< Back to Index

Safe-Plate: AI Food Ingredient Scanner

[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

> 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]