Crops Leaf Diseases Recognition: A Framework of Optimum Deep Learning Features

: Manual diagnosis of crops diseases is not an easy process; thus, a computerized method is widely used. From a couple of years, advancements in the domain of machine learning, such as deep learning, have shown substantial success. However, they still faced some challenges such as similarity in disease symptoms and irrelevant features extraction. In this article


Introduction
Agriculture contributes significantly to economic growth and poverty reduction.This sector, which accounts for 26% of total revenue, provides direct assistance to the country's citizens.Cotton, wheat, rice, sugar beets, fruits, and vegetables are among the most important agricultural crops [1].Changes in agricultural production and quality have a significant financial impact on the country.As a result, detecting illnesses in plants at an early stage is critical, because crop output has a significant impact on them.Plant diseases reduce agricultural productivity and quality.Computer vision approaches can greatly aid in early stage disease diagnosis [2].With advancements in the field of Computer vision (CV), it is high chance to detect and recognize plant diseases [3].Climate change is to blame for the apparent global spread of plant diseases.When new diseases emerge in different parts of the world, they are rarely discovered [4].Plant diseases pose significant challenges to food security and early detection of infection symptoms.This is still a challenge in many parts of the world, resulting in a shortage of high operational and maintenance personnel [5].Early detection of these plant diseases can aid in the prevention of national economic losses.As a result, it is critical to protect crops against diseases from the beginning [6].In recent years, agricultural innovation has focused on increasing agricultural production supply while lowering costs and improving profitability.Manual disease detection can take a long time and may necessitate extra work.One of the most perplexing factors impeding plant magnification is disease assault.According to extensive agricultural research, plant disease-related issues may reduce the quality and quantity of agricultural goods.A machine learning methodology, rather than a manual method, can identify many infections more quickly [7].Tomato, potato, and cucumber are among the most important vegetables in several nations, including India, Pakistan, and Algeria.However, illnesses have an adverse influence on the production of these crops, resulting in a food scarcity.Because of the lack of specialist availability, the manual process of treating these crops' leaf diseases is complex and time-consuming [8].Plant diseases detection using an automated technique is advantageous since it reduces the amount of supervision necessary in big local farmers and identifies disease signs immediately, i.e., when they first appear on leaf tissue [9].
Lately, computer vision (CV) shows much interest in the domain of agriculture for plant diseases detection and classification at the early stage [10].The manual processing of plant diseases is a time consuming and required an expert person.Therefore, a computerized method is widely required for diseases detection and classification [11].A computerized method includes some important steps such as preprocessing of original images, detection of infected parts using image processing techniques, features extraction, reduction of redundant features, and classification using machine learning algorithms [12].Preprocessing is an important step in agriculture for better visualization of infected part of the crop leaf.The better contrast images helped in the important features extraction.Features are extracted through some important techniques such as shape, texture, and named a few more.However, these traditional features extraction methods are not performed well once the numbers of training data increased.Recently, deep learning (DL) demonstrated outstanding performance in the agriculture domain for both disease detection and classification [13].The performance of deep learning methods is better than the traditional techniques [14].Convolutional neural network (CNN) is a type of deep learning consists of some important layers such as input layer, convolutional layer, normalization and activation layers, fully connected layer, and finally a Softmax layer.Using a CNN model, features are extracted from the fully connected layers.However, sometimes redundant features are also extracted that misleads the classification process.Therefore, the researchers developed some features reduction techniques such as entropy based approach, Genetic Algorithm (GA), and named a few more [15].Finally, the selected features are classified using machine learning classifiers such as support vector machine (SVM), K-Nearest Neighbor (KNN), and named a few more [16].
Many techniques have been introduced in the literature for crops leaf diseases using deep learning and features optimization.Ma et al. [17] presented a projected deep convolutional neural network (DCNN) based method for recognition of cucumber leaf diseases such as anthracnose, downy mildew, powdery mildew, and target leaf spots.Data augmentation methods were used to reduce the likelihood of imbalanced datasets by the segmented symptom images.They used total 14,208 symptom images from augmented datasets for the experimental process and attained an accuracy of 93.4%.Singh et al. [18] multi-class classification technique for tomato ripened analysis.In the presented method, features are extracted from the images and reduced using Principal Component Analysis (PCA) that later classified using machine learning classifiers such as SVM and named a few more.The experimental procedure was performed on 250 images and attained an accuracy of 90.80% by employing multi-class SVM.Sravan et al. [19] presented a CNN based method for crops leaf diseases recognition.In the presented method, ResNet50 model was employed for features extraction through transfer learning (TL).They collected 20,639 images from the database of Plant Village and attained 99.26% accuracy.Chakraborty et al. [20] presented a hybrid CNN based framework for potato leaf diseases recognition.They used four pre-trained CNN models named MobileNet, VGG16, ResNet, and VGG19 and trained on Plant Village dataset.The results are computed on each model and VGG16 gives better results of 97.8%.Khalifa et al. [21] presented a 14-layered CNN architecture for potato leaf diseases recognition.They used 2 convolutional layers having different window sizes that followed by two 2 FC layers.The features are extracted from the convolutional layers for the final classification.They also employed a data augmentation step to increase the number of images for better testing accuracy.On the selected dataset, the presented method attained an accuracy of 98%.Rashid at al. [22] presented a yoloV5 and CNN based framework for potato leaf diseases recognition.They collected more than 4000 images for the experimental process and attained an accuracy of 99%.Thangaraj et al. [23] presented a deep transfer learning based architecture for tomato leaf diseases recognition.They used three optimization methods for the training of a CNN model such as Adam, stochastic gradient descent (SGD), and Rgprops.Based on the analysis, they conclude that Rgprops attained better accuracy.

Motivation and Problem Statement:
Manual inception of crop leaf diseases is not an easy task.There are many manual techniques available but they are costly and time consuming.The diseases in the crops, impact on the both quality and quantity of foods.The use of computerized techniques is widely required for early detection and classification of crops diseases.Many computerized techniques have been introduced in the literature but still they are facing the challenges-i) contrast and noise in the original images extracts the irrelevant and noisy features that in the outcome recognition accuracy is stained; ii) normally, the researchers extracted deep features from the fully connected layers but after the visualization process, some important features are seems missing.Due to the missing features, incorrect predication results are retrieved, and iii) several extracted features includes some redundant information; therefore, it affects the classification accuracy and consume more time during the training and testing process.In this paper, a deep learning and feature optimization-based architecture for crop leaf disease recognition is proposed.Our most significant contributions are as follows: • A hybridization-based contrast enhancement technique is proposed.
• Tweaked the Darknet19 CNN model and trained it with transfer learning.Weights from 50% of the layers are considered for training instead of 20% in the learning process.• A new Cuckoo Search algorithm is introduced for selecting the best features.A fitness function and MSER loss are used to evaluate the selected features.
The remainder of this article is divided into the sections listed below.Section 2 discusses the datasets used in the experimental process in detail.The deep learning and optimization methodologies are presented in Section 3. Section 4 presents the findings and comparisons.Finally conclude the manuscript.

Datasets
In this work, two publically available datasets are utilized named-China National Cucumber (CNC) dataset [24] and Plant Village [25].The CNC dataset includes five cumber diseases, as illustrated in Fig. 1.The Plant Village dataset includes more than 30 diseases classes but in this work, we only consider the Potato and Tomato crops.A few sample images are illustrated in Fig. 2. Both datasets includes RGB images having different dimension.The detail of diseased leaf images of each crop is presented in Tab. 1.

Figure 1: Sample images of cucumber leaf diseases 3 Proposed Methodology
The proposed crops leaf diseases recognition framework is illustrated in Fig. 3.The proposed framework includes the following important steps.In the first step, data augmentation is performed to increase the numbers of training samples.In the second step, pre-trained DarkNet19 deep model is opted and fine-tuned.The fine-tuned model is trained using transfer learning in the third step and deep features are extracted from the global pooling layer.In the fourth step, Improved Cuckoo search algorithm is applied on extracted deep feature vector and selects the best features.Finally, the best selected features are classified using machine learning classifiers in the fifth step.The explanation of each step is given below.

Contrast Enhancement and Data Augmentation
Enhancement of an image is an important research area in image processing form the last decade.Many techniques are introduced in the literature for contrast enhancement such as histogram equalization, filtering, and named a few more.The main purpose of this step is to improve the contrast of original image for better visualization.In the domain of agriculture, the core idea behind the use of contrast enhancement is to highlight the infected regions that later utilized for accurate features extraction.In this article, we implemented a hybrid approach for contrast enhancement.Three steps based hybrid approach is implemented: i) image is processed through 3D box filter of filter size 3 × 3; ii) top hat and bottom hat filtering applied to increase the local contrast of infected region, and iii) a CNN model is trained named VGG19 and applied on each image for final refinement.Mathematically, this process is defined through Eqs. ( 1)- (5).
where After that, we applied a data augmentation step to increase the numbers of images of each dataset for the sake of better training of a CNN model.Through this step, the Over fitting challenge is efficiently controlled.The process modifies the actual images so that the new images have the same properties as the originals.The benefit of data augmentation is that it allows you to train a model on a single image in several directions.Three well known operations such as left to right flip (LR), vertical flip (UD), and rotate 90 are applied on each image.
These above mentioned operations applied on selected crops such as Tomato, Cucumber, and Potato.The each crop originally consists of 15,938 images, 4863 images, and 2152 images, respectively.As given in Tab. 1, the each class is showing imbalanced; therefore, we applied three aforementioned operations.After these operations, each class images of tomato disease increased to 6000, cucumber class reached to 2000, and potato class reached to 4000, respectively.This augmented dataset is alter utilized for the training of a CNN model.A few sample image of data augmentation operations are illustrated in Fig. 4.
A full image/filer combination's output can be represented as: where the two-dimensional relationship is denoted by * .ReLU is the activation layer stands for Rectified linear unit.ReLU's goal is to increase the CNN's nonlinear behavior.It mark zero to all negative weight values and for the next phase, the subsequent positive weights will indeed be processed in the same way.
where the ar is input value in ReLU, and the output is A r .The following equation was used to update the weights using the updating rule.
Update weight is denoted by We, the actual value is denoted by we, and rate of learning presented by θ.The supremacy of ReLU is that it speedup training of dataset and sparsity in hidden units.In pooling layer, there are down sampling operations performed which reduce the dimensions of the network.In any case, the max pooling may be a broad and promising strategy within the literature CMC, 2023, vol.74, no.1 since it gives noteworthy comes about by down sampling input estimate by 75%.It also reduces computational work of network.There are the three pooling operations which are normally used such as maximum pooling, average pooling, and minimum pooling.Mathematically, operations are expressed in terms: in−1 (10) Maximum pooling represented with Maxpool as well in represented output.In the fully connected layer fu fully = fu CNN , CNN's extracted characteristics were merged into 1D.The classification outcomes was then generated using the softmax function, as represented by the given equations: where, the output represented by V, output bias is represented by μ υ and weight matrix represented by σ υ .The FC layer works with a flattening input, which means that all neurons are connected to one another.

Transfer Learning
In transfer learning, a model created for one problem is repurposed for a different problem based on a set of requirements.Its allow us to use knowledge from previously trained model to train newer model.It is the most frequent strategy in Computer Vision where models are employed as a starting point for solving other problems to consume less time.Mathematically, the TL is formulated as follows: A domain dm = {H, p (h)} is defined as a feature space ξ , and a distribution of marginal probabilities g (h), where h = {h1, h2, h3, . . .hn} ∈ ξ .For two different domains, the marginal probabilities will be p ξ p = p ξ q , where the feature space will be ξ p = ξ q .Given a source domain dm s as well learned task Tr st , a target domain dm t and learning task Tr tt , transfer learning seeks to assist inside learning of desired predictor function fn Tr (.) in Tr tt using information from the source area dm so and Tr st , where dm so = dm t or Tr st = dm Tr .
Visually, the this above process is presented in Fig. 5.In this figure, it is described that knowledge of original pre-trained deep model is transfer to the newly target model.The original pre-trained deep model consists of 1000 object classes, whereas the target model includes only crops disease classes.During the training of the newly trained model, the following hyper parameters are included-learning rate is 0.05, mini batch size is 64, total epochs are 100, and learning method is ADAM.

Fine-Tuned Darknet 19 Deep Features
As a feature extractor, the DarkNET-19 pre-trained CNN model is utilized in this work.Darknet-19 is the backbone of YOLOv2.To create estimates, system which was uses before 1 × 1 scrubbers for condense the feature maps among 3 × 3 convolutions as well globally averaged pooling.Darknet19 is made up of 19 convolutional and 5 max pooling layers as well 1 fully connected and soft max layer.Originally, this model was trained on ImageNet dataset that have 1000 object classes.This network accepted an input of dimension 256 by 256.Original architecture of DarkNet19 is illustrated in Fig. 6.The main motivation behind the choice of this model in this work is better performance on ImageNet dataset in terms of accuracy and time.In the fine-tuning process, we removed the last layer (fully connected) and added a new layer (new_FC).After that the, defined the hyper parameters and trained on selected crops leaf datasets using TL.Features are extracted from the new trained CNN model.For features extraction, sigmoid activation function is applied on global average pooling layer and obtained a feature vector of dimension N × 1026.This extracted feature vector is refined using a hybrid optimization algorithm named-Hybrid Cuckoo Newton Raphson Optimization algorithm.

Hybrid Improved Cuckoo Newton Raphson Optimization
In this work, we proposed a Hybrid Improved Cuckoo Newton Raphson Optimization (HICNRO) algorithm for best features selection.The purpose of this algorithm is to minimize the redundancy in the features and increase in the accuracy.Moreover, computational time can be reducing using HICNRO.Originally, the cuckoo search algorithm is proposed by Gandomi et al. [26] in 2013.But the convergence rate of this algorithm is not very fast that is improved in this work using Newton Raphson formulation.
Consider, the bird nests count is c, current iterations count is T, and the maximum number of iterations are t.The initial position vector X i of the bird's nest (1 ≤ i ≤ c) is defined as S i = S i1 , S I2,..... S iN .CMC, 2023, vol.74, no.1 The bird continues explore the journey through c nests in an n-dimensional environment and the place of the cuckoo bird's current nest presents a fresh technique to solving this problem.The goal of the optimization process is to continuously replace prior bad solutions with new ones and it depends on two connections for seek: stochastic walk and Levy flight.The route of search is defined as follows: The position vectors of the bird's nest i at the T − Th and (T + 1) − Th iterations, α is the step size of control factor; ⊕ is the multiplication from one point to another, and stochastic seek route is represented by Levy().The relationship among T follows the Levy() distribution as follows: The step size factor is calculated using the following equation: Based on l (Z), the present optimal solution is computed as: where α 0 is constant, initialized as 0.02, S T i is current feature ∈ S T+1 i and S best is the current best solution.To calculate the stochastic numbers, the following formulation is defined: By integrating S T+1 i and Levy (λ), the cuckoo search produce new solutions as follows: The stochastic number rand [0, 1] is compared to the finding probability after update each position.The S T+1 i is modified if rand > probability, otherwise it remains unchanged.To alter S T+1 i , the preferred stochastic walk is used to create the same amount of new solutions.Mathematically, the stochastic walk desire is defined as follows: where S T J and S T K are two stochastic outcomes of the t th iteration and r is a homogeneous distributed stochastic result in the [0, 1] interval.After that, the direction of each cuckoo is updated with faster speed by using the following formulation.
Nes best = P best i=1 S i s i,1, s i,2,....., s i,D P best (22) where L represents the Levy distribution regulates step length, NE represents the total number of nests, and b and B max are the present and total iterations.The additional parameter Nes best is a prospective search space that will be modified constantly after each iteration, and P best is the swarm hierarchy that will be improved with a downward trend after each iteration.At the end of the loop, P best is assigned a value of 2. The parameter α is restricted in the range [0, 2] for enlarging the search space around the potential region according to the stochastic optimization algorithm.As a result, the alteration of step length L called L * will be addressed first in any iteration.
where α will be in the same range as [0, 2], S b i is the best approach for b th iteration, and η is the orientation parameter specified in the preceding section.The orientation parameter is the one described in the preceding section and S b best was the best answer.Later step, the Newton Raphson (NR) equation is opted to stop the numbers of iterations and got the fixed numeric value for final solution.Mathematically, the NR is defined as follows: where, F n+1 is NR resultant value and H (F n ) is first derivative value and F n represents S b+1 i initial feature values.Based on the resultant value F n+1 , the best selected feature vector is obtained having a dimension of N × 704.The selected feature vector is passed to multiclass SVM classifier for final classification results.

Experimental Results and Discussion
Two publically available datasets named Plant village and Cucumber Leaf Images are utilized in this work for the experimental process.The 50% of the images of each dataset are utilized for the training purpose, whereas the 50% of the rest of the images are employed for the testing purpose.After that, the 10-Fold cross validation is opted for the classification results.Ten different classifiers such as fine tree (FT), Medium tree (MT), Linear Discriminant (LD), Coarse tree, Medium Gaussian SVM (MG-SVM), Gaussian Naive Bayes (GN Bayes), Kernel Naive Bayes (KN Bayes), Linear support vector machine (SVM), Q-SVM, and Cubic SVM are employed for the classification comparison.The each classifier performance is computed based on the six performance measures such as sensitivity, precision, F1-Score, False-Positive rate (FPR), accuracy, and testing time per second.The entire proposed architecture is implemented on MATLAB 2021a using a Corei7 processor with 32GB of RAM and a 64-bit operating system.Moreover, a 8GB graphics card is also employed.

Potato Leaf Diseases Classification Results:
The numerical results of tomato leaf diseases recognition are presented in Tab. 2. This table presents the best accuracy of 100% for GN Bayes classifier.The other calculated measures such as sensitivity rate are 100, precision rate is 100, and F1-Score is 100%, respectively.Fig. 6 showing the confusion matrix of GN Bayes that can utilized to verify the sensitivity rate.The computation time of the testing process is 9.68 (sec) for GN Bayes classifier.The rest of the classifiers listed in this table also performed well and attained an accuracy of above 98%.To analyze the performance of proposed framework, we also computed the results of all extracted deep features and compared with proposed framework in terms of accuracy and time.Fig. 7 showing the accuracy based comparison of proposed framework and all extracted features of fine-tuned DarkNet19.This figure showing that the accuracy is improved almost 2%-3% after employing proposed feature selection algorithm.Fig. 14 showing the testing time based comparison of proposed framework with original fine-tuned DarkNet19 extracted features.Based on this figure, it is observed that the time is significantly reduced after applying feature selection algorithm.3.In this table, the best attained accuracy of 92.9% for GN Bayes classifier.The sensitivity rate of GN Bayes is 94.49%, whereas the precision rate and F1-Score values are 94.19% and 94.33%.Fig. 9 showing the confusion matrix of GN Bayes that can utilized to verify the sensitivity rate.The computation time of the GN Bayes during the testing process is 21.433 (sec).The minimum noted computational time for this experiment is 9.359 (sec).The recognition accuracy for the rest of the classifiers listed in this table attained an average accuracy of 90%.The performance of proposed framework is also compared with the original features extraction from fine-tuned DarkNet19 CNN model in terms of accuracy and time.Fig. 10 showing the accuracy based comparison of propose framework and all extracted features of fine-tuned DarkNet19.This figure showing that the accuracy is improved almost 3%-4% after employing proposed feature selection algorithm.Fig. 11 showing the testing time based comparison of proposed framework with original fine-tuned DarkNet19 extracted features.This figure shows that the testing time is significantly reduced after using proposed optimization algorithm.

Discussion
At the end, the proposed method is discussed and shows the importance of each step.Fig. 3 illustrated the proposed framework that based on the contrast enhancement and data augmentation.Contrast enhancement visual results are illustrated in Fig. 15 that shows the improvement after the proposed enhanced technique.The resultant enhanced images are utilized for the training of finetuned DarkNet19 model that later exploited for the deep features extraction.After that, the proposed optimization algorithm is applied and results are given in above tables and plots.The results show that the proposed framework gives better results.Finally, the proposed method accuracy is compared with recent state of the art (SOTA) techniques, as presented in Tab. 5.In this table, it is noted that the recently published techniques attained the maximum accuracy of 91.67% for potato leaf diseases, 87.11 for tomato, and 98.4% for cucumber.The proposed method achieved an improved accuracy of 100%, 92.9%, and 99.2%, respectively of each crop.

Conclusion
In this article, we proposed a deep learning and optimization based sequence architecture for crops leaf diseases recognition.The developed architecture consists of five sequential steps.In the first step, data augmentation is performed based on the contrast enhancement and rotation operations to increase the numbers of training samples.In the next step, a pre-trained DarkNet19 deep model is opted and fine-tuned based on the last layers.In third step, fine-tuned model is trained using transfer learning and deep features are extracted from the global pooling layer.In the fourth step, Improved Cuckoo search algorithm based best features are selected that are finally classified in fifth step using machine learning classifiers.The experimental process of the proposed series architecture is conducted on publically available datasets and shows the improved accuracy.Based on the results, we conclude that the data augmentation step improves the learning capability of a CNN model.The main aim behind the selection of DarkNet19 is less number of parameters than few other pre-trained models.However, during the analysis, it is noted that few irrelevant features are also extracted.Therefore, the improved optimization algorithm is developed.In the future, the following points shall be considered: i) Advanced CNN model shall be opted for deep features extraction [29,30]; ii) Model shall be train on noisy and clean images to check the capability of designed CNN architecture [31][32][33], and iii) More datasets will be utilized for the experimental process and consider reinforcement learning technique.

Figure 2 :
Figure 2: Sample images of Tomato leaf diseases recognition

Figure 3 :
Figure 3: Proposed flow of crops leaf diseases recognition using deep learning and features optimization

Figure 4 :
Figure 4: Visual samples of data augmentation process

Figure 5 :
Figure 5: Process of transfer learning for crops leaf diseases

Figure 6 :
Figure 6: Confusion matrix of GN Bayes classifier for potato leaf diseases recognition using proposed architecture

Figure 7 :
Figure 7: Comparison among all features and best selected features for Potato leaf diseases in terms of accuracy

Figure 8 :
Figure 8: Comparison among all features and best selected features for Potato leaf diseases in terms of testing time

Figure 9 :
Figure 9: Confusion matrix of GN Bayes classifier for Tomato leaf diseases recognition using proposed architecture

Figure 10 :
Figure 10: Comparison among all features and best selected features for Tomato leaf diseases in terms of accuracy

Figure 11 :
Figure 11: Comparison among all features and best selected features for Tomato leaf diseases in terms of testing time

Figure 12 :
Figure 12: Confusion matrix of Linear SVM classifier for Cucumber leaf diseases recognition using proposed architecture

Figure 13 :
Figure 13: Comparison among all features and best selected features for Cucumber leaf diseases in terms of accuracy

Figure 14 :
Figure 14: Comparison among all features and best selected features for Cucumber leaf diseases in terms of testing time

Figure 15 :
Figure 15: Visual results of contrast enhancement technique

Table 1 :
Brief description of selected datasets

Table 2 :
Classification results of potato leaf diseases recognition using proposed architecture

Table 3 :
Classification results of tomato leaf diseases recognition using proposed architecture

Table 4 :
Classification results of cucumber leaf diseases recognition using proposed architecture

Table 5 :
Comparison of proposed method accuracy with SOTA techniques