Abstract
Onion storage suffers from major challenges due to post-harvest losses (PHLs) in agricultural supply chains, especially in developing countries where continuous monitoring of surrounding conditions is limited. Standard storage monitoring systems are typically based on traditional static threshold rules (e.g., an excess of 60% relative humidity), and as such, do not have intelligent capabilities to make decisions. To assist with this gap in the current available options for storage monitoring, this study presents a multimodal Internet of Things (IoT) system combined with deep learning for real-time detection of onion spoilage. This unique approach uses environmental data from Internet of Things (IoT) sensors connected via an ESP32 microcontroller to measure temperature, humidity, moisture content, and gas concentration. It also takes images of the onions and uses Convolutional Neural Networks (CNNs) to classify the photos of the onions as they spoil. The application of Grad-CAM visualization of the features contributing to image classification will also assist with the interpretability of the developed models. The evaluation of the proposed framework employed a dataset of 2400 onion images categorized into four classifications: healthy, sprouted, spoiled and with black mold. Precision, recall and F1-score were 91.8%, 93.2% and 92.4%, respectively, for each of the four classifications using the proposed multimodal IoT and CNN framework. Overall, the system achieved an end-to-end latency of approximately 1.3 seconds; therefore, providing almost real-time monitoring of stored onions.
Keywords
Onion, DHT11, MQ3, MQ4, ESP32 microcontroller, Grad-CAM, CNN,Downloads
References
- D. Spurthi, P.C. Swathi, Yerra, S.C., Balaji, M.D. Pai, D., Early Detection of Onion Spoilage Utilizing IoT and AI during Storage and Transportation. International Journal of Innovative Science and Research Technology (IJISRT), 9(4), (2024).
- K.A. Shah, M.U. Sri, B.V. Goud, K. Mannem, (2023) Two-Fold Spoiled Onion Detection using Soft Computing and IoT. In 2023 International Conference on Inventive Computation Technologies (ICICT), IEEE, Lalitpur, Nepal. https://doi.org/10.1109/ICICT57646.2023.10134248
- R. Ali Eltabey, Utilizing Digital Technologies to Ensure Food Safety. International Journal of Artificial Intelligence and Emerging Technology, 6(2), (2023) 42-65.
- S. Banerjee, K. Sarda, S. Khandelwal, A. Gajarushi, S. Gawande, R. Velmurugan, M.S. Baghini, (2024) IoT-based Sensing System for Thrips Pest and Disease Management in Onion Crop. In 2024 IEEE Applied Sensing Conference (APSCON), IEEE, Goa, India. https://doi.org/10.1109/APSCON60364.2024.10466190
- V.B. Singh, N. Sharma, S. Singh, A review of imaging techniques for plant disease detection. Artificial Intelligence in Agriculture, 4, (2020) 229-242. https://doi.org/10.1016/j.aiia.2020.10.002
- Z. Khan, M.Z. Khan, S. Ali, I.A. Abbasi, H.U. Rahman, U. Zeb, H. Khattak, J. Huang, Internet of Things-Based Smart Farming Monitoring System for Bolting Reduction in Onion Farms. Scientific Programming, 2021(1), (2021) 7101983. https://doi.org/10.1155/2021/7101983
- P. Gavali, A. Gend, D. Birari, R. Garad, IOT Based Smart Farming Monitoring System for Bolting Reduction in Onion Farms, 8(3), (2023) 86-90. https://ijsdr.org/papers/IJSDR2303018.pdf
- K.N. Vhatkar, A.B. Kathole, J. Katti, G.J. Dharmale, An Innovative Onion Disease Classification Framework Using Smart IoT Assisted Multi-Scale Attention-Based ResNeXt with SPP via Modified Cat–Mouse Optimizer. International Journal of Image and Graphics, 26(08), (2025) 2750028. https://doi.org/10.1142/S0219467827500288
- A. Popa, M. Hnatiuc, M. Paun, O. Geman, D.J. Hemanth, D. Dorcea, L.H. Son, S.I. Ghita, An Intelligent IoT-Based Food Quality Monitoring Approach Using Low-Cost Sensors. Symmetry, 11, (2019) 374.
- E.G.A.M. El-Dawy, M.A. Hussein, S. El-Nahas, Description and Management of Aspergillus Section Nigri Causing Post-Harvest Bulbs Rot of Onion. Scientific Reports, 14, (2024) 6076. https://doi.org/10.1038/s41598-024-53849-9.
- M. Labanska, S.V. Amsterdam, S. Jenkins, J.P. Clarkson, J.A. Covington, Preliminary Studies on Detection of Fusarium Basal Rot Infection in Onions and Shallots Using Electronic Nose. Sensors (Basel, Switzerland), 22(14), (2022) 5453. https://doi.org/10.3390/s22145453
- M. Imran, H. Kang, S. Lee, E. Kim, H. Park, S. Oh, Current Trends and Future Prospects in Onion Production, Supply, and Demand in South Korea: A Comprehensive Review. Sustainability, 17(3), (2025) 837. https://doi.org/10.3390/su17030837
- T. Nivethitha, P. Vijayalakshmi, J. Jaya, S. Shriram, (2022). A review on coconut tree and plant disease detection using various deep learning and convolutional neural network models. In 2022 International conference on smart and sustainable technologies in energy and power sectors (SSTEPS), IEEE, Mahendragarh, India. https://doi.org/10.1109/SSTEPS57475.2022.00042
- P. Bhavesh, N. Ramakrishnan, (2025) An Interpretable and Efficient Deep Learning Framework for Leaf Disease Detection in Agriculture. In 2025 IEEE 6th India Council International Subsections Conference (INDISCON), IEEE, Rourkela, India. https://doi.org/10.1109/INDISCON66021.2025.11253779
- C. Harishankar, N.S. Anoop, K.S. Niranjana, A. Biju, V. Venugopal, S. Vekkot, (2024) An Explainable Hybrid Learning Model for Indian Food Image Classification. In 2024 15th International Conference on Computing Communication and Networking Technologies (ICCCNT), IEEE, Kamand, India. https://doi.org/10.1109/ICCCNT61001.2024.10724730
- R.R. Selvaraju, A. Das, R. Vedantam, M. Cogswell, D. Parikh, D. Batra, Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization. International Journal of Computer Vision, 128, (2016) 336–359. https://doi.org/10.1007/s11263-019-01228-7
- S. Manoj, M. Sathyanarayana, S.E. Neelagund, AI-Assisted Smart Food Packaging: Current Technologies, Challenges, and Future Opportunities. International Journal of Science, Strategic Management and Technology, 02(05), (2026). https://doi.org/10.55041/ijsmt.v2i5.130
- R.C. Balasooriya, E.L.A.Y. Adithya, M.M.S. Gunarathne, T.C.D. Silva, S. Lokuliyana, P. Wijesiri, (2025) An Explainable Deep Learning Framework for Coconut Disease Detection Using MobileNetV2, Super-Resolution, and Grad-CAM++. In 2025 International Conference on Data Science and Its Applications (ICoDSA), IEEE, Jakarta, Indonesia. https://doi.org/10.1109/ICoDSA67155.2025.11157166
- G.M. Abhishek Drusti S. Shastri, Amit Kumar Yadav, S.V. Aisiri, Sugarcane Disease Detection Using Deep-Learning and LIME. International Journal of Multidisciplinary Research in Science, Engineering and Technology, 8(4), (2025) 6845-6850.
- S. Vidhanaarachchi, J.L. Wijekoon, W.S.P. Abeysiriwardhana, M. Wijesundara, Early Diagnosis and Severity Assessment of Weligama Coconut Leaf Wilt Disease and Coconut Caterpillar Infestation Using Deep Learning-Based Image Processing Techniques. IEEE Access, 13, (2025) 24463–24477. https://doi.org/10.1109/ACCESS.2025.3537664
- M.J. Hoque, M.S. Islam, An Explainable and Lightweight CNN Framework for Robust Potato Leaf Disease Classification Using Grad-CAM Visualization. Applied AI Letters, 7(1), (2026) e70011. https://doi.org/10.1002/ail2.70011
- B.B. Vikhe, P.R. Patil, P.R. Bhaladhare, A. Potgantwar, Image-Based Onion Leaf Disease Identification using a CNN-Transformer Hybrid Approach. International Journal of Image and Data Fusion, 16(1), (2025) 2561938. https://doi.org/10.1080/19479832.2025.2561938
- S.N. Zaki, M. Ahmed, M. Ahsan, S. Zai, M.R. Anjum, N.U. Din, Image-Based Onion Disease (Purple Blotch) Detection Using Deep Convolutional Neural Network. International Journal of Advanced Computer Science and Applications, 12(5), (2021) 448-458. https://doi.org/10.14569/ijacsa.2021.0120556
- P. Singh, R. Krishnamurthi, IoT-Based Real-Time Object Detection System for Crop Protection and Agriculture Field Security. Journal of Real-Time Image Processing, 21(4), (2024) 106. https://doi.org/10.1007/s11554-024-01488-8
Articles

