Journal of Artificial Intelligence and Metaheuristics

Journal DOI

https://doi.org/10.54216/JAIM

Submit Your Paper

2833-5597ISSN (Online)

Volume 10 , Issue 1 , PP: 23-44, 2025 | Cite this article as | XML | Html | PDF | Full Length Article

Apple Quality Classification Using a Metaheuristic-Optimized Machine Learning Framework

El-Sayed M. El-Kenawy 1 *

  • 1 Department of Communications and Electronics, Delta Higher Institute of Engineering and Technology, Mansoura 35111, Egypt; Applied Science Research Center, Applied Science Private University, Amman 11931, Jordan - (skenawy@ieee.org)
  • Doi: https://doi.org/10.54216/JAIM.100102

    Received: March 27, 2025 Revised: June 14, 2025 Accepted: August 21, 2025
    Abstract

    This study presents a comprehensive evaluation of metaheuristic-optimized machine learning models for automated apple quality classification, addressing the critical need for accurate and consistent fruit grading systems in agricultural applications. The research integrates four bio-inspired optimization algorithms—Whale Optimization Algorithm (WOA), Salp Swarm Algorithm (SSA), Cuckoo Search (CS), and Bat Algorithm (BAT)—with Multi-Layer Perceptron (MLP) classifiers to enhance fruit quality assessment performance. Experimental validation was conducted using a comprehensive apple quality dataset containing seven key attributes: size, weight, sweetness, crunchiness, juiciness, ripeness, and acidity. The results demonstrate that WOA-MLPClassifier achieves superior performance with 95.37% accuracy, 95.99% sensitivity, and balanced effectiveness across all evaluation metrics including specificity, positive predictive value, negative predictive value, and F1 Score. Statistical validation through one-way ANOVA and Wilcoxon signed-rank tests confirms significant performance improvements over baseline models and alternative optimization approaches, with p-values less than 0.001. The proposed framework exhibits remarkable consistency across multiple evaluation runs, with perfect positive rank sums indicating reliable optimization behavior. These findings establish a new benchmark for automated fruit quality classification systems and provide valuable insights for deploying bio-inspired optimization techniques in agricultural machine learning applications where both accuracy and reliability are essential for commercial viability.

    Keywords :

    Metaheuristic optimization , Apple quality classification , Whale optimization Algorithm , multi-layer perceptron , Fruit grading , Bio-inspired algorithms , Agricultural machine learning , Food quality assessment

    References

    [1] M. Agarla, P. Napoletano, and R. Schettini, “Quasi real-time apple defect segmentation using deep learning.,” Sensors (Basel, Switzerland), 2023. DOI: 10.3390/s23187893.

     

    [2] W. Ji, J. Wang, B. Xu, and T. Zhang, “Apple grading based on multi-dimensional view processing and deep learning.,” Foods (Basel, Switzerland), 2023. DOI: 10.3390/foods12112117.

     

    [3] F. Yu, T. Lu, and C. Xue, “Deep learning-based intelligent apple variety classification system and model interpretability analysis.,” Foods (Basel, Switzerland), 2023. DOI: 10.3390/foods12040885.

     

    [4] J. F. I. Nturambirwe, E. A. Hussein, M. Vaccari, C. Thron, W. J. Perold, and U. L. Opara, “Feature reduction for the classification of bruise damage to apple fruit using a contactless ft-nir spectroscopy with machine learning.,” Foods (Basel, Switzerland), 2023. DOI: 10.3390/foods12010210.

     

    [5] M. Anastasiadi, F. Mohareb, S. P. Redfern, M. Berry, M. S. J. Simmonds, and L. A. Terry, “Biochemical profile of heritage and modern apple cultivars and application of machine learning methods to predict usage, age, and harvest season.,” Journal of agricultural and food chemistry, 2017. DOI: 10.1021/ acs.jafc.7b00500.

     

    [6] B. Liu, H. Fan, Y. Zhang, J. Cai, and H. Cheng, “Deep learning architectures for diagnosing the severity of apple frog-eye leaf spot disease in complex backgrounds.,” Frontiers in plant science, 2024. DOI: 10.3389/fpls.2023.1289497.

     

    [7] M. Li et al., “Label-free raman microspectroscopic imaging with chemometrics for cellular investigation of apple ring rot and nondestructive early recognition using near-infrared reflection spectroscopy with machine learning.,” Talanta, 2023. DOI: 10.1016/j.talanta.2023.125212.

     

    [8] U. E. Prechsl, A. Mejia-Aguilar, and C. B. Cullinan, “In vivo spectroscopy and machine learning for the early detection and classification of different stresses in apple trees.,” Scientific reports, 2023. DOI: 10.1038/s41598-023-42428-z.

     

    [9] Z. Zhao, J. Wang, and H. Zhao, “Research on apple recognition algorithm in complex orchard environment based on deep learning.,” Sensors (Basel, Switzerland), 2023. DOI: 10 . 3390 / s23125425.

     

    [10] O. E. Apolo-Apolo, M. Pérez-Ruiz, J. Martínez-Guanter, and J. Valente, “A cloud-based environment for generating yield estimation maps from apple orchards using uav imagery and a deep learning technique.,” Frontiers in plant science, 2020. DOI: 10.3389/fpls.2020.01086.

     

    [11] S. Jang et al., “Estimation of apple leaf nitrogen concentration using hyperspectral imaging-based wavelength selection and machine learning,” MDPI, vol. 10, no. 1, p. 35, 2023. DOI: 10 . 3390 / horticulturae10010035.

     

    [12] D. Kasperek, P. Antonowicz, M. Baranowski, M. Sokolowska, and M. Podpora, “Comparison of the usability of apple m2 and m1 processors for various machine learning tasks.,” Sensors (Basel, Switzerland), 2023. DOI: 10.3390/s23125424.

     

    [13] A. Bonkra et al., “Apple leave disease detection using collaborative ml/dl and artificial intelligence methods: Scientometric analysis.,” International journal of environmental research and public health, 2023. DOI: 10.3390/ijerph20043222.

     

    [14] D. Kasperek, M. Podpora, and A. Kawala-Sterniuk, “Comparison of the usability of apple m1 processors for various machine learning tasks.,” Sensors (Basel, Switzerland), 2022. DOI: 10.3390/ s22208005.

     

    [15] V. R. Sharabiani, S. Sabzi, R. Pourdarbani, M. Szymanek, and S. MichaƂek, “Inner properties estimation of gala apple using spectral data and two statistical and artificial intelligence based methods.,” Foods (Basel, Switzerland), 2021. DOI: 10.3390/foods10122967.

     

    [16] Y. Tian, E. Li, Z. Liang, M. Tan, and X. He, “Diagnosis of typical apple diseases: A deep learning method based on multi-scale dense classification network.,” Frontiers in plant science, 2021. DOI: 10. 3389/fpls.2021.698474.

     

    [17] M. Lashgari, A. Imanmehr, and H. Tavakoli, “Fusion of acoustic sensing and deep learning techniques for apple mealiness detection.,” Journal of food science and technology, 2020. DOI: 10 . 1007 / s13197-020-04259-y.

     

    [18] J. W. McGrath, J. Neville, T. Stewart, H. Clinning, B. Thomas, and J. Cronin, “Quantifying cricket fast bowling volume, speed and perceived intensity zone using an apple watch and machine learning.,” Journal of sports sciences, 2021. DOI: 10.1080/02640414.2021.1993640.

     

    [19] O. Thamsuwan and P. W. Johnson, “Machine learning methods for electromyography error detection in field research: An application in full-shift field assessment of shoulder muscle activity in apple harvesting workers.,” Applied ergonomics, 2021. DOI: 10.1016/j.apergo.2021.103607.

     

    [20] S. Samiei, P. Rasti, P. Richard, G. Galopin, and D. Rousseau, “Toward joint acquisition-annotation of images with egocentric devices for a lower-cost machine learning application to apple detection.,” Sensors (Basel, Switzerland), 2020. DOI: 10.3390/s20154173.

     

    [21] Q. Zhang and W.-H. Su, “Real-time recognition and localization of apples for robotic picking based on structural light and deep learning,” MDPI, vol. 6, no. 6, pp. 3393–3410, 2023. DOI: 10.3390/ smartcities6060150.

     

    [22] Y. Jiao et al., “Lcamnet: A lightweight model for apple leaf disease classification in natural environments.,” Frontiers in plant science, 2025. DOI: 10.3389/fpls.2025.1626569.

     

    [23] S. M. Hassan, K. S. Roy, R. A. Hazarika, M. Alam, and M. Mukherjee, “Multi-kernel inception-enhanced vision transformer for plant leaf disease recognition.,” Scientific reports, 2025. DOI: 10.1038/s41598-025-16142-x.

     

    [24] Z. Bi et al., “Apple leaf disease severity grading based on deep learning and the drl-watershed algorithm.,” Scientific reports, 2025. DOI: 10.1038/s41598-025-15246-8.

     

    [25] H. Ali, N. Shifa, R. Benlamri, A. A. Farooque, and R. Yaqub, “A fine tuned efficientnet-b0 convolutional neural network for accurate and efficient classification of apple leaf diseases.,” Scientific reports, 2025. DOI: 10.1038/s41598-025-04479-2.

     

    [26] H. Zhu, S. Qin, S. Liang, M. Su, P. Wang, and Y. He, “Hyperspectral imaging and machine learning for quality assessment of apples with different bagging types.,” Spectrochimica acta. Part A, Molecular and biomolecular spectroscopy, 2025. DOI: 10.1016/j.saa.2025.126443.

     

    [27] L. Gao, H. Wu, Y. Sheng, K. Liu, H. Wu, and X. Zhang, “Enhancing the dataset of cyclegan-m and yolov8s-kef for identifying apple leaf diseases.,” PloS one, 2025. DOI: 10.1371/journal.pone. 0321770.

     

    [28] G. Wang, W. Sang, F. Xu, Y. Gao, Y. Han, and Q. Liu, “An enhanced lightweight model for apple leaf disease detection in complex orchard environments.,” Frontiers in plant science, 2025. DOI: 10.3389/ fpls.2025.1545875.

     

    [29] A. S. Doutoum and B. Tugrul, “A systematic review of deep learning techniques for apple leaf diseases classification and detection.,” PeerJ. Computer science, 2025. DOI: 10.7717/peerj-cs.2655.

     

    [30] H. Zou, P. Lv, and M. Zhao, “Detection of apple leaf diseases based on lightyolo-appleleafdx.,” Plants (Basel, Switzerland), 2025. DOI: 10.3390/plants14040599.

     

    [31] E. Ropelewska and M. Lewandowski, “The changes in color and image parameters and sensory attributes of freeze-dried clones and a cultivar of red-fleshed apples.,” Foods (Basel, Switzerland), 2024. DOI: 10.3390/foods13233784.

     

    [32] M. U. Ali, M. Khalid, M. Farrash, H. F. M. Lahza, A. Zafar, and S.-H. Kim, “Appleleafnet: A lightweight and efficient deep learning framework for diagnosing apple leaf diseases.,” Frontiers in plant science, 2024. DOI: 10.3389/fpls.2024.1502314.

     

    [33] C. Zhan et al., “Detection of apple sucrose concentration based on fluorescence hyperspectral image system and machine learning.,” Foods (Basel, Switzerland), 2024. DOI: 10.3390/foods13223547.

     

    [34] J. Wang, C. Qin, B. Hou, Y. Yuan, Y. Zhang, and W. Feng, “Lcgsc-yolo: A lightweight apple leaf diseases detection method based on lcnet and gsconv module under yolo framework.,” Frontiers in plant science, 2024. DOI: 10.3389/fpls.2024.1398277.

     

    [35] Z. Guo et al., “Dynamic nondestructive detection models of apple quality in critical harvest period based on near-infrared spectroscopy and intelligent algorithms.,” Foods (Basel, Switzerland), 2024. DOI: 10.3390/foods13111698.

     

    [36] J. Wang, J. Jia, Y. Zhang, H. Wang, and S. Zhu, “Raawc-unet: An apple leaf and disease segmentation method based on residual attention and atrous spatial pyramid pooling improved unet with weight compression loss.,” Frontiers in plant science, 2024. DOI: 10.3389/fpls.2024.1305358. [37] A. A. Yatoo and A. Sharma, “An indigenous dataset for the detection and classification of apple leaf diseases.,” Data in brief, 2024. DOI: 10.1016/j.dib.2024.110165.

     

    [38] M. Lv and W.-H. Su, “Yolov5-cbam-c3tr: An optimized model based on transformer module and attention mechanism for apple leaf disease detection.,” Frontiers in plant science, 2024. DOI: 10 . 3389/fpls.2023.1323301.

    Cite This Article As :
    M., El-Sayed. Apple Quality Classification Using a Metaheuristic-Optimized Machine Learning Framework. Journal of Artificial Intelligence and Metaheuristics, vol. , no. , 2025, pp. 23-44. DOI: https://doi.org/10.54216/JAIM.100102
    M., E. (2025). Apple Quality Classification Using a Metaheuristic-Optimized Machine Learning Framework. Journal of Artificial Intelligence and Metaheuristics, (), 23-44. DOI: https://doi.org/10.54216/JAIM.100102
    M., El-Sayed. Apple Quality Classification Using a Metaheuristic-Optimized Machine Learning Framework. Journal of Artificial Intelligence and Metaheuristics , no. (2025): 23-44. DOI: https://doi.org/10.54216/JAIM.100102
    M., E. (2025) . Apple Quality Classification Using a Metaheuristic-Optimized Machine Learning Framework. Journal of Artificial Intelligence and Metaheuristics , () , 23-44 . DOI: https://doi.org/10.54216/JAIM.100102
    M. E. [2025]. Apple Quality Classification Using a Metaheuristic-Optimized Machine Learning Framework. Journal of Artificial Intelligence and Metaheuristics. (): 23-44. DOI: https://doi.org/10.54216/JAIM.100102
    M., E. "Apple Quality Classification Using a Metaheuristic-Optimized Machine Learning Framework," Journal of Artificial Intelligence and Metaheuristics, vol. , no. , pp. 23-44, 2025. DOI: https://doi.org/10.54216/JAIM.100102