DEV Community

Alex Mozeak
Alex Mozeak

Posted on

🥬 Freshness Checker AI: The AI-Powered Food Safety Assistant

This is a submission for the Google AI Studio Multimodal Challenge

What I Built

Do you ever find yourself looking over some wilted veggies from your fridge, then spending precious minutes agonizing over whether or not to throw them out? Happens to me all the time. Sometimes even a web search doesn't yield results that are helpful enough to reach a decision! That's why I decided to build Freshness Checker AI.

Freshness Checker AI is a comprehensive food safety application that helps users determine whether or not their food is safe to consume. The app combines advanced AI image analysis and real-time data to provide users with detailed assessments of their food's freshness.

Key Problems Solved:

  • Food Waste Reduction: Helps users make informed decisions about borderline food items
  • Food Safety: Provides detailed analysis with visual evidence and safety recommendations
  • Education: Shows users what their spoiled food could actually look like through AI-generated examples
  • Awareness: Alerts users to recent FDA recalls related to their food items

The app analyzes uploaded food photos and provides a detailed freshness assessment (Fresh, Still Good, Eat Soon, Spoiled, or Unsure), complete with explanations, storage advice, spoilage date estimates, and FDA recall information.

Demo

🔗 Try Freshness Checker AI Live

Screenshots:

Clean, intuitive interface with camera and upload options
Main Interface


Comprehensive analysis with visual comparisons and safety advice
Analysis Results

Key User Flow:

  1. Capture/Upload: Take a photo or upload an image of food
  2. AI Analysis: Get instant freshness assessment with detailed explanations
  3. Visual Learning: See AI-generated examples of what spoiled versions look like
  4. Safety Check: Review recent FDA recalls for the food type
  5. Storage Optimization: Get personalized advice to extend freshness

How I Used Google AI Studio

Google AI Studio was a game-changer for me when it came to prototyping and deploying the application. I loved how I could iterate quickly by prompting the Code Assistant, then make tweaks here and there in the Code Editor. Plus, being able to deploy directly to Cloud Run took a whole chunk of DevOps time off of my plate! It's such a relief to have my baseline infrastructure set up so that I can focus on adding and deploying new features.

One thing I hope to see in future updates to Google AI Studio is tighter Git integration. It'd be nice to sync with different branches so that I can work on different features without immediately pushing to the main branch.

Multimodal Features

I leveraged multiple Gemini capabilities to create a comprehensive multimodal experience:

Gemini 2.5 Flash for Image Analysis

  • Structured JSON Responses: Used response schemas to ensure consistent, parseable analysis results
  • Detailed Visual Assessment: Prompted the model to identify specific spoilage indicators (mold, discoloration, texture changes)
  • Safety-First Approach: Configured prompts to err on the side of caution for food safety
  • Contextual Explanations: Generated detailed reasoning for each freshness assessment

Imagen 4.0 for Educational Content

  • Realistic Spoilage Examples: Generated high-quality images showing different types of food spoilage
  • Variety in Deterioration: Created examples showing mold, sliminess, discoloration specific to each food type
  • Educational Value: Helped users learn to identify spoilage patterns they might miss

Additional Gemini Features

  • Storage Optimization: Provided personalized storage advice based on user's current method
  • Spoilage Prediction: Estimated freshness windows based on purchase dates and food types

Technical Highlights

  • Camera Integration: Native camera access with rear-camera preference for better food photography
  • Responsive Design: Works seamlessly across desktop and mobile devices
  • Real-time FDA Data: Integration with openFDA API for current recall information
  • Smart Error Handling: Graceful degradation when AI services are unavailable
  • Performance Optimized: Efficient image processing and API usage

Impact & Future Vision

Freshness Checker AI represents a practical application of multimodal AI that directly impacts daily life. The multimodal approach creates a comprehensive learning experience that goes beyond simple "good/bad" classifications, providing users with the knowledge and tools they need to make smarter decisions about food safety!

I am going to continue developing this application with an eye toward providing plenty of value to the user. I'm currently considering:

  • Adding authentication with Firebase so that users can keep track of the food that they've analyzed with a personalized dashboard
  • Allowing users to upload verified images of spoiled food so that other users can view real-world spoilage examples instead of just AI-generated ones
  • Smart grocery list generation based on spoilage patterns
  • Recipe recommendations to help users get the most out of their borderline ingredients

Thanks to Google and DEV for putting together this contest and bringing Google AI Studio into my awareness. I hope many more people have the chance to use this tool!


Built on Google AI Studio with React, TypeScript, Google Gemini 2.5 Flash, and Google Imagen 4.0

Top comments (0)