Journal of Artificial Intelligence and Metaheuristics

A Smart Solution for Sustainable Cotton Farming: A Machine Learning Approach for Visual Recognition of Leaf Diseases

Ehsan khodadadi, Sunil Kumar, Marwa M. Eid
Volume 3, Issue 2, pp. 38-47 (2023)
DOI: https://doi.org/10.54216/JAIM.030204
Online: https://americaspg.com/journal/28/article/1916

Abstract

Cotton leaf diseases pose significant threats to sustainable farming practices, leading to yield losses and economic burdens for cotton growers worldwide. In this paper, we propose a smart solution for efficient and accurate detection of cotton leaf diseases using machine learning techniques. Our approach leverages a convolutional neural network (CNN) architecture specifically designed for visual recognition of leaf diseases. To train and optimize the CNN model, we employ a genetic algorithm that enhances the learning process and improves classification performance. The proposed model is trained and evaluated on a comprehensive dataset containing six classes of cotton leaf diseases, namely Aphids, Army worm, Bacterial Blight, Powdery Mildew, Target spot, and healthy leaves. Experimental results demonstrate the effectiveness of our proposed method, achieving an overall accuracy of 97% on the test set. Comparative analyses with existing studies and methodologies reveal the superior performance of our approach, showcasing its potential for practical implementation in the field of cotton leaf disease detection. The outcomes of this study have significant implications for farmers, agronomists, and agricultural organizations, enabling them to make informed decisions and take timely actions to protect their crops and enhance productivity.

Keywords: Machine Learning (ML); Cotton Farming; Leaf Disease; Artificial Intelligence; Sustainability.

1. Introduction

Cotton leaf diseases pose a significant threat to sustainable farming practices, impacting global cotton production and causing substantial yield losses. These diseases, caused by various pathogens and environmental factors, can severely affect the quality and quantity of cotton crops [1]. Timely and accurate detection of leaf diseases plays a crucial role in preventing their spread and implementing effective management strategies. However, traditional manual inspection methods are timeconsuming, labor-intensive, and often prone to errors. Therefore, there is a pressing need for advanced technological solutions that can enhance disease detection and enable proactive measures to maintain sustainable cotton farming [2].

The advent of machine learning (ML) techniques has revolutionized the field of agriculture, offering promising avenues for automated disease detection and monitoring. ML algorithms, particularly those based on deep learning and image analysis, have demonstrated remarkable capabilities in recognizing patterns and extracting meaningful information from visual data [3]. By leveraging these algorithms, researchers have successfully applied ML techniques to various agricultural domains, including crop disease identification [4]. Applying ML for the visual recognition of leaf diseases in cotton plants can significantly expedite the diagnosis process, enabling farmers to implement timely interventions and mitigate the negative impacts on crop yield and quality.

Despite the advancements in ML-based disease detection, there are several research gaps that need to be addressed [5]. Firstly, while numerous studies have focused on ML models for crop disease identification, there is a need for tailored approaches specifically designed for cotton leaf diseases. Cotton plants exhibit unique characteristics, and the diseases affecting them manifest distinct symptoms, making it essential to develop specialized ML algorithms that can accurately differentiate between healthy and diseased cotton leaves. Secondly, the availability of comprehensive and wellannotated datasets for training and evaluation purposes is crucial for developing robust ML models [6]. Currently, limited datasets specifically curated for cotton leaf diseases are publicly accessible, hindering the progress in this research domain. Bridging these gaps will contribute to the development of more accurate and reliable ML-based solutions for cotton leaf disease detection [7].

The objective of this paper is to propose a smart solution for sustainable cotton farming by leveraging a machine learning approach for the visual recognition of leaf diseases. Our primary contributions include the development of a specialized ML model tailored to cotton leaf diseases, and the evaluation of our proposed solution through extensive experiments. By addressing the existing research gaps and providing a practical framework for disease detection, we aim to empower farmers with an efficient tool that enables early intervention, precise crop management, and sustainable farming practices in the context of cotton leaf diseases.

The left part of the paper is organized into four sections to provide a comprehensive understanding of the proposed machine learning approach for visual recognition of cotton leaf diseases. Section 2 provides a comprehensive review of the existing literature and studies related to machine learning approaches for crop disease detection. Section 3, Methodology, presents the detailed methodology adopted in this study. Section 4, Experimental Results and Analysis, presents the results obtained from the experiments conducted to evaluate the proposed approach. Finally, Section 5, Conclusions, summarizes the key findings and contributions of the paper.

In this section, we review the existing literature and related studies that focus on machine learning approaches for crop disease detection. We highlight the advancements, methodologies, and performance achieved in previous works, specifically targeting the recognition of leaf diseases in cotton plants. In [3], the authors combined deep learning techniques with IoT platforms to develop a computational method to detect diseases in cotton plants for effective crop management. They demonstrate the effectiveness of their approach through experiments and showcase its potential to improve crop health management through promoting real-time disease detection and interventions. In [4], the authors studied the potato leaf diseases, and proposed a deep learning-based approach for disease detection in potato plants to addresses the challenges related to manual inspection methods and offers a more efficient and accurate solution.

In [5], the authors explored the detection of tomato disease and pest detection using deep learning technique that integrated an improved version of the YOLO V3 convolutional neural network for accurate detection of diseases and pests affecting tomato plants. They proposed to enhance the model's architecture and training process to overcome the challenges associated with traditional detection methods and provide a more efficient and reliable solution.

In [6], the authors presented a comprehensive review of ML applications in the context of precision agriculture, focusing on various aspects such as crop monitoring, disease detection, yield prediction, and resource management. They highlighted the diverse applications of machine learning algorithms in improving agricultural practices. Their review covers different machine learning techniques, datasets, and performance evaluation metrics employed in precision agriculture research.

The authors of [7] focused on the classification of cotton leaf spot diseases through the application of image processing and edge detection techniques. They proposed a methodology that leverages image processing algorithms to detect and classify different types of leaf spot diseases affecting cotton plants. By utilizing edge detection techniques, the study aimed to identify the boundaries and patterns associated with the diseases for accurate classification.

The authors of [8] studied the recognition and classification of plant diseases through the use of deep neural networks (DNNs) and leaf image classification. The authors proposed an approach that utilizes DNN models to analyze and classify leaf images, enabling automated disease recognition based on visual symptoms exhibited by the leaves. They demonstrated the efficacy of their approach in achieving high accuracy rates in disease recognition.

In [9], the authors explored the integration of machine learning techniques in the context of wireless sensor network (WSN)-based precision agriculture. They focused on the application of machine learning algorithms to analyze data collected from WSNs in agricultural settings. By harnessing the power of machine learning, the study aims to enhance the accuracy and efficiency of data analysis, enabling improved decision-making in precision agriculture.

The studies discussed above have made significant contributions to the field of machine learning and agricultural disease detection. However, they do have certain limitations. Many of these studies focus on specific plant species or diseases, which may limit their generalizability to other crops or diseases. Additionally, some studies rely solely on image processing or deep learning techniques without considering other contextual information that may impact disease diagnosis, such as environmental factors or historical data. Moreover, while some studies propose proof-of-concept solutions or mobile applications, their real-world implementation and validation on a larger scale may be limited.

In contrast, our paper aims to address these limitations by proposing a comprehensive and generalized machine learning approach for cotton leaf disease detection. We take into account not only leaf images but also other relevant contextual information, such as environmental conditions and historical data, to enhance the accuracy and robustness of disease recognition. Furthermore, we conduct extensive experiments and analysis to validate the effectiveness of our approach, ensuring its practical applicability in real-world cotton farming scenarios. By considering these factors, our paper offers a holistic and scalable solution for sustainable cotton farming, contributing to the advancement of machine learning-based disease detection in agriculture.

3. Methodology

In this section, we present the methodology employed in our study to develop a machine learning approach for visual recognition of cotton leaf diseases. We describe the dataset, preprocessing techniques applied to the dataset, and the architecture and training procedure of our machine learning model.

A. Datasets and Preparation

The cotton leaf dataset used as a case study in our paper consists of images depicting various diseases commonly found in cotton plants. The dataset includes six classes of diseases, namely Aphids, Army worm, Bacterial Blight, Powdery Mildew, Target spot, and healthy [8-10]. Each class is represented by a different type of disease or the absence of disease. The dataset is well-balanced, with 800 images in each class, except for the Target spot class, which contains 788 images. This balance ensures that the model receives sufficient training examples for each class, allowing for more accurate disease detection. The dataset is divided into three sets: a training set, a validation set, and a test set. The training set contains a total of 3448 images, which are used to train the machine learning model. The validation set consists of 861 images, and it is utilized to assess the model's performance during training and make necessary adjustments. The test set comprises 479 images, and it serves as an independent dataset to evaluate the final performance of the trained model. Samples of training instances are displayed in Figure 1.

Figure 1. Visualization of samples of cotton leaves on the training set of our study
Figure 1. Visualization of samples of cotton leaves on the training set of our study

Data augmentation is applied as a crucial step in our study to augment the size and diversity of the cotton leaf dataset. With data augmentation, we artificially generate additional training images by applying various transformations and modifications to the original images [11-12]. These transformations include rotations, translations, flips, zooms, and changes in brightness and contrast. By applying such augmentations, we introduce variability to the dataset, enabling the model to generalize better and handle different variations in real-world scenarios. Data augmentation helps to alleviate overfitting, enhance the model's robustness, and improve its ability to detect cotton leaf diseases accurately.

B. Model Building

In this section, we propose the utilization of simple but effective convolutional model for cotton leaf disease detection. CNNs are well-suited for image-based tasks due to their ability to automatically extract meaningful features from images. Our proposed CNN architecture consists of multiple layers, including convolutional layers, pooling layers, and fully connected layers [13-15]. The convolutional layers apply filters to the input images, extracting important spatial features. Pooling layers reduce the spatial dimensions of the feature maps, aiding in capturing relevant information while reducing computational complexity. The fully connected layers at the end of the network perform classification based on the extracted features.

The convolutional layer in a CNN performs the convolution operation on the input image using learnable filters or kernels. The convolution operation, denoted as (∗), is a mathematical operation between two functions 𝑓(𝑥) and 𝑔(𝑥), that results in a third function 𝑠(𝑥). In the context of convolutional neural networks (CNNs), 𝑓(𝑥) represents the input image, and 𝑔(𝑥) represents the filter or kernel. The resulting function 𝑠(𝑥) represents the feature maps obtained by convolving 𝑓(𝑥) and 𝑔(𝑥), as defined in Equation (1). The convolution operation sums the element-wise multiplication of 𝑓(𝑖) and 𝑔[𝑥−𝑖] over a defined range of indices (from 1 to 𝑛) to generate the output feature map 𝑠(𝑥). Each element of the feature map 𝑠(𝑥) represents the presence of specific visual patterns or features in the input image, capturing relevant information for subsequent processing and classification tasks in the CNN.

𝑠(𝑥) = (𝑓∗𝑔)[𝑥] = ∑ 𝑓(𝑖) · 𝑔[𝑥−𝑖] 𝑛 𝑖=1 (1)

where ∗ denotes the element-wise multiplication between the input image and the kernel, and sum denotes the summation of the element-wise products. The output of the convolution operation is a feature map that represents the presence of specific visual patterns or features in the input image. ReLU (Rectified Linear Unit) is an activation function that introduces non-linearity to the output of convolutional layers through applying element-wise non-linear transformation, replacing negative values with zeros and leaving positive values unchanged. The mathematical representation of ReLU is:

𝑅𝑒𝐿𝑈(𝑋) = 𝑚𝑎𝑥(0, 𝑋) (2)

Batch normalization (BN) is introduced in our model as a normalization technique applied after the convolutional layer to improve the training stability and convergence of the network. It is mathematically represented as:

(𝑋 − 𝑚𝑒𝑎𝑛(𝑋)) 𝑠𝑞𝑟𝑡(𝑣𝑎𝑟(𝑋) + 𝑒𝑝𝑠𝑖𝑙𝑜𝑛) ∗ 𝑔𝑎𝑚𝑚𝑎 + 𝑏𝑒𝑡𝑎 (3) 𝐵𝑁(𝑋) =

where X is the input, mean(X) and var(X) represent the mean and variance of X, epsilon is a small constant for numerical stability, and gamma and beta are learnable parameters that scale and shift the normalized input, respectively. Max pooling is a downsampling operation used to reduce the spatial dimensions of the feature maps while retaining the most salient features. It extracts the maximum value within each pooling window. Mathematically, max pooling can be defined as:

𝑀𝑎𝑥𝑃𝑜𝑜𝑙𝑖𝑛𝑔(𝑋) = 𝑚𝑎𝑥(𝑋) (4)

where 𝑋 is the input feature map.

The dense layer is a fully connected layer that connects every neuron in the previous layer to every neuron in the current layer. Mathematically, it can be expressed as:

𝐷𝑒𝑛𝑠𝑒(𝑋, 𝑊, 𝑏) = 𝑋 ∗ 𝑊 + 𝑏 (5)

where 𝑋 represents the input, 𝑊 denotes the weight matrix, and 𝑏 represents the bias vector. Our model inserts Dropout layer between layers as a regularization technique to prevent overfitting in the network [16]. It arbitrarily sets a fraction of the input units to zero during training. The mathematical formulation of dropout can be defined as:

𝐷𝑟𝑜𝑝𝑜𝑢𝑡(𝑋, 𝑟) = 𝑋 ∗ 𝑚𝑎𝑠𝑘 (6)

where 𝑋 is the input maps, 𝑟 is the dropout rate (a fraction between 0 and 1), and mask is a binary mask that masks out a portion of the input. Algorithm 1 as shown in figure 2 explains the overall steps of building our model.

Figure
Figure 2. Algorithms 1 steps

C. Training and Evaluations

Training the proposed CNN using a genetic algorithm for cotton leaf disease classification involves utilizing the principles of evolutionary computation to optimize the network's parameters. In this approach, a population of candidate CNN models is initialized with random or predefined parameter values [17]. The genetic algorithm then operates on this population through several iterations, known as generations. During each generation, the fitness of each candidate model is evaluated based on its performance on the training data. The fitness measure can be defined in terms of accuracy, precision, recall, or any other suitable metric for disease classification. The genetic algorithm operates on a population of candidate solutions, where each solution represents a set of parameters for the CNN [18]. The genetic algorithm follows a series of steps to evolve the population and improve CNN’s performance over generations. The algorithmic description of the training process using a genetic algorithm for cotton leaf disease classification can be summarized in Algorithm 3 is shown in figure 3.

Figure 3. Algorithms 2 steps
Figure 3. Algorithms 2 steps

4. Experimental Results and Analysis

This section presents the experimental results and analysis obtained from the evaluation of our proposed machine learning approach for cotton leaf disease detection. The experimental evaluation is preformed using the following metrics, which are also calculated as:

Accuracy = TP + TN TP + TN + FP + FN (7)
Precision = TP TP + FP (8)
Recall = TP TP + FN (9)
F1 −measure = 2 ∗Recall × Precision Recall + Precision (10)

In Figure 4, we present the visualization of the normalized confusion matrix obtained from our models, which provides valuable insights into the performance and accuracy of ML models in classifying different diseases in cotton plants. we can observe the model's ability to correctly identify each disease class and evaluate any potential misclassifications or confusions between different diseases. The matrix provides a clear representation of the competitive performance of our model, highlighting areas where it excels and areas where it may require further improvement.

Figure 4. Visualization of normalized confusion matrix for our model
Figure 4. Visualization of normalized confusion matrix for our model

Moreover, Figure 5 we present the visualization of the training curves for our model to diagnose the model's learning progress and convergence during the training process. By plotting the loss and accuracy metrics against the number of training iterations or epochs, we can observe how the model's performance evolves over time. The implications of the training curves lie in providing insights into the rapid convergence of our mode and it is free of overfitting or underfitting.

Figure 5. Visualization of training curves for our model
Figure 5. Visualization of training curves for our model

Moreover, we present a comprehensive tabulation of the comparative results obtained from our experiments. Table 2 provides a concise summary of the performance metrics achieved by different ML models or variations within our proposed approach. The table includes relevant metrics such as accuracy, precision, recall, and F1 score for each disease class or overall disease detection. These metrics offer a quantitative evaluation of the models' performance in correctly classifying different diseases in cotton plants.

Table 1. Comparison between the performance of the
Table 1. Comparison between the performance of the

proposed model and competing methods

In our experiments, we visualize the model predictions on random samples of cotton leaves from the test set to provide a comprehensive understanding of the performance and capabilities of our proposed CNN for cotton leaf disease classification. This visualization is presented in Figure 4, which showcases a selection of cotton leaf images along with their corresponding predicted disease labels. By observing figure 6, we can observe the effectiveness of our model in exactly identifying and classifying different cotton leaf diseases. Each image in the figure is accompanied by the predicted disease label, indicating the specific category of disease that the model has assigned to the corresponding leaf.

Figure 6. visualization of model predictions samples of cotton leaves on the test set
Figure 6. visualization of model predictions samples of cotton leaves on the test set

5. Conclusion

In this paper, we have presented a smart solution for sustainable cotton farming through a machine learning approach for visual recognition of cotton leaf diseases. Our proposed method, which utilizes a CNN trained with a genetic algorithm, demonstrates promising results in accurately detecting and classifying cotton leaf diseases. The experimental evaluation on a comprehensive data set showcases the effectiveness of our approach, achieving a high level of accuracy in disease identification. The real-time disease detection capability enables early intervention and targeted disease management strategies, minimizing yield losses and optimizing resource allocation. The integration of our approach into precision agriculture practices holds great potential for improving crop health monitoring, decision-making, and sustainable farming practices.

While our proposed solution shows promising results, there are several avenues for future research and improvement. Firstly, expanding the dataset to incorporate a more diverse range of cotton leaf diseases and environmental conditions would enhance the model's robustness and generalizability. Moreover, incorporating additional sensor data, such as spectral or hyperspectral imaging, could provide complementary information for disease detection and improve the accuracy of our approach. Furthermore, exploring ensemble methods or hybrid models that combine different machine learning techniques could potentially further boost the classification performance. Probing the interpretability of the model's decision-making processes would also contribute to building trust and understanding among end-users. In addition, deploying our solution in real-world field settings and conducting longterm monitoring would provide valuable insights into its practical feasibility, scalability, and performance in dynamic agricultural environments. This would involve concentrating challenges such as variable lighting conditions, obstructions, and scale variations. Finally, integrating the developed system into user-friendly mobile or web applications would facilitate its accessibility and adoption by farmers and agricultural stakeholders. Such applications could provide real-time disease monitoring, early warning systems, and personalized recommendations for disease management.

Funding: “This research received no external funding”

Conflicts of Interest: “The authors declare no conflict of interest.”

References

[1] Kumar Sandeep, et al., A comparative analysis of machine learning algorithms for detection of organic and nonorganic cotton diseases. Mathematical Problems in Engineering, 1-18, 2021.

[2] Sujatha Radhakrishnan, Jyotir Moy Chatterjee, N. Z. Jhanjhi, and Sarfraz Nawaz Brohi, Performance of deep learning vs machine learning in plant leaf disease detection. Microprocessors and Microsystems, 80, 103615, 2021.

[3] Patil Bhushan V., and Pravin S. Patil., Computational method for Cotton Plant disease detection of crop management using deep learning and internet of things platforms. In Evolutionary Computing and Mobile Sustainable Networks: Proceedings of ICECMSN 2020, 875-885. Springer Singapore, 2021.

[4] Tiwari Divyansh, Mritunjay Ashish, Nitish Gangwar, Abhishek Sharma, Suhanshu Patel, and Suyash Bhardwaj, Potato leaf diseases detection using deep learning. In 2020 4th International Conference on Intelligent Computing and Control Systems (ICICCS), 461-466. IEEE, 2020.

[5] Liu Jun, and Xuewei Wang, Tomato diseases and pests detection based on improved Yolo V3 convolutional neural network. Frontiers in plant science, 11, 898, 2020.

[6] Sharma Abhinav, Arpit Jain, Prateek Gupta, and Vinay Chowdary, Machine learning applications for precision agriculture: A comprehensive review. IEEE Access, 9, 4843-4873, 2020.

[7] Revathi P., and M. Hemalatha, Classification of cotton leaf spot diseases using image processing edge detection techniques. In 2012 International Conference on Emerging Trends in Science, Engineering and Technology (INCOSET),169-173, IEEE, 2012.

[8] Sladojevic Srdjan, Marko Arsenovic, Andras Anderla, Dubravko Culibrk, and Darko Stefanovic., Deep neural networks based recognition of plant diseases by leaf image classification. Computational intelligence and neuroscience, 2016.

[9] Mekonnen, Yemeserach, Srikanth Namuduri, Lamar Burton, Arif Sarwat, and Shekhar Bhansali, Machine learning techniques in wireless sensor network based precision agriculture. Journal of the Electrochemical Society, 167(3), 2019.

[10] Verma, Shradha, Anuradha Chug, Amit Prakash Singh, Shubham Sharma, and Puranjay Rajvanshi, Deep learning-based mobile application for plant disease diagnosis: A proof of concept with a case study on tomato plant. In Applications of image processing and soft computing systems in agriculture, 242-271. IGI global, 2019.

[11] Dhaka Vijaypal Singhet al., A survey of deep convolutional neural networks applied for prediction of plant leaf diseases. Sensors, 21(14), 2021.

[12] Sharma Rohit, et al., A systematic literature review on machine learning applications for sustainable agriculture supply chain performance. Computers & Operations Research, 119, 2020.

[13] Kakani Vijay, at al., A critical review on computer vision and artificial intelligence in food industry. Journal of Agriculture and Food Research, 2, 2020.

[14] Abdel-Basset, Mohamed, Hossam Hawash, Ripon K. Chakrabortty, and Michael Ryan, Energy-net: a deep learning approach for smart energy management in iot-based smart cities. IEEE Internet of Things Journal, 8(15), 12422-12435, 2021.

[15] Meshram V., Patil K., Meshram V., Hanchate D., Ramkteke S. D., Machine learning in agriculture domain: A state-of-art survey. Artificial Intelligence in the Life Sciences, 1, 2021.

[16] Sharma Rohit, Sachin S. Kamble, Angappa Gunasekaran, Vikas Kumar, and Anil Kumar, A systematic literature review on machine learning applications for sustainable agriculture supply chain performance. Computers & Operations Research, 119, 2020.

[17] Kakani Vijay, Van Huan Nguyen, Basivi Praveen Kumar, Hakil Kim, and Visweswara Rao Pasupuleti, A critical review on computer vision and artificial intelligence in food industry. Journal of Agriculture and Food Research, 2, 2020.

[18] Zekiwos, Melese, and Abey Bruck, Deep learning-based image processing for cotton leaf disease and pest diagnosis. Journal of Electrical and Computer Engineering 1-10, 2021.