Team Ai
Datasetpublic

build-small-hackathon/kirana-invoice-train-data

Kirana Invoice Training Data — Indian FMCG Training dataset for the Kirana Detective project — an AI pipeline that audits distributor invoices for Indian kirana (grocery) stores. The repository contains two distinct sub-datasets used to fine-tune two separate models. Dataset Summary Sub-dataset Purpose Size Format synthetic_invoices/ OCR fine-tuning (MiniCPM-V) 500 images + annotations PNG + JSONL fmcg_catalog.json Product name normalization… See the full description on the dataset page: https://huggingface.co/datasets/build-small-hackathon/kirana-invoice-train-data.

sourceHugging Facecc0-1.0updated 4mo agoView on Hugging Face
0likes26downloads
Dataset Card

Kirana Invoice Training Data — Indian FMCG

Training dataset for the Kirana Detective project — an AI pipeline that audits distributor invoices for Indian kirana (grocery) stores. The repository contains two distinct sub-datasets used to fine-tune two separate models.


Dataset Summary

Sub-datasetPurposeSizeFormat
synthetic_invoices/OCR fine-tuning (MiniCPM-V)500 images + annotationsPNG + JSONL
fmcg_catalog.jsonProduct name normalization (MiniCPM5-1B)200 SKUs → 2,000 pairsJSON

Both sub-datasets are fully synthetic — generated programmatically from a hand-curated SKU catalog. No real customer or business data is included.


Sub-dataset 1: Synthetic Invoice Images

Overview

500 invoice images rendered in pure Python (Pillow) across four realistic formats. Designed to teach MiniCPM-V to extract structured JSON from invoice photos regardless of format, quality, or layout.

Invoice Formats (125 images each)

FormatDescriptionSimulated Noise
printed_gst/GST-compliant printed invoices (A4, 96 DPI)None
tally_pdf/Tally ERP-style export layoutMonospace fonts, box borders
handwritten/Handwritten invoice photosGaussian blur, ink texture, skew
whatsapp/WhatsApp-forwarded invoice screenshotsJPEG compression, timestamp overlay, dark mode

Invoice Contents

Each invoice contains:

  • —5–14 line items randomly sampled from the 200-SKU FMCG catalog
  • —Supplier (1 of 10 major Indian FMCG distributors) with GSTIN
  • —Buyer (1 of 8 kirana store archetypes) with GSTIN
  • —Invoice number in formats: INV/2024-25/XXXXX, TAX/..., GST/..., BILL/...
  • —Date between April 2024 and March 2025
  • —Pricing in range ₹8–₹480 per item (15% anomaly rate for training diversity)
  • —GST calculations at 0%, 5%, 12%, 18%, or 28% depending on product category

Suppliers represented:

CompanyGSTIN StateCity
Hindustan Unilever LtdMaharashtraMumbai
Nestle India LtdDelhiDelhi
Parle Products Pvt LtdMaharashtraMumbai
Britannia Industries LtdKarnatakaBengaluru
ITC LimitedTamil NaduChennai
Amul (GCMMF)GujaratAnand
Dabur India LtdUttar PradeshGhaziabad
Marico LimitedMaharashtraMumbai
Emami LimitedWest BengalKolkata
Godrej Consumer ProductsMaharashtraMumbai

HF Dataset Schema

The dataset on HuggingFace Hub is stored as Parquet with two columns:

ColumndtypeDescription
imageImageEmbedded invoice image (PIL-compatible)
responsestringSerialized JSON string with extracted invoice fields

The response string follows this structure:

json
{
  "supplier": "Nestle India Ltd",
  "gstin_supplier": "07AAACN0032R1ZX",
  "buyer": "Ravi Provision Store",
  "gstin_buyer": "33AABCR5678K1ZQ",
  "invoice_number": "INV/2024-25/04821",
  "date": "2024-09-14",
  "line_items": [
    {
      "raw_name": "MAGGI NDL 70GM",
      "quantity": 12,
      "unit_price": 45.50,
      "gst_rate": 18,
      "total": 546.00
    }
  ],
  "subtotal": 3840.00,
  "gst_total": 691.20,
  "invoice_total": 4531.20
}

Data Splits

SplitExamplesSize
Train450~169 MB
Test50~18.7 MB
Total500~188 MB

Sub-dataset 2: FMCG Product Name Normalization Pairs

Overview

A structured catalog of 200 Indian FMCG SKUs with known abbreviations and aliases, used to generate 2,000 synthetic (raw, canonical) training pairs for MiniCPM5-1B.

Catalog Structure (fmcg_catalog.json)

Each entry:

json
{
  "product_id": "maggi_masala_70g",
  "canonical_name": "Nestle Maggi Masala Noodles 70g",
  "hsn_code": "1902",
  "gst_rate": 18,
  "category": "noodles",
  "brand": "Nestle",
  "common_aliases": [
    "MAGGI 70G",
    "MAGGI NDL 70",
    "MAGGI MSL 70G",
    "MAGGI MASALA 70",
    "MGI 70G",
    "MAGGI 70GM"
  ]
}

SKU Breakdown by Category

CategorySKUsGST RateExample Brands
Personal Care5018%Colgate, Dettol, Parachute, Head & Shoulders, Dove
Beverages450–28%Coca-Cola, Tata Tea, Nescafe, Horlicks, Amul
Home Care3518%Surf Excel, Harpic, Lizol, Vim, Dettol
Biscuits3018%Parle-G, Britannia, ITC Sunfeast, Cadbury Oreo
Dairy200–12%Amul, Mother Dairy
Atta / Flour105%Aashirvaad, Annapurna, Fortune, Patanjali
Noodles1018%Maggi, ITC Yippee, Top Ramen, Wai Wai
Total200—10 major Indian FMCG distributors

Augmentation Strategy

Each canonical SKU name is transformed into realistic raw invoice variants using rule-based augmentation:

TechniqueExample
Known aliases (hand-curated)"SURF XL 1K" → Surf Excel Washing Powder 1kg
Uppercase conversion"AMUL BUTTER 100G" → Amul Butter 100g
Unit abbreviation rules"500GM" ↔ "500G" ↔ "500GRM"
Product abbreviation rules"NDL" ↔ Noodles, "TPASTE" ↔ Toothpaste
Common typo injection"Colgat" ↔ Colgate, "Britania" ↔ Britannia
Random truncation"AASHIRVAAD ATT" (3-word truncation)
Regional shorthand"PARLEG" ↔ Parle-G, "H&S" ↔ Head & Shoulders

Normalization Pair Format

Each training sample follows a chat template:

json
{
  "messages": [
    {
      "role": "system",
      "content": "You are an Indian FMCG product name normalizer. Given a raw product name from a distributor invoice, return ONLY the canonical product name. No explanation, no punctuation — just the canonical name."
    },
    {
      "role": "user",
      "content": "Invoice product name: \"MAGGI NDL 70GM\""
    },
    {
      "role": "assistant",
      "content": "Nestle Maggi Masala Noodles 70g"
    }
  ]
}

Data Splits

SplitPairs
Train1,800
Eval200
Total2,000

Downstream Models

This dataset is used to fine-tune two models in the Kirana Detective pipeline:

ModelTaskHF Hub
MiniCPM-V 4.6Invoice OCR & JSON extraction`build-small-hackathon/minicpm-v-4-6-indian-invoice-extraction`
MiniCPM5-1BProduct name normalization`build-small-hackathon/minicpm5-1b-indian-fmcg-normalizer`

Known Limitations & Biases

LimitationImpactMitigation
Fully synthetic — no real invoice imagesMay not capture real-world degradation (stains, folds, lighting)Collect real invoices post-hackathon; add augmentation (blur, noise, shadows)
10 suppliers onlyModels may fail on invoices from unrepresented regional distributorsExpand supplier coverage after deployment
English-only product names and labelsNon-English invoices (Hindi, Tamil, Marathi) will failAdd regional language templates
200 SKUsOut-of-catalog products will not normalize correctlyExpand catalog to 2,000+ SKUs
Rule-based typo augmentationReal-world typos and OCR errors may differ from simulated patternsCollect 200+ real invoice samples for retraining
GST rates hardcoded (0%, 5%, 12%, 18%, 28%)Uncommon or product-specific rates may be misclassifiedParameterize rate extraction
Brand bias toward premium national brandsMay underperform on regional / private-label productsCollect data from regional distributors

Load from HuggingFace Hub

python
from datasets import load_dataset
import json

ds = load_dataset("build-small-hackathon/kirana-invoice-train-data")

sample = ds["train"][0]
image = sample["image"]                    # PIL Image — ready for model input
data  = json.loads(sample["response"])     # parse the JSON string

print(data["supplier"])
print(data["line_items"])

Citation

bibtex
@misc{kirana_invoice_train_data_2026,
  author    = {Syed Naazim hussain},
  title     = {Kirana Invoice Training Data: Synthetic Indian FMCG Invoices for OCR and Product Normalization},
  year      = {2026},
  publisher = {HuggingFace},
  howpublished = {\url{https://huggingface.co/datasets/build-small-hackathon/kirana-invoice-train-data}},
  note      = {Part of the Kirana Detective project}
}

License

CC0 1.0 Universal (Public Domain Dedication) All data in this repository — synthetic invoice images, annotations, and the SKU catalog — is released to the public domain. No attribution required.

The generation scripts (generate_invoices.py, build_catalog.py) are licensed under MIT.


Version: 1.0 Last Updated: June 10, 2026