Rice Disease Image Recognition Based on Improved Multi-scale Stack Autoencoder

Recently, deep learning methods are widely used in the rice diseases identification. However, the actual image background of rice disease is complex, the classification performance is not ideal. Therefore, this paper proposed a multi-scale feature extraction method based on stacked autoencoder, named the multi-scale stacked autoencoder (MSSAE), to improve the recognition accuracy of rice diseases. This method extracts the complex rice disease image’s features by two steps. In the first step, the images are preprocessed. Then, the MSSAE extract the multi-scale features through preprocessed rice diseases data in different scales. Through comparative analysis of experiments, the new method achieved greater than 95% precision in the detection of rice diseases. It indicated that the MSSAE model has an outstanding identification performance for actual crop disease image recognition.


Introduction
Rice is one of the important food crops, and nearly half of the world's population takes rice as the main food (Meng, 2014). As a large agricultural country, China is also the country of origin of rice. Rice is one of the three major grain crops in China and occupies a large proportion in agricultural output (Chen, 2016). However, due to its own characteristics and the impact of its growing environment, rice is often harmed by diseases and insects, resulting in a decrease in rice production (Hu, 2017).
In the process of planting rice in the northern cold region, many diseases often occur. The rice blast and sheath blight had the most serious effect on rice yield, followed by bakanae disease, leaf sheath rot and damping off, etc (Lu et al., 2018). These diseases occur in every part of rice, such as leaf, neck and ear and the disease spot characteristics of the same disease are also different in different growing stages. These diseases caused the decline of rice quality and serious economic losses. At present, the main means of disease prevention are using pesticides and the development of disease-resistant varieties. However, these methods often fail to play a full role because they cannot accurately identify rice diseases, even lead to reduced rice production. Even for experienced experts, this is a very subjective and time-consuming task. Therefore, accurate identification of rice diseases is the primary task of rice disease control in China.
In recent years, lots of scholars have used machine learning to identify rice disease. Liang et al. (2019) proposed a new method for identification of rice blast based on convolutional neural network (CNN) (Lecun, 1995). Tan et al. (2019) according to the map of rice disease control (Sun, 2004) selected eight types of common rice diseases as the research objects, used fine-tuned and optimized to achieve a high recognition accuracy with a limited number of images. Qiu et al. (2019) proposed a new identification model aiming at the low recognition rate of traditional technology, and the identification accuracy reached over 90%. Liu et al. (2014) collected pictures of rice leaf diseases, compared their characteristic parameters of color, shape, texture and junction, these parameters were used for identification respectively, the recognition accuracy of a single characteristic parameter reached 96.71%. However, most scholars take pictures of experimental crops in laboratory or crops grown indoors by digital cameras. In this case, the background of the rice disease image is single, which cannot truly reflect the growing environment of the actual rice in the field. Under such conditions, there will be a large deviation in the actual field application. ase images are all from the r 2019, they w ncluding 78 im ges of rice stri n in Figure 1.  Autoencoder, also known as Auto Associator or Diabolo Network, is an unsupervised learning algorithm. In practice, the number of hidden layer nodes is very close to or even greater than the number of input (Jia et al., 2018). Therefore, the number of active neurons in the hidden layer node can be reduced by adding certain keeping most neurons in a suppressed state. After adding sparsity limitation, the sparsity autoencoder is formed. For a data set containing m samples, the cost function is defined as Equation (1). (1) Where, L is the L hidden layer, is the regular term coefficient. The activation of neurons can be obtained by Equation (2). (2) Then the average activation degree is expressed by Equation (3). (3) Join the sparse parameters ρ = ρ (usually equal to 0 approximate value) and penalty factor ∑ KL(ρ||ρ j ) s 2 j=1 . KL(ρ||ρ j ) can be expressed by Equation (4). (4) To further minimize the punishment factor. The overall cost function can be expressed as Equations (5).

(5)
Where, β is the weight of control sparsity penalty factor. Then the partial derivative of the cost function is solved by the Equations (6) and (7).
Finally, Softmax classifier was used for supervised training. The accuracy of the classifier was used as the output index to evaluate the feature expression ability. The Softmax classifier could be expressed by Equation (8). (8) By gradient descent method, J'(θ) is gradually converged to the global optimal solution.
Through the above method, multi-layer autoencoder is trained, and the output of the first layer is taken as the input of the second features of the data are mapped layer by layer, finally abstracted into the activation value of the deepest layer network. Finally, input the extracted feature values into the Softmax classifier, and conduct supervision training according to the label of the sample. In this way, the stack autoencoder (SAE) is built, the training steps of SAE are shown in Figure 2. The concrete algorithm of stacked autoencoder is shown in Algorithm 1.

Results
In this section, we discuss the experimental results. All experiments were implemented in MATLAB_R2018a under Windows 10, the processor was dual-core I5-8250, 128G SSD, the CPU was Intel core I7-6500U, and the main frequency was 2.5 ghz.

Images Processing
Due to the lack of rice diseases data, especially the panicle neck blast and leaf spot of flax, it is easily lead to over-fitting problem and reduce the accuracy of rice disease recognition. Therefore, we use two solutions to solve these problems: The first approach is the data enhancement. We use reflection deformation, the image data for 90 degrees, 180 degrees, 270 degrees and vertical mirror of rotation (Mairal, 2010). In addition, histogram equalization was used to enhance the disease image and highlight the characteristics of disease spots.
The rotated instance diagram is shown in Figure 4. The enhanced sample information obtained is shown in Table  1.

Scale S
An import neighborho feature ex Therefore, 15 × 15, 1 and compu Figure 6(a As can be calculation When the more than between ac 17 × 17 an

Model
The input the specifi  As can be seen from Table 2, when the first hidden layer is 200, the second hidden layer is 100, the learning rate is 0.01, and the number of iterations is 300, the recognition accuracy is the best, 95.78%, and the required time is 34.12 seconds.

Results of Experimental
In order to quantitatively analyze and test the network performance, the precision (P), recall (R) and F1 scores (F1) were used for objective evaluation. The precision is the percentage of the correct portion of the test results. The recall is the percentage of the correct part of the test results to the actual correct part. In addition, the F1 score was given to evaluate the overall performance of the classifier (Fu et al., 2020). The calculation equations are as follow.
Where, true positive refers to the number of correctly identified rice disease, false positive refers to the number of incorrectly identified rice disease, false negative refers to the numbers of incorrectly identified rice disease as other.
The classification accuracy for every class is presented in Table 3 along with P, R and F1 scores coefficient values. The confusion matrix of the MSSAE method is shown in Table 4. jas.ccsenet. There are two reasons for this phenomenon: (1) Grain blast and leaf spot of flax are similar in features, point by point, and similar in color, so it is easy to confuse leaf spot and grain blast.
(2) Most of the reasons for misidentification are due to the complex actual field background, which is easy to confuse the characteristics of some diseases.

Conclusions
In this paper, we proposed a multi scale staked autoencoder (MSSAE) method based on the staked autoencoder to extract the deep multi-scale features for rice diseases and obtained a high rice diseases recognition accuracy. The method preprocesses the image first. Then, extract the multi scale features by different scales images. Finally, the feature fusion method is proposed to obtain the feature matrix. It can be seen from the experiment that MSSAE has a high recognition accuracy rate for images with complex background, and can effectively overcome the noises. From the result, the classification accuracy of the MSSAE achieved as high as 95.78%, the computing time was only 34.12 seconds. This indicates that the new model can accurately identify rice diseases, prepared for accurate removing disease accurately in the future, and provided reliable support.