A Multi-Class Deep Learning Architecture for Quality Classification and Formalin Contamination Detection in Horticultural Fruits
Abstract
The adulteration of fresh horticultural produce with formaldehyde (formalin) and the rapid physiological decay of fruit remain persistent food-safety and economic problems within agricultural supply chains. Deep learning offers a non-destructive route to automated fruit-quality screening; however, the literature has largely pursued peak accuracy using progressively heavier network backbones, leaving the computational cost of that accuracy and therefore the feasibility of on-site, embedded deployment insufficiently examined. This study benchmarks three representative visual-recognition paradigms of markedly different scale, namely MobileNetV2 (a depthwise-separable lightweight convolutional neural network), ResNet-50 (a deep residual network), and ViT-B/16 (a patch-based Vision Transformer), on the identical three-class task of distinguishing fresh, rotten, and formalin-mixed fruit. A total of 10,154 images from the public FruitVision dataset were processed under a single fixed preprocessing and training protocol, so that architecture was the only experimental variable. Rather than accuracy alone, performance was assessed through an efficiency lens that normalises accuracy by parameter count and by inference cost (GFLOPs). The lightweight MobileNetV2 attained the highest test accuracy (99.69%) while using approximately one-seventh of the parameters and one-thirteenth of the floating-point operations of ResNet-50, and about one twenty-fifth of the parameters of ViT-B/16; the Transformer recorded the lowest accuracy (99.28%) at the highest cost. These results indicate that, for this medium-scale task, additional architectural capacity yields a negligible accuracy return, and that a compact model can support reliable, safety-critical formalin screening on resource-constrained devices. Per-class reliability and deployment implications, including one residual false negative, are reported without overstatement.
Downloads
References
S. V Binorkar and M. S. Bhoyar, “Toxicological Insights into Food Additives and FP-Impact, Trends, and Resolves,” Annals of Ayurvedic Medicine, vol. 14, no. 2, pp. 164–174, 2025, doi: 10.5455/AAM.
Y. Cui, Y. Cheng, Z. Xu, B. Li, W. Tian, and J. Zhang, “Cellulose-Based Transparent Edible Antibacterial Oxygen-Barrier Coating for Long-Term Fruit Preservation,” Advanced Science, vol. 11, no. 48, Dec. 2024, doi: 10.1002/advs.202409560.
C. Wang, X. Li, Z. Zhang, X. Luo, J. Cai, and A. Wang, “Nondestructive Quality Detection of Characteristic Fruits Based on Vis/NIR Spectroscopy: Principles, Systems, and Applications,” Oct. 01, 2025, Multidisciplinary Digital Publishing Institute (MDPI). doi: 10.3390/agriculture15202167.
U. Amin, M. I. Shahzad, A. Shahzad, M. Shahzad, U. Khan, and Z. Mahmood, “Automatic Fruits Freshness Classification Using CNN and Transfer Learning,” Applied Sciences (Switzerland), vol. 13, no. 14, Jul. 2023, doi: 10.3390/app13148087.
M. H. I. Bijoy, S. Z. Tasnim, S. A. Awsaf, and M. Z. Hasan, “FruitVision: A benchmark dataset for fresh, rotten, and formalin-mixed fruit detection,” Data Brief, vol. 61, Aug. 2025, doi: 10.1016/j.dib.2025.111752.
P. Dhiman et al., “A Novel Deep Learning Model for Detection of Severity Level of the Disease in Citrus Fruits,” Electronics (Switzerland), vol. 11, no. 3, Feb. 2022, doi: 10.3390/electronics11030495.
Z. Cao and Z. Cao, “Design of a MobilNetV2-Based Retrieval System for Traditional Cultural Artworks,” Int. J. Gaming Comput. Mediat. Simul., vol. 16, no. 1, pp. 1–17, 2023, doi: 10.4018/IJGCMS.334700.
W. Nugroho, R. Zahabiyah, M. J. F. Arifiant, and A. Afianto, “Automated Component Detection for Quality PCB Using YOLO Algorithm with IoT Real-Time Streaming on Raspberry Pi,” JURNAL INFOTEL, vol. 17, no. 2, Jul. 2025, doi: 10.20895/infotel.v17i2.1313.
U. Barman et al., “ViT-SmartAgri: Vision Transformer and Smartphone-Based Plant Disease Detection for Smart Agriculture,” Agronomy, vol. 14, no. 2, Feb. 2024, doi: 10.3390/agronomy14020327.
H. M. Albarakati et al., “A Novel Deep Learning Architecture for Agriculture Land Cover and Land Use Classification from Remote Sensing Images Based on Network-Level Fusion of Self-Attention Architecture,” IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens., vol. 17, pp. 6338–6353, 2024, doi: 10.1109/JSTARS.2024.3369950.
Z. Muthi’ah, Oktalia Triananda Lovita, Oktalia Triananda Lovita, and Mohd Iqbal Muttaqin, “Deep Learning Based Classification of TB and Normal Chest X-rays Using a Custom CNN with Minimal Epoch Training,” Jurnal Inotera, vol. 10, no. 2, pp. 272–279, Jul. 2025, doi: 10.31572/inotera.vol10.iss2.2025.id503.
M. Ben Ammar, “ENHANCING REAL-TIME INSTANCE SEGMENTATION FOR PLANT DISEASE DETECTION WITH IMPROVED YOLOV8-SEG ALGORITHM,” 2024.
G. Al-refai, H. Elmoaqet, A. Al-Refai, A. Alzu’bi, T. Al-Hadhrami, and A. Alkhateeb, “Two-stage object detection in low-light environments using deep learning image enhancement,” PeerJ Comput. Sci., vol. 11, 2025, doi: 10.7717/peerj-cs.2799.
M. H. Ashraf et al., “HIRD-Net: An Explainable CNN-Based Framework with Attention Mechanism for Diabetic Retinopathy Diagnosis Using CLAHE-D-DoG Enhanced Fundus Images,” ., vol. 15, no. 9, Sep. 2025, doi: 10.3390/life15091411.
Y. S. Cho and P. C. Hong, “Applying Machine Learning to Healthcare Operations Management: CNN-Based Model for Malaria Diagnosis,” Healthcare (Switzerland), vol. 11, no. 12, Jun. 2023, doi: 10.3390/healthcare11121779.
M. Abedin, S. Islam, and N. Sultana, “Comprehensive data of 10 fruit leaf classes captured for agricultural AI applications,” Data Brief, vol. 61, Aug. 2025, doi: 10.1016/j.dib.2025.111879.
A. Bhatt and M. Joshi, “De dicate d dataset of Sapota (Manilkara zapota) fruit for machine vision applications,” Data Brief, Jul. 2025, doi: 10.17632/jgtb95x6kf.2.
Copyright (c) 2026 Ahmad Fauzi, Achmad Lutfi Fuadi Ahmad, Agus Heri Yunial

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.















