Smartphone Spoilage Detection with Image CNNs

Smartphone Spoilage Detection with Image CNNs

ISEF Category: Microbiology

Ready to Turn This Idea Into a Real Project?

This guide was put together with the help of AI research tools to give you a solid starting point. But a competitive science fair project lives in the details: refining your research question, fine-tuning your variables, analyzing your data, and presenting your findings like a seasoned scientist.

For next steps tailored to your interests, skill level, and timeline, work one-on-one with a MehtA+ mentor. Learn more about MehtA+ Science & Engineering Research Mentorship →

Subcategory: Applied Microbiology  ·  Difficulty: Advanced  ·  Setup: University Lab  ·  Time: Full Year

The Hook

Food can look fine and still be going bad. That means your eyes miss the warning signs, but a camera may not. You can test whether a CNN, or convolutional neural network, can spot those early changes before visible mold shows up. If it works, you are building a faster way to flag spoilage.

What Is It?

This project asks whether tiny image patterns can predict food spoilage before you can see mold. A CNN, or convolutional neural network, is a type of AI that learns patterns from images. Here, you would feed it USB-microscope photos of bread and tomato as they age, then ask it to classify spoilage stage or estimate when spoilage is coming.

Think of it like teaching a helper to read faint warning signs in the texture of a surface. Early spoilage can change color, moisture, and surface structure before a person notices anything obvious. You can pair those images with public 16S datasets, which list bacterial and fungal DNA found on food, to compare image changes with likely microbial shifts.

Why This Is a Good Topic

This is a strong science fair topic because it connects image analysis, machine learning, and real food safety. You have a clear input, the microscope image, and a clear output, the spoilage stage or likely microbial community. You can measure accuracy, compare model types, and test whether one food type predicts better than another. You also learn data labeling, model evaluation, and how to connect visual patterns to microbiology.

Research Questions

  • How does the CNN accuracy change when you train on bread images versus tomato images?
  • What is the effect of adding early-stage images on the model's ability to predict spoilage before visible mold appears?
  • Does combining RGB color features with texture features improve spoilage classification?
  • To what extent can the image model predict the dominant taxon group reported in public 16S food-microbiome datasets?
  • Which lighting setup produces the most stable microscope images for spoilage detection?
  • How does transfer learning compare with training a small CNN from scratch on this dataset?

Basic Materials

  • Smartphone with a fixed camera mount or tripod adapter.
  • USB microscope with consistent magnification.
  • Bread and tomato samples from the same store batch.
  • Sealable clear containers for controlled storage.
  • Labels and marker for sample tracking.
  • Digital kitchen scale for tracking mass change.
  • Printed color reference card for image calibration.
  • Notebook or spreadsheet for daily observations.

Advanced Materials

  • USB microscope with adjustable magnification and manual focus.
  • Smartphone or camera system with manual exposure control.
  • Temperature and humidity logger.
  • Sterile swabs for optional surface sampling.
  • Agar plates for basic culture comparisons, if your lab allows it.
  • DNA extraction and 16S sequencing access through a university or partner lab.
  • Reference food microbiome datasets from public repositories.
  • GPU access for model training.

Software & Tools

  • Google Colab: Runs Python notebooks for image preprocessing, CNN training, and model evaluation without local hardware setup.
  • Python: Lets you clean image data, build labels, and test different machine learning workflows.
  • TensorFlow or PyTorch: Builds and trains the CNN that classifies spoilage images.
  • ImageJ: Measures color, texture, and brightness changes in microscope photos.
  • PubMed: Finds review articles on food spoilage microbiology and image-based classification.

Experiment Steps

  1. Define the exact spoilage labels you will predict, such as visible mold, early surface change, or day-based spoilage stage.
  2. Plan a consistent imaging setup so every photo uses the same distance, framing, and lighting.
  3. Build a labeling scheme that links each image to storage day, food type, and observed spoilage state.
  4. Decide whether you will train one model for both foods or separate models for bread and tomato.
  5. Choose the comparison metrics you will report, such as accuracy, precision, recall, and confusion matrices.
  6. Map image predictions against public 16S datasets to test whether visual change lines up with likely microbial shifts.

Common Pitfalls

  • Changing lighting between photo sessions, which makes the CNN learn brightness instead of spoilage patterns.
  • Mixing samples from different store batches without tracking them, which hides real variation in the data.
  • Labeling every day after storage as a separate class without checking whether the visible changes are actually distinct.
  • Using too few images per class, which causes the model to memorize samples instead of learning general patterns.
  • Comparing CNN output to public 16S data without matching food type, storage condition, or spoilage stage.

What Makes This Competitive

A class-level version of this project just asks whether the model can sort fresh from spoiled food. A stronger version tests how early the model can detect change, before your eyes can see mold. You can also compare bread and tomato, test several model architectures, and use public microbiome data to support or challenge the image-based predictions. Strong controls and careful validation will matter more than flashy code.

Project Variations

  • Use only bread and compare crust versus crumb images to see which region predicts spoilage first.
  • Swap the CNN for transfer learning with a small pretrained vision model and compare performance against a custom model.
  • Add humidity and temperature data to see whether the model improves when environmental variables join the image features.

Learn More

  • PubMed: Search for review articles on food spoilage microbiology, microbial succession on foods, and image-based spoilage detection.
  • NCBI SRA and BioProject: Search for public 16S food microbiome datasets and sample metadata.
  • NIH 16S and microbiome primers, methods, and review papers: Use NIH pages and linked reviews to understand sequencing basics.
  • USDA FoodData and food safety resources: Look for background on storage conditions, spoilage, and food handling.
  • MIT OpenCourseWare, Introduction to Deep Learning: Find the course materials for CNN basics, training, and model evaluation.

For next steps tailored to your interests, skill level, and timeline, work one-on-one with a MehtA+ mentor. Learn more about MehtA+ Science & Engineering Research Mentorship →

To discover more projects, visit the MehtA+ Science Fair Project Discovery Hub​ →

Shopping Cart