Classification and Shelf Life Prediction of Bananas Using Thermal Imaging with Vision Transformer and Random Forest

PDF (1780KB), PP.226-250

Views: 0 Downloads: 0

Author(s)

Amey Kulkarni 1 Sejal Pathrabe 1 Hans Gupta 1 Gajanan K. Birajdar 2,* Sangita Chaudhari 2

1. Ramrao Adik Institute of Technology, Department of Information Technology, Navi Mumbai, 400706, India

2. Ramrao Adik Institute of Technology, Department of Computer Science and Engineering, Navi Mumbai, 400706, India

* Corresponding author.

DOI: https://doi.org/10.5815/ijigsp.2026.02.12

Received: 19 May 2025 / Revised: 20 Oct. 2025 / Accepted: 6 Jan. 2026 / Published: 8 Apr. 2026

Index Terms

Thermal Imaging, Banana Shelf Life, Vision Transformer, Random Forest, T-SNE

Abstract

Classifying and predicting banana shelf life is vital for optimizing storage and distribution in agriculture. Traditional methods, relying on subjective visual inspection, are inconsistent and time-intensive. This study presents a new, non-destructive approach combining thermal imaging, and machine learning to classify naturally ripened and artificially ripened bananas and forecast their shelf life. Preprocessed thermal images are flattened, segmented into fixed-size patches, and then linearly projected into feature tokens. Position embeddings are incorporated to retain spatial information, and the sequence is processed by a Vision Transformer (ViT) encoder, which leverages self-attention mechanisms to model relationships between patches. The [CLS] token output is subsequently processed through fully connected layers for final classification, achieving 97.59% accuracy. Validation using t-SNE visualization demonstrated clear class separability, and receiver operating characteristic (ROC) curves confirmed robust performance. With an MSE of 0.10, MAE of 0.18, and R2 score of 0.85, the random forest algorithm performed exceptionally well at predicting the shelf life of artificially ripened bananas. This approach offers significant advantages, including improved accuracy, reduced subjectivity, and efficiency in data processing. By integrating thermal imaging with advanced models, the proposed method enhances agricultural supply chain management and promotes precision in ripening classification and shelf life prediction.

Cite This Paper

Amey Kulkarni, Sejal Pathrabe, Hans Gupta, Gajanan K. Birajdar, Sangita Chaudhari, "Classification and Shelf Life Prediction of Bananas Using Thermal Imaging with Vision Transformer and Random Forest", International Journal of Image, Graphics and Signal Processing(IJIGSP), Vol.18, No.2, pp. 226-250, 2026. DOI:10.5815/ijigsp.2026.02.12

Reference

[1]Vassilia J Sinanoglou, Thalia Tsiaka, Konstantinos Aouant, Elizabeth Mouka, Georgia Ladika, Eftichia Kritsi, Spyros J Konteles, Alexandros-George Ioannou, Panagiotis Zoumpoulakis, Irini F Strati, et al. Quality assessment of banana ripening stages by combining analytical methods and image analysis. Applied Sciences, 13(6):3533, 2023.
[2]P. Rajkumar, N. Wang, G. EImasry, G.S.V. Raghavan, and Y. Gariepy. Studies on banana fruit quality and maturity stages using hyperspectral imaging. Journal of Food Engineering, 108(1):194–200, 2012.
[3]Abdelmalek Bouguettaya, Hafed Zarzour, Ahmed Kechida, and Amine Mohammed Taberkit. Deep learning techniques to classify agricultural crops through uav imagery: A review. Neural computing and applications, 34(12):9511–9536, 2022.
[4]P Pathmanaban, BK Gnanavel, and Shanmuga Sundaram Anandan. Recent application of imaging techniques for fruit quality assessment. Trends in Food Science & Technology, 94:32–42, 2019.
[5]Naveen Sharma, Satbir Singh, Ashu Rastogi, Mirza Sarfaraj, and Prasant Kumar Mahapatra. Shape-based wound localization in diabetic foot ulcer using foot thermograms. International Journal of Image, Graphics and Signal Processing (IJIGSP), 16(6):32–43, 2024.
[6]Heesup Yun, Sassoum Lo, Christine H. Diepenbrock, Brian N. Bailey, and J. Mason Earles. Vista-sr: Improving the accuracy and resolution of low-cost thermal imaging cameras for agriculture. In 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 5470–5479, 2024.
[7]Maidul Islam, Suraj Bijjahalli, Thomas Fahey, Alessandro Gardi, Roberto Sabatini, and David W. Lamb. Destructive and non-destructive measurement approaches and the application of ai models in precision agriculture: a review. 25(3):1127–1180, 2024.
[8]Hyeon Woo Park and V M Balasubramaniam. Infrared thermal image processing technique for evaluating superheated steam as a dry sanitation method. Food and Bioprocess Technology, aug 2024.
[9]Bei Guo, Baicheng li, Yuanshen Huang, Fayi Hao, Banglian Xu, and Yuanyuan Dong. Bruise detection and classification of strawberries based on thermal images. Food and Bioprocess Technology, 15, 05 2022.
[10]Candra Dewi, Wayan Firdaus Mahmudy, Endang Arisoesilaningsih, and Solimun Solimun. Review of nondestructive banana ripeness identification using imagery data. In Proceedings of the 6th International Conference on Sustainable Information Engineering and Technology, pages 348–354, 2021.
[11]Byeong-Hyo Cho and Shigenobu Koseki. Determination of banana quality indices during the ripening process at different temperatures using smartphone images and an artificial neural network. Scientia Horticulturae, 288:110382, 2021.
[12]Sri Waluyo, Nanda Febrianingrum, Soesiladi Esti Widodo, Agus Karyanto, and Zulferiyenni Zulferiyenni. Maturity assessment of cavendish bananas (musa paradisiaca l.) using the thermal image method. In AIP Conference Proceedings, volume 2616. AIP Publishing, 2023.
[13]Mai Al-Dairi, Pankaj B. Pathare, and Rashid Al-Yahyai. Applying a computer vision system to monitor external quality attributes of damaged banana fruit during storage. In Proceedings of the 3rd International Conference on Sustainable Agriculture for Rural Development (ICSARD 2022), pages 199–207, New York, NY, USA, 2023.Atlantis Press.
[14]Armacheska Rivero Mesa and John Chiang. Non-invasive grading system for banana tiers using rgb imaging and deep learning. In Proceedings of the 2021 7th International Conference on Computing and Artificial Intelligence, ICCAI ’21, page 113–118, New York, NY, USA, 2021. Association for Computing Machinery.
[15]Robert Singh and Suganya Athisayamani. Banana leaf diseased image classification using novel heap auto encoder (hae) deep learning. Multimedia Tools and Applications, 79(41):30601–30613, 2020.
[16]Kowshik Kumar Saha and Manuela Zude-Sasse. Estimation of chlorophyll content in banana during shelf life using lidar laser scanner. Postharvest Biology and Technology, 192:112011, 2022.
[17]Sai Vignesh N and Harini S. Detection of artificially ripened bananas using multispectral images and deep learning. In 2024 International Conference on Smart Systems for Electrical, Electronics, Communication and Computer Engineering (ICSSEECC), pages 50–55, 2024.
[18]Liu Yang, Bo Cui, Junfeng Wu, Xuan Xiao, Yang Luo, Qianmai Peng, and Yonglin Zhang. Automatic detection of banana maturity—application of image recognition in agricultural production. Processes, 12(4), 2024.
[19]Irzal Ahmad Sabilla, Cahyaningtyas Sekar Wahyuni, Chastine Fatichah, and Darlis Herumurti. Determining banana types and ripeness from image using machine learning methods. In 2019 International Conference of Artificial Intelligence and Information Technology (ICAIIT), pages 407–412, 2019.
[20]Rahul Agrawal and Manoj Kumar. Deep learning framework for banana shelf life classification based on ripening: Bslc. In 2023 6th International Conference on Information Systems and Computer Networks (ISCON), pages 1–5. IEEE, 2023.
[21]Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale, 2021.
[22]Sushma Jaiswal, Harikumar Pallthadka, Rajesh P. Chinchewadi, and Tarun Jaiswal. Optimized image captioning: Hybrid transformers vision transformers and convolutional neural networks: Enhanced with beam search. International Journal of Intelligent Systems and Applications (IJISA), 16(2):53–61, 2024.
[23]Roohum Jegan, Bhakti Kaushal, Gajanan K. Birajdar, and Mukesh D. Patil. Deep Scattering Wavelet Network and Marine Predators Algorithm-Based Stuttering Disfluency Detection, pages 31–50. CRC Press, 7 2024.
[24]Narayan Vetrekar, Anish K. Prabhu, Aparajita Naik, Raghavendra Ramachandra, Kiran B. Raja, Adavi R. Desai, and Rajendra S. Gad. Collaborative representation of convolutional neural network features to detect artificial ripening of banana using multispectral imaging. Journal of Food Processing and Preservation, 46(10):e16882, 2022.
[25]Narayan Vetrekar, Raghavendra Ramachandra, Kiran B. Raja, and R. S. Gad. Multi-spectral imaging for artificial ripened banana detection. In 2019 8th European Workshop on Visual Information Processing (EUVIP), pages 187– 192, 2019.
[26]Narayan Vetrekar, Raghavendra Ramachandra, and R. S. Gad. Multilevel fusion of multispectral images to detect the artificially ripened banana. IEEE Sensors Letters, 7(1):1–4, 2023.
[27]Narayan Vetrekar, Raghavendra Ramachandra, Kiran B. Raja, and R. S. Gad. Multi-spectral imaging to detect artificial ripening of banana: A comprehensive empirical study. In 2019 IEEE International Conference on Imaging Systems and Techniques (IST), pages 1–6, 2019.
[28]Narayan Vetrekar, Raghavendra Ramachandra, Kiran Raja, Rajendra Gad, Aparajita Naik, and Anish Prabhu. Detection of artificially ripened banana using spectral signature from multi-spectral imaging. volume 2335, page 050001, 03 2021.
[29]P.L. Arunima, Pratheesh P. Gopinath, P.R. Geetha Lekshmi, and M. Esakkimuthu. Digital assessment of post-harvest nendran banana for faster grading: Cnn-based ripeness classification model. Postharvest Biology and Technology, 214:112972, 2024.
[30]Sirinya Thanyacharoen, Sumetee Jirapattarasakul, Napat Joijinda, Giuseppe Riccardo Leone, Thaweewong Akkaralaertsest, and Thaweesak Yingthawornsuk. Deep learning approaches to banana ripeness detection. In 2025 13th International Electrical Engineering Congress (iEECON), pages 1–6, 2025.
[31]Dayanand G. Savakar. Identification and classification of bulk fruits images using artificial neural networks. 2012.
[32]Priyanka Sahu, Amit Prakash Singh, Anuradha Chug, and Dinesh Singh. A systematic literature review of machine learning techniques deployed in agriculture: A case study of banana crop. IEEE Access, 10:87333–87360, 2022.
[33]Jiajun Zhuang, Chaojun Hou, Yu Tang, Yong He, Qiwei Guo, Aimin Miao, Zhenyu Zhong, and Shaoming Luo. Assessment of external properties for identifying banana fruit maturity stages using optical imaging techniques. Sensors, 19(13), 2019.
[34]Haoyang Cui, Yongpeng Xu, Jundong Zeng, and Zhong Tang. The methods in infrared thermal imaging diagnosis technology of power equipment. In 2013 IEEE 4th International Conference on Electronics Information and Emergency Communication, pages 246–251. IEEE, 2013.
[35]P N Renjith et al. Comprehensive systematic review on fruit maturity detection technique. In 2021 Second International Conference on Electronics and Sustainable Communication Systems (ICESC), pages 1234–1240. IEEE, 2021.
[36]S Kumari and A K Nirala. Biospeckle image processing algorithms for non-destructive differentiation between maturity and ripe stages of indian climacteric fruits and evaluation of their ripening period. Laser Physics, 29(7):075601, may 2019.
[37]Ria Kanjilal, Jorge E Saenz, and Ismail Uysal. Large-scale data-driven uniformity analysis and sensory prediction of commercial banana ripening process. Postharvest Biology and Technology, 219:113203, 2025.
[38]Dawei Li, Lin Bai, Rong Wang, and Sun Ying. Research progress of machine learning in extending and regulating the shelf life of fruits and vegetables. Foods, 13(19):3025, 2024.
[39]Julaiza I Larada, Glydel J Pojas, Laura Vithalie V Ferrer, et al. Postharvest classification of banana (musa acuminata) using tier-based machine learning. Postharvest biology and technology, 145:93–100, 2018.
[40]Yuan-Yuan Pu, Da-Wen Sun, Marina Buccheri, Maurizio Grassi, Tiziana MP Cattaneo, and Aoife Gowen. Ripeness classification of bananito fruit (musa acuminata, aa): A comparison study of visible spectroscopy and hyperspectral imaging. Food Analytical Methods, 12:1693–1704, 2019.
[41]L. Angiolillo, A. Conte, and M.A. Del Nobile. Packaging and shelf life of produce. In Reference Module in Food Science. Elsevier, 2016.
[42]Mai Al-Dairi, Pankaj B. Pathare, Rashid Al-Yahyai, Hemanatha Jayasuriya, and Zahir Al-Attabi. Postharvest quality, technologies, and strategies to reduce losses along the supply chain of banana: A review. Trends in Food Science & Technology, 134:177–191, 2023.
[43]A. N. Wilson, Khushi Anil Gupta, Balu Harshavardan Koduru, Abhinav Kumar, Ajit Jha, and Linga Reddy Cenkeramaddi. Recent advances in thermal imaging and its applications using machine learning: A review. IEEE Sensors Journal, 23(4):3395–3407, 2023.
[44]P Pathmanaban, BK Gnanavel, Shanmuga Sundaram Anandan, and S Sathiyamurthy. Advancing post-harvest fruit handling through ai-based thermal imaging: applications, challenges, and future trends. Discover Food, 3(1):27, 2023.
[45]S. Sofana Reka, Ankita Bagelikar, Prakash Venugopal, V. Ravi, and Harimurugan Devarajan. Deep learning-based classification of rotten fruits and identification of shelf life. Computers, Materials and Continua, 78(1):781–794, 2024.
[46]Falguni Vasant Patre, Aditya Arya, and G. Saranya. Banana freshness classification: A deep learning approach with vgg16. In Sandeep Kumar, Saroj Hiranwal, Ritu Garg, and S. D. Purohit, editors, Proceedings of International Conference on Communication and Computational Technologies, pages 205–217, Singapore, 2024. Springer Nature Singapore.
[47]Kostas-Gkouram Mirzaev and Chairi Kiourt. Machine learning and thermal imaging in precision agriculture. In Nikolaos Bourbakis, George A. Tsihrintzis, Maria Virvou, and Lakhmi C. Jain, editors, Extended Selected Papers of the 14th International Conference on Information, Intelligence, Systems, and Applications, pages 168–187, Cham, 2024. Springer Nature Switzerland.
[48]Maimunah Mohd Ali, Norhashila Hashim, Bernard Maringgal, and Nurazwin Zulkifli. Thermal Imaging, pages 129–147. Springer Nature Switzerland, Cham, 2024.
[49]Kristian M. S. Callaghan and Uriel Martinez-Hernandez. Banana ripeness estimation using a non-destructive approach composed of an array of multimodal sensors and machine learning. In 2024 IEEE SENSORS, pages 1–4, 2024.
[50]D. Cozzolino, S. Alagappan, and L.C. Hoffman. The missing link between shelf life and food waste: are infrared sensing technologies underutilised? Trends in Food Science & Technology, 148:104494, 2024.