An Efficient Convolutional Neural Network for Paddy Leaf Disease and Pest Classification

Improving the quality and quantity of paddy production is very important since rice is the most consumed staple food for billion people around the world. Early detection of the paddy diseases and pests at different stages of growth is very crucial in paddy production. However, the current manual method in detecting and classifying the paddy diseases and pests requires a very knowledgeable farmer and time consuming. Thus, this study attempts to utilize an effective image processing and machine learning technique to detect and classify the paddy diseases and pests more accurately and less time processing. To accomplish this study, 3355 images comprises of 4 classes paddy images which are healthy, brown spot, leaf blast, and hispa was used. Then the proposed five layers of CNN technique is used to classify the images. The result shows that the proposed CNN technique is outperform and achieved the accuracy rate up to 93% as compared to other state-of-art comparative models. Keywords—Convolutional neural network; image classification; paddy classification; paddy disease and pest


I. INTRODUCTION
Plants disease detection is one of the major problems in sustainable agriculture [1]. Recent research outputs gives a strong indication towards the plants diseases that can occur in different stages with different rates [2]. The fact that plant diseases can also be transferred globally, makes it more complicated situation than ever before. It causes new types of diseases occur in places where they completely unidentified so that there is no local and fast solution [3]. Unexperienced farmers and manually finding solutions in paddy fields can cause the poor growth ratio and surely less ability for fight back with such diseases. In such cases, in time and accurate disease diagnoses are most important pillars of advanced agriculture [4]. It is very important to reduce unnecessary finance and wastage of other resources, thus obtaining high production of paddy with less risks. Advances in technology and computer vision application gives a better opportunity to improve and enhance the paddy field protection while extending the applications of computer vision in agriculture.
With a very high demand on productivity and the best quality of food, research in agriculture especially for paddy production is growing nowadays. Rice which is produced from paddy is the staple food for more than 3.5 billion people of the world's population including Malaysia [5]. For that, the needs of accurate diagnosis and fast solution to handle paddy problems have become the vital components in crop management. Diagnosis of paddy disease is a very challenging task to be performed manually due to several factors such as large size of paddy fields, various types of diseases, and nonnative diseases which caused from environment, nutrient and organism [6] [7]. There are several types of paddy disease such as leaf blast [6][7] [8], brown spot [6][7] [8], bacterial blight [7] and sheath blight [8]. Most of the paddy diseases can be identified based on colored spots or a stripe where each disease has it owns different color, shape, size and pattern. These signs of diseases can be found on paddy leaves or stem. In addition, different parts of paddy plant are also affected by the many diseases and parasites during several phases of growth [8].
Due to this complexity, identifying paddy diseases/pest manually is high cost procedure which leads to poor classification and time consuming especially when the farmers have lack of experience and knowledge to handle it. These can cause the diseases or the problems spread over and lead to greater losses of production. With the advance technology of image processing and machine learning, the problems in handling paddy problems manually can be solved in more accurate result, short period of processing time and require less human effort and expert.
For that, various types of image processing and machine learning techniques have been proposed by previous researchers to detect and classify paddy disease through affected paddy leaf [9][10] [11] [12]. Some of the classification techniques used are Self Organizing Map (SOM) neural network [6], Gaussian Naïve Bayes [7], Support Vector Machine [8], Radial Basis Function Network [9], Optimized Deep Neural Network with Jaya Optimization Algorithm [10] and the recent technique is Convolutional Neural Network (CNN) [11] [12]. Convolutional Neural Network is one of the deep learning techniques that have exposed great promise result in image classification. This is due to the ability of CNN to provide end-to-end learning and to work on raw image without requiring a prior knowledge which can reduce the loss of information. However, in [11] CNN was utilized only as feature extractor where the last layer of CNN was eliminated. The extracted features from previous CNN layers were then fed to SVM to classify the dataset. While, in [12] a different dataset with different types of disease was studied. In this study, the CNN classifier will be fully utilized to classify the paddy disease to healthy or non-healthy. For that, in this study, a dataset consist of three types of paddy disease/pest images which are Brown Spot, Leaf Blast and Hispa is utilized. The augmentation process is then applied to the dataset to reduce overfitting problem. The proposed CNN classifier is then applied to classify the dataset. Finally, the performance of the proposed technique is compared with others classifiers which are ANN and MLP based on the classification accuracy.
The organization of the rest paper is as follows: the related work of paddy disease classification technique is given in Section 2. Section 3 presents the core of CNN and its fundamental architecture, while Section 4 describes the details of the research methodology and the proposed technique. A discussion of the result is presented in Section 5 followed by the conclusion in Section 6.

II. RELATED WORK
In literature, many methods and techniques have been applied to identify the paddy diseases based on its images. The high ratio of these techniques are using generalize image processing techniques [34], Self-Organizing Map (SOM) neural network [6], Gaussian Naïve Bayes [7], Support Vector Machine (SVM) [8], Radial Basis Function Network [9], Deep Neural Network (DNN) based on Jaya Optimization (JO) Algorithm [10], and the recent technique is Convolutional Neural Network (CNN) [11] [12].
In [6], the unsupervised SOM neural network is utilized to classify two major types of paddy diseases that are Leaf Blast and Brown Spots using image. Before the classification, the feature extraction process were done by detecting the infected part on the leaf image by using image growing and image segmentation techniques. The comparison is done based on four (4) different setting on the spots which are RGB, Fourier Transform, Arbitrary rotation of 50% spot with Fourier Transform of the 50% rotating spots. The outcomes of this work shows that the highest accuracy of 92% is obtained from Case 1 using RGB of the spot, which concludes that in the frequency domain, image transformation does not give better classification output as compared to original image. Islam et. al [7] used Gaussian Naïve Bayes to classify the paddy disease into three main categories including rice bacterial blight, rice blast and brown spot. The reason for choosing this classifier in their study is its simplicity with naive independence among the selected features. The RGB quantity values of the infected area is used as the input features. They claimed that this technique is more efficient as compared to the previous approach which generally applied on the calculated area of leaf. The classification accuracy achieved up to 90% shows that this technique able to produce a good result with fast processing time due to its simplicity nature.
Besides, in [8] the idea of using SVM for classifying three main paddy diseases including Brown Spot of Rice, Sheath Blight of Rice and Rice Blast, using paddy leaf images is presented. The images are segmented using Otsu's method in order to calculate the threshold value. They used the image processing technique from [32] for shape and color features are used in this study. Verma and Dubey [9] proposed Radial Basis Function Network and image processing to recognize five categories of paddy disease (leaf blast, brown spot, Sheath Blight, Panicle Blast and Stem Borer)along with non-infected images. The image processing is conducted for storage, transmission, and representation for machine learning in RBFN. The extracted wavelet features for Red, Blue and Green components of the images are applied in their study. The classification accuracy produced is over 95% for both training and testing datasets.
Instead of these classical classifiers, researchers nowadays are working on deep learning techniques especially for image processing problems. This is due to the ability of this technique to extract complicated information from the raw images. In paddy disease detection, deep learning techniques have been applied in [10] [11] [12]. In [6], Optimized Deep Neural Network with Jaya Algorithm was proposed to recognize and classify paddy leaf diseases. The images were captured directly from paddy field contain normal and disease leaf like bacterial blight, brown spot, sheath rot, and blast diseases. Six features include mean values and standard deviation (from color features), homogeneity, contrast, correlation and energy (from textures features) are extracted. In overall, the results show that their proposed approach outperform 98% as compared to the other comparative techniques which are the standard DNN, DAE and ANN classifiers. Shiravastava et al. [11] applied CNN classifier where pre-trained deep CNN model based on AlexNet for feature extraction and a multi Support Vector Machine (SVM) as a base classifier. Four types of disease were studied which are Rice Blast, Sheath Blight, Healthy Leaves and Bacterial Leaf Blight. The comparison has been performed with three different training and testing ratio including 80:2, 70:30 and 60:40. The accuracy of 91% has been gained with 80:20 of training and testing ratio.
Another work done in [12] proposed a hybrid technique of CNN with SVM. The drawback of CNN which contains maximum trainable parameters is improved by integrating SVM as classifier to remove this barrier and offer better classification accuracy to extract one dimensional feature vector. Nine common types of disease which are Rice Blast, Brown spot, Bacterial Leaf Blight, False Smut, Red Stripe, Leaf Smut, Leaf Scald, Tungro and Sheath Blight, considered in their work. The proposed technique successfully classified the nine paddy diseases and achieved more than 97% accuracy rate. Study by Atole and Park [13] also used a pre-trained weights and biases based CNN with AlexNet architecture for classifying paddy plants images. They performed multiclass classification based on three main classes called unhealthy, normal and golden apple snail infested.

III. CONVOLUTIONAL NEURAL NETWORK
Convolutional Neural Network refers to a biological inspired ANN in which the information are transfer in unidirection same as feed forward neural network. Its architecture is a motivation of visual cortex of brain that consists of simple and complex cells based alternating layers [14]. Generally CNN consists of convolutional and pooling layer or subsampling layers; however, it has many variants architectures that are grouped into different modules [15]. These modules are followed by conventional feedforward neural network based on a single or multiple fully connected layers. To form a deep CNN model architecture, the different modules are stacked on one another. A typical CNN based architecture for paddy leaves classification has been illustrated in Fig. 1. A paddy image has been given as input to the CNN architecture followed by different convolutional and pooling phases. The representation out from these phases has been feed into different connected layers and lastly the final fully connected layer presents the output which is actually a predicted class label. Despite, this architecture is more famous in the literature studies, but still several changes has been found in the recent years based on the objective of enhancing image classification in term of accuracy and computation cost reduction [16][17] [31]. In all of these architectures, the major components of CNN are convolutional layers, pooling layers and fully connected layers.

A. Convolutional Layer
The primary objective of convolutional layer is to extract features and it learns the informative feature representation from its input image. Inside the convolutional layer, the neurons are arranged according to feature maps.
In the feature map, every neuron has its own receptive field that are connected to the nearby neurons in preceding layer with a group of randomized weights, usually named as filter bank [18]. According to the learned weights, it convolves the input neurons in order to draw the next feature vector and finally the outputs are forwarded using a non-linear activation function. Typically, a single feature vector has a constraint that all the neurons have the same weights; however, within a same convolutional layer, different feature maps have different weight matrix so that some informative features can be extracted in different stages [19]. In this situation, the j th output feature map Y can be calculated using Equation 1.
Where, x is the input image, W j represents the j th feature map for the convolutional filter. In this context, the * sign denotes the convolutional operator that is used to computer filter model product of an input image at each location. While f is the nonlinear activation function [20][33] that extract the nonlinear features.

B. Pooling Layer
The main aim of using pooling layer in CNN, is to minimize the spatial resolution of feature space in order to achieve the high spatial invariance for the input distortion [21]. In the typical CNN architecture, mean pooling aggregation layers are used to disseminate the average input values of an image to the next layer. However, in the most recent architectures [22][23], max pooling layers pass the maximum values to the proceeding layer. Formally, in max pooling, the highest values are selected from each receptive field such as Equation 2.
Where, Y jik denotes the j th feature map as an output of the pooling operation. x jpq represents the elements at point (p, q) in the pooling R ik that expresses the receptive field at location (i,k). The difference between average pooling and max pooling is given in Fig. 2.

C. Fully Connected Layer
In order to extract the high order abstract features map during propagating through the CNN, a few pooling and convolutional layers are stacked over one another. The fully connected layer, which follow these layers aimed to translate the output of these layers and compute the high-level reasoning function [24] [25]. In case of solving classification problems using deep CNN, the use of Softmax operator is more effective [26], while replacing it support vector machine (SVM) also leading to improved accuracy results [27]. Moreover, the computational cost of fully connected layer is always being challenged due to its compute-to-date ratio, which can be solve using global averaged pooling layer. Notwithstanding these contributions, the performance of different CNN based architectures can be still improve and thus needs further attention from machine learning researchers to investigate the issue associated with standard CNN and provide some research directions.

IV. PROPOSED METHODOLOGY
This section describes the whole procedure of CNN based model for paddy disease detection and classification. The entire implementation process has been divided into several necessary stages. Each of the subsections is discussed with process detail in the proceeding sections starting from dataset towards final classification.

A. Datasets Specification
The data for this research activity is collected from Kaggle repository [30]. Recently Kaggle is found to the most famous bench mark and real dataset provider for machine learning and artificial intelligence. This dataset consists of three major classes of paddy leaf images with disease which are brown spot, hispa and leaf blast and one class of healthy images. There is total number of 3355 paddy images. In these images, 523 were found for brown spot diseases images, 565 for hispa pests and 779 images for leaf blast disease. The rest of 1488 images are belongs to healthy paddy. In this research work, we have conducted the experiment with two different training and testing ratios that are 50:50 and 70:30. This split for testing and training ratio is based on with randomly selected images for both.

B. Data Augmentation
The main objective of applying augmentation process in this research refers to the increment in dataset elements and adding a minor distortion to the images in dataset. This augmentation helps to reduce the model overfitting during learning stage. In the field of statistics, artificial intelligence and machine learning, overfitting caused when the statistical model produces random noise and error rather than primary relationship. A few transformation techniques are included in data augmentation such as affine transformation and perspective transformation. The purpose of affine transformation is applied for linear transformation and vector rotation. The process of transformation is carried out using an application developed in C++ based on OpenCV [28].

C. Model Training
The proposed convolutional model is trained the dataset mentioned in sub-section IV (A) for paddy image classification task. In literature, there are many famous stateof-the-art frameworks for implementing CNN based models. The final architecture of the proposed CNN based model is given in Fig. 3. Normalized paddy images are the inputs of the CNN with a unite variance and a zero mean. In the proposed model architecture, convolutional layer based on a kernel size of 7x7 pixels is considered as a first layer with 16 output channels. Max pooling is considered as the second layer proceeding to the first convolutional layer, with kernel size of 3x3 pixels. The following all three layers are considered as fully connected layers consists of 100-50-10 neuron for each layer.
In the proposed CNN model, we have used only one convolutional and one pooling layer. As there are paddy images, which consist of only single texture and color patches, therefore there is no clear high level or large scale feature for the convolutional layer to learn multi-color or multi-texture images. In our research work, a single layered convolutional layer performs comparatively same as multi-convolutional layered architecture because of normal paddy images. The proposed simple architecture model also reduces the number of parameter for learning, with dramatically improve the network and avoid over fitting during learning phase. We also used the batch normalization approach during training phase in order to boost the training with fast convergence.  Vol. 11, No. 7, 2020 D. Experimental Setup To conduct fair experiments for the evaluation of the proposed CNN model, we have used same hardware and software setup for all comparative models as well. Algorithms and approaches which have many inputs and update parameters are highly depending on parameters tuning. Parameter setting is generally a high computationally intensive task because some parameters have a large set of values to be evaluated. This section explains the experimental evaluation based on the feature learning ability of the proposed and comparative models, towards better solution for paddy diseases classification problems. All the experiments were conducted on Intel core i7 CPU, with 8GB of RAM having windows 10 operating system. The Python2.7 is used as compiler and language used for developing and testing these algorithms. For fair and fast implementation of the proposed and comparative approaches, an efficient numeric computational open source library Tensorflow [29] is used which allows a simple and fast development for both CPU and GPU support.

V. RESULTS AND DISCUSSION
This sections gives a detailed view of the obtain results for paddy disease classification. The output of the proposed CNN model training process is based on all images in dataset containing original and augmented images because, it is wellknown that CNN learn feature more efficiently on large scale datasets. Proceeding to the fine tuning of the parameters for the proposed CNN architecture, the high accuracy of 93.6% was achieved based on the 100 training epochs, which was 90.2% without fine-tuning. Furthermore, the trained CNN model was also applied to separate classes for individual testing. All the images from validation set has been tested for evaluating the performance of the proposed CNN based model for paddy classification. The results illustrated in Fig. 4, 5, 6, and 7 are focus on the number of total images for each class that are correctly classified by the proposed and comparative models. These results are the output of the proposed CNN trained model, and it is obvious from these results that the classes with less number of images in dataset got less accuracy as compared to the classes with high number of image in dataset.
In more detailed research activities, it is important to evaluate the proposed model based on comparison with a few well-known models for a clear comparative analysis. Although this dataset has never been used by any researchers in machine learning application specifically for paddy leaves images classification and disease prediction, it is impossible to compare it with any other example based on the scientific research literature. To cover the comparative analysis of our proposed CNN model, we have tested a few standard approaches including conventional artificial neural network (ANN), standard multi-layered perceptron (MLP) and a standard Support vector machine (SVM). The final results presented in different tables and figures reveals that the developed CNN model has performed better than the considered comparative approaches.   All the comparative results for the proposed and comparative models have been presented in Table I for  training accuracy and Table II for testing accuracy respectively. The accuracy has been calculated using standard equation presented in Equation 3. Final accuracy is the mean of each class accuracy.
Where t is the number of correct classification and n is the total number of samples.

VI. CONCLUSION
The recent research finds many methods and approaches for solving the plants classification and disease detection based on their leaves and other parts images. In all these previously proposed approaches, there is a lack of paddy disease detection and classification based on it leaves images using the most powerful image classification approach called CNN. In this research work, we proposed five layered CNN, with one convolution, one pooling and three fully connected layers that efficiently solves the problem of paddy disease detection and classification based on it images. The proposed model was able to give 93% accurately detected results for effected and healthy paddy leafs that helps in the automated paddy classification applications. This paper also conducted class wise detection accuracies for the proposed approach with a complete procedure of paddy disease classification from dataset specification towards final testing. The results presents in different figures and tables reveals that the proposed CNN model outperformed the well-known classification approaches such as ANN, MLP and SVM in paddy leaf disease detection and classification. In future work, we are planning to use entropy and information gain parameters for learning high order informative features from paddy images.