Intelligent System to Aid in the Detection of Cocoa Diseases by Processing Images of Infected Leaves ()
1. Introduction
Côte d’Ivoire, a West African country, has an economy primarily based on agriculture. In the south and west of the country, cocoa cultivation is the main activity. The Tonkpi region, located in the west, is one of the key cocoa-growing areas. The people of this region have therefore built their hopes and their economies on cocoa. However, this crop is regularly affected by various fungal and bacterial diseases, resulting in significant losses of up to 40% of the harvest due to cocoa phytophthora [1] [2]. Faced with this situation, farmers resort to solutions such as visual observation followed by random diagnosis, or by contacting agents from the CNRA (National Center for Agricultural Research) or ANADER (National Agency for Rural Development), whose services are sometimes costly. Furthermore, these approaches have several limitations: they are subjective, require specialized expertise that is difficult to mobilize for all affected plantations, and do not allow for efficient disease diagnosis.
Several research projects have already focused on automating agricultural diagnostics to overcome these limitations. Among others, we can cite the work of [3] [4] [5], which marked a significant advance in cocoa disease detection by proposing a hybrid approach combining texture analysis (GLCM) and color analysis (HSV) in Côte d’Ivoire. Their contribution demonstrated that automated classification using SVM can achieve robust accuracy in identifying pathological symptoms, paving the way for more effective diagnostic systems. In parallel, the research of [6] took a decisive step towards practical application with the development of the “Cocoa Companion” mobile tool in Canada. By leveraging the power of convolutional neural networks (CNNs) such as InceptionV3, this work demonstrated that automated smartphone-based diagnostics can achieve 92.1% accuracy, thus offering an accessible field solution for the early detection of cocoa diseases.
Despite these advances, the specific application of this technology to detect cocoa diseases in the unique geographical context of the Tonkpi region remains poorly documented, particularly regarding the systematic comparison of multimodal descriptors and lightweight Deep Learning models [4].
Therefore, a central question arises: how can we design a technological tool that is accessible, accurate, and automated, capable of providing a reliable diagnosis of cocoa diseases under the real-world growing conditions of the Tonkpi region?
Our study proposes a system based on digital image processing to automatically detect and characterize cocoa foliar diseases. The system combines image segmentation techniques, multimodal descriptor extraction, and classification using machine and deep learning, thus offering a comprehensive and efficient solution.
The overall objective of this work is to design and validate an intelligent system to assist in the automatic detection of cocoa foliar diseases through the analysis and processing of digital images acquired in the Tonkpi region. To achieve this objective, we define the following specific goals:
- To create a database of images of healthy and diseased leaves representative of actual growing conditions in the Tonkpi region;
- To implement and compare two methods for automatically segmenting infected areas: Otsu thresholding and K-means segmentation;
- To extract and analyze quantitative descriptors characterizing infected leaf areas;
- To compare the performance of three classification approaches: k-NN, Random Forest, and CNN using Transfer Learning (SqueezeNet);
- To propose the most effective classification technique for future integration into a decision support tool for farmers and field agents;
Our work will be structured around four parts: a literature review, the materials and methods used to design our model, the results and discussion of the results obtained, and finally, the conclusion of the work carried out.
1.1. Diseases of Cocoa Crops
Cocoa cultivation is a major economic pillar for many farmers in West Africa. However, in Côte d’Ivoire, this crop is subject to a wave of foliar diseases that reduce producers’ yields [7]. Understanding these diseases is therefore essential for the design of any automated detection system. Cocoa anthracnose, caused primarily by the fungus Colletotrichum gloeosporioides, is one of the most studied and widespread foliar diseases in tropical regions. It manifests as well-defined, brown to black necrotic lesions that first appear on young leaves before spreading across the entire leaf blade. Under conditions of high humidity, characteristic orange acervuli appear on the surface of the lesions [8].
Figure 1 shows images of a cocoa anthracnose epidemic in parts of Ghana from July to October 2019.
Cocoa brown rot, or Phytophthora, is caused by the oomycete Phytophthora megakarya in West Africa and Phytophthora palmivora in other cocoa-producing regions worldwide [10]. It affects the pods, stems, and leaves, producing dark brown, water-soaked lesions that rapidly progress to generalized necrosis. On the leaves, foliar symptoms appear as irregular chlorotic patches, often associated with a whitish mycelial down on the underside of the leaves under humid conditions. Mineral deficiencies, particularly in nitrogen, magnesium, and potassium, induce characteristic foliar chlorosis in cocoa trees. Magnesium deficiency manifests as yellowing of older leaves, nitrogen deficiency produces generalized paling, while potassium deficiency often causes yellowing or burning of the leaf margins, progressing inward [11]. These symptoms are frequently mistaken for early fungal infections during visual diagnosis. Natural leaf senescence is another confounding factor, as it produces color patterns similar to those seen in infectious diseases.
![]()
Figure 1. Symptoms of anthracnose: (a) wet-looking brown spots on a young leaf; (b) dark brown spots with yellow halo borders on a mature leaf; (c) large dark brown lesions on mature leaves; (d) dark lesions on pods; (e) orange fruiting bodies (acervules) of the pathogen on a leaf; (f) browned dead leaves on the canopy of affected cocoa trees [9].
Cocoa swollen shoot virus (CSSV) is the main viral threat to cocoa production in West Africa. Its presentation varies depending on the viral strain, cocoa variety, and environmental conditions. Three main types of symptoms are distinguished: red bands on young leaves, mosaic patterns on older leaves, and swellings on orthotropic shoots [12]. Figure 2 illustrates the early symptoms of swollen shoot on young cocoa leaves.
Cocoa swollen shoot virus (CSSV) is the main viral threat to cocoa production in West Africa. Its presentation varies depending on the viral strain, cocoa variety, and environmental conditions. Three main types of symptoms are distinguished: red bands on young leaves, mosaic patterns on older leaves, and swellings on orthotropic shoots [12]. Figure 2 illustrates the early symptoms of swollen shoot on young cocoa leaves.
Figure 2. Main foliar symptoms of cocoa swollen shoot disease in Ivory Coast on young leaves: (a): Red bands on main and secondary veins; (b): Red bands on secondary and tertiary veins [12].
1.2. Agricultural Context of the Tonkpi Region
The Tonkpi region is located in the far west of Côte d’Ivoire, between latitudes 7˚ and 8˚ North and longitudes 7˚ and 8˚ West. It is bordered to the west by Guinea and Liberia, to the north by the Bafing region, to the east by the Cavally region, and to the south by the Guémon region. The landscape is dominated by mountain ranges, including Mount Nimba (1752 m), the highest point in Côte d’Ivoire, and Mount Dent de Man (881 m). The region has a monomodal climate with two seasons: a rainy season from April to October and a dry season from November to March. Average annual rainfall is 1632 mm, with an average temperature of around 25˚C [13]-[15]. This microclimate, combined with deep ferrallitic soils rich in organic matter, creates particularly favorable conditions for tropical perennial crops, notably coffee and cocoa. Figure 3 shows the location of the Tonkpi region and the boundaries of the four sub-prefectures selected as study areas within the Tonkpi region.
![]()
Figure 3. Location map of the Tonkpi region and the four sub-prefectures selected as study areas.
1.3. Digital Image Processing Applied to Agriculture
A review of the literature reveals a nuanced assessment of existing approaches to automated foliar disease detection. Traditional methods with manually defined characteristics (colorimetric, textural, and geometric descriptors coupled with k-NN, SVM, or Random Forest classifiers) offer the advantage of being interpretable, data-efficient, and deployable on resource-constrained embedded systems. Kone et al., [16] illustrate their relevance by achieving 93.75% accuracy in detecting cocoa rust using a simple fuzzy inference system based on the GCC index. However, their main limitations lie in their dependence on the quality of prior segmentation, their sensitivity to acquisition conditions, and their generally lower performance compared to CNNs on large databases.
Deep learning approaches (CNN, Transfer Learning) outperform classical methods under controlled conditions, with classification rates exceeding 95% on Plant Village for many of the architectures identified by Saleem et al. [17]. However, they require large volumes of annotated data, significant computing resources, and offer limited interpretability, hindering their adoption in the field. Furthermore, their performance degrades considerably outside the controlled training environment, as public reference datasets are mostly composed of images from controlled environments, which are not very representative of tropical African crops [18].
2. Materials and Methods
The Tonkpi region, located in western Côte d’Ivoire, constituted the geographical setting for our data collection. To ensure the diversity and representativeness of our image databases, we photographed infected and healthy cocoa leaves in four distinct locations in the region between January 9 and 28, 2026. The first location was the village of Kassiapleu, in the sub-prefecture of Man, the regional capital. The second was the village of Bloleu, located in the sub-prefecture of Songouiné, northwest of Man. The third was the village of Mangouin-Yrongouin, in the sub-prefecture of Biankouma, to the north. Finally, the fourth was the village of Douèlé, in the sub-prefecture of Logoualé, southeast of Man.
Figure 4. Sampling map in the four sub-prefectures of the Tonkpi region where we collected our data.
Figure 4 shows the four sub-prefectures as well as the sampling points of our images.
The images were acquired using a Tecno Spark 20C smartphone equipped with a 50 MP AI camera. This high-resolution sensor incorporates built-in artificial intelligence algorithms that enable automatic optimization of exposure, white balance, and digital noise reduction. We chose a smartphone to demonstrate that the system we intend to develop can be deployed with equipment readily available to field agents and farmers without significant investment. Figure 5 shows the Tecno Spark 20C smartphone used for the image capture.
Figure 5. Tecno Spark 20C smartphone used for shooting coffee and cocoa leaves.
2.1. Creation of Image Databases
Once the raw databases were created, it was necessary to assign each image in the disease class a precise pathological label. First, we used an advanced conversational artificial intelligence system, Claude (Anthropic) Professional, to which a specialized phytopathology skill was configured and assigned. This system allowed us to classify diseased cocoa leaves into five classes. To verify the accuracy of this initial process, we then consulted the recognized phytopathological database JMuBEN, a reference database documenting the symptoms, causative agents, and visual distinguishing criteria of the main foliar diseases of tropical crops [19] [20]. This final step enabled us to establish a correct differential diagnosis. Figure 6 illustrates the ten diseases included in our databases, five of which relate to cocoa cultivation.
Figure 6. The five classes of cocoa pathologies in the study database.
To create our dataset, our cocoa leaf image databases contained 805 original images. The database folder includes 145 images of anthracnose, 120 images of nutritional deficiency, 70 images of phytophthora, 385 images of healthy leaves, 35 images of natural senescence, and 50 images of vascular streaks.
Figure 7 shows the cocoa leaf samples for the five diseases and the healthy leaf.
Figure 7. Sample images of different cocoa diseases: (a) cocoa anthracnose; (b) cocoa nutritional deficiency; (c) cocoa phytophthora; (d) healthy cocoa; (e) natural cocoa senescence; (f) cocoa vascular streaks.
For our classification models, our dataset will be divided as shown in Table 1 below:
Table 1. Distribution dataset.
Culture |
Dataset (100%) |
Training (60%) |
Validation (20%) |
Test (20%) |
Cocoa |
805 |
483 |
161 |
161 |
This allocation was performed according to a standard ratio of 60% training, 20% validation, and 20% testing to ensure that our model is tested on data completely independent of that used during its training.
2.2. Custom CNN Transfer Learning
The SqueezeNet architecture was used via transfer learning, employing weights pre-trained on ImageNet. Unlike k-NN and RF methods, this network directly processes raw images without prior segmentation, thus facilitating its real-world deployment. The fine-tuning process involved replacing the final classification layer with a fully connected layer with 6 outputs. The model was then retrained on a CPU (MATLAB R2023b) using the SGD optimizer with moment, with an 80% training and 20% testing allocation. The training duration was set to 30 epochs. Figure 8 shows our custom architecture used for classification.
The system is structured around a five-step sequential architecture, implemented in MATLAB R2023b with the Image Processing Toolbox and Statistics and Machine Learning Toolbox. Figure 9 below illustrates the overall sequence. Raw images acquired in the Tonkpi region constitute the system’s input and simultaneously feed two parallel processing chains. The first chain applies two distinct segmentations, Otsu thresholding and K-means (K = 3), producing binary masks from which 53 quantitative descriptors are extracted, divided into five categories: color, texture, shape, intensity, and statistics. This feature matrix then feeds two supervised classifiers, k-NN and Random Forest, which are evaluated using five-fold cross-validation. In parallel, the raw images are resized to 227 × 227 pixels and fed into the CNN SqueezeNet, pre-trained on ImageNet and refined by fine-tuning (30 epochs for cocoa) across six classes per crop. Finally, the predictions of the three classifiers converge towards a common evaluation stage, based on overall accuracy, the F1 score, confusion matrices, precision, and recall, in order to validate the system’s effectiveness.
![]()
Figure 8. CNN architecture by Transfer Learning-SqueezeNet customized for multiclass classification of foliar diseases.
Figure 9. Overall processing architecture of the SIADMA system.
The performance of each classifier is evaluated using four standard metrics from the confusion matrix [21] [22]:
Accuracy: the proportion of correctly classified images in the entire test set. It is calculated using Formula (1).
(1)
Accuracy (Formula (2)): proportion of predicted diseased images that are actually diseased (minimizes false positives).
(2)
Recall (Recall or Sensitivity): proportion of true diseased images correctly detected (minimizes false negatives, critical in phytosanitary context), Formula (3).
(3)
F1-score: harmonic mean of accuracy and recall, synthesizing the compromise between these two metrics, calculated by Formula (4).
(4)
Figure 10. Anatomy of a 6 × 6 confusion matrix.
The confusion matrix is the primary visualization tool used to analyze classification errors in detail. For binary classification, it presents the four cells: VP, VN, FP, and FN. For multiclass classification (SqueezeNet CNN, 6 classes), the 6 × 6 confusion matrix allows for the precise identification of the most frequent interclass confusions.
Figure 10 illustrates the structure of a confusion matrix for a 6 × 6 classification problem.
3. Results and Discussion
We performed Otsu segmentation on cocoa images; the overall finding is that Otsu performs segmentation in 0.016 seconds per image. Dark necrotic areas of anthracnose are effectively isolated, and healthy leaves do not generate any white pixels, unlike diseased leaves. However, limitations appear on the fine linear patterns of vascular streaks, which are lost against the black background of the mask, and on images with pronounced light reflections.
Figure 11 shows a comparison of the original images and those obtained using the Otsu method for the five coffee and cocoa diseases and images of healthy leaves.
Figure 11. Binary segmentation by the Otsu method applied to foliar pathologies of cocoa: comparison between the original images and the segmentation masks obtained.
These results on our databases are explained by the Otsu principle: Otsu thresholding is particularly effective when diseased areas are significantly darker or lighter than the rest of the leaf. Chen et al. [23] [24] confirmed this effectiveness on well-defined dark lesions in the context of maize disease detection. Otsu’s weakness on vascular streaks is explained by the fact that this method only sees the image in grayscale and therefore loses all color information, making it difficult to detect fine patterns with low contrast. Despite some limitations with fine patterns, the Otsu method offers a good balance of speed and efficiency for cocoa cultivation. It is a simple, fast, and sufficiently precise tool for preparing images for analysis.
K-means processes images slightly slower: 0.12 seconds per image. The choice of K equal to three groups proved judicious because the three categories—background, healthy leaf, and diseased area—are well separated in both cultures. The resulting masks are visually more appealing and detailed than those produced with Otsu. Figure 12 presents the original results and those of K-means on the pathologies of anthracnose, vascular streaks, and nutritional deficiency in cocoa.
Figure 12. K-means segmentation applied to cocoa tree pathologies: comparison between original images and color clusters.
Using all three color channels gives K-means a clear visual advantage. Our results align with those of researchers such as Dayang et al. [25]-[27] who have shown that K-means visually outperforms thresholding methods on images of tomato and potato diseases. However, a mask that is pleasing to the eye is not always the most useful for a machine. K-means produces the most visually appealing images, but its visual superiority does not necessarily translate into analytical superiority. Table 2 shows the impact of certain parameters on the efficiency of these two methods.
Table 2. Comparison of the technical and temporal criteria of Otsu and K-means algorithms.
Criteria |
Otsu method |
K-means method |
Visual precision |
Mederate |
high |
Noise sensitivity |
high |
moderate |
Mean cocoa time |
0.016 s/image |
0.12 s/image |
Spectral analysis domain |
grayscale (1 channel) |
RGB color (3 channels) |
The results highlight a clear contrast between the two methods: Otsu is significantly faster at 0.016 s/image compared to 0.12 s for K-means, representing a speed ratio of 6 to 7 in favor of Otsu. However, K-means produces visually superior masks thanks to its simultaneous analysis of all three RGB color channels, while Otsu is limited to a single grayscale channel. Regarding noise sensitivity, K-means is more moderate, while light reflections and shadows disrupt Otsu masks more significantly. Otsu’s segmentation is fast, but K-means provides good visual differentiation between healthy and infected cocoa tissue.
3.1. Most Discriminating Descriptors on Cocoa
Table 3 presents the ranking of the 10 most effective descriptors on cocoa images.
Table 3. Top 10 most discriminating descriptors for cocoa obtained by the Otsu segmentation method according to F-ANOVA.
Rank |
Descriptor |
F-ANOVA |
Family |
1 |
pct_necrose_R |
35.34 |
Color/chrominance |
2 |
r_moy |
33.12 |
Color/chrominance |
3 |
r_std |
32.90 |
Color/chrominance |
4 |
G_ratio_bord_int |
32.34 |
Statistic/signal |
5 |
CNR |
23.45 |
Statistic/signal |
6 |
d_prime |
23.45 |
Statistic/signal |
7 |
sigma_infecte |
22.17 |
Statistic/signal |
8 |
ENT_locale_moy |
21.23 |
Texture |
9 |
IDM_moy |
20.26 |
Texture |
10 |
BI_moy |
19.85 |
Intensity/contrast |
Analysis of the table reveals that in the cocoa corpus, pct_necrose_R retains first place with an F-value of 35.34. The color/chrominance and statistical/signal families share the ranking equally, before texture appears in ranks 8 and 9. CNR and d_prime are again redundant with an F-value of 23.45, as are BI_moy and deseq_RG with an F-value of 19.85.
The balanced presence of the color and signal families is explained by the nature of cocoa pathologies: anthracnose produces clearly visible brown necroses, captured by color descriptors, while phytophthora and vascular striations create more subtle discolorations on the veins, which signal descriptors capture better. The low F-value is due to the fact that cocoa pathologies are more visually similar to each other, making discrimination more difficult. Azim et al. [28]-[30] observed a similar structure in rice, where color and signal co-dominate for diseases with visually similar symptoms.
Color descriptors remain the primary discriminators, but signal descriptors play an essential complementary role. K-means segmentation exploits RGB chrominance, modifying the geometry of the mask and thus the nature of the most discriminating descriptors.
Table 4 presents the ranking of the 10 most effective descriptors.
Table 4. Top 10 most discriminating descriptors on cocoa obtained by the K-means segmentation method according to F-ANOVA.
Rank |
Descriptor |
F-ANOVA |
Family |
1 |
LBP_uniformite |
19.72 |
Texture |
2 |
LBP_moy |
17.16 |
Texture |
3 |
ENT_moy |
16.58 |
Texture |
4 |
LBP_entropie |
16.33 |
Texture |
5 |
IDM_moy |
15.42 |
Texture |
6 |
E_moy |
15.35 |
Texture |
7 |
E_energie |
15.07 |
Texture |
8 |
kurt_infecte |
14.40 |
Statistic/signal |
9 |
cv_infecte |
14.25 |
Statistic/signal |
10 |
skew_infecte |
14.11 |
Statistic/signal |
The results in the table show that texture descriptors dominate the discriminatory ranking for cocoa K-means images. LBP_uniformity has the highest F-value of 19.72, followed by LBP_average at 17.16 and ENT_average in third place with an F-value of 16.58. This value for the most discriminating descriptor, LBP_uniformity, is 44% lower than Otsu’s value of 35.34 for Pct_necrose_R. The statistical/signal and texture families co-dominate the top 10, with overlapping F-values within each family.
The K-means mask has three color channels: red, green, and blue. Since the LBP descriptor analyzes small texture variations pixel by pixel, it is better suited than global intensity descriptors to capture color differences between mask areas. This result is consistent with the observations of [31] [32] regarding the robustness of LBP descriptors to segmentation variations. Nevertheless, the 44% reduction in the maximum F-value remains significant and unfavorable. K-means produces less effective descriptors than Otsu. Otsu’s superiority is therefore universal across both image databases. This validates the relevance of our feature vector for k-NN and Random Forest models: constructed from masks derived from Otsu thresholding, it better captures the most discriminating spectral and textural variations between pathology classes.
3.2. Random Forest Classifier
Table 5 highlights the performance of the RF classifier for each number of trees tested in our cocoa images.
Table 5. Evaluation of performance metrics of the RF model applied to detection on cocoa images.
Number of Trees |
Accuracy_CV (%) |
Accuracy_Test (%) |
Precision |
Reminder |
Score F1 |
10 |
99.38 |
100 |
1 |
1 |
1 |
50 |
100.00 |
100 |
1 |
1 |
1 |
100 |
100.00 |
100 |
1 |
1 |
1 |
200 |
100.00 |
100 |
1 |
1 |
1 |
500 |
99.38 |
100 |
1 |
1 |
1 |
Analysis of this table reveals that regardless of the number of trees, RF consistently achieves 100% test accuracy, with precision, recall, and F1 score all equal to 1. The confusion matrices show no classification errors: all 77 healthy images and 84 infected images are identified. In cross-validation, the scores are also very high: 99.38% for numbers of trees equal to 10 and 500, and 100% for tree configurations of 50, 100, and 200. Figure 13 shows the RF confusion matrices for our ten tree values for cocoa images segmented by the Otsu method.
These exceptional results can be explained by three factors. First, the high quality of the Otsu descriptors (maximum F-ANOVA of 112.83) ensures sufficient inter-class separability for a binary classifier. Second, the majority-voting bagging mechanism reduces variance without increasing bias, providing structural robustness to overfitting. Finally, for cocoa, the relative balance between classes 77 healthy versus 84 diseased—facilitates learning. Our results also align with those of [33] [34], which achieved accuracy rates of 97% to 99% on tomato leaf pathologies for RF on GLCM descriptors. Achieving zero false negatives is particularly valuable in a phytosanitary context, where an undetected disease is more serious than a false alarm.
Figure 13. Visualization of predictions (classes 0 and 1) of the RF model for 10, 50, 100, 200 and 500 trees on cocoa images.
In practice, a configuration of 100 trees would be a better choice, thus offering the best accuracy in cross-validation.
3.3. Results and Discussion of the CNN SqueezeNet
Figure 14 illustrates the training progress of the SqueezeNet model on our 80% cocoa images. The accuracy curve starts at around 40% in the first iteration and then shows rapid and steady growth, exceeding 90% within the first 200 iterations. At approximately 300 iterations, the curve stabilizes around 100%, indicating complete convergence of the model on the training data.
The validation curve, shown as a black dotted line, follows a similar trajectory, reaching values close to 100% from epoch 10 onward and remaining at this level until the end of training. Regarding the loss curve, we observe a rapid drop from an initial value of about 3 to values close to 0 after 300 iterations, with remarkable stabilization for both curves, training and validation, up to the final iteration 900.
The confusion matrix for the cocoa test images shown in Figure 15 confirms the excellent results obtained during training: out of 161 test images, the model achieves an overall accuracy of 99.38%, meaning that four out of six classes (anthracnose, nutritional deficiency, healthy, and natural senescence) are recognized 90.0% without any errors.
Figure 14. Learning curves of the SqueezeNet model showing the evolution of accuracy and loss on cocoa images.
Figure 15. Confusion matrix of the SqueezeNet model on the test set for the classification of pathologies of cocoa leaves.
The two classes exhibiting slight imperfections are: Phytophthora with 93.3% predictive accuracy (14 images correctly identified and one misclassified as vascular striations), and vascular striations (90.0% recall, meaning 9 images correctly identified and one misclassified as Phytophthora). It is worth noting that the column accuracy reaches 100% for all classes except Phytophthora (93.3%), meaning that when the model predicts a class, it is correct in almost all cases.
Confusion between phytophthora and vascular streaks on cocoa is expected given the visual similarity of these two pathologies, both manifesting as yellowish discolorations on the veins. Saleem et al. [17] [35] [36] report similar confusions between visually similar classes in their benchmarks on PlantVillage, and emphasize that CNN architectures struggle to distinguish classes with low interclass contrast without discriminating pretreatment.
3.4. k-NN Classifier
Table 6 below presents the performance of the k-NN classifier for each tested value of k.
Table 6. Performance of the k-NN classifier on cocoa images as a function of different values of the parameter k.
k |
Accuracy_CV (%) |
Accuracy_Test (%) |
Precision |
Recall |
Score F1 |
1 |
99.84 |
100 |
1 |
1 |
1 |
3 |
95.19 |
97.52 |
0.977 |
0.974 |
0.975 |
5 |
86.02 |
95.65 |
0.962 |
0.955 |
0.956 |
7 |
84.47 |
78.26 |
0.783 |
0.784 |
0.783 |
9 |
82.14 |
78.26 |
0.782 |
0.782 |
0.782 |
11 |
81.37 |
81.99 |
0.820 |
0.819 |
0.819 |
13 |
78.26 |
81.99 |
0.820 |
0.819 |
0.819 |
15 |
77.64 |
76.40 |
0.766 |
0.761 |
0.762 |
17 |
77.80 |
72.05 |
0.721 |
0.719 |
0.719 |
21 |
76.24 |
73.91 |
0.739 |
0.739 |
0.739 |
Figure 16. Evolution of the confusion matrices of the k-NN classifier for different values of k (from 1 to 21) on the cocoa images.
Analysis of the table reveals that the k-NN classifier achieves its best performance for low k values on the Otsu-segmented cocoa images. For k equal to 1, the test accuracy is perfect, at 100%, with an F1 score of 1: no classification errors on the 161 cocoa images. For k equal to 3, performance remains remarkable at 97.52% accuracy and an F1 value of 0.975. There are only 4 false positives and 0 false negatives, a particularly favorable result in a phytosanitary context where a false negative (undetected disease) is more serious than a false positive. From k equal to 7, accuracy drops to 78.26% with 20 additional false negatives. A slight improvement is observed for k values of 11 and 13, which show an accuracy of 81.99%, but performance remains below that of k values less than 5.
Figure 16 groups the K-NN confusion matrices of our ten k values for the cocoa images.
Table 7 groups together the best results that we have identified throughout this results and discussion section.
Table 7. Summary of best configurations and performance achieved.
Component |
Optimal configuration |
Cacoa |
Segmentation |
Otsu |
0.016 s/image |
Best descriptor |
Pct_necrose_R |
F = 35.34 |
Binary detection-RF |
100 cocoa tree |
100% test 100% CV |
Binary detection kNN |
K = 3 (euclidean) |
97.52% test F1 = 0.975 |
Multi classes identification SqueezeNet |
30 cocoa epochs |
99.38% (6 classes) |
Cross-analysis of the results establishes a clear hierarchy. For binary healthy/ disease detection, RF dominates with 100% accuracy, followed by k-NN at 97.52% accuracy. For multiclass identification, SqueezeNet achieves 99.38% accuracy.
The best overall combination is: Otsu segmentation, extraction of the 53 descriptors plus RF for binary detection, complemented by SqueezeNet using Transfer Learning for specific disease identification.
This hybrid architecture of our Intelligent Agricultural Disease Detection System (IADDS) offers a dual level of operational security: RF ensures that no diseased leaves are classified as healthy, while SqueezeNet identifies the specific disease to guide the appropriate phytosanitary treatment. This design is particularly relevant to the Tonkpi region, where access to computing resources is limited and diagnostic reliability is critical.
3.5. System Limitations and Prospects for Improvement
We would like to emphasize that despite the performance of our system, several limitations deserve to be highlighted in order to contextualize our results and identify areas for improvement in future work. Four aspects should be mentioned:
Controlled Collection Conditions: We acquired our images under natural lighting conditions, at a fixed distance, and against a uniform background. Therefore, integrating data augmentation techniques (rotation, zoom, Gaussian noise, brightness variations) would improve the system’s robustness in the field to compensate for variations in shooting angle and camera quality.
CNN Training on CPU: We trained SqueezeNet on the CPU, limiting the exploration depth to 30 epochs. We believe that extending training to more than 45 epochs and using deeper architectures like ResNet-50 or EfficientNet-B0 could improve performance on challenging classes such as the leaf miner and the nutrient deficiency.
Class imbalance and database size: Our coffee test images exhibit an imbalance between classes (ranging from 13 to 91 test images per class), which penalizes minority classes. Therefore, balancing the number of images per class would improve overall performance.
4. Conclusion and Outlook
At the conclusion of our work, we can confirm that all our objectives have been met. Our Intelligent System for Agricultural Disease Detection (SIADMA) has enabled the automatic detection of foliar diseases in cocoa in the Tonkpi region. Otsu’s thresholding proved six times faster and analytically superior to K-means, with an Otsu F-ANOVA of 112.83 compared to 27.00 for K-means images. Meanwhile, the pct_necrose_R descriptor, the proportion of red in infected areas, emerged as the dominant pathological signal for both crops. Random Forest, thanks to its robust majority voting, achieved 100% accuracy for binary detection, surpassing K-NN with 97.52% accuracy for cocoa. SqueezeNet, using Transfer Learning, identified the six disease classes with 99.38% accuracy without prior segmentation. SIADMA is the first system to compare two segmentations, 53 multimodal descriptors, and three classifiers on a local tropical corpus specifically covering cocoa cultivation in the Tonkpi region, demonstrating that classical descriptors and lightweight deep learning are complementary on modest corpora. The optimal Otsu, Random Forest, and SqueezeNet architecture, deployable on smartphones, offers a reliable and accessible diagnostic tool for farmers and field agents. Looking ahead, extending data collection to other cocoa-producing areas of the country, enriching underrepresented classes with synthetic images (DCGAN), and performing biological identification of pathogens in the laboratory will enhance the system’s reliability for operational deployment.
Author Contributions
Guié Toa Bi Toa: Study design, methodology development, data collection and processing, development and evaluation of image processing and machine learning models, analysis of results, and manuscript writing.
Vangah Wognin: Contribution to the development, implementation, and evaluation of machine learning approaches, as well as the analysis of results.
Alico Nango: Contribution to the implementation and evaluation of machine learning methods and the interpretation of results.
Kouassi Francis Yao: Expertise in plant pathology, particularly regarding the identification and characterization of cocoa diseases, and contribution to the biological interpretation of results.
Kadja Anicet: Contribution to leaf collection, data acquisition, and the performance of measurements required for the study.
Sié Ouattara: Scientific supervision of the study, methodological guidance, interpretation of results, and critical revision of the manuscript.
Alain Clément: Scientific supervision of the study, contribution to methodological guidance, critical revision of the manuscript, and validation of the final version.