< Back to Index

[FastAPI][React][Google Gemini][OCR (Tesseract)][Python]

01 Context & Problem

Consumers struggle to understand complex chemical names in ingredient lists and identify hidden health risks like sugar aliases.

02 Architecture & Design

SYSTEM DIAGRAM
[ Initializing Diagram... ]
> OCR Service: Tesseract/OpenCV for text extraction from images
> Classification Engine: Local Dictionary Lookup -> Fallback to Gemini Flash
> Logic Layer: Sugar Alias Detection & Allergen Filtering
> Frontend: React client for image capture and result visualization

A pipeline that OCRs ingredient text from images, classifies additives using a hybrid approach (Static DB + LLM fallback), and generates plain-English health scores.

03 Key Technical Decisions

  • Decision: Hybrid Classification: Prioritized local DB for speed/cost, used LLM only for unknown ingredients.
  • Decision: FastAPI: Chosen for high-performance async handling of OCR tasks.
  • Decision: Gemini Flash: Selected for low latency structured data extraction.

04 Challenges & Resolutions

! Warning: OCR Accuracy: Improved text extraction from curved packaging surfaces using OpenCV preprocessing.
! Warning: Latency: Parallelized database lookups to return "Safe" ingredients immediately while processing "Unknowns" in background.
[View Source Code on GitHub]