Multi-Class Guava Classification Using Convolutional Neural Networks for Precision Agriculture

  • Sajjad Ahmed
  • Muhammad Juman Jhatial
  • Farhan Bashir
  • Anjum Usman
  • Inam Ali
  • Shahnaz Memon
Keywords: Guava classification, Convolutional Neural Network, deep learning, image processing, precision agriculture, Sindh guava varieties

Abstract

Guava (Psidium guajava L.) is an important fruit crop in Pakistan, especially in the province of Sindh where several varieties especially Thadharami, Local Sindhi and Riyali are grown and sold. While this is a common approach, the manual visual inspection approach is subjective, time-consuming, labor-intensive and prone to errors of classification, particularly when guava varieties and maturity stages have similar visual similarities. To overcome these, in this study, an automated image-based guava classification system has been proposed using Convolutional Neural Network (CNN). The proposed system differentiates between both guava variety and maturity stage (green, mature green and ripe). Images of guavas were arranged in nine classes of this data set according to its three local varieties and three maturity stages. The image was preprocessed to ensure uniformity of the input, minimize overfitting and improve the generalization of the model under variable imaging conditions. The CNN model was composed of several convolutional, pooling, and fully connected layers to extract the discriminative spatial, color, texture, and shape features in guava images automatically. The model is trained using categorical cross entropy loss and optimized with Adam optimizer. The experimental results presented here revealed the effectiveness of the proposed CNN for Guava classification by automatic classification with a validation accuracy of 92.5%. The misclassifications were higher for the green-stage classes as compared to the ripe guava classes, which was attributed to the large visual similarity between classes and high number of classes of green guavas. The result shows, CNN-based classification can be reliable, scalable and non-destructive solution for guava grading to ensure better quality control, decrease post-harvest losses, increase efficiency in supply chain of the guava industry in Pakistan.

References

[1]. E. Butt, A. B. Altemimi, A. Younas, M. S. Butt, M. Jalal, M. Bhatty, G. Abdi, and R. M. Aadil, “Guava (Psidium guajava): A brief overview of its therapeutic and health potential,” Food Chemistry: X, vol. 31, p. 103027, 2025.
[2]. Y. Emam, R. M. Abdou, I. Y. Younis, and M. A. Farag, “Metabolomics in guava: A comprehensive review of quality, agricultural traits, composition, and nutraceutical applications of Psidium guajava fruits and byproducts,” Phytochemistry Reviews, 2025.
[3]. K. Maitlo, A. Aziz, H. Raza, and N. Abbas, “A novel dataset of guava fruit for grading and classification,” Data in Brief, vol. 49, p. 109462, 2023.
[4]. Toptaş and S. Altun Güven, “Guava fruit classification system design with convolutional neural networks,” Gümüşhane Üniversitesi Fen Bilimleri Dergisi, vol. 14, no. 4, pp. 1247–1258, 2024.
[5]. Kumari and J. Singh, “Designing of guava quality classification model based on ANOVA and machine learning,” Scientific Reports, vol. 15, art. no. 33920, 2025.
[6]. Z. A. Haq, Z. A. Jaffery, and S. Mehfuz, “Precision harvesting: Comparative analysis of machine learning and generative AI-based classifiers for guava fruit maturity assessment using thermal imaging,” CyTA–Journal of Food, vol. 22, no. 1, 2024.
[7]. T. Akter, T. Bhattacharya, J.-H. Kim, M. S. Kim, I. Baek, D. E. Chan, and B.-K. Cho, “A comprehensive review of external quality measurements of fruits and vegetables using nondestructive sensing technologies,” Journal of Agriculture and Food Research, vol. 15, p. 101068, 2024.
[8]. N. Ismail and O. A. Malik, “Real-time visual inspection system for grading fruits using computer vision and deep learning techniques,” Information Processing in Agriculture, vol. 9, no. 1, pp. 24–37, 2022.
[9]. H. S. Gill, G. Murugesan, A. Mehbodniya, G. S. Sajja, G. Gupta, and A. Bhatt, “Fruit type classification using deep learning and feature fusion,” Computers and Electronics in Agriculture, vol. 211, p. 107990, 2023.
[10]. Y. Gulzar, “Fruit image classification model based on MobileNetV2 with deep transfer learning technique,” Sustainability, vol. 15, no. 3, p. 1906, 2023.
[11]. T. B. Shahi, C. Sitaula, A. Neupane, and W. Guo, “Fruit classification using attention-based MobileNetV2 for industrial applications,” PLOS ONE, vol. 17, no. 2, p. e0264586, 2022.
[12]. Y. Li, X. Feng, Y. Liu, and X. Han, “Apple quality identification and classification by image processing based on convolutional neural networks,” Scientific Reports, vol. 11, art. no. 16618, 2021.
[13]. 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, vol. 13, no. 14, p. 8087, 2023.
[14]. Hayat, F. Morgado-Dias, T. Choudhury, T. P. Singh, and K. Kotecha, “FruitVision: A deep learning based automatic fruit grading system,” Open Agriculture, vol. 9, no. 1, p. 20220276, 2024.
[15]. C. Olisah, B. Trewhella, B. Li, M. L. Smith, B. Winstone, E. C. Whitfield, F. Fernández Fernández, and H. Duncalfe, “Convolutional neural network ensemble learning for hyperspectral imaging-based blackberry fruit ripeness detection in uncontrolled farm environment,” Engineering Applications of Artificial Intelligence, vol. 132, p. 107945, 2024.
[16]. Y. Fu, X. Lu, and Y. Chen, “Grading methods for fruit freshness based on deep learning,” SN Computer Science, vol. 3, art. no. 264, 2022.
[17]. H.-S. Shrisha and A. V, “MultiNet: A lightweight deep learning group of models for fruit maturity detection,” Measurement: Digitalization, vol. 4, p. 100012, 2025.
[18]. M. Xu, S. Yoon, A. Fuentes, and D. S. Park, “A comprehensive survey of image augmentation techniques for deep learning,” Pattern Recognition, vol. 137, p. 109347, 2023.
[19]. M. A. K. Raiaan, S. Sakib, N. M. Fahad, A. A. Mamun, M. A. Rahman, S. Shatabda, and M. S. H. Mukta, “A systematic review of hyperparameter optimization techniques in convolutional neural networks,” Decision Analytics Journal, vol. 11, p. 100470, 2024.
[20]. Ahmed, S., Aminuddin, N. F., Jhatial, M. J., Niaz, A., & Ali, I. (2024). AI-based Detection of Mask-Wearing Compliance Using Deep Neural Networks. Lahore Garrison University Research Journal of Computer Science and Information Technology, 8(3), 47-57.
[21]. J. Liu, X. Zhang, Y. Wang, and L. Chen, “Non-destructive detection of fruit quality: Technologies, applications and prospects,” Foods, vol. 14, no. 12, p. 2137, 2025.
[22]. K. B. Chhetri, “Applications of artificial intelligence and machine learning in food quality control and safety assessment,” Food Engineering Reviews, vol. 15, pp. 1–21, 2023.
[23]. M. Waqas, M. Naseem, A. Ali, and M. A. Khan, “Applications of machine learning and deep learning in agriculture: A comprehensive review,” Green Technologies and Sustainability, vol. 3, p. 100199, 2025.
[24]. Ahmed, S., Jhatial, M. J., Ali, I., Rasheed, A., Niaz, A., & Akbar, S. (2025). Deep Learning for Precision Agriculture: Tomato Leaf Disease Diagnosis Using Convolutional Neural Networks. International Journal of Artificial Intelligence and Mathematical Sciences, 4(1), 74.
[25]. Rojas Santelices, S. Cano, F. Moreira, and Á. Peña Fritz, “Artificial vision systems for fruit inspection and classification: Systematic literature review,” Sensors, vol. 25, no. 5, p. 1524, 2025.
Published
2026-07-20
How to Cite
Ahmed, S., Jhatial, M., Bashir, F., Usman, A., Ali, I., & Memon, S. (2026). Multi-Class Guava Classification Using Convolutional Neural Networks for Precision Agriculture. International Journal of Artificial Intelligence & Mathematical Sciences, 4(2), 40-60. https://doi.org/10.58921/ijaims.v4i2.176