Development of an Intelligent Inspection System Based on YOLOv7 for Real-Time Detection of Foreign Materials in Fresh-Cut Vegetables
Abstract
1. Introduction
2. Materials and Methods
2.1. Sample Preparation
2.2. Data Collection and Dataset Production
2.3. YOLO Series Algorithm
2.3.1. YOLOv5
2.3.2. YOLOv7
2.3.3. YOLOv8
2.4. Experimental Environment
2.5. Model Evaluation
2.6. Inspection System
2.7. YOLO Model Implementation
3. Results
3.1. Training and Comparison Results of Different Detection Algorithms
3.2. Performance of YOLOv7x in Detecting Each Category of FMs
3.3. Performance of the YOLOv7x Model on an Unrecognized FM Dataset
3.4. Performance of the Developed Inspection System in Real-Time
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Tunny, S.S.; Amanah, H.Z.; Faqeerzada, M.A.; Wakholi, C.; Kim, M.S.; Baek, I.; Cho, B.K. Multispectral Wavebands Selection for the Detection of Potential Foreign Materials in Fresh-Cut Vegetables. Sensors 2022, 22, 1775. [Google Scholar] [CrossRef]
- Raffo, A.; Paoletti, F. Fresh-Cut Vegetables Processing: Environmental Sustainability and Food Safety Issues in a Comprehensive Perspective. Front. Sustain. Food Syst. 2022, 5, 681459. [Google Scholar] [CrossRef]
- Sucheta; Singla, G.; Chaturvedi, K.; Sandhu, P.P. Status and Recent Trends in Fresh-Cut Fruits and Vegetables. In Fresh-Cut Fruits and Vegetables; Elsevier: Amsterdam, The Netherlands, 2020; pp. 17–49. [Google Scholar]
- Archive Market Research. Fresh-Cut Vegetables Market Size, Share, Trends, and Forecast, 2025–2033; Archive Market Research: Pune, India, 2024. [Google Scholar]
- Statista Research Department. Fresh Vegetables-South Korea; Statista: Hamburg, Germany, 2025. [Google Scholar]
- Čapla, J.; Zajác, P.; Fikselová, M.; Bobková, A.; Belej, Ľ.; Janeková, V. Analysis of the incidence of foreign bodies in european foods. J. Microbiol. Biotechnol. Food Sci. 2019, 9, 370–375. [Google Scholar] [CrossRef]
- Payne, K.; O’Bryan, C.A.; Marcy, J.A.; Crandall, P.G. Detection and Prevention of Foreign Material in Food: A Review. Heliyon 2023, 9, e19574. [Google Scholar] [CrossRef]
- U.S. Food and Drug Administration. U.S. Food and Drug Administration Ben’s OriginalTM Issues Voluntary Recall of Select Ben’s Original Long Grain White, Whole Grain Brown, and Ready Rice Products; U.S. Food and Drug Administration: Silver Spring, MD, USA, 2025.
- SGS Digicomply (FoodChain ID). Foreign Objects on the Rise: Wood, Metal, and Plastic in Your Food—What’s Going Wrong? SGS Digicomply: Geneva, Switzerland, 2024. [Google Scholar]
- Urazoe, K.; Kuroki, N.; Maenaka, A.; Tsutsumi, H.; Iwabuchi, M.; Fuchuya, K.; Hirose, T.; Numa, M. Automated Fish Bone Detection in X-Ray Images with Convolutional Neural Network and Synthetic Image Generation. IEEJ Trans. Electr. Electron. Eng. 2021, 16, 1510–1517. [Google Scholar] [CrossRef]
- Key Technology. Industry Report: Sorting Fresh-Cut Produce; Key Technology: Walla Walla, WA, USA, 2023. [Google Scholar]
- Astute Analytica. X-Ray Food Inspection Equipment Market Report, 2024–2032; Astute Analytica: New Delhi, India, 2024. [Google Scholar]
- Pigłowski, M. Food Hazards on the European Union Market: The Data Analysis of the Rapid Alert System for Food and Feed. Food Sci. Nutr. 2020, 8, 1603–1627. [Google Scholar] [CrossRef]
- RSA Group. Contamination and Product Recall: Food & Drink; RSA Insurance Group: London, UK, 2016; Available online: http://ec.europa.eu/food/safety/ (accessed on 12 June 2022).
- Lohumi, S.; Cho, B.-K.; Hong, S. LCTF-Based Multispectral Fluorescence Imaging: System Development and Potential for Real-Time Foreign Object Detection in Fresh-Cut Vegetable Processing. Comput. Electron. Agric. 2021, 180, 105912. [Google Scholar] [CrossRef]
- Patel, K.K.; Kar, A.; Jha, S.N.; Khan, M.A. Machine Vision System: A Tool for Quality Inspection of Food and Agricultural Products. J. Food Sci. Technol. 2012, 49, 123–141. [Google Scholar] [CrossRef]
- Everard, C.D.; Kim, M.S.; Lee, H. A Comparison of Hyperspectral Reflectance and Fluorescence Imaging Techniques for Detection of Contaminants on Spinach Leaves. J. Food Eng. 2014, 143, 139–145. [Google Scholar] [CrossRef]
- He, D.F.; Yoshizawa, M. Metal Detector Based on High-Tc RF SQUID. Phys. C Supercond. Appl. 2002, 378–381, 1404–1407. [Google Scholar] [CrossRef]
- Morita, K.; Ogawa, Y.; Thai, C.N.; Tanaka, F. Soft X-Ray Image Analysis to Detect Foreign Materials in Foods. Food Sci. Technol. Res. 2003, 9, 137–141. [Google Scholar] [CrossRef]
- Ricci, M.; Crocco, L.; Vipiana, F. Microwave Imaging Device for In-Line Food Inspection. In Proceedings of the 14th European Conference on Antennas and Propagation, EuCAP 2020, Copenhagen, Denmark, 15–20 March 2020. [Google Scholar] [CrossRef]
- Sugiyama, T.; Sugiyama, J.; Tsuta, M.; Fujita, K.; Shibata, M.; Kokawa, M.; Araki, T.; Nabetani, H.; Sagara, Y. NIR Spectral Imaging with Discriminant Analysis for Detecting Foreign Materials among Blueberries. J. Food Eng. 2010, 101, 244–252. [Google Scholar] [CrossRef]
- Pallav, P.; Diamond, G.G.; Hutchins, D.A.; Green, R.J.; Gan, T.H. A Near-Infrared (NIR) Technique for Imaging Food Materials. J. Food Sci. 2009, 74, 23–33. [Google Scholar] [CrossRef]
- Voss, J.O.; Doll, C.; Raguse, J.D.; Beck-Broichsitter, B.; Walter-Rittel, T.; Kahn, J.; Böning, G.; Maier, C.; Thieme, N. Detectability of Foreign Body Materials Using X-Ray, Computed Tomography and Magnetic Resonance Imaging: A Phantom Study. Eur. J. Radiol. 2021, 135, 109505. [Google Scholar] [CrossRef]
- Khairi, M.T.M.; Ibrahim, S.; Yunus, M.A.M.; Wahap, A.R. Detection of Foreign Objects in Milk Using an Ultrasonic System. Indones. J. Electr. Eng. Comput. Sci. 2019, 15, 1241–1249. [Google Scholar] [CrossRef]
- Tang, T.; Zhang, M.; Mujumdar, A.S. Intelligent Detection for Fresh-cut Fruit and Vegetable Processing: Imaging Technology. Compr. Rev. Food Sci. Food Saf. 2022, 21, 5171–5198. [Google Scholar] [CrossRef] [PubMed]
- Mohd Khairi, M.T.; Ibrahim, S.; Md Yunus, M.A.; Faramarzi, M. Noninvasive Techniques for Detection of Foreign Bodies in Food: A Review. J. Food Process. Eng. 2018, 41, 12808. [Google Scholar] [CrossRef]
- Graves, M.; Smith, A.; Batchelor, B. Approaches to Foreign Body Detection in Foods. Trends Food Sci. Technol. 1998, 9, 21–27. [Google Scholar] [CrossRef]
- Einarsdóttir, H.; Emerson, M.J.; Clemmensen, L.H.; Scherer, K.; Willer, K.; Bech, M.; Larsen, R.; Ersbøll, B.K.; Pfeiffer, F. Novelty Detection of Foreign Objects in Food Using Multi-Modal X-Ray Imaging. Food Control 2016, 67, 39–47. [Google Scholar] [CrossRef]
- Rizalman, N.F.I.S.; Rashid, W.N.A.; Lokmanulhakim, N.; Mohamad, E.J. Development of Foreign Material Detection in Food Sensor Using Electrical Resistance Technique. Int. J. Integr. Eng. 2019, 11, 277–285. [Google Scholar] [CrossRef]
- Mo, C.; Kim, G.; Kim, M.S.; Lim, J.; Cho, H.; Barnaby, J.Y.; Cho, B.-K. Fluorescence Hyperspectral Imaging Technique for Foreign Substance Detection on Fresh-Cut Lettuce. J. Sci. Food Agric. 2017, 97, 3985–3993. [Google Scholar] [CrossRef]
- Senni, L.; Ricci, M.; Palazzi, A.; Burrascano, P.; Pennisi, P.; Ghirelli, F. On-Line Automatic Detection of Foreign Bodies in Biscuits by Infrared Thermography and Image Processing. J. Food Eng. 2014, 128, 146–156. [Google Scholar] [CrossRef]
- Sharma, A.K.; Nguyen, H.H.C.; Bui, T.X.; Bhardwa, S.; Van Thang, D. An Approach to Ripening of Pineapple Fruit with Model Yolo V5. In Proceedings of the 2022 IEEE 7th International conference for Convergence in Technology (I2CT), Mumbai, India, 7–9 April 2022; pp. 1–5. [Google Scholar]
- Wang, Y.; Zhang, C.; Wang, Z.; Liu, M.; Zhou, D.; Li, J. Application of Lightweight YOLOv5 for Walnut Kernel Grade Classification and Endogenous Foreign Body Detection. J. Food Compos. Anal. 2024, 127, 105964. [Google Scholar] [CrossRef]
- Xia, Y.; Nguyen, M.; Yan, W.Q. A Real-Time Kiwifruit Detection Based on Improved YOLOv7. In Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics); Springer: Berlin/Heidelberg, Germany, 2023; Volume 13836 LNCS, pp. 48–61. ISBN 9783031258244. [Google Scholar]
- Li, Z.; Zhu, Y.; Sui, S.; Zhao, Y.; Liu, P.; Li, X. Real-Time Detection and Counting of Wheat Ears Based on Improved YOLOv7. Comput. Electron. Agric. 2024, 218, 108670. [Google Scholar] [CrossRef]
- Wang, Z.; Zhang, S.; Chen, Y.; Xia, Y.; Wang, H.; Jin, R.; Wang, C.; Fan, Z.; Wang, Y.; Wang, B. Detection of Small Foreign Objects in Pu-Erh Sun-Dried Green Tea: An Enhanced YOLOv8 Neural Network Model Based on Deep Learning. Food Control 2025, 168, 110890. [Google Scholar] [CrossRef]
- Lu, J.; Lee, S.-H.; Kim, I.-W.; Kim, W.-J.; Lee, M.-S. Small Foreign Object Detection in Automated Sugar Dispensing Processes Based on Lightweight Deep Learning Networks. Electronics 2023, 12, 4621. [Google Scholar] [CrossRef]
- Kurniawan, H.; Andi Arief, M.A.; Manggala, B.; Lee, S.; Kim, H.; Cho, B.K. Advanced Detection of Foreign Objects in Fresh-Cut Vegetables Using YOLOv5. LWT 2024, 212, 116989. [Google Scholar] [CrossRef]
- Edwards, M.C.; Stringer, M.F. Observations on Patterns in Foreign Material Investigations. Food Control 2007, 18, 773–782. [Google Scholar] [CrossRef]
- Caparros Megido, R.; Sablon, L.; Geuens, M.; Brostaux, Y.; Alabi, T.; Blecker, C.; Drugmand, D.; Haubruge, É.; Francis, F. Edible Insects Acceptance by B Elgian Consumers: Promising Attitude for Entomophagy Development. J. Sens. Stud. 2014, 29, 14–20. [Google Scholar] [CrossRef]
- Choi, J.; Lee, S.I.; Rackerby, B.; Moppert, I.; McGorrin, R.; Ha, S.-D.; Park, S.H. Potential Contamination Sources on Fresh Produce Associated with Food Safety. J. Food Hyg. Saf. 2019, 34, 1–12. [Google Scholar] [CrossRef]
- Gil, M.I.; Selma, M.V.; López-Gálvez, F.; Allende, A. Fresh-Cut Product Sanitation and Wash Water Disinfection: Problems and Solutions. Int. J. Food Microbiol. 2009, 134, 37–45. [Google Scholar] [CrossRef]
- Jocher, G.; Stoken, A.; Borovec, J.; NanoCode012; ChristopherSTAN; Liu, C.; Laughing; Hogan, A.; Lorenzomammana; Tkianai; et al. ultralytics/yolov5: v3.0; Zenodo: Geneva, Switzerland, 2020. [Google Scholar] [CrossRef]
- Fan, Y.; Zhang, S.; Feng, K.; Qian, K.; Wang, Y.; Qin, S. Strawberry Maturity Recognition Algorithm Combining Dark Channel Enhancement and YOLOv5. Sensors 2022, 22, 419. [Google Scholar] [CrossRef]
- Wang, J.; Chen, Y.; Dong, Z.; Gao, M. Improved YOLOv5 Network for Real-Time Multi-Scale Traffic Sign Detection. Neural. Comput. Appl. 2023, 35, 7853–7865. [Google Scholar] [CrossRef]
- Zhao, J.; Zhang, X.; Yan, J.; Qiu, X.; Yao, X.; Tian, Y.; Zhu, Y.; Cao, W. A Wheat Spike Detection Method in UAV Images Based on Improved YOLOv5. Remote Sens. 2021, 13, 3095. [Google Scholar] [CrossRef]
- Wang, H.; Shang, S.; Wang, D.; He, X.; Feng, K.; Zhu, H. Plant Disease Detection and Classification Method Based on the Optimized Lightweight YOLOv5 Model. Agriculture 2022, 12, 931. [Google Scholar] [CrossRef]
- Zhao, Z.; Yang, X.; Zhou, Y.; Sun, Q.; Ge, Z.; Liu, D. Real-Time Detection of Particleboard Surface Defects Based on Improved YOLOV5 Target Detection. Sci. Rep. 2021, 11, 21777. [Google Scholar] [CrossRef] [PubMed]
- Sun, Y.; Zhang, D.; Guo, X.; Yang, H. Lightweight Algorithm for Apple Detection Based on an Improved YOLOv5 Model. Plants 2023, 12, 3032. [Google Scholar] [CrossRef]
- Wang, C.-Y.; Bochkovskiy, A.; Liao, H.-Y.M. YOLOv7: Trainable Bag-of-Freebies Sets New State-of-the-Art for Real-Time Object Detectors. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar]
- Thakuria, A.; Erkinbaev, C. Improving the Network Architecture of YOLOv7 to Achieve Real-Time Grading of Canola Based on Kernel Health. Smart Agric. Technol. 2023, 5, 100300. [Google Scholar] [CrossRef]
- Terven, J.; Córdova-Esparza, D.-M.; Romero-González, J.-A. A Comprehensive Review of YOLO Architectures in Computer Vision: From YOLOv1 to YOLOv8 and YOLO-NAS. Mach. Learn Knowl. Extr. 2023, 5, 1680–1716. [Google Scholar] [CrossRef]
- Jabed, M.R.; Shamsuzzaman, M. YOLObin: Non-Decomposable Garbage Identification and Classification Based on YOLOv7. J. Comput. Commun. 2022, 10, 104–121. [Google Scholar] [CrossRef]
- Jocher, G.; Chaurasia, A.; Qiu, J. Ultralytics YOLOv8; Ultralytics: London, UK, 2023; Available online: https://github.com/ultralytics/ultralytics (accessed on 22 July 2025).
- Gašparović, B.; Mauša, G.; Rukavina, J.; Lerga, J. Evaluating YOLOV5, YOLOV6, YOLOV7, and YOLOV8 in Underwater Environment: Is There Real Improvement? In Proceedings of the 2023 8th International Conference on Smart and Sustainable Technologies (SpliTech), Split/Bol, Croatia, 20–23 June 2023; pp. 1–4. [Google Scholar]
- Mahboob, Z.; Zeb, A.; Khan, U.S. YOLO v5, v7 and v8: A Performance Comparison for Tobacco Detection in Field. In Proceedings of the 2023 3rd International Conference on Digital Futures and Transformative Technologies (ICoDT2), Islamabad, Pakistan, 3–4 October 2023; pp. 1–6. [Google Scholar]
- Wang, X.; Li, H.; Yue, X.; Meng, L. A Comprehensive Survey on Object Detection YOLO. In Proceedings of the 5th International Symposium on Advanced Technologies and Applications in the Internet of Things (ATAIT 2023), Kusatsu, Japan, 28–29 August 2023; Available online: http://ceur-ws.org (accessed on 6 March 2024).
- Sharma, A.; Kumar, V.; Longchamps, L. Comparative Performance of YOLOv8, YOLOv9, YOLOv10, YOLOv11 and Faster R-CNN Models for Detection of Multiple Weed Species. Smart Agric. Technol. 2024, 9, 100648. [Google Scholar] [CrossRef]
- Nkuzo, L.; Sibiya, M.; Markus, E.D. A Comprehensive Analysis of Real-Time Car Safety Belt Detection Using the YOLOv7 Algorithm. Algorithms 2023, 16, 400. [Google Scholar] [CrossRef]
- Gai, R.; Liu, Y.; Xu, G. TL-YOLOv8: A Blueberry Fruit Detection Algorithm Based on Improved YOLOv8 and Transfer Learning. IEEE Access 2024, 12, 86378–86390. [Google Scholar] [CrossRef]
- Diwan, T.; Anirudh, G.; Tembhurne, J.V. Object Detection Using YOLO: Challenges, Architectural Successors, Datasets and Applications. Multimed. Tools Appl. 2023, 82, 9243–9275. [Google Scholar] [CrossRef] [PubMed]
- Kwak, D.H.; Son, G.J.; Park, M.K.; Kim, Y.D. Rapid Foreign Object Detection System on Seaweed Using Vnir Hyperspectral Imaging. Sensors 2021, 21, 5279. [Google Scholar] [CrossRef]
- Jiang, J.; Cen, H.; Zhang, C.; Lyu, X.; Weng, H.; Xu, H.; He, Y. Nondestructive Quality Assessment of Chili Peppers Using Near-Infrared Hyperspectral Imaging Combined with Multivariate Analysis. Postharvest Biol. Technol. 2018, 146, 147–154. [Google Scholar] [CrossRef]
- Chen, S.-H.; Jang, J.-H.; Chang, Y.-R.; Kang, C.-H.; Chen, H.-Y.; Liu, K.F.-R.; Lee, F.-L.; Hsueh, Y.-S.; Youh, M.-J. An Automatic Foreign Matter Detection and Sorting System for PVC Powder. Appl. Sci. 2022, 12, 6276. [Google Scholar] [CrossRef]
- Wang, C.; Zhao, J.; Yu, Z.; Xie, S.; Ji, X.; Wan, Z. Real-Time Foreign Object and Production Status Detection of Tobacco Cabinets Based on Deep Learning. Appl. Sci. 2022, 12, 10347. [Google Scholar] [CrossRef]
- Jubayer, F.; Soeb, J.A.; Mojumder, A.N.; Paul, M.K.; Barua, P.; Kayshar, S.; Akter, S.S.; Rahman, M.; Islam, A. Detection of Mold on the Food Surface Using YOLOv5. Curr. Res. Food Sci. 2021, 4, 724–728. [Google Scholar] [CrossRef]
- Meng, J.; Kang, F.; Wang, Y.; Tong, S.; Zhang, C.; Chen, C. Tea Buds Detection in Complex Background Based on Improved YOLOv7. IEEE Access 2023, 11, 88295–88304. [Google Scholar] [CrossRef]
- Xu, J.; Lu, Y. Prototyping and Evaluation of a Novel Machine Vision System for Real-Time, Automated Quality Grading of Sweetpotatoes. Comput. Electron. Agric. 2024, 219, 108826. [Google Scholar] [CrossRef]
- Qin, Z.; Li, X.; Yan, L.; Cheng, P.; Huang, Y. Real-time Detection of Angelica Dahurica Tablet Using YOLOX_am. J. Food Process Eng. 2023, 46, e14480. [Google Scholar] [CrossRef]
















| References | Subject | Hazards | Origin |
|---|---|---|---|
| 2023.6484 | Organic chickpeas | Stone | Italy |
| 2023.4564 | Frozen bell pepper strips | Plastic | Türkiye |
| 2023.1886 | Filled dates with walnut kernel from Algeria | Glass splinters | Algeria |
| 2022.5839 | Pinto beans | Stones, soil, plant parts, sand or rock | Iran |
| 2022.0517 | Powdery mildew on the flavoring ingredient dill and pickled tomatoes | Insect | Poland |
| 2022.0281 | Fruit spread | Glass fragments | Denmark |
| 2021.4500 | Organic brown lentils | Insect | Türkiye |
| 2021.3013 | Canned peas | Glass fragments | Moldova |
| 2021.2206 | Freeze-dried organic fruit mixture | Glass fragments | Germany |
| No. | FMs | Length × Width | |
|---|---|---|---|
| Maximum (mm) | Minimum (mm) | ||
| 1 | Hard plastic | 17.11 × 7.28 | 7.93 × 3.73 |
| 2 | Soft plastic | 17.01 × 8.16 | 8.15 × 5.96 |
| 3 | Metal | 27.63 × 7.78 | 4.20 × 2.84 |
| 4 | Stone | 22.44 × 19.60 | 4.15 × 2.99 |
| 5 | Insect | 12.14 × 6.16 | 2.88 × 2.22 |
| 6 | Glass | 17.98 × 4.81 | 5.30 × 3.66 |
| 7 | Wood | 15.71 × 4.68 | 7.80 × 3.46 |
| 8 | Paper | 12.29 × 9.69 | 8.72 × 4.42 |
| 9 | Rubber | 21.00 × 1.34 | 8.00 × 2.12 |
| 10 | Cable | 20.88 × 1.97 | 8.73 × 1.71 |
| 11 | Cotton bud | 18.31 × 3.87 | 12.04 × 4.47 |
| 12 | Cigarette butt | 22.63 × 8.22 | 10.08 × 3.21 |
| 13 | Styrofoam | 8.78 × 7.30 | 7.15 × 2.02 |
| 14 | Thread | 52.15 × 0.40 | 17.43 × 0.36 |
| YOLO Versions | URL | Reference |
|---|---|---|
| YOLOv5 | https://github.com/ultralytics/yolov5 (accessed on 20 August 2024) | [43] |
| YOLOv7 | https://github.com/WongKinYiu/yolov7 (accessed on 21 August 2024) | [50] |
| YOLOv8 | https://github.com/ultralytics/ultralytics.git (accessed 21 August 2024) | [54] |
| Experimental Environment | Details |
| Programming language | Python 3.9 |
| Operating system | Ubuntu 18.04.6 LTS, Linux version 5.4.0-126-generic |
| Deep learning framework | PyTorch v1.7.1 |
| GPU | NVIDIA TITAN RTX 24 GB |
| CPU | Intel(R) Xeon(R) Gold 6230 CPU@2.10 GHz |
| Acceleration environment | CUDA 10.2 version |
| Training parameters | Details |
| Epochs | 100 |
| Batch-size | 16 |
| Image-size | 640 × 640 |
| Initial learning rate | 0.01 |
| Optimization algorithm | SGD |
| Momentum | 0.937 |
| Weight decay | 0.0005 |
| Model | P (%) | R (%) | mAP0.5 (%) | F1 | Inference (ms) |
|---|---|---|---|---|---|
| YOLOv5s | 96.70 | 95.90 | 97.90 | 0.9630 | 21.4 |
| YOLOv5x | 96.80 | 95.00 | 97.20 | 0.9589 | 34.3 |
| Yolov7-tiny | 96.20 | 95.70 | 97.50 | 0.9595 | 1.3 |
| Yolov7x | 99.80 | 99.00 | 99.80 | 0.9940 | 1.2 |
| YOLOv8s | 96.70 | 95.20 | 97.50 | 0.9594 | 17.6 |
| YOLOv8x | 96.80 | 95.70 | 97.90 | 0.9625 | 23.2 |
| No | FMs | Total FM | Detected (TP) | Undetected (FN) | Accuracy (%) | MDR *, % (FN/(TP + FN)) |
|---|---|---|---|---|---|---|
| 1 | Cigarette butt | 61 | 61 | 0 | 100.00 | 0.00 |
| 2 | Cotton bud | 65 | 62 | 3 | 95.38 | 4.62 |
| 3 | Thread | 61 | 60 | 1 | 98.36 | 1.64 |
| 4 | Insect | 57 | 56 | 1 | 98.25 | 1.75 |
| 5 | Glass | 75 | 73 | 2 | 97.33 | 2.67 |
| 6 | Styrofoam | 72 | 70 | 2 | 97.22 | 2.78 |
| 7 | Rubber | 71 | 70 | 1 | 98.59 | 1.41 |
| 8 | Cable | 69 | 68 | 1 | 98.55 | 1.45 |
| 9 | Metal | 62 | 62 | 0 | 100.00 | 0.00 |
| 10 | Wood | 73 | 73 | 0 | 100.00 | 0.00 |
| 11 | Paper | 74 | 73 | 1 | 98.65 | 1.35 |
| 12 | Stone | 69 | 69 | 0 | 100.00 | 0.00 |
| 13 | Hard plastic | 82 | 81 | 1 | 98.78 | 1.22 |
| 14 | Soft plastic | 63 | 62 | 1 | 98.41 | 1.29 |
| No | FMs | Total FM | Detected (TP) | Undetected (FN) | Accuracy (%) | MDR *, % (FN/(TP + FN)) |
|---|---|---|---|---|---|---|
| 1 | Cigarette butt | 69 | 69 | 0 | 100.00 | 0.00 |
| 2 | Cotton bud | 57 | 56 | 1 | 98.25 | 1.75 |
| 3 | Thread | 64 | 64 | 0 | 100.00 | 0.00 |
| 4 | Insect | 74 | 70 | 4 | 94.59 | 5.41 |
| 5 | Glass | 69 | 68 | 1 | 98.55 | 1.45 |
| 6 | Styrofoam | 78 | 69 | 9 | 88.46 | 11.54 |
| 7 | Rubber | 71 | 70 | 1 | 98.59 | 1.41 |
| 8 | Cable | 68 | 66 | 2 | 97.06 | 2.94 |
| 9 | Metal | 57 | 57 | 0 | 100.00 | 0.00 |
| 10 | Wood | 64 | 64 | 0 | 100.00 | 0.00 |
| 11 | Paper | 86 | 84 | 2 | 97.67 | 2.33 |
| 12 | Stone | 70 | 69 | 1 | 98.57 | 1.43 |
| 13 | Hard plastic | 74 | 72 | 2 | 97.30 | 2.70 |
| 14 | Soft plastic | 80 | 75 | 5 | 93.75 | 6.25 |
| Vegetables | Total FM | Detected | Undetected | Accuracy (%) |
|---|---|---|---|---|
| Cabbage | 122 | 121 | 1 | 99.18 |
| Green onion | 125 | 123 | 2 | 98.40 |
| System Environment | Hardware and Software |
|---|---|
| Programming language | Python 3.10 |
| Operating system | Windows 10 Enterprise |
| Deep learning framework | PyTorch |
| GPU | NVIDIA GeForce RTX 3060 12GB |
| CPU | Intel(R) Core(R) i7-4770 CPU@3.40GHz 8 GB RAM |
| Acceleration environment | CUDA 10.6 version |
| Speed (cm/s) | Fresh-Cut Vegetables | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Cabbage | Green Onion | |||||||||
| Total FM | Detected | Undetected | Overlapping | Accuracy (%) | Total FM | Detected | Undetected | Overlapping | Accuracy (%) | |
| High (69.88) | 33 | 29 | 3 | 1 | 87.88 | 30 | 26 | 3 | 1 | 86.67 |
| Medium (36.73) | 48 | 47 | 1 | 0 | 97.92 | 40 | 38 | 1 | 1 | 95.00 |
| Low (18.40) | 48 | 46 | 1 | 1 | 95.83 | 32 | 31 | 0 | 1 | 96.88 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Kurniawan, H.; Arief, M.A.A.; Manggala, B.; Kim, H.; Lee, S.; Kim, M.S.; Baek, I.; Cho, B.-K. Development of an Intelligent Inspection System Based on YOLOv7 for Real-Time Detection of Foreign Materials in Fresh-Cut Vegetables. Agriculture 2025, 15, 2297. https://doi.org/10.3390/agriculture15212297
Kurniawan H, Arief MAA, Manggala B, Kim H, Lee S, Kim MS, Baek I, Cho B-K. Development of an Intelligent Inspection System Based on YOLOv7 for Real-Time Detection of Foreign Materials in Fresh-Cut Vegetables. Agriculture. 2025; 15(21):2297. https://doi.org/10.3390/agriculture15212297
Chicago/Turabian StyleKurniawan, Hary, Muhammad Akbar Andi Arief, Braja Manggala, Hangi Kim, Sangjun Lee, Moon S. Kim, Insuck Baek, and Byoung-Kwan Cho. 2025. "Development of an Intelligent Inspection System Based on YOLOv7 for Real-Time Detection of Foreign Materials in Fresh-Cut Vegetables" Agriculture 15, no. 21: 2297. https://doi.org/10.3390/agriculture15212297
APA StyleKurniawan, H., Arief, M. A. A., Manggala, B., Kim, H., Lee, S., Kim, M. S., Baek, I., & Cho, B.-K. (2025). Development of an Intelligent Inspection System Based on YOLOv7 for Real-Time Detection of Foreign Materials in Fresh-Cut Vegetables. Agriculture, 15(21), 2297. https://doi.org/10.3390/agriculture15212297

