PrismOCR: Deterministic Computer Vision for Label Extraction
A production-ready OCR engine that extracts structured product label data (GTIN, FSSAI, net weight, MRP, dates, and more) using barcode decoding and deterministic computer-vision rules, with validator-gated accuracy and zero data fabrication. There is no LLM involved: this is pure computer vision, running entirely offline with zero per-document API cost.
Platform
Web & Batch
Duration
Ongoing
The Challenge
FMCG and retail teams manage catalogues of thousands of SKUs, each requiring accurate label data (GTIN, FSSAI licence number, net weight, MRP, and manufacturing/expiry dates) for regulatory compliance, e-commerce listings, and data-pool submissions. Manual transcription from label photographs is slow and does not scale, while generative OCR and LLM-based extraction tools carry an unacceptable risk: they can produce fluent, plausible-looking values that were never actually printed on the label. For regulated numeric fields, a fabricated digit is not a minor error: it is a compliance and financial risk.
- Manual transcription of label data (GTIN, FSSAI licence numbers, net weight, MRP, expiry dates) from thousands of product images is slow, error-prone, and does not scale to a catalogue of thousands of SKUs.
- Generative and LLM-based OCR tools can silently invent plausible-looking values, a serious risk for regulated fields like GTIN and FSSAI licence numbers, where a single wrong digit carries compliance and financial consequences.
- Cloud OCR and vision APIs charge per document, which becomes cost-prohibitive at high volume and raises data-privacy concerns for proprietary product catalogues.
- Teams need an audit trail showing exactly where each extracted value came from (the source image, snippet, and confidence), not just a final answer.
- A single product typically has multiple label faces (front, back, ingredients panel, nutritional panel) whose data must be reconciled into one authoritative record.
Project Goals
How We Built It
Barcode-First Product Identification
Every extraction begins by decoding the printed barcode using zxing-cpp, run against both the original image and a 2x-upscaled variant to recover barcodes on small or low-resolution captures. A correctly decoded, checksum-valid barcode anchors the GTIN before any text recognition is attempted.
Multi-Engine OCR with Automatic Fallback
Text recognition runs through a chained sequence of open-source engines (PaddleOCR as the primary engine, EasyOCR as a secondary fallback, and Tesseract as a lightweight final fallback), so extraction keeps working even in constrained or fully offline environments.
Anchored, Validator-Gated Field Extraction
Each field is extracted only near its expected anchor keywords (dates only near "MFG"/"EXP", licence numbers only where an FSSAI anchor is present) and is then passed through a format or checksum validator specific to that field: GTIN check-digit validation, 14-digit FSSAI format rules, unit-bearing weight patterns, and similar rules.
Multi-Face Image Consolidation
Product packaging carries information across several physical faces: front, back, left, right, top and bottom. Each face is processed independently, then a consolidation step merges the per-face results field by field, using confidence scores combined with a per-field "panel prior" (for example, MRP and expiry date are expected on the back panel, brand on the front).
Batch Processing at Production Scale
A Redis-backed job queue and long-lived worker process allow products to be submitted and processed as batches rather than one at a time, with incremental progress tracked in Redis and every completed job permanently recorded in a SQLite job history store, including CSV/JSON export and image re-download.
The Outcome
PrismOCR proves that a zero-hallucination extraction requirement is best met not by a larger model but by the deliberate absence of one. By combining barcode-first identification, checksum validation, anchored keyword extraction, and multi-engine OCR with automatic fallback, the platform delivers a guarantee generative pipelines cannot: every value returned is either decoded directly from real pixels or it is not returned at all. The architecture (queue-backed batch processing, persistent job history, optional authentication) is built for production deployment, not a lab demo, while remaining extensible: optional AI-assisted enhancements can be layered on top of the deterministic core when a use case calls for it, without ever compromising the core guarantee of source-grounded, auditable extraction.
Impact & Results
Key Takeaways
Deterministic computer vision, not an LLM, powers every extraction, giving clients consistency, predictability, and full data privacy.
Barcode-first identification plus checksum and format validators mean the system never fabricates a value: unclear or unverifiable data is dropped, not guessed.
Multi-engine OCR fallback and multi-face image consolidation make the pipeline resilient to varied label layouts, image quality, and fully offline environments.
Batch processing, persistent job history, and optional authentication make the platform ready for real production workloads, not just single-image demos.
The architecture is extensible by design: optional AI-assisted enhancements can be added later as a genuine hybrid capability, without ever making the core OCR workflow dependent on GPT or any generative AI model.
Conclusion & Impact
"Codeprism's OCR platform proves that enterprise-grade document intelligence doesn't require a large language model or a per-document API call. By anchoring every extraction in decoded barcodes, a chained multi-engine OCR pipeline, and anchor-and-validator-gated field rules, the system delivers extraction that is consistent, auditable, and private enough to run entirely within a client's own infrastructure, at zero per-document cost and zero external AI dependency. There is no LLM involved. This is pure computer vision. The platform is production-ready today, with batch processing, job history, and deployment authentication already in place, and it was designed with extensibility in mind: optional AI-assisted enhancements can be added later as a genuine hybrid capability, layered on top of the deterministic core rather than replacing it. For organizations digitizing product labels, verifying regulatory compliance, or automating catalog data entry, this approach delivers accuracy they can verify, costs they can predict, and a system they fully control."
Technology Stack

Ready to achieve similar results?
Let our dedicated engineers bring your vision to life with cutting-edge technology and unparalleled expertise.