G. Madasamy Raja , P. Pathmanaban , P. Selvaraju , S. Vanaja
{"title":"Bread contamination detection using deep learning and thermal imaging","authors":"G. Madasamy Raja , P. Pathmanaban , P. Selvaraju , S. Vanaja","doi":"10.1016/j.jfoodeng.2025.112639","DOIUrl":null,"url":null,"abstract":"<div><div>The effectiveness of four You Only Look Once (YOLO) models (YOLOv5, YOLOv8, YOLOv9, and YOLOv11) was evaluated for detecting contamination (water, oil, grease, and cleaning chemicals) in bread using thermal imaging. Thermal images of contaminated and uncontaminated bread slices were collected through active thermography, employing a controlled hot air supply under varying conditions. The analysis revealed distinct thermal signs, with oil-contaminated areas exhibiting higher temperatures, and water, grease, and chemical contaminants appearing cooler. The trained YOLO models were assessed based on the mean average precision (mAP50-95), inference speed, and computational efficiency. The results indicate that increased model complexity does not always translate into higher accuracy. The lightweight YOLOv11n model (2.59 M parameters, 6.4 Giga Floating Point Operations Per Second (GFLOPs) achieved a competitive mAP50-95 score of 0.607, closely matching larger models such as YOLOv8s (28.6 GFLOPs, mAP50-95: 0.601) and YOLOv9s (27.4 GFLOPs, mAP50-95: 0.601). Despite deeper architectures, models such as YOLOv9s exhibit signs of overfitting without significant performance improvements. YOLOv11n outperformed the other models in terms of operational efficiency, achieving faster inference speeds (3.0 ms/image) and lower memory consumption, thus making it suitable for real-time industrial applications. The training durations for all models were low, ranging between 0.107 and 0.146 h for 10 epochs on an NVIDIA Tesla T4 GPU, demonstrating that contamination detection is a computationally manageable task. These findings suggest that lightweight models, such as YOLOv11n, provide an optimal balance between accuracy, computational efficiency, and practical deployment feasibility.</div></div>","PeriodicalId":359,"journal":{"name":"Journal of Food Engineering","volume":"400 ","pages":"Article 112639"},"PeriodicalIF":5.8000,"publicationDate":"2025-05-02","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Food Engineering","FirstCategoryId":"97","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0260877425001748","RegionNum":2,"RegionCategory":"农林科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"ENGINEERING, CHEMICAL","Score":null,"Total":0}
引用次数: 0
Abstract
The effectiveness of four You Only Look Once (YOLO) models (YOLOv5, YOLOv8, YOLOv9, and YOLOv11) was evaluated for detecting contamination (water, oil, grease, and cleaning chemicals) in bread using thermal imaging. Thermal images of contaminated and uncontaminated bread slices were collected through active thermography, employing a controlled hot air supply under varying conditions. The analysis revealed distinct thermal signs, with oil-contaminated areas exhibiting higher temperatures, and water, grease, and chemical contaminants appearing cooler. The trained YOLO models were assessed based on the mean average precision (mAP50-95), inference speed, and computational efficiency. The results indicate that increased model complexity does not always translate into higher accuracy. The lightweight YOLOv11n model (2.59 M parameters, 6.4 Giga Floating Point Operations Per Second (GFLOPs) achieved a competitive mAP50-95 score of 0.607, closely matching larger models such as YOLOv8s (28.6 GFLOPs, mAP50-95: 0.601) and YOLOv9s (27.4 GFLOPs, mAP50-95: 0.601). Despite deeper architectures, models such as YOLOv9s exhibit signs of overfitting without significant performance improvements. YOLOv11n outperformed the other models in terms of operational efficiency, achieving faster inference speeds (3.0 ms/image) and lower memory consumption, thus making it suitable for real-time industrial applications. The training durations for all models were low, ranging between 0.107 and 0.146 h for 10 epochs on an NVIDIA Tesla T4 GPU, demonstrating that contamination detection is a computationally manageable task. These findings suggest that lightweight models, such as YOLOv11n, provide an optimal balance between accuracy, computational efficiency, and practical deployment feasibility.
期刊介绍:
The journal publishes original research and review papers on any subject at the interface between food and engineering, particularly those of relevance to industry, including:
Engineering properties of foods, food physics and physical chemistry; processing, measurement, control, packaging, storage and distribution; engineering aspects of the design and production of novel foods and of food service and catering; design and operation of food processes, plant and equipment; economics of food engineering, including the economics of alternative processes.
Accounts of food engineering achievements are of particular value.