November 17, 2026
Detection and Diagnosis of Diseases in Corn and Rice in Mozambique with Deep Learning
Tomane Mateus Tomane; Ricardo Janes
DOI: 10.22167/2675-6528-202603948
Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
Mozambican agriculture depends on corn and rice, fundamental crops for food security, but their productivity is strongly affected by phytosanitary diseases, whose early and accurate identification remains a challenge in resource-limited contexts. The study aimed to develop and compare Deep Learning-based models for the automatic detection and diagnosis of diseases in corn and rice leaves in Mozambique. Three approaches were used: a classic Convolutional Neural Network (CNN) developed from scratch, and two transfer learning models, ResNet50 and MobileNetV2. The dataset consisted of images from public databases and collected in the field, which underwent cleaning, balancing, and artificial augmentation steps. The models were trained and evaluated with standard performance metrics, including accuracy, precision, recall, F1-score, Log Loss, and Cohen’s Kappa. The classic CNN presented the best overall performance, with 94% precision, recall, and F1-score, and 93% accuracy and Cohen’s Kappa. MobileNetV2 achieved 91% F1-score and 90% accuracy, standing out for its lower Log Loss (0.30) and training time (6h32min59s). ResNet50 reached 80% F1-score and 79% accuracy. It was concluded that Deep Learning techniques have high potential to support phytopathological diagnosis in real agricultural contexts, contributing to faster and more accurate decisions in the management of corn and rice diseases.
Keywords: Deep learning; Rice; Plant diseases; Corn; Computer vision.
1. Introduction
Agriculture constitutes one of the main pillars of the Mozambican economy, being the primary source of livelihood for 70% of the rural population (Abbas, 2024; Inclusive Growth in Mozambique, 2020). In this context, crops such as corn and rice are essential for the country’s food security and economic stability (Nova & Teixeira, 2025). The economic development of a nation is intrinsically linked to agricultural performance, which provides food, raw materials, and livelihoods for millions of families globally (Gollin, 2010).
However, the productivity of these crops is strongly affected by phytosanitary diseases. Early and accurate identification of these diseases remains a significant challenge, especially in resource-limited contexts. It is estimated that productivity losses caused by diseases can exceed 40% in developing regions, such as Mozambique, where control options are limited (Ristaino et al., 2021; Savary et al., 2019). Traditional identification, carried out by specialized technicians, can be subjective, time-consuming, and result in inaccurate diagnoses, delaying adequate interventions and increasing the incorrect use of pesticides, with negative environmental and economic impacts (Bartoli & Roux, 2017; Sankaran et al., 2010; Santos & Santos, 2023; Silva & Kramer, 2023).
With the advancement of digital technologies in recent decades, new possibilities emerge to face these challenges. Artificial intelligence (AI), and in particular Deep Learning techniques, have stood out as promising tools in the automatic recognition of complex visual patterns. Convolutional Neural Networks (CNNs), one of the most used models, have already demonstrated high accuracy in classifying images of diseased leaves in databases (Ferentinos, 2018; Sugriv Waghmare et al., 2025). Deep Learning, a branch of Machine Learning, is based on artificial neural networks capable of learning complex data patterns through multiple hidden layers, directly impacting areas such as image processing (Ganaie et al., 2022; Colombo & Ritchie, 2024).
From classic CNNs, deeper and specialized architectures have been developed to improve performance and computational efficiency. Among them, ResNet50 stands out, a deep residual network with 50 layers, which uses skip connections to facilitate the training of very deep networks and increase accuracy in image classification. This architecture has been widely applied in the detection and classification of plant diseases, presenting robust results (He et al., 2015; Islam et al., 2023; Nwaneto et al., 2024). Another relevant architecture is MobileNetV2, designed with a focus on computational efficiency and low resource consumption. MobileNetV2 is based on depthwise separable convolutions and inverted residual blocks, allowing good performance even on devices with limited capacity and automatically extracting useful features from large volumes of data (Sandler et al., 2019; Yu & Wang, 2024).
Despite the promising results, Deep Learning still faces several challenges in identifying diseases in plant leaves (Zhan et al., 2025). One of the main problems is how to improve the model’s generalization ability to different contexts and types of diseases, effectively adapting it to real application conditions. In the detection of diseases in leaves, Deep Learning models often suffer from imbalanced data and incorrect labeling, which compromises the reliability and stability of the system. Furthermore, it is necessary to develop models that balance accuracy and computational resource consumption, enabling disease identification to be carried out efficiently on devices with limited capacity, ensuring accessibility for farmers in the field.
Given the importance of agriculture in Mozambique, the challenges in detecting phytosanitary diseases, and the potential of Deep Learning techniques to offer faster and more accurate solutions in managing diseases in corn and rice, this study is justified by the need to develop and compare models adapted to the local context. In this context, the present work aimed to compare three techniques based on different Deep Learning architectures (Artificial Neural Networks, ResNet50, and MobileNetV2) for the intelligent detection and diagnosis of diseases in corn and rice crops, considering the sociocultural and agroeconomic context of Mozambique.
2. Material and Methods
The study was characterized as an applied research, with a quantitative approach, aiming to develop and compare Deep Learning models for the automatic detection and diagnosis of diseases in corn and rice leaves. The investigation was conducted in the agricultural context of Mozambique, with field data collection in the city of Beira, complemented by public databases.
The unit of analysis consisted of images of corn and rice leaves, including healthy and infected samples. The dataset was compiled from public repositories such as Kaggle, OPIA (Open Plant Image Archive), PlantVillage, Makerere University Maize Image Dataset, and University of Pretoria. Additionally, images were collected directly from agricultural fields in Beira, Mozambique, using a Samsung S22 Ultra mobile phone. The initial database totaled 68,950 raw images, categorized into 14 classes. Duplicate images were removed using perceptual hashing (pHash).
The dataset was divided into 70% for training, 15% for validation, and 15% for testing. To mitigate class imbalance and increase model robustness, “data augmentation” was applied exclusively to the training set. Transformations included rotations, horizontal and vertical mirroring, zoom, geometric variations, and controlled noise addition. After augmentation, the training set totaled 70,118 images. All images were resized to 160 × 160 pixels and subjected to normalization and internal adjustments with Keras and TensorFlow.
The study developed and evaluated three deep learning models: a classic Convolutional Neural Network (CNN), ResNet50, and MobileNetV2. The classic CNN served as a baseline. During the training of the architectures, techniques such as dropout, “early stopping”, and learning rate adjustment were applied to optimize model generalization and prevent overfitting. The experiments were conducted on a personal computer with an AMD Ryzen 7 7730U processor (2.00 GHz), 16 GB of RAM, and a 64-bit operating system, using Python 3.12.7 and Jupyter Notebook 7.2.2 with libraries such as TensorFlow/Keras, NumPy, Pandas, Matplotlib, and Scikit-learn.
The classic CNN was composed of five sequential convolutional blocks, totaling ten Conv2D layers with Max Pooling, using the ReLU activation function. The number of filters increased from 32 to 512 in the blocks. The extracted features were forwarded to fully connected layers. 40% “dropout” was applied and the output layer used softmax for 14 classes. The model was trained for up to 20 epochs with the Adam optimizer (0.0001 “learning rate”) and “early stopping” with a patience of five epochs.
ResNet50 was used with “transfer learning” from weights pre-trained on ImageNet, adapted for 14 classes. With 50 layers and residual blocks with “skip connections”, the model applied convolution, “batch normalization”, and ReLU. The final architecture included GlobalAveragePooling2D, a dense layer of 256 neurons with ReLU, 40% “dropout”, and softmax output. Training used Adam (“learning rate” 0.0001), “early stopping”, and automatic learning rate adjustment, with initial weights frozen and refined via “fine-tuning”.
MobileNetV2 was implemented with “transfer learning” from weights pre-trained on ImageNet, with the original classification layer removed. The convolutional base is formed by inverted residual blocks with depthwise separable convolutions. “Global Average Pooling”, “batch normalization”, a dense layer of 256 neurons with ReLU, 50% “dropout”, and a softmax output layer for 14 classes were applied. Training occurred in two phases: classifier training and “fine-tuning” of the last 40 layers of the convolutional base, using Adam with a reduced learning rate, “early stopping”, and automatic learning rate adjustment.
For the evaluation of the models’ performance, standard metrics in multiclass classification were used: accuracy, precision, recall, and F1-score. The confidence of the estimated probabilities was evaluated by Log Loss. The model’s class separation capability was measured by the multiclass ROC curve and the Area Under the Curve (AUC). Cohen’s Kappa agreement index was included to correct for chance effects in imbalanced data. The total training time was recorded to compare computational efficiency.
3. Results and Discussion
The results obtained in this study provide a detailed comparative analysis of the performance of three Deep Learning architectures – the classic Convolutional Neural Network (CNN), ResNet50 with fine-tuning, and MobileNetV2 – in the detection and diagnosis of diseases in corn and rice leaves in Mozambique. The central objective was to evaluate the effectiveness, robustness, and practical viability of these models in a real agricultural context, characterized by challenges such as image variability and the need for computational efficiency. The findings demonstrate the significant potential of deep learning techniques to improve phytosanitary management. The evaluation was performed based on standard performance metrics, including accuracy, precision, recall, F1-score, Log Loss, and Cohen’s Kappa, in addition to training time.
Accuracy and Loss
The analysis of the accuracy and loss curves was fundamental to understanding the learning process of the models and identifying the occurrence of overfitting or underfitting. For the classic CNN, a consistent and stable behavior was observed in the training set accuracy curves, with continuous and smooth growth over the epochs, culminating in an overall average accuracy of 97.7%. This pattern indicates that the model effectively learned the visual patterns associated with foliar diseases, as expected for deep convolutional architectures (Lecun et al., 2015). However, in the validation set, the accuracy showed variations, with an average of 91.3%, suggesting some sensitivity to the variability of unseen samples, a common scenario in real agricultural datasets (Qin et al., 2025; Sultan et al., 2022a).
The training loss curve of the classic CNN decreased substantially, starting from high values in the first epoch and reaching low levels in the thirteenth epoch, at which point the “early stopping” criterion was automatically triggered. The average training loss was 6.7%, while on the validation set, the reduction was less continuous, with an average of 33.6%. This behavior, characterized by a rapid drop in training loss and oscillation in validation, is consistent with reports in studies of leaf disease detection with classic CNNs, attributed to the greater heterogeneity of validation images (Ferentinos, 2018a; Sultan et al., 2022b). This highlights the importance of representative and diverse validation data to assess model generalization.
In the initial phase of ResNet50 training, without fine-tuning, performance was unsatisfactory, with an average training accuracy of approximately 44% and high losses in both training and validation. This result corroborates findings by Hossen et al. (2025), which indicate that deep architectures like ResNet can have convergence difficulties when applied directly to agricultural datasets without prior adaptation, due to the domain difference between ImageNet and plant images. Furthermore, the difference in image resolution (ResNet50 designed for 224×224 pixels and the dataset resized to 160×160) and the limited number of samples per class may have contributed to this performance limitation (Hossen et al., 2025).
The high loss curves observed in the initial phase of ResNet50 suggest that the model failed to adequately adjust its weights to represent the relevant features of foliar diseases. Shafiq and Gu (2022) state that deep residual networks can perform poorly with limited data volume or high visual similarity between classes. However, with the introduction of fine-tuning, which unfroze the deep layers of ResNet50, there was a significant improvement. The average training accuracy increased to 79%, and validation accuracy to about 73%. Training loss decreased from 2.13 to 0.52, and on the validation set, from 1.74 to 0.91. This improvement is consistent with studies demonstrating the specialization of convolutional filters for the new domain through fine-tuning (Vakli et al., 2018; Yosinski et al., 2014).
Despite the improvement with fine-tuning, ResNet50 continued to present relatively high loss curves, which can be attributed to the excessive complexity of the 50-layer architecture for the specific context of the study. Liakos et al. (2018) observe that, in agricultural applications, very deep architectures do not always result in better practical performance, especially when intra-class variability is high. This indicates that, although fine-tuning has adapted the model, the inherent depth of ResNet50 may have been a limiting factor for complete optimization on a dataset with such specific and varied characteristics.
MobileNetV2 demonstrated the best balance between performance and stability, with an average accuracy of 90.2% in training and very close values in validation, indicating a low discrepancy between the sets. This balance is a result of its optimized architecture, which combines computational efficiency with the ability to extract relevant features, minimizing the risk of overfitting compared to more complex models. This behavior is corroborated by studies targeting real-time applications and environments with limited computational resources (Sandler et al., 2019; Xu et al., 2025). The overall average loss of 0.305, along with the stability of the curves, suggests robust and discriminative representational learning without overfitting.
Studies such as Zhang et al. (2023) observed similar behavior when applying MobileNetV2 to detect rice diseases in field environments, highlighting the architecture’s effectiveness in extracting relevant features, even with significant visual noise. Mohanty et al. (2016a) reinforce that models with stable loss curves and consistent accuracy tend to offer greater reliability in mobile or web applications, reducing the risk of misclassifications under uncontrolled conditions. MobileNetV2, therefore, showed promise for scenarios where efficiency and robustness are crucial, such as in the Mozambican agricultural context.
Performance Metrics Models Summary
The comparison of global performance metrics revealed clear differences among the three models. The classic CNN achieved the best overall performance, with an average F1-score of 94%, accuracy of 93%, and Cohen’s Kappa of 93%. These values indicate high consistency and reliability in classifying corn and rice leaf diseases, suggesting that the architecture, despite its relative simplicity, managed to extract relevant discriminative patterns from the dataset. The Log Loss for the classic CNN was 0.34, a value that, while not the lowest, demonstrates good confidence in the model’s probabilistic predictions.
MobileNetV2 presented a competitive performance, with an average F1-score of 91%, accuracy of 90%, and Cohen’s Kappa of 89%. It stood out for its lower Log Loss (0.30), indicating more reliable and calibrated probabilistic predictions, and for its shorter training time of 6 hours, 32 minutes, and 59 seconds. This computational efficiency, combined with good performance, makes MobileNetV2 particularly suitable for applications in resource-limited environments, such as mobile devices in the field (Sandler et al., 2019; Xu et al., 2025). Its stability is a crucial factor for large-scale adoption.
In contrast, ResNet50, even after fine-tuning, showed the lowest performance among the evaluated models, with an average F1-score of 80%, accuracy of 79%, and Cohen’s Kappa of 87%. The Log Loss for this model was 0.97, the highest, indicating lower confidence in its predictions. ResNet50’s training time was 13 hours, 35 minutes, and 18 seconds, intermediate between the other models. These results suggest that the depth of the ResNet50 architecture may have been excessive or difficult to adapt to the specific characteristics of the foliar disease dataset, especially for classes with very similar visual symptoms.
At the level of specific classes, it was observed that diseases with more distinct visual patterns, such as common corn rust, rice tungro, and sheath blight, showed high values of precision and recall in all models. Common corn rust, for example, achieved an F1-score of 0.97 in the classic CNN, 0.95 in ResNet50, and 0.98 in MobileNetV2. Similarly, rice tungro obtained 1.00 in the classic CNN, 0.91 in ResNet50, and 0.99 in MobileNetV2. These results indicate the high effectiveness of the models in identifying diseases with well-defined visual characteristics.
On the other hand, diseases with more diffuse or similar symptoms, such as Brown Spot, Blight, and bacterial wilt, exhibited greater variability in performance across architectures. This variability reinforces the importance of developing robust and well-regularized models to handle the visual complexity of these pathologies, where distinction can be more challenging. The need for models adaptable to these nuances is crucial to ensure accurate diagnoses across a broad spectrum of phytosanitary conditions, especially in field environments where symptom clarity can be compromised by external factors.
Confusion Matrix
The analysis of confusion matrices complemented the evaluation of metrics, providing a granular view of the errors and correct predictions of each model. In the classic CNN, although most classes were predicted correctly, with high values on the main diagonal, classes with similar visual symptoms, such as gray spot and blight or spot, showed higher confusion rates. This indicates limitations in discriminating subtle features, a finding consistent with observations by Kalpathy-Cramer et al. (2021), who use confusion matrices to identify classes with greater difficulty and adjust training strategies and data balancing. The ability to distinguish between visual nuances is a persistent challenge.
ResNet50, without fine-tuning, demonstrated high confusion between classes with similar visual symptoms, particularly between rice leaf diseases such as Blast, Brown Spot, and Leaf Blight. This reflects the limitations of directly transferring generic features learned on ImageNet to specific phytopathological patterns (Ferentinos, 2018b). Despite good performance on corn diseases with more contrasting symptoms, the dispersion of errors indicated reduced sensitivity to subtle variations in texture and coloration, a common phenomenon in agricultural applications of non-specialized deep networks. Model adaptation to the specific domain is therefore essential.
With the application of fine-tuning, ResNet50 showed a substantial improvement in the concentration of values along the main diagonal of the confusion matrix, reducing intra-cultural confusions and increasing the correct recognition capacity in critical classes, such as rice tungro and corn streak virus. However, some ambiguities persisted between diseases with close visual manifestations. This suggests that, although fine-tuning refines the feature space, its effectiveness is limited when there is strong morphological overlap between classes. Similar results were reported by Too et al. (2019), who observed consistent gains with fine-tuning, but with diminishing returns in scenarios of high visual similarity between diseases.
The MobileNetV2, in turn, presented a reasonably stable and clean confusion matrix, with a good hit rate on the diagonal and minimal dispersion of errors between classes, for both rice and corn. The model demonstrated a notable ability to distinguish between visually similar diseases, as well as a good separation between healthy and diseased leaves. Studies confirm that lightweight architectures, such as MobileNetV2, can maintain high performance with lower computational cost, being particularly suitable for agricultural applications and restricted operational environments (Sandler et al., 2019). This characteristic is vital for implementation on field devices with limited capacity.
ROC Curve and Area Under the Curve (AUC)
Multiclass ROC curves and Area Under the Curve (AUC) were employed to evaluate the discriminative performance of the models at different decision thresholds. The classic CNN presented high AUCs, ranging from 0.99 to 1.00 for most classes, indicating an excellent separation capacity between healthy and diseased leaves. There was only a slight reduction in classes with similar visual symptoms, which is an expected behavior in phytopathological problems with overlapping visual patterns (Mohanty et al., 2016a). These results reinforce the robustness of the classic CNN in distinguishing between different leaf conditions.
MobileNetV2 stood out for presenting AUCs close to 1.00 in most classes, combining high sensitivity and a low false positive rate. This corroborates the evidence that lightweight and efficient architectures can maintain high discriminative power even in complex multiclass tasks (Sandler et al., 2019). Its discrimination capacity is an important differential for application in practical scenarios, where accuracy in identification is crucial for the adequate management of diseases. The consistency of MobileNetV2’s results across various classes underlines its adaptability and effectiveness.
In contrast, ResNet50 without fine-tuning exhibited greater variability in AUCs across classes, especially in those with visually similar symptoms. This reflects the limitations of directly transferring generic representations trained outside the agricultural domain (Ferentinos, 2018a). Applying fine-tuning to ResNet50 resulted in substantial improvements in ROC curves, with high and more stable AUCs among classes. This demonstrates that adapting weights to the specific domain is a determining factor in maximizing the discriminative capacity of models (Too et al., 2019). Even with fine-tuning, ResNet50 still showed challenges in classes with high visual similarity.
In summary, the results of this study demonstrate the high potential of Deep Learning techniques for the phytopathological diagnosis of diseases in corn and rice in Mozambique. The classic CNN presented the best overall performance in accuracy, F1-score, and Cohen’s Kappa, indicating robustness in identifying visual patterns. MobileNetV2 stood out for its computational efficiency and shorter training time, maintaining competitive performance and reliable predictions, ideal for resource-limited environments. ResNet50, although improved with fine-tuning, proved less adaptable to the specific dataset. Thus, the study achieved its objective of comparing these architectures, providing valuable insights for decision support systems in agricultural disease management.
4. Conclusion
The present study aimed to develop and compare Deep Learning-based models for the automatic detection and diagnosis of diseases in corn and rice leaves in Mozambique. It was found that the classic Convolutional Neural Network demonstrated the best overall performance, achieving 94% F1-score, 93% accuracy, and 93% Cohen’s Kappa. MobileNetV2 presented competitive performance, with 91% F1-score and 90% accuracy, standing out for its computational efficiency, with the lowest Log Loss and training time. In contrast, ResNet50, even after fine-tuning, exhibited inferior performance, with 80% F1-score and 79% accuracy. It was observed that diseases with more distinct visual patterns, such as common corn rust and rice tungro, were identified with high precision by all models, while pathologies with more diffuse or similar symptoms, such as brown spot and rice blast, showed greater variability in performance among the architectures.
The main contribution of this work lies in demonstrating the high potential of Deep Learning techniques to support phytopathological diagnosis in real agricultural contexts, promoting faster and more accurate decisions in disease management in corn and rice. However, the study faced limitations, including potential bias introduced by data from different sources and variability in image capture conditions. There was also a risk of overfitting, particularly in the classic CNN, and practical applicability in field environments may not fully reflect performance obtained under controlled conditions, due to factors such as lighting and occlusion. The absence of external validation with completely independent data constitutes an additional limitation. For future studies, it is suggested to improve the generalization capability of models to different contexts and disease types, develop more robust strategies to deal with the visual complexity of pathologies with similar symptoms, and explore the integration of external validation to ensure robustness in diverse operational environments, including mobile field devices.
Bibliographic References
Abbas, M. 2024. Organismos geneticamente modificados (OGMs): Um caminho para a segurança alimentar ou para aprofundar a dependência externa?
Bartoli, C.; Roux, F. 2017. Genome-wide association studies in plant pathosystems: Toward an ecological genomics approach. Frontiers in Plant Science 8: 763.
Gollin, D. 2010. Agricultural productivity and economic growth. Handbook of Agricultural Economics 4: 3825-3866.
Inclusive Growth in Mozambique. 2020. Desenvolvimento agrário em Moçambique 2002–2020. Disponível em: https://igmozambique.wider.unu.edu. Acesso em: 18 jan. 2026.
Sankaran, S.; Mishra, A.; Ehsani, R.; Davis, C. 2010. A review of advanced techniques for detecting plant diseases. Computers and Electronics in Agriculture 72(1): 1-13.
Article originating from the Final Course Work of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform