Comparison of ResNet CNN and Optimized Vision Transformer Model for Classification of Dried Moringa Leaf Quality
Abstract views: 8 , PDF downloads: 5Abstract
The quality classification of dried Moringa leaves is an essential task in the agricultural and food processing industries due to its direct impact on product value and consumer acceptance. This study aims to compare the performance of a Convolutional Neural Network (CNN) based on ResNet architecture with an optimized Vision Transformer (ViT) model for automated classification of dried Moringa leaf quality. The methodology involved preprocessing and normalization of image data, followed by training and evaluation of both models under identical experimental settings. The ResNet CNN achieved an overall accuracy of 68%, showing strong performance in certain classes such as “A” (precision 0.78, recall 0.90) and “F” (precision 0.80, recall 1.00), but poor recognition of class “D.” Conversely, the optimized Vision Transformer model attained an accuracy of 60%, demonstrating robust classification for classes “C” (f1-score 0.77) and “D” (f1-score 0.79), though it struggled with class “E.” The findings indicate that while ResNet CNN yields higher overall accuracy, the Vision Transformer shows potential in handling complex visual variations with optimization. This study contributes to the development of AI-based agricultural quality assessment systems by providing comparative insights into deep learning architectures for image-based classification.
Downloads

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
References
[2] S. A. Prayitno et al., “Fortification of Moringa Oleifera Flour on Quality of Wet Noodle,” Food Sci. Technol. J., pp. 63–70, 2022, doi: 10.25139/fst.v5i1.4236.
[3] N. Soni and S. Kumar, “Effect of Fortification of Pasta With Natural Immune Booster Moringa Oleifera Leaves Powder (MLP) on Cooking Quality and Sensory Analysis,” Sustain. Agri Food Environ. Res., 2021, doi: 10.7770/safer-v0n0-art2303.
[4] L. P. Wulandari and A. Hapsari, “The EFFECT OF Moringa Oleifera LEAF EXTRACT ON THECA CELL IN POLYCYSTIC OVARY SYNDROME MODEL WITH INSULIN RESISTANCE,” J. Kedokt. Hewan - Indones. J. Vet. Sci., vol. 14, no. 3, 2020, doi: 10.21157/j.ked.hewan.v14i3.16919.
[5] B. D. Tambe and P. D. Gadhave, “Phytochemical Screening and in Vitro Antibacterial Activity of Moringa Oleifera (Lam.) Leaf Extract,” Int. J. Sci. Res. Arch., vol. 12, no. 1, pp. 125–130, 2024, doi: 10.30574/ijsra.2024.12.1.0759.
[6] T. O. Olabanji, O. M. Ojo, C. G. Williams, and A. S. Adewuyi, “Assessment of Moringa Oleifera Seeds as a Natural Coagulant in Treating Low Turbid Water,” Fuoye J. Eng. Technol., vol. 6, no. 4, 2021, doi: 10.46792/fuoyejet.v6i4.702.
[7] A. C. P. Ferraz, I. F. S. dos Santos, A. M. ́és L. Silva, R. M. Barros, M. V. L. Martins, and A. L. Junho, “Wastewater Treatment From Potato Processing Industry Using Moringa Oleifera-Based Coagulant,” Rev. Ibero-Americana Ciências Ambient., vol. 12, no. 7, pp. 211–224, 2021, doi: 10.6008/cbpc2179-6858.2021.007.0020.
[8] A. Kumar, A. Kumar, R. K. Rout, and P. S. Rao, “Drying Kinetics and Quality Attributes Analysis of Moringa (Moringa Oleifera) Leaves Under Distinct Drying Methods,” J. Food Process Eng., vol. 47, no. 1, 2024, doi: 10.1111/jfpe.14530.
[9] D. S. R. Ariendha, S. Handayani, and Y. S. Pratiwi, “The Effect of Moringa Leaf ≪i>Cilok</I> Supply on Hemoglobin Levels of Female Adolescents With Anemia,” Glob. Med. Heal. Commun., vol. 10, no. 1, 2022, doi: 10.29313/gmhc.v10i1.8951.
[10] R. Peñalver, L. Martínez‐Zamora, J. M. Lorenzo, G. Ros, and G. Nieto, “Nutritional and Antioxidant Properties of Moringa Oleifera Leaves in Functional Foods,” Foods, vol. 11, no. 8, p. 1107, 2022, doi: 10.3390/foods11081107.
[11] S. Sabba, M. Smara, M. Benhacine, L. Terra, and Z. E. Terra, “Residual Neural Network in Genomics,” Comput. Sci. J. Mold., vol. 30, no. 3(90), pp. 308–334, 2022, doi: 10.56415/csjm.v30.17.
[12] E. Suherman, B. Rahman, D. Hindarto, and H. Santoso, “Implementation of ResNet-50 on End-to-End Object Detection (DETR) on Objects,” Sinkron, vol. 8, no. 2, pp. 1085–1096, 2023, doi: 10.33395/sinkron.v8i2.12378.
[13] A. Abdullah, A. Siddique, K. Shaukat, and T. Jan, “An Intelligent Mechanism to Detect Multi-Factor Skin Cancer,” Diagnostics, vol. 14, no. 13, p. 1359, 2024, doi: 10.3390/diagnostics14131359.
[14] M. Muslih and A. D. Krismawan, “Tomato Leaf Diseases Classification Using Convolutional Neural Networks With Transfer Learning Resnet-50,” Kinet. Game Technol. Inf. Syst. Comput. Netw. Comput. Electron. Control, pp. 149–158, 2024, doi: 10.22219/kinetik.v9i2.1939.
[15] D. Zhang, “Fruit 360 Classification Based on the Convolutional Neural Network,” Appl. Comput. Eng., vol. 15, no. 1, pp. 219–222, 2023, doi: 10.54254/2755-2721/15/20230837.
[16] M. Usman, T. Zia, and S. A. Tariq, “Analyzing Transfer Learning of Vision Transformers for Interpreting Chest Radiography,” J. Digit. Imaging, vol. 35, no. 6, pp. 1445–1462, 2022, doi: 10.1007/s10278-022-00666-z.
[17] Y. Li, M. R. Joaquim, S. Pickup, H. K. Song, R. Zhou, and Y. Fan, “Learning ADC Maps From Accelerated Radial
[18] H. S. Malekroodi, N. Madusanka, B.-I. Lee, and M. Yi, “Leveraging Deep Learning for Fine-Grained Categorization of Parkinson’s Disease Progression Levels Through Analysis of Vocal Acoustic Patterns,” Bioengineering, vol. 11, no. 3, p. 295, 2024, doi: 10.3390/bioengineering11030295.
[19] T. A. Çengel, B. Gencturk, E. T. Yasin, M. B. Yıldız, İ. Çınar, and M. Köklü, “Automating Egg Damage Detection for Improved Quality Control in the Food Industry Using Deep Learning,” J. Food Sci., vol. 90, no. 1, 2025, doi: 10.1111/1750-3841.17553.
[20] S. Prathima, N. G. Praveena, S. Kasiviswanathan, S. S. Nath, and B. Sarala, “Generic Paddy Plant Disease Detector (GP2D2),” Int. J. Electr. Comput. Eng. Syst., vol. 14, no. 6, pp. 647–656, 2023, doi: 10.32985/ijeces.14.6.4.
[21] Z.-Z. Su et al., “Application of Hyperspectral Imaging for Maturity and Soluble Solids Content Determination of Strawberry With Deep Learning Approaches,” Front. Plant Sci., vol. 12, 2021, doi: 10.3389/fpls.2021.736334.
[22] E. S. Dreier, K. M. Sørensen, T. Lund-Hansen, B. M. Jespersen, and K. S. Pedersen, “Hyperspectral Imaging for Classification of Bulk Grain Samples With Deep Convolutional Neural Networks,” J. Near Infrared Spectrosc., vol. 30, no. 3, pp. 107–121, 2022, doi: 10.1177/09670335221078356.
[23] Y. Wu, Q. Weng, J. Lin, and C. Jian, “RA-ViT:Patch-wise Radially-Accumulate Module for ViT in Hyperspectral Image Classification,” J. Phys. Conf. Ser., vol. 2278, no. 1, p. 12009, 2022, doi: 10.1088/1742-6596/2278/1/012009.
[24] Y. Dai, Y. Gao, and F. Liu, “TransMed: Transformers Advance Multi-Modal Medical Image Classification,” Diagnostics, vol. 11, no. 8, p. 1384, 2021, doi: 10.3390/diagnostics11081384.
[25] B. Song, D. R. KC, R. Y. Yang, S. Li, C. Zhang, and R. Liang, “Classification of Mobile-Based Oral Cancer Images Using the Vision Transformer and the Swin Transformer,” Cancers (Basel)., vol. 16, no. 5, p. 987, 2024, doi: 10.3390/cancers16050987.
[26] G. M. S. Himel, M. M. Islam, K. A. Al-Aff, S. I. Karim, and M. K. U. Sikder, “Skin
Cancer Segmentation and Classification Using Vision Transformer for Automatic Analysis in Dermatoscopy-Based Noninvasive Digital System,” Int. J. Biomed. Imaging, vol. 2024, pp. 1–18, 2024, doi: 10.1155/2024/3022192.
[27] J. Maurício, I. Domingues, and J. Bernardino, “Comparing Vision Transformers and Convolutional Neural Networks for Image Classification: A Literature Review,” Appl. Sci., vol. 13, no. 9, p. 5521, 2023, doi: 10.3390/app13095521.
[28] J. Selvaraj, F. Almutairi, S. M. Aslam, and U. Snekhalatha, “Binary and Multi-Class Classification of Colorectal Polyps Using CRP-ViT: A Comparative Study Between CNNs and QNNs,” Life, vol. 15, no. 7, p. 1124, 2025, doi: 10.3390/life15071124.
[29] M. A. Hasan et al., “Mulberry Leaf Disease Detection by CNN-ViT With XAI Integration,” PLoS One, vol. 20, no. 6, p. e0325188, 2025, doi: 10.1371/journal.pone.0325188.
[30] H. Alshammari, K. Gasmi, I. B. Ltaifa, M. Krichen, L. B. Ammar, and M. A. Mahmood, “Olive Disease Classification Based on Vision Transformer and CNN Models,” Comput. Intell. Neurosci., vol. 2022, pp. 1–10, 2022, doi: 10.1155/2022/3998193.
[31] A. Gümüş, “Classification of Microscopic Fungi Images Using Vision Transformers for Enhanced Detection of Fungal Infections,” Türk Doğa Ve Fen Derg., vol. 13, no. 1, pp. 152–160, 2024, doi: 10.46810/tdfd.1442556.
[32] S. Zafar, A. Muhammad, and D. Han, “Plant Disease Classification in the Wild Using Vision Transformers and Mixture of Experts,” Front. Plant Sci., vol. 16, 2025, doi: 10.3389/fpls.2025.1522985.







