Good and Bad classification of Chapati (Roti)

Published: 30 June 2026| Version 1 | DOI: 10.17632/bhntr53rd3.1
Contributors:
Sangita Sarkar Sangita Sarkar ,

Description

Project Title Good and Bad Classification of Chapati (Roti) Description This project focuses on developing a machine learning-based image classification system to identify and classify roti samples into two categories: Good Roti (fresh and consumable) and Bad Roti (spoiled or stale). The dataset consists of more than 1000 images, including over 480 good roti images and 510 bad roti images. Images were captured using a Moto G34 5G smartphone camera under both natural daylight and indoor LED lighting conditions. Data collection was performed at a room temperature of approximately 27°C–30°C. A plain background was used to reduce distractions and improve image quality. Dataset Composition Good Roti Good roti samples show: - Fresh appearance - Uniform golden-brown color - Soft texture - Proper cooking - No visible spoilage Bad Roti Bad roti samples show: - Dryness and staleness - Mold or fungal growth - Discoloration - Hard texture - Visible spoilage signs Data Collection and Annotation Images were captured from different angles and distances to increase dataset diversity. Each image was manually labeled as either Good Roti or Bad Roti based on visual characteristics such as color, texture, freshness, and spoilage symptoms. These labels were used for supervised machine learning. Objective The main objective of this project is to develop an automated system that can accurately classify fresh and spoiled rotis using image analysis. The system aims to reduce manual inspection efforts and support food quality monitoring. Expected Outcome The developed model is expected to: - Accurately classify roti quality. - Improve food safety and quality control. - Reduce food wastage. - Support automation in food inspection systems. Hardware Used - Moto G34 5G Mobile Camera - Natural Daylight and LED Light - Plain Background - Computer System for Model Training - Primary cameta -50 mp sensor - Aperture -f/1.8 - Camera technology -quad pixel  - Effective pixel size- 1.28 micrometre - Focus system - phase detection auto focus Conclusion This project demonstrates the use of computer vision and machine learning for food quality assessment. By analyzing images captured with a Moto G34 5G smartphone, the system can classify rotis as good or bad based on their visual characteristics. The project contributes to food safety, quality control, and shelf-life monitoring while reducing the need for manual inspection.

Files

Steps to reproduce

1.Prepare fresh roti samples and store some samples under normal room temperature conditions (27°C–30°C) for different durations to obtain spoiled rotis. 2.Capture images of both fresh and spoiled rotis using a Moto G34 5G smartphone camera. 3.Take photographs under different lighting conditions, including natural daylight and indoor LED lighting. 4.Store all images in separate folders named "Good Roti" and "Bad Roti". 5.Review and manually label each image according to its quality category. 6.Preprocess the images by resizing them to a uniform size and organizing them into a structured dataset. Split the dataset into training and testing sets. 7.Train the machine learning image classification model using the training dataset. 8.Evaluate the model using the testing dataset and calculate performance metrics such as accuracy. 9.Upload a new roti image to the trained model and observe the predicted result as either "Good Roti" or "Bad Roti". 10.Compare the prediction with the actual condition of the roti to verify the model's performance.

Categories

Food Quality Assessment, Characterization of Food, Binary Classification

Licence