Intelligent pesticide recommendation system for cocoa plant using computer vision and deep learning techniques

Agriculture in India is a vital sector that contains a major portion of the population and impacts substantially the country’s economy. Cocoa is a crop that has commercial importance and is used for the production of chocolates. It is one of the main crops cultivated in south India due to the humid tropical climate. However, the cocoa plant is susceptible to various diseases caused by bacteria, viruses, and pests resulting in yield losses. Visual analysis is a subjective and time-consuming process. Further, farmers use improper pesticides to prevent diseases, and this will degrade the plant and soil quality. To overcome these problems, this paper proposes an automatic cocoa plant disease detection and pesticide recommendation system using computer vision and deep learning techniques. The proposed system was evaluated on several cocoa plant images, and an accuracy of 97.36% was obtained in disease classification. The proposed system can help cocoa farmers in the detection of cocoa plant diseases in the early stage and reduce the use of excessive pesticides, thus promoting sustainable agriculture practices.


Introduction
The agriculture sector in India has witnessed significant growth over the years.With a large rural population dependent on agriculture for livelihood, the sector plays a crucial role in the country's economy.Cocoa production in India has exhibited a gradual growth trend.Although the cocoa plant is not native to India, it is grown in southern states of India, particularly in Kerala, Tamil Nadu, and Karnataka in recent years [1].The favourable climatic conditions and suitable soil characteristics in these areas provide an advantageous environment for cocoa farming.Cocoa plants, which are the source of cocoa beans used in the production of chocolate, and rich sources of antioxidants, particularly flavonoids, which have been linked to various health benefits.
India offers large scope for cocoa growth and it has become an important export commodity.Currently, around 10 multinational companies are working on manufacturing cocoa export products in India.The demand from the chocolate industry in India is 50,000 MT per annum.But the production is only about 26,000 MT [2].The present production of cocoa beans in India is not sufficient to meet the demand of the industry [3].This is because, cocoa plants are easily prone to diseases like black pod rot, anthracnose, stem canker, etc [4,5].This will significantly impact the yield and quality of cocoa beans.Common diseases of a cocoa plant are shown in figure 1.These diseases may be caused by bacteria, viruses, or pests.
Several pesticides can be used to control cocoa plant diseases.The selection of pesticide depends on the type and severity of the disease.Some of the common pesticides applied for cocoa plant diseases include Copper fungicides, Mancozeb, Chlorothalonil, Carbamate insecticides, and organic methods involve pruning, sanitation, biological control, use of resistant variants, cultural practices and use of organic fungicides [6].The analysis of the disease by the farmer is inaccurate and time-consuming due to his poor information about the root cause of the disease [7].The current manual disease identification practices are based on the observation of visual symptoms by the farmer.However, this approach is highly unreliable due to the similarity of diseases and the diversity of characteristics.Sometimes farmers also contact agriculture specialists for disease identification.The agriculture specialist identifies the disease based on the laboratory analysis of the sample using a selective medium or microscope.However, this method potentially leads to inaccuracies because it heavily relies on the expertise of the observer.Many farmers do not have access to specialists, making accurate and timely disease identification very difficult.Further, to control the disease, the farmer sprays inappropriate pesticides in incorrect quantities on plants [8].This will affect the plant's health and soil quality resulting in low yield.To overcome these problems, this work develops an automatic and accurate system for cocoa plant disease detection, recognition, and pesticide recommendation.
The advancement of machine learning technology, particularly, deep learning has paved the way for researchers to focus on the field of agriculture for disease detection of crops and precision farming [9].Deep learning, utilizing advanced image processing and data analysis techniques, offers promising results by mimicking human brains through artificial neural networks [10][11][12][13][14].Its implementation in agriculture aims to enhance food security by reducing losses and improving crop production efficiency.Hence, this paper proposes a methodology for cocoa plant disease detection and recommendation system based on deep learning techniques.The proposed system is trained on the various characteristics of the disease and hence it provides automatic, accurate, and timely decisions on the disease.Thus, it overcomes the drawbacks of the manual methods.The following are the significant contributions of the authors: • Cocoa disease identification and recommendation Mobile application, which will provide farmers with the ability to diagnose diseases quickly and accurately in their cocoa plantations.
• Development of a deep learning model that can differentiate different types of diseases caused by different pests and pathogens in cocoa plantations.
• A recommendation system to assist farmers in preventing the spread of diseases, by suggesting pesticides based on the type of disease identified.The remaining content of the paper is divided into the following sections.A thorough literature review of the existing techniques is given in section 2. Next, the proposed solution for the cocoa plant disease detection and pesticide recommendation is presented in section 3. The results of the experiments carried out are given in section 4. Finally, the conclusion and future enhancements are discussed in section 5.

Related work
A thorough study was conducted on the existing techniques in the area of cocoa disease detection, and their respective literature reviews are presented in this section.
Precision agriculture or smart farming helps in increasing the yield of the crops and has made farming easier.Advancements in the field of technology have made smart and precision agriculture possible.There exist several mobile applications for agriculture that help farmers to select crops, sell their crops, predict climatic conditions, and market value [15,16].There are two commercially available Mobile applications namely Plantix and Cashew Protect for the diagnosis of plant diseases [17,18].The Plantix mobile application helps to identify pests, diseases, and nutrient deficiencies affecting plants or crops.While Plantix is a great application, it's important to note that it currently doesn't support cocoa crops.The application's database primarily focuses on major agricultural crops and common garden plants.So, if a farmer is facing issues with their cocoa crops, Plantix might not be able to provide an accurate diagnosis or treatment recommendations.Cashew Protect is a mobile app developed by the Indian Council of Agricultural Research (ICAR) to help cashew farmers in India.It uses vision-based artificial intelligence (AI) technology to detect pests, diseases, and nutrient deficiencies in cashew trees.This application is currently optimized for cashew varieties and conditions in India.Its effectiveness in other regions or with different cashew types might be lower.It is observed that there are no mobile applications available for disease identification and pesticide recommendation.
Machine learning and deep learning techniques are extensively applied in plant disease detection and recognition.They help in developing automated systems and thus produce accurate and quick results.Elhassouny A and Smarandache F [19] developed a mobile application to detect diseases in tomato leaf.They trained a deep learning model with 7000 images of plants and obtained a disease recognition accuracy of 88.4%.This low accuracy was due to the less number of images in the dataset.Deep learning techniques give good accuracy when trained with a large number of images.Sandra et al [20] developed a smartphone application aimed at detecting cocoa diseases.This is achieved through image analysis and classification using Convolutional Neural Networks (CNN).However, a drawback of the proposed application is its primary focus on the identification of Black Pod and Swollen Shoot diseases, while failing to identify other diseases affecting cocoa plants.Richard et al [21] developed integrated deep learning model into the mobile application to identify diseases of cocoa plant.Four different models of CNN models, specifically CenterNet ResNet 50 V2, EfficientNet D0, SSD MobileNet V2, and SSD ResNet50 V1 FPN, were trained for this purpose.It was observed that the most effective and fastest model was MobileNet V2 with a detection accuracy of approximately 88.0%.However, this accuracy is insufficient for the real-world usage of the application by the farmer.
Harivinod et al [22] have developed an application named Cocoa-care which detects the diseases of cocoa crops.This mobile app is developed using image processing techniques where the input is the cocoa image and the output is the identified disease.Despite its notable benefits, the paper does acknowledge a limitation which is the inability of Cocoa-care to distinguish between non-cocoa and cocoa images.Consequently, this drawback restricts the application's ability to provide tailored recommendations regarding pesticide usage and the incorporation of organic methods.Basri et al [23] created a mobile image processing application capable of identifying the early symptoms of pests and diseases affecting cacao fruits.Deep learning techniques were employed to develop this application.The cocoa images in the dataset were processed by a deep learning system, which transformed them into features for comparison with the input image captured through a mobile camera.However, a limitation of this application is its focus on solely identifying the early symptoms of pests and diseases in cacao fruits, without providing classification specifically for the affected fruits.
Lopes et al [24] conducted a comparative analysis between deep learning based computer vision and a traditional computer vision system for the classification of cocoa beans into various varieties.The deep learning based approach utilized Resnet18 and Resnet50 models, whereas the simple computer vision approach employed Support Vector Machine and Random Forest algorithms for machine learning.However, a notable restriction of this research is its focus solely on classifying different varieties of cocoa beans, without encompassing the classification of diseases affecting the cocoa plants.Yusof et al [25] have developed a mobile application called M-DCocoa, which facilitates the diagnosis of cocoa plant diseases and offers suitable advice or treatments based on user responses to specific questions.The system was created utilizing a rule-based approach and a forward chaining reasoning method.Nevertheless, a significant constraint of this design is the absence of image processing capabilities for recognizing cocoa plant diseases.Additionally, it is suggested that the application's inference engine be updated to incorporate more advanced techniques such as fuzzy logic or neural networks.
It was observed in the literature survey that there is no mobile application for disease detection and pesticide recommendation for cocoa plants.The existing methods focus on the diagnosis of a single specific disease and the accuracy obtained is insufficient to use the system in real-time.Furthermore, there is no method to distinguish between cocoa and non-cocoa images.The pesticide recommendation system for the identified disease is also required.Hence, this work proposes a deep learning and computer vision-based system that can distinguish between cocoa and non-cocoa images and accurately recognize the disease of the cocoa plant.A pesticide is also recommended to the farmer based on the identified disease.

Proposed methodology
The proposed methodology for cocoa plant disease detection and pesticide recommendation system is shown in figure 2. It uses a three-step approach to recommend the appropriate pesticides for the detected diseases.The steps include: (1) Data preparation (2) Applying deep learning algorithm (3) Pesticide recommendation.Each of these steps involves several functions as described below.

Data preparation
This step involves the preparation of data for training deep learning models.It involves several tasks like capturing the image, annotation, splitting the data into a test set, train set, and validation set, and then augmenting the training set.

Image dataset
This step involves capturing digital images of cocoa plant leaves, pods, and stems using the camera.The obtained images are stored in the database for further processing.

Image annotation
It is the process of labelling or adding metadata to images.It involves marking objects or regions of interest within an image to provide context and understanding for computer vision algorithms.Here, we have labelled each set of images according to the diseases, i.e., anthracnose, monilia, sana, fito, black pod, and stem canker.

Data splitting
The image dataset is divided into training, validation, and testing sets with a percentage of 80%, 10%, and 10% respectively.This split-up of the dataset was used in the current work as it attained higher classification accuracy when compared to other split-up ratios.The train and validation sets are used to train the model in identifying the disease of the cocoa plant.The test set is utilized to assess the performance of the trained model in disease recognition on unseen samples.

Augmentation
This step involves the creation of new image samples by applying various geometric or intensity transformations to existing images.This technique is required to artificially increase the size of a training dataset to improve classification accuracy.This will help in improving the model's recognition ability and robustness by introducing • Rotation: The image is rotated by a random degree.This simulates how objects might appear at various orientations.For example, an object may be tilted slightly in a photograph due to the camera angle.
• Cropping: A section of the image is randomly cropped.This mimics scenarios where objects may be partially occluded or when the camera zooms on a specific area of interest.
• Scaling and Resizing: This involves either scaling up or down the size of the image.It simulates variations in object size and camera distance.For instance, an object may appear larger if it's closer to the camera.
• Brightness/Contrast Adjustment: This adjusts the brightness and contrast of the image.It mimics changes in lighting conditions, such as when an image is taken in bright sunlight or dim indoor lighting.
• Noise: Adds random noise to the image.This simulates sensor noise or imperfections that can occur during image capture.Gaussian noise is a type of noise that follows a Gaussian distribution, commonly seen in electronic imaging systems.

Apply deep learning algorithms
In this work, deep learning techniques are used for classification as they can recognize complex patterns in the disease through the hierarchical processing of image data.This helps in developing an accurate and automatic method for the classification of plant diseases.To overcome the limitation of Cocoa-care [22], the YOLOv8 model [26] is trained on Roboflow platform to distinguish between cocoa and non-cocoa images.This ensures that the model learns from a focused set of cocoa-specific examples, optimizing its ability to accurately detect and classify cocoa plants.This also minimizes the risk of the model being distracted by non-cocoa plant features.This training approach results in a more accurate and reliable cocoa detection system, which is a crucial requirement for the application's effectiveness in real-world scenarios.If the image is identified as a cocoa image, the disease detection model is then executed and it displays the cocoa disease class.However, if the image is not a cocoa image, then the predicted class is 'null' as shown in figure 3.
Next, to identify the type of disease, the deep learning model is trained with cocoa images in the train set to recognize diseases.Then the working of the trained model is tested by presenting images to the model from the test set.The trained deep learning model will predict the type of disease for the given cocoa plant image.Then the effectively working deep learning model is deployed into the mobile application.This mobile application called 'Cocoa Vision' for cocoa plant disease detection and pesticide recommendation is developed using Flutter.
The current work employs six different deep-learning models for the task of identifying cocoa diseases.Six deep learning-based classifiers are used separately to test their effectiveness in disease classification.Specifically, the Traditional Conv2D, ResNet50, VGG16, MobileNetV2, InceptionV3, and EfficientNetB1 [27,28] were used in the experiments.These classifiers have been trained on a dataset consisting of seven classes: six classes for cocoa diseases, namely 'ANTHRACNOSE', 'BLACK POD ROT', 'FITO', 'MONILIA', 'SANA', 'STEM CANKER', and 'HEALTHY COCOA'.The system takes an image of cocoa as an input and outputs information about the type of disease present, as well as its region within the image.The working principle of all these six deep learning models used in this work is given here:

Traditional Conv2D
Conv2D is a commonly used layer in CNN for image recognition and classification tasks.The Conv2D layer uses a set of filters on the input image to extract features at different levels of abstraction.

ResNet50
It is a deep learning architecture that uses residual connections to enhance the training performance of deep neural networks.ResNet50 is a variation of the ResNet architecture that has 50 layers and has achieved good results in a variety of computer vision tasks.

VGG16
It is another popular deep-learning based architecture that uses convolutional layers for image recognition and classification.VGG16 is a specific variant of the VGG architecture that has 16 layers and has been used extensively in computer vision research.

MobileNetV2
It is a deep learning architecture used for mobile and embedded devices, which typically have limited computational resources.MobileNetV2 uses separable convolutions depth-wise to optimize the parameters and computations required in the training phase, while achieving high accuracy on image recognition tasks.

InceptionV3
This is a family of deep learning architectures that use a combination of different convolutional filters to extract features at multiple scales.InceptionV3 is a specific variation of the Inception architecture that has achieved excellent results on a variety of computer vision tasks.

EfficientNetB1
It is a CNN architecture used to enhance neural network models by improving depths, breadth, and precision.It evenly scales up resolution, width and depth using a compounded coefficient.
In the proposed work, various libraries were employed in the machine learning training process.These helped in providing different functionalities required for training the deep learning model efficiently.Libraries used in this work are NumPy, TensorFlow, Keras, Matplotlib, Pandas, and Sklearn.It was observed through the experiments that EfficientNetB1 outperformed all other classifiers in the training phase.Hence, the proposed method adopted this model for disease classification.
EfficientNetB1 is a convolutional neural network built upon a concept called 'compound scaling.'This concept addresses the longstanding trade-off between model size, accuracy, and computational efficiency.The idea behind compound scaling is to scale three essential dimensions of a neural network: width, depth, and resolution.Figure 4 depicts the scaling methods used in the EfficientNetB1 architecture.
• Baseline: The baseline model's dimensions (depth, width, resolution) are established here.
• Width Scaling: Demonstrates increasing the width (number of channels) of each layer without changing the resolution or depth.This helps the network capture more detailed features within the same receptive field size.
• Depth Scaling: Illustrates an increase in the number of layers (depth) which enables the network to learn more complex features and representations.
• Resolution Scaling: Shows an increase in the input image size (resolution).Higher resolution allows the network to perceive finer details in the input image.
• Compound Scaling: This is the combined approach that EfficientNetB1 uses, scaling width, depth, and resolution in a balanced way as determined by the compound coefficient.This holistic scaling helps maximize the efficiency and effectiveness of the model across all dimensions.
EfficientNetB1 uses Mobile Inverted Bottleneck (MBConv) layers, which are a combination of depth-wise separable convolutions and inverted residual blocks as shown in figure 5. Additionally, the model architecture uses the Squeeze-and-Excitation (SE) optimization to further enhance the model's performance.The MBConv layer starts with a depth-wise convolution, followed by a point-wise convolution (1 × 1 convolution) that expands the number of channels, and finally, another 1 × 1 convolution that reduces the channels back to the original number.This bottleneck design allows the model to learn efficiently.In addition to MBConv layers, EfficientNetB1 incorporates the SE block, which helps the model learn to focus on essential features and suppress less relevant ones.The SE block uses global average pooling to reduce the spatial dimensions of the feature map to a single channel, followed by two fully connected layers and a Swish activation function to output the class probabilities.To optimize the performance of the model, the Adam optimizer and categorical crossentropy loss function are used during training.The model contains different types of layers such as input layer, rescaling and normalization, convolution, batch normalization, activation layer, SE blocks, dropout, additive and zero padding.Each layer in the model receives weighted input, transforms it with a set of functions and then passes these values as output to the next layer.Overall, the model uses 345 layers.Each layer has a varied number of filters.The total number of filters included in all the layers is 37472.The model consists of 6,909,837 parameters out of which 6,845,222 are trainable parameters.The EfficientNetB1 model is trained with a total of 4908 images (80%) out of which 614 images are original images and 4294 images are augmented images.The model is validated with 76 images (10%) and tested with 76 images (10%).

Pesticide recommendation
A user submits an image of a cocoa plant to the system, the deep learning model then analyses the image to determine whether it is a cocoa image.If it is a cocoa image then the model identifies the type of disease based on its training data.After the disease identification, the model retrieves information on the recommended pesticides for that particular disease and displays it to the user as shown in table 1.This information is gathered from a database that contains data on different pesticides available in the market and their effectiveness in treating specific cocoa diseases.By providing the user with information on the  recommended pesticides, the model aims to assist cocoa farmers or anyone involved in cocoa cultivation in making correct decisions about disease management.It enables them to take appropriate measures to treat the identified disease, potentially minimizing crop losses and maintaining healthy cocoa plants.

Experimental results
The Cocoa dataset for training the model was collected from various sources such as Kaggle [29], Harvard website [30], and from researchers at Central Plantation Crops Research Institute, Puttur, Karnataka, India [31].It consists of images of 6 Classes of cocoa diseases and one healthy cocoa class.The different classes included are 'ANTHRACNOSE', 'BLACK POD ROT', 'FITO', 'MONILIA', 'SANA', 'STEM CANKER' and 'HEALTHY'.A total of 764 images were collected and images in each class are shown in table 2. All these images are in .jpegformat and these image are resized to 224 × 224 and normalized for further processing.
Next, the original dataset consisting of 764 images was split into training, validation, and testing in the ratio 80:10:10.split ratios like 60:20:20, 65:18:17, 70:15:15, and 75:13:12.But none of these ratios yielded the best accuracy.Ultimately, the model achieved the highest accuracy when trained on an 80:10:10 dataset split for training, testing, and validation.This split ratio was chosen as the final ratio due to its superior performance.Thus, as per this split ratio, the training set had 612 images, the validation set had 76 images and the testing set had 76 images as shown in figures 6 and 7.The 'HEALTHY' class was also included in the dataset as shown in table 2. Among 612 images in the training set, 89 were of the 'HEALTHY' class.Including variety of cocoa plant images, including healthy specimens, in training enables the model to develop a nuanced understanding of healthy plant characteristics.This approach helps the model distinguish between healthy and diseased cocoa plants and establishes a solid baseline for healthy specimen identification.Such comprehensive training significantly boosts the model's disease identification accuracy while reducing false positives.
To achieve optimum accuracy when training a deep learning model, it is generally beneficial to have a sufficiently large and balanced dataset, especially when the number of samples per class is limited.When the number of images per class is low, it can lead to several challenges during training such as imbalanced classes, overfitting, and limited variability.The imbalanced dataset can result in the model being biased towards the majority class and performing poorly on the minority class.Overfitting leads to a situation where the model becomes too specialized in recognizing the images in the training data but fails to recognize well unobserved data.
A small dataset may have limited variability in terms of different perspectives, angles, lighting conditions, or object orientations.This can hinder the ability of the model to handle unseen variations in testing or deployment phases.Hence, data augmentation was used in this work to address this issue by generating additional samples in the training dataset with various transformations such as flip, rotation, scale, brightness change etc.These transformations introduced variations in the data, effectively expanding the variety and volume of the dataset.Several parameters were used in training the models.For instance the training of EfficientNetB1 included parameters such as number of epochs (15), the patience value (1), the stop_patience value (3), the threshold value (0.9), the factor value (0.5), the dwell flag (True), the freeze flag (False), and the number of batches (train_steps).A callback named 'LRA' is created, which is used for regulating the learning rate based on monitored values such as accuracy or loss.This callback is initialized with the defined parameters.The LRA callback's 'epochs' attribute is set to the total number of epochs (15) to determine the value of the last epoch for    The trained deep learning models were used for the classification of cocoa diseases.The performance of different classifiers was determined using the accuracy metric as given below: Where, n represents the number of image samples and the condition [K] outputs 0 when the expression is false and 1 otherwise.y i and z i variables represent the actual and predicted output labels of the given sample, respectively.The accuracy of training and validation obtained for the different models on the augmented dataset are shown in table 3.In the training phase, a high classification accuracy of 99.79% and validation accuracy of  99.83% were obtained for the EfficientNetB1 model.The model with the least performance is VGG16 as it is evident from the huge difference between accuracy and validation accuracy that it was overfitted.
The experiment was also carried out on a non-augmented dataset to understand the model's performance.The accuracy of training and validation obtained for the different models on the augmented dataset are shown in table 4.
It was observed that all the models could not achieve satisfactory results when trained on a non-augmented dataset.The lack of diversity in the training data hindered the model's ability to generalize to unseen scenarios, leading to poor performance, particularly in handling variations in object orientation, lighting conditions, and occlusions.However, upon augmenting the dataset with techniques such as flipping, rotation, cropping, scaling, and brightness adjustments, the performance of the model significantly improved.The augmented dataset provided a richer and more varied set of training examples, enabling the model to learn robust features and patterns that generalize better to real-world scenarios.As a result, the model exhibited improved accuracy in its predictions, demonstrating the crucial role of data augmentation in enhancing model performance.The time taken in training different models was also analysed as shown in figure 12.It was observed that EfficientNetB1 took less time for training when compared to other models.
Further, the performance analysis was carried out on EfficientNetB1 model as it proved to be the best classifier when compared to other classifiers in the study.The performance analysis was carried out using the confusion matrix and metrics like accuracy, precision, recall, F1-score.A confusion matrix helps in assessing the effectiveness of a classification model.It gives information on the predicted and actual class labels  obtained from a classification task.It is represented as a matrix, where the rows give the actual class labels, and the columns indicate labels of the predicted class as shown in figure 13.Each element in the confusion matrix represents the count or proportion of data points that fall into a particular combination of predicted and actual classes.The data presented in the confusion matrix as shown in figure 13 is derived from an independent test set consisting of 76 images.Experimenting with independent test set images aids in preventing overfitting problems by offering an impartial assessment of the model's performance on new, unseen data.By excluding the testing set from the training phase, the model cannot memorize these particular instances, compelling it to generalize its knowledge to novel examples.This approach guarantees that the model's performance metrics, better reflect its capacity to handle real-world data rather than merely memorizing the training set.The following are the key components of a confusion matrix: True Positives (TP): The number of images correctly classified as positive.
True Negatives (TN): The number of images correctly predicted as negative.
False Positives (FP): The number of images incorrectly predicted as positive when they actually belong to the negative class.
False Negatives (FN): The number of images incorrectly predicted as negative when they actually belong to the positive class The confusion matrix reveals instances where Anthracnose images are misclassified as Monilia and Black pod rot images are misclassified as Stem cranker.These misclassifications are due to a few confusing disease features and too much brightness in the image.To have a thorough analysis of EfficientNetB1 model's performance, the following classification performance measures were computed based on the confusion matrix [32] and their values are shown in table 5.
Accuracy: The correct classifications made by the model is calculated as TP TN TP TN FP FN 2 The EfficientNetB1 achieved overall accuracy of 97.36%.This model is integrated with the developed mobile application called Cocoa Vision to classify the disease.This application is developed using the Flutter framework    The 'Detect Disease' option provides the functionality for disease identification.The user can either select an image present in the gallery or click the picture of the affected part in the cocoa crop for the upload as shown in figure 15(a).The identified disease is displayed and the appropriate pesticides are shown on clicking the solution button.Referring to these methods, the farmer can take the necessary actions as shown in figure 15(b).Besides these, users can also get to know the benefits of cocoa and the growth requirements for the cocoa crop.
A comparative performance analysis was carried out to demonstrate the effectiveness of manual and proposed methods.A test was conducted on 76 samples, and the outcomes of a few samples are presented in table 6.A farmer was asked to identify the disease in 76 samples.Trained deep learning models were also tested on the same set.A comparative analysis against manual methods highlights the proposed system's advantages, illustrating its ability to improve accuracy, and reduce resource expenditures.This evidence underscores the system's practical application, and its potential to revolutionize disease management in cocoa cultivation, paving the way for sustainable agricultural practices.The current manual methods inadequately detect diseases, resulting in lower accuracy during testing.Statistical evidence is also provided using the accuracy metrics that quantify the results of classification as shown in figure 16.
The performance of the proposed method based on EfficientNetB1 was also compared with the existing techniques to illustrate the superiority of the proposed method as shown in table 7. It was observed that the proposed method achieved 99.8% and showed superior performance when compared to existing methods.This is because the method uses YOLOv8 model to differentiate between Cocoa and Non-Cocoa images.Furthermore, it uses the best performing EfficientNetB1 model for the classification of diseases.The method proposed by Sandra K et al [20] achieved 80% accuracy as it is primarily focused on identified Black Pod and Swollen Shoot diseases.It could not identify all other classes accurately.The method developed by Harivinod N et al [22] showed lower performance as it could not recognize real-time variations in the images.Basri et al [23] could recognize only diseases of cocoa fruits and not any other diseases of a cocoa plant.
To overcome the drawback of Cocoa-care developed by Harivinod N et al [22], the YOLOv8 model was trained on the Roboflow platform to differentiate between Cocoa and Non-cocoa images.The total images in the dataset used with YOLOv8 model consisted of 1620 images out of which 764 belonged to Cocoa and 856 images belonged to Non-cocoa images.It was split in the ratio 80:10:10 for train, test, and validation sets respectively.Augmentation techniques were applied to the training set to increase the volume of the dataset and model's performance.The number of images in the train, validation, and test sets are shown in table 8. Table 7.Comparison with the existing methods.

Method Accuracy
Sandra K et al [20] 80.89% Harivinod N et al [22] 71.42% Basri et al [23] 76.31% Proposed method 97.36% The trained YOLOv8 model is deployed on the mobile application.When the user presents an image to the application, it first uses YOLOv8 model to determine whether the given image is Cocoa or Non-Cocoa.If it is Non-Cocoa then the message is displayed as 'No cocoa found in the image' as shown in figure 17(a).If it is identified as a Cocoa image, then the EfficientNetB1 model is applied to identify the disease as shown in figure 17(b).The model achieved good performance in differentiating between Cocoa and Non-Cocoa images with accuracy of 96.5%, precision of 92.7%, recall of 91%, and F-score of 91.84%.

Conclusion and future work
This paper proposed a cocoa plant disease detection and pesticide recommendation system as an effective tool for the early detection and treatment of diseases in cocoa plants.The proposed method uses deep learning-based disease detection along with the mobile application-cocoa vision.The system employs image processing and deep learning techniques to accurately classify different diseases affecting cocoa plants and recommends appropriate pesticides for their treatment.The proposed model has acquired an accuracy of 97.36%.The highest accuracy obtained by the model EfficientNetB1 in disease classification demonstrates its potential for widespread use in the cocoa research community.The proposed system can assist farmers in the timely detection of plant diseases, preventing yield losses, and reducing the use of inappropriate pesticides.Thus, the system can promote sustainable agriculture practices and contribute to the long-term viability of the cocoa farming community.Further, the proposed system can be enhanced by providing weather information of the cropland for pesticide application, regional languages in the mobile application to enable easy access to farmers, and classification of diseases under the pathogens category.

Figure 2 .
Figure 2. Block diagram of the disease detection and recommendation system.

Figure 3 .
Figure 3. Classification of cocoa and non-cocoa images: (a) cocoa image predicted as cocoa (b) guava fruit predicted as non-cocoa.
This augmentation resulted in 4098 images in training dataset as shown in figure 8. Furthermore, the dataset was balanced to avoid bias as shown in figure 9 and the hold-out cross-validation technique was used to evaluate the model's performance.This method involves dividing the dataset into distinct subsets to facilitate effective training, hyperparameter tuning, and unbiased performance assessment.By allocating a significant portion of the data to training, the model can grasp intricate patterns.Ensuring reproducibility through a random seed enhances performance evaluation consistency across multiple runs.The augmented training set consisting of 4098 images were used to train for training deep learning models to classify the disease.By including augmented samples, the model is exposed to a larger and more diverse set of examples, which helps in improving the model's performance.The augmented data provides more variations and challenges for the model to learn from, enabling it to better handle different inputs and real-world scenarios.In this work, six different deep learning models namely Conv2D, ResNet50, VGG16, MobileNetV2, InceptionV3, and EfficientNetB1 were trained for the task of classifying cocoa diseases.

Figure 9 .
Figure 9. Distribution of classes in an augmented training dataset(4098 images).

Figure 12 .
Figure 12.Time complexity comparison of different models.
(a).The application's homepage is shown in figure 14(b), and it displays three options: (a) Detect Disease (b)Health Benefits of Cocoa (c) Growth Requirements of Cocoa.

Figure 16 .
Figure 16.Performance comparison of manual method and deep learning models.

Table 1 .
Pesticide recommendations for cocoa diseases.

Table 3 .
Training and validation accuracy of models on augmented dataset.

Table 4 .
Training and validation accuracy of models on nonaugmented dataset.

Table 5 .
Classification performance of EfficientNetB1.Recall: It evaluates the model's ability to identify positive classes correctly and is calculated as given below: Precision: It shows the model's ability to avoid FP predictions and is calculated as given below:F1 Score: It computes mean of recall and precision.It provides a balanced measure of the model's performance by considering both precision and recall, calculated as

Table 6 .
Recognition of cocoa diseases using manual method and deep learning models.

Table 8 .
Dataset used for YOLOv8 model.