As part of my AI/ML learning journey, I recently developed a Food Ingredient Identifier app, whose main function is powered by Google’s Gemini AI API. This project was born out of a desire to better understand the health implications of food ingredients and to easily identify potentially harmful additives in packaged foods. The recent news about California banning food dyes for school lunches(1) motivated me to build a food ingredient identifier app.
Please check out the food ingredient identifier app here. https://food-ingredients-detector-wuyingwywy.replit.app/. The app can be used on both mobile device and desktop. Save it to Home on your mobile device for quick access and select desktop view on your phone’s browser for best view of formatting.

The full source code for this project is available on my GitHub repository: Food-Ingredient-Detector (2)
In this post, I’ll share my motivation, the development process, and some insights gained along the way.
Motivation
In today’s world of processed foods, it’s becoming increasingly important to be aware of what we’re consuming. Many of us have experienced the frustration of trying to decipher long lists of ingredients on food packaging, often encountering unfamiliar terms or chemical names. This app aims to simplify that process by leveraging AI to analyze ingredient lists and provide useful insights.
Recent legislative changes have also highlighted the need for such tools. For instance, California recently passed new state laws regulating food dyes as ingredients. These regulations underscore the growing concern about certain additives and their potential health impacts. By creating this app, I hoped to not only educate myself but also provide a useful tool for others who share these concerns.
Development Process
The Food Ingredient Identifier app utilizes several key technologies:
- Gemini AI API: This powerful API is used to process images of food packaging and extract the text containing the ingredient list. This eliminates the need for manual input and makes the app much more user-friendly.
- Curated Harmful Ingredients List: I compiled a list of ingredients that are known to be potentially harmful or controversial. The app checks the extracted ingredients against this list to quickly identify any red flags.
- AI-Powered Analysis: Beyond just checking against a predefined list, the app uses AI to offer additional insights on potentially unhealthy ingredients. This adds a layer of intelligence that can adapt to new information and provide more nuanced analysis.
The basic flow of the app is as follows:
- The user uploads an image of a food package.
- The Gemini AI API processes the image and extracts the text.
- The app identifies the ingredient list within the extracted text.
- It checks each ingredient against the curated list of harmful ingredients.
- The AI then provides additional analysis on potentially unhealthy ingredients, even if they’re not on the predefined list.
- The results are displayed to the user, highlighting any concerning ingredients and providing explanations.
Results and Insights
Testing the app with various food packages has been enlightening. For example, when analyzing a package of potato chips, the app successfully identified the ingredients (potatoes, vegetable oil, and salt) and provided insights on the potential health implications of excessive vegetable oil and salt consumption. The AI-powered analysis is particularly interesting, as it can provide context that goes beyond a simple “good” or “bad” classification. For instance, it noted that while vegetable oils are generally considered healthier than saturated fats, they are high in omega-6 fatty acids, which can lead to inflammation if consumed in excess.


Future Improvements
While the current version of the app is functional, there’s always room for improvement. Some ideas for future enhancements include:
- Expanding the database of known harmful ingredients
- Implementing user accounts to save and track scanned products
- Adding nutritional information analysis
Conclusion
Developing this Food Ingredient Identifier app has been a valuable learning experience in applying AI and ML technologies to real-world problems. It’s also deepened my understanding of food science and nutrition. I hope that this tool will be useful to others who are conscious about their food choices and want to make more informed decisions about what they consume.
I welcome feedback and contributions from the community to help improve and expand this tool. Together, we can work towards making healthy eating more accessible and understandable for everyone.
Reference:
Leave a comment