Case study

FreshTrack AI Module

OCR plus optional LLM parsing service that turns noisy receipt images into structured, confidence-scored JSON contracts.

Computer vision / OCR / structured extractionpolished demo

Primary evidence: FastAPI docs and endpoint contract

System thesis

OCR plus optional LLM parsing service that turns noisy receipt images into structured, confidence-scored JSON contracts.

TypeDocument/vision extraction APIUsersProduct engineers, document AI reviewers, API consumersMaturityProduction-style reference implementation

At a glance

Input
Receipt/document image
Pipeline
Preprocessing, Tesseract OCR, cleanup, optional LLM parser
Output
Structured JSON with confidence fields
APIFastAPI docs and endpoint contract
ValidationOCR, matching, LLM service tests
AssetSample receipt image and output docs

System problem

Why this system exists.

Receipt and image parsing pipelines need to distinguish real entities from payment lines, addresses, totals, headers, and formatting noise.

Implementation surface

What was built.

  • FastAPI service.
  • OCR and parsing utilities.
  • Optional LLM path.
  • Docker variants.

Architecture

A system map for the project.

Receipt image -> preprocessing -> OCR -> text cleanup -> optional LLM parser -> confidence scoring -> structured JSON API -> frontend/database consumer.

Custom architectureOCR-to-JSON extraction API

A document/vision API path where image cleanup, OCR, parsing, optional LLM filtering, confidence, and JSON output are distinct.

Image Intake

receipt imagepreprocessingupload API

OCR Layer

Tesseractraw textnoise cleanup

Parser Layer

domain matchingoptional LLMfalse-positive filter

Contract Layer

confidenceshelf-life lookupJSON response

How it works

Input, transformation, model or agent logic, and reviewable output.

01

Image intake

The service starts with a receipt-like image and keeps the extraction path API-first.

02

OCR cleanup

Tesseract output is cleaned to reduce store metadata, payment lines, and formatting noise.

03

Optional LLM parser

LLM-assisted parsing is used as a false-positive reduction aid when available.

04

JSON contract

Confidence-scored output is designed for downstream UI or database integration.

Evidence

Screenshots, responses, diagrams, tests, and model tables from the source repos.

Artifacts are included only where the public repo has enough context to show them safely.

Engineering Decisions

01

Confidence over certainty

The API exposes confidence so downstream workflows can review or route uncertain outputs.

02

Local/service variants

Docker variants and optional LLM paths keep the system adaptable to different runtime constraints.

03

Transferable pattern

The same OCR-to-JSON discipline transfers to regulated document extraction workflows.

Validation / reliability

How the system is made reviewable.

  • Python source and scripts compile.
  • Full pytest requires optional sentence-transformers.
  • README documents dependency limitations.
  • FastAPI service and docs.
  • Docker variants and env examples.
  • Confidence fields support review.

Limits / responsible use

Production-style reference implementation. Do not commit sensitive receipts, payment data, or API keys.

  • Confidence fields and cleanup logic make noisy OCR output reviewable.
  • Optional LLM assistance is treated as parsing support, not automatic truth.
  • Sensitive receipts, payment data, and API keys are out of scope for public artifacts.

Repository

Open the source repo and inspect the implementation boundary.

All public examples are synthetic, sanitized, historical, or research/demo implementations. No PHI, PII, employer-confidential data, proprietary claims data, private keys, production credentials, or sensitive datasets are included.