ResNet-20: A Deep Learning Approach for Accurate Classification and Identification of Legume Leaf Diseases

B
Babasaheb Dnyandeo Patil1
G
Geetika Parmar2
M
Manisha Shinde-Pawar3
D
Deepali Shahane4
A
Abhijit Ashok Patil5
V
Vaibhav Dhotare6,*
1Department of Computer Applications, Bharati Vidyapeeth (Deemed to be University) Pune, Institute of Management and Rural Development Administration, Sangli-416 416, Maharashtra, India.
2Department of Computer Science and Application, Dr. Vishwanath Karad MIT World Peace University, Pune-411 045, Maharashtra, India.
3Department of Computer Applications, Kasegaon Education Society’s Rajarambapu Institute of Technology, affiliated to Shivaji University, Sakharale-415 414, Maharashtra, India.
4School of Computer Science and Applications, Dr. Vishwanath Karad MIT World Peace University, Pune-411 038, Maharashtra, India.
5Department of Computer Applications, Bharati Vidyapeeth (Deemed to be University), Pune, Yashwantrao Mohite Institute of Management, Karad-416 416, Maharashtra, India.
6Department of Computer Science and Engineering, Kasegaon Education Society’s Rajarambapu Institute of Technology, affiliated to Shivaji University, Sakharale-415 414, Maharashtra, India.

Background: The necessity for effective and precise disease detection techniques is highlighted by the rising demand for legumes. Convolutional Neural Networks (CNNs), a type of deep learning, provide a potent way to diagnose plant diseases. CNNs make it possible to accurately identify illnesses in real time by quickly evaluating enormous amounts of plant pictures. By giving farmers proactive tools for monitoring crop health, cutting losses and enhancing food quality, automated detection systems can improve agricultural practices.
Methods: To categorize bean leaves, this study suggests a deep learning-based method utilizing the ResNet-20 model. To increase model generalization and lessen overfitting, data augmentation techniques such as scaling, rotation and flipping were employed. The model was trained on a dataset of labelled images and its performance was assessed using categorization metrics, confusion matrix, ROC curve and Matthews Correlation Coefficient.
Result: The ResNet-20 model’s test accuracy was 76.15%. Additional performance indicators such as metrices demonstrated the model’s reliable classification abilities. The ROC curve further illustrated the model’s exceptional ability to differentiate between healthy and unhealthy leaves.

One of the many issues facing the world’s agriculture sector is the proliferation of plant diseases (FAO, 2024). These diseases have the potential to seriously harm crops, lowering their quality and output. Conventional plant disease diagnosis techniques need a lot of time and professional expertise (Negi and Anand, 2024). Automated disease identification using picture categorization has emerged as a possible answer to this problem using deep learning and artificial intelligence (AI). Bean crops, which are vital to the world’s food systems, are especially vulnerable to several leaf diseases, including rust and angular leaf spot. Farmers can take prompt action to minimize crop losses if these illnesses can be automatically identified and categorized (Zhang et al., 2024; Buja et al., 2021).
       
Plant disease detection uses a variety of Convolutional Neural Networks (CNNs). One of the first models is LeNet-5 (Ramesh et al., 2024). It has limitations for more complicated situations, although it performs well with small datasets. On larger datasets with more complicated clinical symptoms, AlexNet performs better and is deeper (Roshini et al., 2024). According to Dong et al., (2024), VGGNet is renowned for its proficiency and precision in identifying minute distinctions between healthy and sick plants. InceptionNet captures features at various scales by using multiple filter sizes in tandem (Khan et al., 2024). Residual connections are introduced by ResNet, including ResNet-20 (Khan et al., 2024). This design facilitates effective training of deeper networks. The strengths of each CNN version are determined by the size of the dataset and the difficulty of the task. Yao et al., (2023) examined ML methods for classifying leaf diseases. They talked about both deep learning approaches, like CNNs and conventional approaches like decision trees and Support Vector Machines (SVMs). The significance of data augmentation in enhancing model performance was also emphasized in the paper. It highlighted how these techniques can be used in smart agriculture to detect and control diseases (Kim and AlZubi, 2024; Min et al., 2024; Mostafa et al., 2025).
       
In order to identify diseases in bean leaves, Serttas and Deniz (2023) investigated deep learning methods. They used a dataset of 1295 photos and applied transfer learning. The accuracy of the ResNet50 model was 98.33%. This illustrates how deep learning is useful for smart farming and disease detection. CNNs were used by Tavakoli et al., (2021) to classify 12 common bean varieties. The method achieved a maximum mean accuracy of 95.86% for species classification and 91.37% for cultivars within the same species. This shows CNNs’ potential in improving classification tasks in agriculture. Kalaivani et al., (2024) investigated ML and DL algorithms for identifying leaf diseases in tomato and potato plants. The study highlighted the need for data augmentation and preparation. ResNet outperformed the  (SVM), achieving 94% accuracy compared to SVM’s 88%. ResNet was selected for real-time disease detection and to guide fertilizer application in agriculture. Kumar et al., (2020) employed ResNet34 for plant leaf disease detection. Their aim was to improve precision agriculture by automating disease diagnosis. Their model produced an amazing 99.40% accuracy on the test set using a dataset of 15,200 photos of crop leaves. This demonstrates how deep learning can improve farming methods and early disease detection. In order to categorize bean leaf diseases, Singh et al., (2023) employed DL-transfer learning. Three pre-trained deep learning models MobileNetV2, EfficientNetB6 and NasNet were used. The study investigated how optimization strategies affected performance using a dataset of 1295 photos. At 91.74%, EfficientNetB6 had the best accuracy. The best model may benefit farmers in disease-prone areas, according to the data, which emphasized the significance of optimizers in enhancing CNN performance.
       
In this work, a deep convolutional neural network (CNN) model called ResNet-20 is used to categorize images of bean leaves. ResNet-20 was chosen due of its ability to learn effectively from tiny to medium-sized datasets. The approach uses residual connections to address the problem of fading gradients in deep networks. The paper covers the model architecture, methodology, data preparation, assessment measures and results. It also highlights the importance of deep learning for applications in agriculture.
Computational system requirements and dataset preparation
 
An 11th Gen Intel® CoreTM i5-11320H CPU with 16 GB RAM and Windows 11 Home was the computing setup. This supplied the processing capacity required to effectively process the image data and train the deep learning model. The most recent version of Anaconda was installed in order to manage Python packages and streamline the development process. Python 3.11 was chosen as the programming language and Jupyter Notebook was utilized for coding. For model building, training and assessment, necessary libraries such as Scikit-learn, TensorFlow and Pandas were installed.
       
Images of bean leaves classified as healthy or diseased are included in the dataset utilized in this study, which was obtained from Kaggle. There are about 1300 photos in the dataset, of which 1036 are used for training, 129 for validation and 130 for testing. Each image had a variety of perspectives, scales and orientations and were taken in a range of lighting situations. The dataset also suffers from noise, which makes it a suitable candidate for exploring data augmentation techniques. Fig 1 depicts images from the dataset with different categories.

Fig 1: Images from the dataset used for experiment.


 
Processing of  data
• In order to prepare the raw images for deep learning model training, data preprocessing is an essential step. The following are the preprocessing procedures used in this study:
Resizing: To guarantee consistency throughout the collection, every image is scaled to a standard size of 224 by 224 pixels. To guarantee high-quality inputs for model training, any corrupted or unintelligible photos were eliminated.
•  Normalization: To guarantee that the model trains on a consistent scale, the pixel values are normalized to a range of [0, 1] by dividing by 255.0.
 
Data augmentation
 
The training images are subjected to  several augmentation techniques, including random zoom, random rotations and random horizontal flipping. These additions improve the model’s capacity to generalize fresh, untested data and help to avoid overfitting. 80% of the dataset was used for training, 10% for validation and 10% for testing. This segmentation guarantees the model’s generalization to new data and helps avoid overfitting.
 
Why ResNet-20
 
The choice of ResNet-20 for classifying bean leaf diseases is based on several factors. First, its network depth is ideal for the task. It captures complex patterns in the images while avoiding the need for excessive computational resources or large datasets. This makes it suitable for tasks with limited resources. Second, residual learning enhances the network’s ability to learn intricate features in leaf images. The residual blocks allow the network to detect complex patterns, which traditional CNNs might struggle with. Lastly, computational efficiency is a key advantage of ResNet-20. With fewer layers and parameters, it requires less memory and processing power. This makes it well-suited for real-time, on-field disease detection, where quick predictions are essential. Overall, ResNet-20 offers a good balance of performance and efficiency for bean leaf disease classification.
 
ResNet-20 model architecture
 
A deep convolutional neural network (CNN) called the ResNet-20 architecture was created to manage challenging picture categorization tasks, like detecting illnesses in bean leaves. The usage of residual connections, which enable the network to get around some layers, is one of its main characteristics. This makes it possible to train deeper networks efficiently and lessens the vanishing gradient issue. ResNet-20 learns the residuals, or differences, between the input and output rather than explicitly learning a mapping from input to output. This facilitates the network’s learning of intricate visual features.
       
The architecture in this work was based on residual blocks, which was made up of two or more convolutional layers. Every block features a skip connection that enabled the output of the preceding layer to be appended to the output of the block’s final convolutional layer, avoiding the current layers. This addition enhanced gradient flow and preserves previously learned features, resulting in more effective training. There were three primary groups of residual blocks in ResNet-20, each with three blocks: 16 filters in the first group, 32 filters in the second group and 64 filters in the third group. These blocks extracted information from the input image that were e more abstract and sophisticated. Fig 2 shows the ResNet-20 architecture.

Fig 2: Architecture of ResNet20.


       
The layout was started with a 224x224x3 (RGB) input image, which was followed by an initial convolutional layer with 16 3x3 filters and the same padding. Batch normalization and a ReLU activation to add non-linearity came next. The model used global average pooling after the convolutional layers to reduce the feature maps’ spatial dimensions and converted them into a fixed-length vector. A completely linked layer with 512 units and a ReLU activation, which further integrated the learnt features, came next. To avoid overfitting, the fully linked layer was subjected to a dropout rate of 0.5. The class probabilities for the three categories- Angular Leaf Spot, Rust and Healthy-were produced by the last layer, a softmax layer with three units. Table 1 summarizes the hyperparameters used in the model’s training and testing.

Table 1: Hyperparameters for ResNet-20 architecture.


 
Evaluation metrics
 
To evaluate the performance of the model, several metrics were used.
 
Accuracy
 
The percentage of correctly classified images from the test set.
 
 
 
Confusion matrix
 
To provide a detailed view of classification performance across the three classes.
Precision agriculture could benefit greatly from the application of deep learning to the classification of bean leaf diseases. To properly maintain crop health and minimize losses, farmers must accurately diagnose plant diseases. In this study, photos of bean leaves were classified using the ResNet-20 model.
       
Accuracy and loss for training and validation datasets over 100 epochs were displayed in Fig 3. The model had a loss of 1.0934 and a training accuracy of 41.64% at Epoch 1. There was a loss of 1.0537 and a validation accuracy of 52.42%. More training was required, but the model was starting to pick up on the disease characteristics. The training accuracy rose to 95.43% by Epoch 50, with a 0.0984 loss. Additionally, the validation accuracy increased to 98.39% with a 0.0619 loss. This demonstrated how well the model was adapting to the validation data. With a loss of 0.0533, the training accuracy at Epoch 100 was 97.63%. With a loss of 0.0172, the validation accuracy was 99.19%. These findings demonstrate how well the model can categorize illnesses of bean leaves. The model appears to be doing a good job of generalizing to new data without overfitting because the validation accuracy is marginally lower than the training accuracy.

Fig 3: Training and validation results as a function of epochs.


       
The classification model’s performance in each of the three classes-Angular Leaf Spot (Class 0), Rust (Class 1) and Healthy (Class 2)- was shown in detail by the confusion matrix (Fig 4). The diagonal values indicated the number of cases that the model properly identified and represented the accurate predictions for each class. For instance, there had 43 correctly identified occurrences of Class 0 (Angular Leaf Spot), 41 correctly classified examples of Class 1 (Rust) and 39 correctly classed instances of Class 2 (Healthy). These diagonal numbers showed that the model predicted each class with a reasonable degree of accuracy.

Fig 4: Confusion matrix.


       
Misclassifications, or instances in which the model predicted a class incorrectly, were shown by the off-diagonal numbers. For example, Class 0 was formerly incorrectly classed as Class 2. Twice, Class 1 was incorrectly classed as Class 2 and once as Class 0. Class 2 (Healthy) was incorrectly categorized as Class 1 twice and as Class 0 once. These incorrect classifications showed where the model’s ability to differentiate across related classes needs to be strengthened. The model continues to perform well with high accuracy across all classes despite these misclassifications.
       
Model performance output metrics (Table 2) was with a precision of 95.56%, recall of 97.73% and F1 score of 96.64%, Class 0 (Angular Leaf Spot) has the greatest accuracy, recall and F1 scores. This suggested that the model performed very good at accurately detecting instances of this class. Precision and recall for Class 1 (Rust) were marginally worse at 93.18% and 93.18%, respectively, compared to 92.86% and 92.86% for Class 2 (Healthy). These numbers implied that although the model worked s well, it was slightly less accurate than Angular Leaf Spot at differentiating between the Rust and Healthy classes. The model’s overall balanced performance had reflected in the macro average metrics (precision, recall and F1 score), with the macro average F1 score being 94.23%. Due to the greater number of examples in Class 0 and Class 1, the weighted average metrics which accounted for the class distribution showed fairly similar results, with only minor increases. The model’s outstanding categorization abilities were further supported by its overall accuracy of 94.62%, which showed that almost 95% of all predictions were accurate.

Table 2: Classification report.


       
The ability of the model to differentiate between several classes was demonstrated by the ROC curves for each class (Fig 5). The model performed well for Angular Leaf Spot (Class 0), with an AUC of 0.93. Rust (Class 1) did well despite having a lower AUC of 0.88. The model performed best for Healthy (Class 2) with an AUC of 0.95, showing excellent classification ability. Overall, the AUC values suggest the model appeared to be highly effective, especially for identifying healthy leaves and angular leaf spot.

Fig 5: ROC(AUC) curve.


       
The performance of the ResNet-20 architecture was highly competitive when compared to more complex models (Fig 6) like ResNet-50 and DenseNet (Picon et al., 2019; Shahoveisi et al., 2023; Suma et al., 2023; Peng and Wang, 2022; Richey et al., 2020). While these models often provide higher accuracy, they also require significantly more computational resources, including greater memory usage and longer training times. The ResNet-20 architecture offers a favorable trade-off, providing 94.62% accuracy while keeping the model size smaller and computational requirements lower.

Fig 6: Comparison of different models.

In this work, ResNet-20 was used for bean leaf disease classification due to its optimal network depth, residual learning capability and computational efficiency. The model achieved an overall accuracy of 94.62%. Compared with other CNN architectures, ResNet-20 demonstrated superior performance in terms of accuracy, faster convergence and lower computational requirements. This makes it suitable for practical, on-field disease estimation. The model effectively captured complex leaf patterns and reliably distinguished between healthy and diseased plants. However, some limitations remain. The dataset was mainly collected under controlled conditions, which may limit generalization to diverse field environments and varying lighting conditions. In addition, rare and mixed disease infections were not extensively evaluated. Future work will focus on expanding the dataset with real-field images, exploring ensemble or hybrid deep learning approaches and deploying the model in real-time mobile applications for early and accurate disease detection.
Authors’ contributions
 
All authors contributed toward data analysis, drafting and revising the paper and agreed to be responsible for all the aspects of this work.
 
Funding details
 
This research received no external funding.
 
Disclaimers
 
The views and conclusions expressed in this article are solely those of the authors and do not necessarily represent the views of their affiliated institutions. The authors are responsible for the accuracy and completeness of the information provided, but do not accept any liability for any direct or indirect losses resulting from the use of this content.
 
Data availability
 
The data analysed/generated in the present study will be made available from corresponding authors upon reasonable request.
 
Use of artificial intelligence
 
Not applicable.
 
Declarations
 
Authors declare that all works are original and this manuscript has not been published in any other journal.
Authors declare that they have no conflict of interest.

  1. Buja, I., Sabella, E., Monteduro, A.G., Chiriacò, M.S., De Bellis, L., Luvisi, A. and Maruccio, G. (2021). Advances in plant disease detection and monitoring: From traditional assays to in-field diagnostics. Sensors. 21(6): 2129. https:// doi.org/10.3390/s21062129

  2. Dong, R., Shiraiwa, A., Pawasut, A., Sreechun, K. and Hayashi, T. (2024). Diagnosis of citrus greening using artificial intelligence: A faster region-based convolutional neural network approach with convolution block attention module- integrated VGGNet and ResNet models. Plants. 13(12): 1631. https://doi.org/10.3390/plants13121631.

  3. FAO. (2024). The State of Plant Health in the World: Global Challenges and Opportunities. Food and Agriculture Organization of the United Nations. https://www.fao.org/ state-of-plant-health/en/

  4. Kalaivani, S., Tharini, C., Viswa, T.M.S., Sara, K.Z.F. and Abinaya, S.T. (2024). RESNET-based classification for leaf disease detection. Journal of the Institution of Engineers (India) Series B. https://doi.org/10.1007/s40031-024-01062-7.

  5. Khan, S.D., Basalamah, S. and Naseer, A. (2024). Classification of plant diseases in images using dense-inception architecture with attention modules. Multimedia Tools and Applications. https://doi.org/10.1007/s11042-024-19860-y

  6. Kim, S.Y. and AlZubi, A.A. (2024). Blockchain and artificial intelligence for ensuring the authenticity of organic legume products in supply chains. Legume Research – An International Journal. 47(7): 1144-1150. doi: 10.18805/LRF-786.

  7. Kumar, V., Arora, H. and Sisodia, J. (2020). ResNet-based Approach for Detection and Classification of Plant Leaf Diseases. In 2020 International Conference on Electronics and Sustainable Communication Systems (ICESC). IEEE. (pp. 495-502). https://doi.org/10.1109/ICESC48915.2020.9155585.

  8. Min, P.K., Mito, K. and Kim, T.H. (2024). The evolving landscape of artificial intelligence applications in animal health. Indian Journal of Animal Research. 58(10): 1793-1798. doi: 10.18805/IJAR.BF-1742.

  9. Mostafa, A., Alnuaim, A. and AlZubi, A.A. (2025). Utilizing convolutional neural networks for accurate detection of leaf diseases in fava beans. Legume Research- An International Journal. 48(3): 494–502. doi: 10.18805/LRF-823.

  10. Negi, P. and Anand, S. (2024). Plant disease detection, diagnosis and management: Recent advances and future perspectives. In: Artificial Intelligence and Smart Agriculture. [K. Pandey, N.L. Kushwaha, C.B. Pande and K.G. Singh (Eds.)], Advances in Geographical and Environmental Sciences. Springer. (pp. 359-374). https://doi.org/10.1007/978-981-97-0341-8_20.

  11. Peng, Y. and Wang, Y. (2022). Leaf disease image retrieval with object detection and deep metric learning. Frontiers in Plant Science13: 963302. https://doi.org/10.3389/ fpls.2022.963302.

  12. Picon, A., Alvarez-Gila, A., Seitz, M., Ortiz-Barredo, A., Echazarra, J. and Johannes, A. (2019). Deep convolutional neural networks for mobile capture device-based crop disease classification in the wild. Computers and Electronics in Agriculture. 161: 280-290.

  13. Ramesh Babu, P., Srikrishna, A. and Gera, V. R. (2024). Diagnosis of tomato leaf disease using OTSU multi-threshold image segmentation-based chimp optimization algorithm and LeNet-5 classifier. Journal of Plant Diseases and Protection. https://doi.org/10.1007/s41348-024-00953-7.

  14. Richey, B., Majumder, S., Shirvaikar, M. and Kehtarnavaz, N. (2020). Real-time Detection of Maize Crop Disease via a Deep Learning-Based Smartphone App. In: Real-time Image Processing and Deep Learning. International Society for Optics and Photonics. (p. 114010A).

  15. Roshini, P., Khajavali, S., Snigdha, M.L.S., Harsha, B.D., Srilakshmi, B. and Gopi, A. (2024). CNN Design with AlexNet Algorithm for Diagnosis of Diseases in Cassava Leaves. 2024 International Conference on Expert Clouds and Applications (ICOECA), 1-8. https://doi.org/10.1109/ICOECA62351. 2024.00129.

  16. Shahoveisi, F., Gorji, H.T., Shahabi, S., Hosseinirad, S., Markell, S. and Vasefi, F. (2023). Application of image processing and transfer learning for the detection of rust disease. Scientific Reports. 13(1). https://doi.org/10.1038/s41598- 023-31942-9.

  17. Serttas, S. and Deniz, E. (2023). Disease detection in bean leaves using deep learning. Communications Faculty of Sciences University of Ankara Series A2-A3 Physical Sciences and Engineering. 65(2): 115-129. https://doi.org/10.33769/ aupse.1247233

  18. Singh, V., Chug, A. and Singh, A.P. (2023). Classification of beans leaf diseases using fine-tuned CNN model. Procedia Computer Science. 218: 348-356. https://doi.org/10.101 6/j.procs.2023.01.017.

  19. Suma, S.A., Haque, A., Vasker, N., Hasan, M., Ovi, J.A. and Islam, M. (2023). Beans Disease Detection using Convolutional Neural Network. In 2023 4th International Conference on Big Data Analytics and Practices (IBDAP), Bangkok, Thailand (pp. 1-5). https://doi.org/10.1109/IBDAP5858 1. 2023.10271983

  20. Tavakoli, H., Alirezazadeh, P., Hedayatipour, A., Nasib, A.B. and Landwehr, N. (2021). Leaf image-based classification of some common bean cultivars using discriminative convolutional neural networks. Computers and Electronics in Agriculture. 181: 105935. https://doi.org/10.1016/j.compag.2020. 105935

  21. Yao, J., Tran, S.N., Sawyer, S. and Garg, S. (2023). Machine learning for leaf disease classification: Data, techniques and applications. Artificial Intelligence Review. 56(S3): 3571- 3616. https://doi.org/10.1007/s10462-023-10610-4.

  22. Zhang, M., Ma, W., Tao, R., Fan, Q., Zhang, M., Qin, D., Cao, X., Li, J., Xiong, R. and Huang, C. (2024). Nanomaterials: Recent advances in plant disease diagnosis and treatment. Nano Today. 57: 102326. https://doi.org/10.1016/j.nantod. 2024.102326

  23. Yao, J., Tran, S.N., Sawyer, S. and Garg, S. (2023). Machine learning for leaf disease classification: Data, techniques and applications. Artificial Intelligence Review. 56(S3): 3571- 3616. https://doi.org/10.1007/s10462-023-10610-4.

ResNet-20: A Deep Learning Approach for Accurate Classification and Identification of Legume Leaf Diseases

B
Babasaheb Dnyandeo Patil1
G
Geetika Parmar2
M
Manisha Shinde-Pawar3
D
Deepali Shahane4
A
Abhijit Ashok Patil5
V
Vaibhav Dhotare6,*
1Department of Computer Applications, Bharati Vidyapeeth (Deemed to be University) Pune, Institute of Management and Rural Development Administration, Sangli-416 416, Maharashtra, India.
2Department of Computer Science and Application, Dr. Vishwanath Karad MIT World Peace University, Pune-411 045, Maharashtra, India.
3Department of Computer Applications, Kasegaon Education Society’s Rajarambapu Institute of Technology, affiliated to Shivaji University, Sakharale-415 414, Maharashtra, India.
4School of Computer Science and Applications, Dr. Vishwanath Karad MIT World Peace University, Pune-411 038, Maharashtra, India.
5Department of Computer Applications, Bharati Vidyapeeth (Deemed to be University), Pune, Yashwantrao Mohite Institute of Management, Karad-416 416, Maharashtra, India.
6Department of Computer Science and Engineering, Kasegaon Education Society’s Rajarambapu Institute of Technology, affiliated to Shivaji University, Sakharale-415 414, Maharashtra, India.

Background: The necessity for effective and precise disease detection techniques is highlighted by the rising demand for legumes. Convolutional Neural Networks (CNNs), a type of deep learning, provide a potent way to diagnose plant diseases. CNNs make it possible to accurately identify illnesses in real time by quickly evaluating enormous amounts of plant pictures. By giving farmers proactive tools for monitoring crop health, cutting losses and enhancing food quality, automated detection systems can improve agricultural practices.
Methods: To categorize bean leaves, this study suggests a deep learning-based method utilizing the ResNet-20 model. To increase model generalization and lessen overfitting, data augmentation techniques such as scaling, rotation and flipping were employed. The model was trained on a dataset of labelled images and its performance was assessed using categorization metrics, confusion matrix, ROC curve and Matthews Correlation Coefficient.
Result: The ResNet-20 model’s test accuracy was 76.15%. Additional performance indicators such as metrices demonstrated the model’s reliable classification abilities. The ROC curve further illustrated the model’s exceptional ability to differentiate between healthy and unhealthy leaves.

One of the many issues facing the world’s agriculture sector is the proliferation of plant diseases (FAO, 2024). These diseases have the potential to seriously harm crops, lowering their quality and output. Conventional plant disease diagnosis techniques need a lot of time and professional expertise (Negi and Anand, 2024). Automated disease identification using picture categorization has emerged as a possible answer to this problem using deep learning and artificial intelligence (AI). Bean crops, which are vital to the world’s food systems, are especially vulnerable to several leaf diseases, including rust and angular leaf spot. Farmers can take prompt action to minimize crop losses if these illnesses can be automatically identified and categorized (Zhang et al., 2024; Buja et al., 2021).
       
Plant disease detection uses a variety of Convolutional Neural Networks (CNNs). One of the first models is LeNet-5 (Ramesh et al., 2024). It has limitations for more complicated situations, although it performs well with small datasets. On larger datasets with more complicated clinical symptoms, AlexNet performs better and is deeper (Roshini et al., 2024). According to Dong et al., (2024), VGGNet is renowned for its proficiency and precision in identifying minute distinctions between healthy and sick plants. InceptionNet captures features at various scales by using multiple filter sizes in tandem (Khan et al., 2024). Residual connections are introduced by ResNet, including ResNet-20 (Khan et al., 2024). This design facilitates effective training of deeper networks. The strengths of each CNN version are determined by the size of the dataset and the difficulty of the task. Yao et al., (2023) examined ML methods for classifying leaf diseases. They talked about both deep learning approaches, like CNNs and conventional approaches like decision trees and Support Vector Machines (SVMs). The significance of data augmentation in enhancing model performance was also emphasized in the paper. It highlighted how these techniques can be used in smart agriculture to detect and control diseases (Kim and AlZubi, 2024; Min et al., 2024; Mostafa et al., 2025).
       
In order to identify diseases in bean leaves, Serttas and Deniz (2023) investigated deep learning methods. They used a dataset of 1295 photos and applied transfer learning. The accuracy of the ResNet50 model was 98.33%. This illustrates how deep learning is useful for smart farming and disease detection. CNNs were used by Tavakoli et al., (2021) to classify 12 common bean varieties. The method achieved a maximum mean accuracy of 95.86% for species classification and 91.37% for cultivars within the same species. This shows CNNs’ potential in improving classification tasks in agriculture. Kalaivani et al., (2024) investigated ML and DL algorithms for identifying leaf diseases in tomato and potato plants. The study highlighted the need for data augmentation and preparation. ResNet outperformed the  (SVM), achieving 94% accuracy compared to SVM’s 88%. ResNet was selected for real-time disease detection and to guide fertilizer application in agriculture. Kumar et al., (2020) employed ResNet34 for plant leaf disease detection. Their aim was to improve precision agriculture by automating disease diagnosis. Their model produced an amazing 99.40% accuracy on the test set using a dataset of 15,200 photos of crop leaves. This demonstrates how deep learning can improve farming methods and early disease detection. In order to categorize bean leaf diseases, Singh et al., (2023) employed DL-transfer learning. Three pre-trained deep learning models MobileNetV2, EfficientNetB6 and NasNet were used. The study investigated how optimization strategies affected performance using a dataset of 1295 photos. At 91.74%, EfficientNetB6 had the best accuracy. The best model may benefit farmers in disease-prone areas, according to the data, which emphasized the significance of optimizers in enhancing CNN performance.
       
In this work, a deep convolutional neural network (CNN) model called ResNet-20 is used to categorize images of bean leaves. ResNet-20 was chosen due of its ability to learn effectively from tiny to medium-sized datasets. The approach uses residual connections to address the problem of fading gradients in deep networks. The paper covers the model architecture, methodology, data preparation, assessment measures and results. It also highlights the importance of deep learning for applications in agriculture.
Computational system requirements and dataset preparation
 
An 11th Gen Intel® CoreTM i5-11320H CPU with 16 GB RAM and Windows 11 Home was the computing setup. This supplied the processing capacity required to effectively process the image data and train the deep learning model. The most recent version of Anaconda was installed in order to manage Python packages and streamline the development process. Python 3.11 was chosen as the programming language and Jupyter Notebook was utilized for coding. For model building, training and assessment, necessary libraries such as Scikit-learn, TensorFlow and Pandas were installed.
       
Images of bean leaves classified as healthy or diseased are included in the dataset utilized in this study, which was obtained from Kaggle. There are about 1300 photos in the dataset, of which 1036 are used for training, 129 for validation and 130 for testing. Each image had a variety of perspectives, scales and orientations and were taken in a range of lighting situations. The dataset also suffers from noise, which makes it a suitable candidate for exploring data augmentation techniques. Fig 1 depicts images from the dataset with different categories.

Fig 1: Images from the dataset used for experiment.


 
Processing of  data
• In order to prepare the raw images for deep learning model training, data preprocessing is an essential step. The following are the preprocessing procedures used in this study:
Resizing: To guarantee consistency throughout the collection, every image is scaled to a standard size of 224 by 224 pixels. To guarantee high-quality inputs for model training, any corrupted or unintelligible photos were eliminated.
•  Normalization: To guarantee that the model trains on a consistent scale, the pixel values are normalized to a range of [0, 1] by dividing by 255.0.
 
Data augmentation
 
The training images are subjected to  several augmentation techniques, including random zoom, random rotations and random horizontal flipping. These additions improve the model’s capacity to generalize fresh, untested data and help to avoid overfitting. 80% of the dataset was used for training, 10% for validation and 10% for testing. This segmentation guarantees the model’s generalization to new data and helps avoid overfitting.
 
Why ResNet-20
 
The choice of ResNet-20 for classifying bean leaf diseases is based on several factors. First, its network depth is ideal for the task. It captures complex patterns in the images while avoiding the need for excessive computational resources or large datasets. This makes it suitable for tasks with limited resources. Second, residual learning enhances the network’s ability to learn intricate features in leaf images. The residual blocks allow the network to detect complex patterns, which traditional CNNs might struggle with. Lastly, computational efficiency is a key advantage of ResNet-20. With fewer layers and parameters, it requires less memory and processing power. This makes it well-suited for real-time, on-field disease detection, where quick predictions are essential. Overall, ResNet-20 offers a good balance of performance and efficiency for bean leaf disease classification.
 
ResNet-20 model architecture
 
A deep convolutional neural network (CNN) called the ResNet-20 architecture was created to manage challenging picture categorization tasks, like detecting illnesses in bean leaves. The usage of residual connections, which enable the network to get around some layers, is one of its main characteristics. This makes it possible to train deeper networks efficiently and lessens the vanishing gradient issue. ResNet-20 learns the residuals, or differences, between the input and output rather than explicitly learning a mapping from input to output. This facilitates the network’s learning of intricate visual features.
       
The architecture in this work was based on residual blocks, which was made up of two or more convolutional layers. Every block features a skip connection that enabled the output of the preceding layer to be appended to the output of the block’s final convolutional layer, avoiding the current layers. This addition enhanced gradient flow and preserves previously learned features, resulting in more effective training. There were three primary groups of residual blocks in ResNet-20, each with three blocks: 16 filters in the first group, 32 filters in the second group and 64 filters in the third group. These blocks extracted information from the input image that were e more abstract and sophisticated. Fig 2 shows the ResNet-20 architecture.

Fig 2: Architecture of ResNet20.


       
The layout was started with a 224x224x3 (RGB) input image, which was followed by an initial convolutional layer with 16 3x3 filters and the same padding. Batch normalization and a ReLU activation to add non-linearity came next. The model used global average pooling after the convolutional layers to reduce the feature maps’ spatial dimensions and converted them into a fixed-length vector. A completely linked layer with 512 units and a ReLU activation, which further integrated the learnt features, came next. To avoid overfitting, the fully linked layer was subjected to a dropout rate of 0.5. The class probabilities for the three categories- Angular Leaf Spot, Rust and Healthy-were produced by the last layer, a softmax layer with three units. Table 1 summarizes the hyperparameters used in the model’s training and testing.

Table 1: Hyperparameters for ResNet-20 architecture.


 
Evaluation metrics
 
To evaluate the performance of the model, several metrics were used.
 
Accuracy
 
The percentage of correctly classified images from the test set.
 
 
 
Confusion matrix
 
To provide a detailed view of classification performance across the three classes.
Precision agriculture could benefit greatly from the application of deep learning to the classification of bean leaf diseases. To properly maintain crop health and minimize losses, farmers must accurately diagnose plant diseases. In this study, photos of bean leaves were classified using the ResNet-20 model.
       
Accuracy and loss for training and validation datasets over 100 epochs were displayed in Fig 3. The model had a loss of 1.0934 and a training accuracy of 41.64% at Epoch 1. There was a loss of 1.0537 and a validation accuracy of 52.42%. More training was required, but the model was starting to pick up on the disease characteristics. The training accuracy rose to 95.43% by Epoch 50, with a 0.0984 loss. Additionally, the validation accuracy increased to 98.39% with a 0.0619 loss. This demonstrated how well the model was adapting to the validation data. With a loss of 0.0533, the training accuracy at Epoch 100 was 97.63%. With a loss of 0.0172, the validation accuracy was 99.19%. These findings demonstrate how well the model can categorize illnesses of bean leaves. The model appears to be doing a good job of generalizing to new data without overfitting because the validation accuracy is marginally lower than the training accuracy.

Fig 3: Training and validation results as a function of epochs.


       
The classification model’s performance in each of the three classes-Angular Leaf Spot (Class 0), Rust (Class 1) and Healthy (Class 2)- was shown in detail by the confusion matrix (Fig 4). The diagonal values indicated the number of cases that the model properly identified and represented the accurate predictions for each class. For instance, there had 43 correctly identified occurrences of Class 0 (Angular Leaf Spot), 41 correctly classified examples of Class 1 (Rust) and 39 correctly classed instances of Class 2 (Healthy). These diagonal numbers showed that the model predicted each class with a reasonable degree of accuracy.

Fig 4: Confusion matrix.


       
Misclassifications, or instances in which the model predicted a class incorrectly, were shown by the off-diagonal numbers. For example, Class 0 was formerly incorrectly classed as Class 2. Twice, Class 1 was incorrectly classed as Class 2 and once as Class 0. Class 2 (Healthy) was incorrectly categorized as Class 1 twice and as Class 0 once. These incorrect classifications showed where the model’s ability to differentiate across related classes needs to be strengthened. The model continues to perform well with high accuracy across all classes despite these misclassifications.
       
Model performance output metrics (Table 2) was with a precision of 95.56%, recall of 97.73% and F1 score of 96.64%, Class 0 (Angular Leaf Spot) has the greatest accuracy, recall and F1 scores. This suggested that the model performed very good at accurately detecting instances of this class. Precision and recall for Class 1 (Rust) were marginally worse at 93.18% and 93.18%, respectively, compared to 92.86% and 92.86% for Class 2 (Healthy). These numbers implied that although the model worked s well, it was slightly less accurate than Angular Leaf Spot at differentiating between the Rust and Healthy classes. The model’s overall balanced performance had reflected in the macro average metrics (precision, recall and F1 score), with the macro average F1 score being 94.23%. Due to the greater number of examples in Class 0 and Class 1, the weighted average metrics which accounted for the class distribution showed fairly similar results, with only minor increases. The model’s outstanding categorization abilities were further supported by its overall accuracy of 94.62%, which showed that almost 95% of all predictions were accurate.

Table 2: Classification report.


       
The ability of the model to differentiate between several classes was demonstrated by the ROC curves for each class (Fig 5). The model performed well for Angular Leaf Spot (Class 0), with an AUC of 0.93. Rust (Class 1) did well despite having a lower AUC of 0.88. The model performed best for Healthy (Class 2) with an AUC of 0.95, showing excellent classification ability. Overall, the AUC values suggest the model appeared to be highly effective, especially for identifying healthy leaves and angular leaf spot.

Fig 5: ROC(AUC) curve.


       
The performance of the ResNet-20 architecture was highly competitive when compared to more complex models (Fig 6) like ResNet-50 and DenseNet (Picon et al., 2019; Shahoveisi et al., 2023; Suma et al., 2023; Peng and Wang, 2022; Richey et al., 2020). While these models often provide higher accuracy, they also require significantly more computational resources, including greater memory usage and longer training times. The ResNet-20 architecture offers a favorable trade-off, providing 94.62% accuracy while keeping the model size smaller and computational requirements lower.

Fig 6: Comparison of different models.

In this work, ResNet-20 was used for bean leaf disease classification due to its optimal network depth, residual learning capability and computational efficiency. The model achieved an overall accuracy of 94.62%. Compared with other CNN architectures, ResNet-20 demonstrated superior performance in terms of accuracy, faster convergence and lower computational requirements. This makes it suitable for practical, on-field disease estimation. The model effectively captured complex leaf patterns and reliably distinguished between healthy and diseased plants. However, some limitations remain. The dataset was mainly collected under controlled conditions, which may limit generalization to diverse field environments and varying lighting conditions. In addition, rare and mixed disease infections were not extensively evaluated. Future work will focus on expanding the dataset with real-field images, exploring ensemble or hybrid deep learning approaches and deploying the model in real-time mobile applications for early and accurate disease detection.
Authors’ contributions
 
All authors contributed toward data analysis, drafting and revising the paper and agreed to be responsible for all the aspects of this work.
 
Funding details
 
This research received no external funding.
 
Disclaimers
 
The views and conclusions expressed in this article are solely those of the authors and do not necessarily represent the views of their affiliated institutions. The authors are responsible for the accuracy and completeness of the information provided, but do not accept any liability for any direct or indirect losses resulting from the use of this content.
 
Data availability
 
The data analysed/generated in the present study will be made available from corresponding authors upon reasonable request.
 
Use of artificial intelligence
 
Not applicable.
 
Declarations
 
Authors declare that all works are original and this manuscript has not been published in any other journal.
Authors declare that they have no conflict of interest.

  1. Buja, I., Sabella, E., Monteduro, A.G., Chiriacò, M.S., De Bellis, L., Luvisi, A. and Maruccio, G. (2021). Advances in plant disease detection and monitoring: From traditional assays to in-field diagnostics. Sensors. 21(6): 2129. https:// doi.org/10.3390/s21062129

  2. Dong, R., Shiraiwa, A., Pawasut, A., Sreechun, K. and Hayashi, T. (2024). Diagnosis of citrus greening using artificial intelligence: A faster region-based convolutional neural network approach with convolution block attention module- integrated VGGNet and ResNet models. Plants. 13(12): 1631. https://doi.org/10.3390/plants13121631.

  3. FAO. (2024). The State of Plant Health in the World: Global Challenges and Opportunities. Food and Agriculture Organization of the United Nations. https://www.fao.org/ state-of-plant-health/en/

  4. Kalaivani, S., Tharini, C., Viswa, T.M.S., Sara, K.Z.F. and Abinaya, S.T. (2024). RESNET-based classification for leaf disease detection. Journal of the Institution of Engineers (India) Series B. https://doi.org/10.1007/s40031-024-01062-7.

  5. Khan, S.D., Basalamah, S. and Naseer, A. (2024). Classification of plant diseases in images using dense-inception architecture with attention modules. Multimedia Tools and Applications. https://doi.org/10.1007/s11042-024-19860-y

  6. Kim, S.Y. and AlZubi, A.A. (2024). Blockchain and artificial intelligence for ensuring the authenticity of organic legume products in supply chains. Legume Research – An International Journal. 47(7): 1144-1150. doi: 10.18805/LRF-786.

  7. Kumar, V., Arora, H. and Sisodia, J. (2020). ResNet-based Approach for Detection and Classification of Plant Leaf Diseases. In 2020 International Conference on Electronics and Sustainable Communication Systems (ICESC). IEEE. (pp. 495-502). https://doi.org/10.1109/ICESC48915.2020.9155585.

  8. Min, P.K., Mito, K. and Kim, T.H. (2024). The evolving landscape of artificial intelligence applications in animal health. Indian Journal of Animal Research. 58(10): 1793-1798. doi: 10.18805/IJAR.BF-1742.

  9. Mostafa, A., Alnuaim, A. and AlZubi, A.A. (2025). Utilizing convolutional neural networks for accurate detection of leaf diseases in fava beans. Legume Research- An International Journal. 48(3): 494–502. doi: 10.18805/LRF-823.

  10. Negi, P. and Anand, S. (2024). Plant disease detection, diagnosis and management: Recent advances and future perspectives. In: Artificial Intelligence and Smart Agriculture. [K. Pandey, N.L. Kushwaha, C.B. Pande and K.G. Singh (Eds.)], Advances in Geographical and Environmental Sciences. Springer. (pp. 359-374). https://doi.org/10.1007/978-981-97-0341-8_20.

  11. Peng, Y. and Wang, Y. (2022). Leaf disease image retrieval with object detection and deep metric learning. Frontiers in Plant Science13: 963302. https://doi.org/10.3389/ fpls.2022.963302.

  12. Picon, A., Alvarez-Gila, A., Seitz, M., Ortiz-Barredo, A., Echazarra, J. and Johannes, A. (2019). Deep convolutional neural networks for mobile capture device-based crop disease classification in the wild. Computers and Electronics in Agriculture. 161: 280-290.

  13. Ramesh Babu, P., Srikrishna, A. and Gera, V. R. (2024). Diagnosis of tomato leaf disease using OTSU multi-threshold image segmentation-based chimp optimization algorithm and LeNet-5 classifier. Journal of Plant Diseases and Protection. https://doi.org/10.1007/s41348-024-00953-7.

  14. Richey, B., Majumder, S., Shirvaikar, M. and Kehtarnavaz, N. (2020). Real-time Detection of Maize Crop Disease via a Deep Learning-Based Smartphone App. In: Real-time Image Processing and Deep Learning. International Society for Optics and Photonics. (p. 114010A).

  15. Roshini, P., Khajavali, S., Snigdha, M.L.S., Harsha, B.D., Srilakshmi, B. and Gopi, A. (2024). CNN Design with AlexNet Algorithm for Diagnosis of Diseases in Cassava Leaves. 2024 International Conference on Expert Clouds and Applications (ICOECA), 1-8. https://doi.org/10.1109/ICOECA62351. 2024.00129.

  16. Shahoveisi, F., Gorji, H.T., Shahabi, S., Hosseinirad, S., Markell, S. and Vasefi, F. (2023). Application of image processing and transfer learning for the detection of rust disease. Scientific Reports. 13(1). https://doi.org/10.1038/s41598- 023-31942-9.

  17. Serttas, S. and Deniz, E. (2023). Disease detection in bean leaves using deep learning. Communications Faculty of Sciences University of Ankara Series A2-A3 Physical Sciences and Engineering. 65(2): 115-129. https://doi.org/10.33769/ aupse.1247233

  18. Singh, V., Chug, A. and Singh, A.P. (2023). Classification of beans leaf diseases using fine-tuned CNN model. Procedia Computer Science. 218: 348-356. https://doi.org/10.101 6/j.procs.2023.01.017.

  19. Suma, S.A., Haque, A., Vasker, N., Hasan, M., Ovi, J.A. and Islam, M. (2023). Beans Disease Detection using Convolutional Neural Network. In 2023 4th International Conference on Big Data Analytics and Practices (IBDAP), Bangkok, Thailand (pp. 1-5). https://doi.org/10.1109/IBDAP5858 1. 2023.10271983

  20. Tavakoli, H., Alirezazadeh, P., Hedayatipour, A., Nasib, A.B. and Landwehr, N. (2021). Leaf image-based classification of some common bean cultivars using discriminative convolutional neural networks. Computers and Electronics in Agriculture. 181: 105935. https://doi.org/10.1016/j.compag.2020. 105935

  21. Yao, J., Tran, S.N., Sawyer, S. and Garg, S. (2023). Machine learning for leaf disease classification: Data, techniques and applications. Artificial Intelligence Review. 56(S3): 3571- 3616. https://doi.org/10.1007/s10462-023-10610-4.

  22. Zhang, M., Ma, W., Tao, R., Fan, Q., Zhang, M., Qin, D., Cao, X., Li, J., Xiong, R. and Huang, C. (2024). Nanomaterials: Recent advances in plant disease diagnosis and treatment. Nano Today. 57: 102326. https://doi.org/10.1016/j.nantod. 2024.102326

  23. Yao, J., Tran, S.N., Sawyer, S. and Garg, S. (2023). Machine learning for leaf disease classification: Data, techniques and applications. Artificial Intelligence Review. 56(S3): 3571- 3616. https://doi.org/10.1007/s10462-023-10610-4.
In this Article
Published In
Indian Journal of Agricultural Research

Editorial Board

View all (0)