spoiledmeat
ML + Embedded

Spoiled Meat Detection and Classifcation

A portable food-safety device that fuses computer vision with ammonia, gas, and infrared temperature sensors to classify meat as fresh, slightly spoiled, or spoiled — running entirely on a Raspberry Pi.

TensorFlowPythonPyQt6Raspberry PiESP32MicroPythonMobileNetV3

Overview

FreshGuard determines meat spoilage by combining what a camera sees with what gas sensors smell and what an IR thermometer feels. A MobileNetV3 image classifier and a sensor-fusion pipeline run on a Raspberry Pi 4, surfacing a clear "fresh / slightly spoiled / spoiled" verdict through a PyQt6 desktop interface.

The Problem

Visual inspection alone misses early-stage spoilage — meat can look fine while ammonia and volatile organics from bacterial decomposition are already rising. A pure-vision model gets fooled. A pure-sensor system can't tell what it's looking at. Restaurants, markets, and home cooks need a quick, reliable second opinion that doesn't require sending samples to a lab.

What we built

A self-contained appliance that captures both images and chemistry in one reading. The Raspberry Pi Camera V2 takes a photo, the MobileNetV3 model classifies it on-device, and an ESP32 reports live readings from an ammonia sensor (MQ-137), a general volatile-organics sensor (MQ-135), and an infrared surface-temperature probe (MLX90614). The PyQt6 GUI fuses these signals into one spoilage verdict instead of asking the user to interpret raw numbers.

Sensor Array

  • MQ-137 ammonia sensor — flags the NH₃ release that accompanies bacterial breakdown of proteins
  • MQ-135 air-quality sensor — picks up broader volatile organic compounds in the air near the sample
  • MLX90614 IR thermometer — measures non-contact surface temperature (warm meat spoils faster; cold-chain breaks matter)
  • Raspberry Pi Camera V2 — captures the visual sample for the CNN
  • ESP32 — reads all three sensors and streams data to the Pi over serial

Key technical choices

  • MobileNetV3 over heavier models — small enough for Pi 4, fast enough for real-time use, accurate after transfer learning on the meat dataset
  • Multi-modal classification — image + chemistry beats either alone, especially in the ambiguous "slightly spoiled" middle class where vision is unreliable
  • ESP32 + Pi split — Pi does the heavy ML work; ESP32 owns the analog sensor reads (it's better suited for the ADC + sensor warmup timing)
  • PyQt6 GUI — offline, instant, no web stack overhead