Smart Agriculture: AI-based System for Classification of Fresh, Rotten, and Formalin Fruits

AI-based System for Classification of Fruits

Authors

  • Mahwish Ilyas Punjab University of Technology, Rasul, Mandi Bahauddin,
  • Sehrish Noreen
  • Anam Naz
  • Muhammad Bilal
  • Muhammad Ramzan
  • Muhammad Summair Raza

Keywords:

CNN, Image Classification, Deep Learning Model, Smart Agriculture

Abstract

Ensuring the freshness and safety of fruits and vegetables is critical for protecting public health, minimizing food waste, and enhancing supply chain efficiency. Traditionally, the assessment of produce quality relies on manual visual inspection, which is time-consuming, labor-intensive, and prone to errors. Recent advances in artificial intelligence have opened opportunities for automating this process, offering faster, more accurate, and scalable solutions. In this work, we propose a lightweight Convolutional Neural Network (CNN) model designed to classify fruits into three categories based on freshness: fresh, rotten, and formalin-treated. The model architecture integrates four convolutional layers with regularization techniques, enabling efficient feature extraction while maintaining low computational cost. We conducted experiments on the peer-reviewed Fruit Vision dataset, consisting of 10,154 images across 15 fruit classes. The proposed CNN achieved a test accuracy of 92.19%, with training and validation accuracies of 94.10% and 92.84%, respectively, and an F1-score of 0.93, outperforming several pretrained baseline models such as VGG16, InceptionV3, and MobileNetV2. These results demonstrate the feasibility of applying deep learning for automated fruit quality inspection. Our approach offers a reliable and efficient framework that can contribute to enhanced food safety, reduced waste, and more intelligent supply chain management.

References

P. G K and G. K. N H, “Fruits and Vegetables Disease Detection Using Deep Learning,” in 2024 International Conference on Integrated Intel-ligence and Communication Systems (ICIICS), 2024, pp. 1–6. doi: 10.1109/ICIICS63763.2024.10859698.

L. Zhang, M. Zhang, A. S. Mujumdar, C. Wu, and D. Wang, “Ad-vanced model predictive control strategies for nondestructive monitor-ing quality of fruit and vegetables during supply chain processes,” Comput Electron Agric, vol. 225, p. 109262, 2024, doi: https://doi.org/10.1016/j.compag.2024.109262.

K. Sangeetha, P. V. Raja, S. S, S. J, and R. S, “Classification of Fruits and its Quality Prediction using Deep Learning,” in 2024 5th Inter-national Conference on Intelligent Communication Technologies and Virtual Mobile Networks (ICICV), 2024, pp. 342–346. doi: 10.1109/ICICV62344.2024.00059.

Daphne Ewing-Chow, “Fruit And Vegetable Spoilage Is A Hidden Contributor To Underdevelopment.”

A. Hayat, F. Morgado-Dias, T. Choudhury, T. P. Singh, and K. Ko-techa, “FruitVision: A deep learning based automatic fruit grading sys-tem,” Open Agric, vol. 9, no. 1, Jan. 2024, doi: 10.1515/opag-2022-0276.

D. Thakur and V. Kumar, “FruitVision: Dual-Attention Embedded AI System for Precise Apple Counting Using Edge Computing,” IEEE Transactions on AgriFood Electronics, vol. 2, no. 2, pp. 445–459, 2024, doi: 10.1109/TAFE.2024.3416221.

L. V. R. Kumari, E. Samsritha, K. Neha, and R. Khandala, “Fruit Dam-age Detection using Custom CNN,” in 2024 15th International Con-ference on Computing Communication and Networking Technologies (ICCCNT), 2024, pp. 1–6. doi: 10.1109/ICCCNT61001.2024.10724199.

T. and A. H. A. M. and A. J. S. and A. M. Z. and K. N. F. Gunasekaran Shanmuka Rooban and Sabapathy, “Combined CNN Based Computer Imaging and Electromagnetic Sensing Analysis for Mango Quality De-tection,” in Advances in Artificial Intelligence and Electronic Design Technologies, T. and P. S. and A. A. and S. P. J. Abdul Khalib Zahereel Ishwar and Sabapathy, Ed., Cham: Springer Nature Switzer-land, 2025, pp. 349–360.

D. Wang, M. Zhang, M. Li, and J. Lin, “Fruits and vegetables preserva-tion based on AI technology: Research progress and application pro-spects,” Comput Electron Agric, vol. 226, p. 109382, 2024, doi: https://doi.org/10.1016/j.compag.2024.109382.

Akshi, P. Varshney, S. Avasthi, and K. Agarwal, “Fruit and Vegetable Classification and Freshness Detection using Machine learning,” in 2024 MIT Art, Design and Technology School of Computing Interna-tional Conference (MITADTSoCiCon), 2024, pp. 1–5. doi: 10.1109/MITADTSoCiCon60330.2024.10575107.

T. B. Kumar and D. Prashar, “A CNN-based Model to Classify Fresh and Damaged Fruit,” in 2024 Third International Conference on Elec-trical, Electronics, Information and Communication Technologies (ICEEICT), 2024, pp. 1–7. doi: 10.1109/ICEEICT61591.2024.10718540.

M. K. Gourisaria, R. Joarder, and J. J. Jena, “Rotten Fruits and Vegeta-bles Detection: A Deep Learning and Transfer Learning Based Ap-proach,” in TENCON 2024 - 2024 IEEE Region 10 Conference (TENCON), 2024, pp. 1676–1679. doi: 10.1109/TENCON61640.2024.10902672.

R. B. N, V. M. S, N. C. Gowda, N. C. R, V. H. N, and D. Roja Ramani, “Fruit Quality Monitoring System using CNN,” in 2025 International Conference on Intelligent Systems and Computational Networks (ICISCN), 2025, pp. 1–6. doi: 10.1109/ICISCN64258.2025.10934279.

M. A. Abu Bakar, Z. Zulkifli, M. Mohamad, and S. Ahmad, “GLCM-Based Feature Extraction and CNN Approach for Fruit Freshness De-tection,” in 2024 5th International Conference on Artificial Intelli-gence and Data Sciences (AiDAS), 2024, pp. 1–6. doi: 10.1109/AiDAS63860.2024.10730167.

N. Rahman, M. Arefin, S. Rahman, M. S. Islam, T. Khatun, and U. Akter, “Enhancing the Accuracy of Fruit Freshness Detection by Uti-lizing Transfer Learning and Customizing Convolutional Neural Net-work(CNN),” in 2024 IEEE 3rd International Conference on Compu-ting and Machine Intelligence (ICMI), 2024, pp. 1–6. doi: 10.1109/ICMI60790.2024.10585689.

M. Iqbal et al., “Canned Apple Fruit Freshness Detection Using Hy-brid Convolutional Neural Network and Transfer Learning,” J Food Qual, vol. 2025, no. 1, 2025, doi: 10.1155/jfq/8522400.

A. Mohite, R. Joshi, S. Kunjir, and M. Kodmelwar, “Deep Learning-Based Fruit Recognition and Quality Assessment: A Convolutional Neural Network Approach,” in 2024 ASU International Conference in Emerging Technologies for Sustainability and Intelligent Systems (ICETSIS), 2024, pp. 589–593. doi: 10.1109/ICETSIS61505.2024.10459453.

H. Sallam, O. N. Ghizawi, A. S. Derrija, and E. B. Sönmez, “A Com-puter Vision Approach for Classifying the Degree of Freshness in Fruits and Vegetables to Reduce Food Waste,” in 2024 Innovations in Intelligent Systems and Applications Conference (ASYU), 2024, pp. 1–5. doi: 10.1109/ASYU62119.2024.10757112.

M. F. Fadhlurrahman, T. A. Budi Wirayuda, and B. Purnama, “Predic-tion of Fruit Freshness Level Using Convolutional Neural Network,” in 2024 12th International Conference on Information and Communi-cation Technology (ICoICT), 2024, pp. 137–143. doi: 10.1109/ICoICT61617.2024.10698538.

L. Fischer-Brandies, L. Muller, J. J. Riegger, and R. Buettner, “Fresh or Rotten? Enhancing Rotten Fruit Detection with Deep Learning and Gaussian Filtering,” IEEE Access, vol. 13, pp. 31857–31869, 2025, doi: 10.1109/ACCESS.2025.3542612.

Y. Zhang et al., “Fruit freshness detection based on multi-task convo-lutional neural network,” Curr Res Food Sci, vol. 8, Jan. 2024, doi: 10.1016/j.crfs.2024.100733.

Y. Yuan, J. Chen, K. Polat, and A. Alhudhaif, “An innovative ap-proach to detecting the freshness of fruits and vegetables through the integration of convolutional neural networks and bidirectional long short-term memory network,” Curr Res Food Sci, vol. 8, Jan. 2024, doi: 10.1016/j.crfs.2024.100723.

T. Tang, M. Zhang, H. Jia, B. Bhandari, and Z. Guo, “Intelligent moni-toring of fruit and vegetable freshness in supply chain based on 3D printing and lightweight deep convolutional neural networks (DCNN),” Food Chem, vol. 480, p. 143886, 2025, doi: https://doi.org/10.1016/j.foodchem.2025.143886.

S. M. Azim, A. Spadaro, J. Kawash, J. Polashock, and I. Dehzangi, “Accurately Identifying Sound vs. Rotten Cranberries Using Convolu-tional Neural Network,” Information (Switzerland), vol. 15, no. 11, Nov. 2024, doi: 10.3390/info15110731.

L. and B. L. Bahaddou Youness and Tamym, “Ensuring Fruits and Vegetables Freshness in Sustainable Agricultural Supply Chain Networks: A Deep Learning Approach,” in Advances in Production Management Systems. Production Management Systems for Volatile, Uncertain, Complex, and Ambiguous Environments, R. and von C. G. and R. D. Thürer Matthias and Riedel, Ed., Cham: Springer Nature Switzerland, 2024, pp. 364–378.

M. A. Sofian, A. A. Putri, I. S. Edbert, and A. Aulia, “AI-Based Recognition of Fruit and Vegetable Spoilage: Towards Household Food Waste Reduction,” in Procedia Computer Science, Elsevier B.V., 2024, pp. 1020–1029. doi: 10.1016/j.procs.2024.10.330.

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.

N. Fatima, K.F. Memon, J. Ahmed, Z.H. Khand, Z.H., Gul, S., Kuma-ri, M. and Mujtaba, G., 2021. Precision agriculture using Internet of thing with artificial intelligence: A systematic literature review. Uni-versity of Sindh Journal of Information and Communication Technol-ogy, 5(2), pp.101-110.

A. Anmol, M. Ilyas, M. Bilal, H. Khan, and M. Ramzan, M., 2024. Automated Pulmonary Tuberculosis Screening Based on Deep Convo-lutional Neural Networks Using Chest Radiographs.

Downloads

Published

2025-12-21 — Updated on 2025-12-26

Versions

How to Cite

Ilyas, M., Noreen, S. ., Naz, A. ., Bilal, M., Ramzan, M., & Raza, M. S. . (2025). Smart Agriculture: AI-based System for Classification of Fresh, Rotten, and Formalin Fruits : AI-based System for Classification of Fruits. University of Sindh Journal of Information and Communication Technology, 9(1), 39–49. Retrieved from https://sujo.usindh.edu.pk/index.php/USJICT/article/view/7786 (Original work published December 21, 2025)

Most read articles by the same author(s)

Obs.: This plugin requires at least one statistics/report plugin to be enabled. If your statistics plugins provide more than one metric then please also select a main metric on the admin's site settings page and/or on the journal manager's settings pages.