Training and validation performance
The training of the DenseNet169 model was conducted for a maximum of 50 epochs with early stopping based on validation accuracy. Initially, during the first epoch, the training accuracy was low, around 32.48% and the validation accuracy reached 54.43%, indicating that the model had begun learning some useful features. The training loss was 1.4304 and the validation loss was 1.1117, showing the model’s initial difficulty in class separation.
As the training progressed, the model improved steadily. By epoch 25, the training accuracy had reached 95.05% with a reduced training loss of 0.2013, while the validation accuracy increased to 95.14%. However, no significant improvement in validation accuracy was observed after that point, suggesting that the model had begun to plateau. The best model checkpoint was obtained at epoch 39, where the validation accuracy reached 96.45%. At this stage, the training accuracy was 95.85%, with a training loss of 0.1504, while the validation loss decreased to 0.1175. The small difference between training and validation performance indicates stable convergence without noticeable overfitting. As no further improvement was observed, early stopping was triggered to preserve the best-performing model. Table 1 presents the training log of the DenseNet169 model near the convergence stage.
Test performance evaluation
The final evaluation was conducted on the unseen test set, where the model achieved an overall accuracy of 95.45% and a test loss of 0.2054. This high accuracy indicates that the model generalized well and performed reliably across all four classes. As shown in Fig 3, training and validation accuracy increased steadily and both losses decreased consistently, with minor fluctuations near convergence. The gap between the training and validation curves was minimal, suggesting that the model did not overfit.
Class-wise confusion matrix analysis
The confusion matrix results of the DenseNet169 model are presented in Fig 4a, while the normalized confusion matrix is shown in Fig 4b. These figures provide detailed insights into the class-wise classification performance of the model on the test dataset. As illustrated in Fig 4a, the Chocolate spot class achieved 354 correct predictions out of 401 samples, while 22 samples were misclassified as Gall, 3 as Healthy and 22 as Rust. For the Gall class, 384 out of 400 samples were correctly classified, with 11 samples misclassified as Chocolate spot, 3 as Healthy and 2 as Rust. The Healthy class showed the highest classification performance, with 400 correctly predicted samples out of 404, while 1 sample was misclassified as Chocolate spot, 2 as Gall and 1 as Rust. Similarly, the Rust class achieved 394 correct predictions out of 400 samples, with 4 samples misclassified as Chocolate spot and 2 as Gall. To provide a clearer interpretation of the class-wise performance, a normalized confusion matrix was generated as shown in Fig 4b, where the classification results are represented as percentages. The normalized matrix indicates that the Healthy class achieved the highest recall (99.01%), followed by Rust (98.50%), Gall (96.00%) and Chocolate spot (88.28%). Overall, the strong concentration of values along the diagonal elements in both matrices indicates that the DenseNet169 model achieved high classification accuracy across all disease categories.
Classification report and metrics
The detailed classification report is presented in Table 2. The Chocolate spot class achieved a precision of 95.68%. The recall was 88.28%, indicating that some images were not identified correctly.
This resulted in an F1-score of 91.83%. The Gall class showed consistent performance with 93.66% precision and 96.00% recall. The F1-score of 94.81% suggests strong balance between sensitivity and specificity. For the Healthy class, the model performed almost perfectly. It achieved 98.52% precision, 99.01% recall and an F1-score of 98.77%. These metrics reflect the model’s ability to identify healthy leaves correctly. The Rust class also had strong results, with 94.03% precision and 98.50% recall, producing an F1-score of 96.21%. The overall accuracy of the model was 95.45% on the test dataset. The macro and weighted averages for precision, recall and F1-score were all around 95.4-95.5%, indicating consistent performance across all classes. The Matthews Correlation Coefficient (MCC) was calculated as 0.9397, showing a high level of balanced classification.
ROC curve analysis
The ROC curves for each class are displayed in Fig 5. The Chocolate spot class achieved an AUC of 0.994, indicating very high separability from other classes. The Gall class recorded an AUC of 0.997, also showing excellent performance. The healthy class reached the highest possible AUC of 1.000, confirming perfect class distinction. The Rust class followed closely with an AUC of 0.998. These results support the robustness of the model in distinguishing between all four categories.
Confident prediction visualization
The most confident predictions made by the model are presented in Fig 6. These samples represent the top three predictions for each class based on the highest confidence scores. The Chocolate spot images were predicted with confidence values of 0.9996–0.9998, showing clear dark lesions on green leaf surfaces. The Gall class images were all predicted with full confidence (1.0000), with visible swelling and distortion of leaf structures. The Healthy class predictions also showed high confidence (0.9993-0.9996) and displayed smooth, undamaged leaf texture and uniform green coloration. Finally, Rust predictions were made with high confidence (0.9999-1.0000) and showed characteristic orange to brown pustules.
These confident predictions visually confirm the model’s capability to identify key features with a high degree of certainty. The confidence scores demonstrate that the model is not only accurate but also reliable in recognizing disease symptoms.
Table 3 summarizes representative failure cases observed during model evaluation. Most misclassifications occur between visually similar diseases such as Chocolate spot, Rust and Gall. The confusion is primarily caused by overlapping lesion patterns, variations in lesion density and differences in lighting conditions in field images.
Precision-recall curve analysis
The precision-recall curves shown in Fig 7 complement the ROC analysis by highlighting how well the model performs under class imbalance. The Chocolate spot class achieved an average precision (AP) of 0.983, while the Gall class recorded 0.992. The Healthy class once again showed optimal performance with an AP of 1.000 and the Rust class followed with 0.995. The curves confirm that the model maintains a strong balance between precision and recall across all disease categories.
A comparative overview of recent CNN-based approaches for legume disease detection is presented in Table 4. These studies report varying performance levels depending on factors such as the CNN architecture, crop type, dataset size, image acquisition conditions and preprocessing strategies. Since these studies were conducted using different datasets and experimental protocols, the reported results should be interpreted with caution and do not represent a direct or strictly comparable benchmark. For instance, DenseNet121 was used by
Abed et al., (2021) for detecting diseases in bean leaves, achieving 98.31% accuracy using manually collected images. Similarly, VGG16 was applied by
Sahu et al., (2021) to a dataset of 1,296 bean leaf images, resulting in 95.31% accuracy. In another study,
Joshi et al., (2021) proposed the VirLeafNet-1 model for
Vigna mungo disease detection and reported 91.23% accuracy using manually collected data. More recent research has explored deeper architectures.
Singh et al., (2023) utilized EfficientNetB6 with a dataset of 1,295 bean leaf images, achieving 91.74% accuracy, while
Serttas and Deniz (2023) applied ResNet50 on a similar dataset size and reported 98.33% accuracy. In contrast,
Kursun et al., (2023) used DenseNet201 on a small dataset of 60 dry bean images, achieving 100% accuracy, although the limited dataset size may restrict the generalizability of the results. For faba bean disease detection,
Salau et al., (2023) proposed an end-to-end CNN model using both raw and preprocessed images and achieved 98.14% accuracy.
Jeong and Na (2024) developed a custom CNN architecture with eight convolutional layers and reported 91.00% accuracy. More recently,
Mostafa et al., (2025) trained a sequential CNN on expert-annotated and preprocessed data, achieving 98.92% accuracy.
In the present study, the DenseNet169 model was applied to a large-scale dataset of 8,021 expert-labeled faba bean leaf images collected under natural field conditions, achieving an overall classification accuracy of 95.45%. Although direct comparison with previous studies is challenging due to differences in datasets and experimental settings, the results demonstrate that the proposed approach provides reliable and robust performance for practical field-based disease detection scenarios.