How LabelCheck works
A five-stage pipeline built so every verdict can be traced back to a statutory clause and to the exact text that triggered it.
Image
Photo of the principal display panel, from any phone — one label or a batch of up to eight.
→ label.jpg
Text extraction
A vision model transcribes every printed line server-side; credentials never reach the browser.
→ raw_text: string
Rule engine
Seven modular detectors: regex for MRP, dates, quantities, e-mail and phone, plus address heuristics.
→ 7 × outcome
Confidence scoring
Pattern strength blended with capture legibility gives a 0-100% score for every declaration.
→ 0-100 per field
Compliance report
Verdict, per-field values, citations and raw text — logged for audit, exportable as a cited PDF with a QR link.
→ verdict + PDF
The rule engine
How each declaration is detected
Each declaration is a self-contained detector. It validates rather than merely spots a keyword — a zero quantity, a blank price or an impossible date all fail. Adding a new rule, say the FSSAI licence number, is one object in the rules array.
Manufacturer / Packer / Importer
The name and complete address of the manufacturer, packer or importer must appear on the principal display panel. For imported goods, the importer's name and address is mandatory.
How it is detected
A declaration lead-in — “Manufactured by”, “Packed by”, “Marketed by” — first. Failing that, an address heuristic: a six-digit PIN code sitting alongside entity keywords. A PIN code raises the confidence.
Common / Generic name of commodity
The common or generic name of the commodity contained in the package must be declared — a brand name alone is not sufficient.
How it is detected
An explicit “Name:” declaration scores highest; otherwise a generic-commodity vocabulary match. A brand name on its own never satisfies the rule.
Net quantity
Net quantity must be declared in standard units — gram (g), kilogram (kg), millilitre (ml), litre (L) — or by number (N/U) for countable articles, excluding the weight of the wrapper.
How it is detected
Three patterns, strongest first: a “Net Qty” declaration carrying a unit, a bare standard-unit amount, then a count (N, U, pcs). Every candidate is validated, so “0 g” is skipped rather than accepted.
Month & year of manufacture / packing
The month and year in which the commodity was manufactured, pre-packed or imported must be declared. The day is optional; the month and year are not.
How it is detected
A labelled Mfd/Mfg/Packed date, a month-name and year, or an MM/YYYY pattern — then a plausibility check. An impossible or out-of-range date fails instead of passing as “present”.
Retail sale price (MRP, inclusive of all taxes)
The retail sale price must be declared as 'Maximum Retail Price ₹ … inclusive of all taxes'. The price shown must be the all-inclusive price a consumer pays.
How it is detected
An “MRP ₹ …” declaration, or a bare rupee amount at lower confidence. ₹0 and blank prices are rejected, and “inclusive of all taxes” wording raises the score.
Consumer care details
The name, address, telephone number and e-mail address (where available) of the person who can be contacted for consumer complaints must be declared.
How it is detected
E-mail and Indian phone-number patterns, including 1800 toll-free forms. Both present scores highest; either alone is accepted at lower confidence, and a “Consumer care” heading lifts it further.
Country of origin
The country of origin or manufacture or assembly must be declared on the package. It is mandatory for imported packages and for goods offered for sale through e-commerce.
How it is detected
“Made in / Manufactured in / Product of …” in any case, plus the Devanagari form, filtered through a country whitelist so a stray phrase cannot pass as an origin declaration.
Under the hood
Built to be handed to someone else
Nothing here is a demo shim. The same code path runs in the field, in a batch and behind an API.
TanStack Start on the edge
React 19 with server functions and SSR. OCR runs inside a server function, so the API key is never shipped to the browser.
Postgres with row-level security
Supabase Postgres and a private storage bucket. Ownership is enforced in the database, not the UI — a user can only touch their own inspections.
Stateless and horizontal
Nothing is held between requests, so the same pipeline behind an API is how a marketplace would pre-check an entire catalogue.
Legal basis
The Legal Metrology Act, 2009 establishes the national standards of weights and measures and empowers the Central Government to regulate pre-packaged commodities. The Legal Metrology (Packaged Commodities) Rules, 2011 operate under that Act; Rule 6 — Declarations to be made on every package lists the declarations that must appear on every retail package. Chapter II further governs the manner of declaration — the size, prominence and placement of the text on the principal display panel.
LabelCheck reports the presence and content of each declaration and cites the clause it derives from. It is a decision-support tool for inspectors, manufacturers and marketplaces — the statutory determination remains with the Legal Metrology officer.
Next
Roadmap
Catalogue-scale batches
Batch checking of up to eight labels ships today. Next: whole-catalogue uploads with a consolidated per-SKU compliance sheet, exportable as CSV for enforcement drives.
E-commerce scanning
Point LabelCheck at a marketplace listing URL to verify the mandatory declarations that Rule 6 requires online sellers to display, at catalogue scale.
Regional languages
Tamil, Telugu, Bengali, Marathi and Gujarati label transcription, with script-aware detectors for quantity and price declarations.