Yolov5–Based Freshness Detection of Selected Vegetables Using Raspberry Pi

Authors

  • Raja Ummu Sulaim Raja Mohd Azman Universiti Tun Hussein Onn Malaysia
  • Mariyam Jamilah Homam Universiti Tun Hussein Onn Malaysia

Keywords:

Yolov5, Object Detection, Vegetable Freshness, Raspberry Pi, Real-Time Monitoring, Image Classification, Food Waste Reduction

Abstract

Maintaining the freshness of vegetables is essential to reduce food waste and ensure customer satisfaction. This work presents an automated monitoring system that uses the YOLOv5 object detection model to classify the freshness of selected vegetables—specifically tomatoes, eggplants, and red onions. A dataset of 800 annotated images (80% for training and 20% for validation) was used to train the model to distinguish between fresh and spoiled produce. The system is implemented using a Raspberry Pi 4 Model B connected to a camera module, which captures images in real time for freshness detection. Based on the classification result, the system triggers physical alerts: if fresh vegetables are detected, the green LED turns on; if spoiled vegetables are detected, the red LED lights up and the buzzer is activated to warn staff. A web interface provides real-time visual feedback, displaying annotated images, confidence scores, and freshness logs. The model achieved an accuracy of 80% under ideal lighting conditions, with confidence scores ranging from 52% to 84% for fresh produce. Challenges include difficulty detecting early-stage spoilage and reduced performance in poor lighting. This system has potential for improving freshness monitoring and quality control in retail stores through automation and real-time alerts.

Downloads

Published

28-10-2025

Issue

Section

Communication Engineering

How to Cite

Raja Ummu Sulaim Raja Mohd Azman, & Homam, M. J. (2025). Yolov5–Based Freshness Detection of Selected Vegetables Using Raspberry Pi. Evolution in Electrical and Electronic Engineering, 6(2), 34-43. https://publisher.uthm.edu.my/periodicals/index.php/eeee/article/view/20965