Food product ingredient labels contain complicated chemicals and additives that the common consumer finds difficult to comprehend. In India, where more and more people are consuming packaged food, along with the prevalence of lifestyle diseases, people seek ways to make healthy decisions but do not have access to the right resources for analyzing food safety.
As we recognized how far AI technology has come, yet there existed no AI-driven food safety assistant for Indians to analyze the information printed on the labels of food products, we decided to develop FoodLensAI, which analyzes food product labels and translates the content into easily understandable insights.
FoodLensAI allows users to understand what goes into packaged food products.
Users will be able to: Use their phone camera to scan food labels Extract ingredients from images via OCR Get an AI-driven ingredient safety analysis Ask questions about the food items in Chat Mode Get explanations regarding health benefits backed by facts with limited hallucinations
FoodLensAI was developed using a contemporary AI-driven full-stack development approach.
Frontend: React + Vite Tailwind CSS Redux Toolkit Supabase authentication
Backend: FastAPI Microservices with Docker OCR extraction pipeline Ingredient normalization module RAG retrieval system
AI & Data Layer: Intelligent reasoning and response generation using the Gemini API Vector storage with PostgreSQL + pgvector Knowledge base retrieval for grounded explanations Contextual chat interactions with conversational memory management
All components of the application are hosted and tested via AWS and Vercel cloud platforms.
One of the key problems was decreasing latency while retaining high quality of the AI output. At first, it took about 50 seconds to generate the responses for ingredients analysis.
We improved: Preprocessing of OCR data Efficiency of the retrieval pipeline Orchestration in the backend Prompt engineering Flow of vector search
This helped decrease the response time to about 15 seconds.
The next challenge was the decrease in hallucinations in the AI responses. The problem was solved by implementing the RAG architecture, which enables grounding of Gemini responses based on retrieving the knowledge about ingredients.
By means of this project, we have acquired first-hand experience in: Creating RAG systems in practice Working with vector databases and semantic search techniques Improving OCR optimization Using Gemini Prompt Engineering API Deploying end-to-end AI systems Scaling infrastructure and creating Docker images for applications Developing AI systems focused on robustness and transparency
We also came to understand that AI solutions become immensely valuable in the case they help us solve routine problems.
Future roadmap plans for FoodLensAI include: Improved AWS infrastructure with faster and scalable performance Personalized dietary recommendation suggestions Health condition-based ingredient warnings Location-based food regulation details Scientific information about ingredients increased QR code scan from desktops to mobile phones API integration with health and fitness websites
The overall vision is to establish FoodLensAI as the most reliable AI-enabled ingredient intelligence platform among the Indian consumer community.
Built With
- ai-powered
- amazon-web-services
- conversational-memory-management
- docker
- fastapi
- gemini-api
- ingredient
- knowledge-base-retrieval
- ocr-pipeline
- pgvector
- postgresql
- python
- rag-(retrieval-augmented-generation)-architecture
- react.js
- redux-toolkit
- rest-apis
- supabase
- supabase-authentication
- tailwind-css
- vector-search
- vercel
- vite
Log in or sign up for Devpost to join the conversation.