CoolFace
Datasetpublic

anirudh1112/corrected-tobacco-dataset-with-ocr

Corrected Tobacco3482 Dataset This repository contains a cleaned and corrected version of the Tobacco3482 dataset. It addresses significant labeling errors found in the original source that negatively impact model performance. πŸ“Œ Dataset Context The original Tobacco3482 dataset is a staple for document image classification, but it is known to contain noisy labels. This version integrates corrections provided by the research community to ensure a higher standard… See the full description on the dataset page: https://huggingface.co/datasets/anirudh1112/corrected-tobacco-dataset-with-ocr.

sourceHugging Facecc-by-4.0updated 5mo agoView on Hugging Face
1likes44downloads
Dataset Card

license: cc-by-4.0 task_categories:

  • β€”image-classification
  • β€”text-classification tags:
  • β€”ocr
  • β€”document-understanding
  • β€”tobacco3482 size_categories:
  • β€”1K<n<10K ---

Corrected Tobacco3482 Dataset

This repository contains a cleaned and corrected version of the Tobacco3482 dataset. It addresses significant labeling errors found in the original source that negatively impact model performance.

πŸ“Œ Dataset Context

The original Tobacco3482 dataset is a staple for document image classification, but it is known to contain noisy labels. This version integrates corrections provided by the research community to ensure a higher standard for multi-modal evaluation.

Source Comparison

SourceFile FormatLabelsUse Case
HuggingFace (sasa3396)Raw/ParquetOriginal (Noisy)Quick baseline/Benchmarking legacy papers.
Kaggle - BalancedJPG/TIFOriginal (Noisy)General practice/Kaggle competitions.
This Repo (based on Gordon Lim)JPG + JSONLCorrectedFormal Research / True Multi-modal Evaluation.

πŸ› οΈ Dataset Creation & Cleaning

It was discovered that the original dataset contained numerous errors. This version was built using the following pipeline:

  1. 1.Alignment: Downloaded the HuggingFace dataset and the Gordon Lim correction CSV.
  2. 2.Filtering: Removed instances with multiple labels or empty labels to ensure a clean, single-label classification task.
  3. 3.Intersection: Verified the intersection between the physical image files and the correction metadata.
  4. 4.OCR Processing: Integrated HOCR data alongside images for multi-modal (Vision + NLP) tasks.

πŸ“‚ Folder Structure

The dataset is organized into standard train, test, and val splits, compatible with the Hugging Face datasets library:

corrected_tobacco_data/
β”œβ”€β”€ README.md
β”œβ”€β”€ train/
β”‚   β”œβ”€β”€ metadata.jsonl # Contains file_name, label, and OCR text
β”‚   β”œβ”€β”€ image_train.jpg
β”‚   └── image_train.hocr
β”œβ”€β”€ val/
β”‚   β”œβ”€β”€ metadata.jsonl
β”‚   β”œβ”€β”€ image_val.jpg
β”‚   └── image_val.hocr
└── test/
    β”œβ”€β”€ metadata.jsonl
    β”œβ”€β”€ image_test.jpg
    └── image_test.hocr

πŸš€ How to Use

You can load this dataset directly using the πŸ€— Datasets library:

python
from datasets import load_dataset

dataset = load_dataset("your-username/your-repo-name")

# Accessing an example
print(dataset['train'][0]['text']) # Access OCR text
dataset['train'][0]['image']       # Access PIL Image

Acknowledgements

Special thanks to Gordon Lim for the label corrections and the original contributors of the Tobacco3482 dataset.