# Research on Soybean Disease Identification Method Based on Deep Learning

Authors: E. Miao; Guixia Zhou; Shengxue Zhao
Journal: Mobile Information Systems
 (2022)

---

## Abstract

With the continuous integration of computer technology into agricultural production, it also reduces personnel costs while improving agricultural production efficiency and quality. Crop disease control is an important part of agricultural production, and the use of computer vision technology to quickly and accurately identify crop diseases is an important means of ensuring a good harvest of agricultural products and promoting agricultural modernization. In this paper, a recognition method based on deep learning is proposed based on soybean brown spot. The method is divided into image pretreatment and disease identification. Based on traditional threshold segmentation, the preprocessing process first uses the HSI color space to filter the information of the normal area of the leaf, adopts OTSU to set the threshold to segment the original image under the Lab color space, and then merges the segmented images. The final spot segmentation image is obtained. Compared with the renderings of several other commonly used methods of segmentation, this method can better separate the lesions from the leaves. In terms of disease identification, in order to adapt to the working conditions of large samples of farmland operations, a convolutional neural network (CNN) of continuous convolutional layers was constructed with the help of Caffe to extract more advanced features of the image. In the selection of activation functions, this paper selects the Maxout unit with stronger fitting ability, and in order to reduce the parameters in the network and prevent the network from overfitting, the sparse Maxout unit is used, which effectively improves the performance of the Maxout convolutional neural network. The experimental results show that the algorithm is superior to the algorithm based on ordinary convolutional neural network in identifying large sample crop diseases.


---

## Body

## 1. Introduction

Disease is one of the main factors affecting soybean yields. The occurrence of leaf diseases is easy to cause changes in leaf color or even leaf shedding, and a large number of leaf shedding will reduce the resistance of plants to diseases, which in turn will lead to yield reduction or quality degradation [1]. The traditional identification of crop diseases mainly relies on the experience accumulated by farmers in the agricultural production process of successive generations to judge, which has extremely high professional knowledge requirements for agricultural producers. However, many agricultural personnel do not have a comprehensive knowledge of disease control, and when judging crop diseases, they often only observe, which inevitably produces errors, thus hindering the timely treatment of crops. With the continuous improvement of the level of computer hardware and the rapid growth of computing speed, pattern recognition and artificial intelligence have developed rapidly on this basis; image processing and machine learning technology has become more mature and has begun to enter people’s production and life, providing great convenience for people’s daily labor [2–4].In recent years, there have been an increasing number of studies on crop disease identification. Mishra et al. [5] developed a maize leaf disease identification classification system that was developed using Intel’s latest Neuron Compute Stick pretrained Movidius of deep CNN model and deployed on a Raspberry Pi 3. The model achieved an accuracy rate of 88.46% in identifying maize leaf diseases. Kumar et al. [6] adopted K-means segmentation and multiclass support vector machine (SVM-based classification) to identify and classify different plant leaf diseases. Compared with other existing methods, the detection accuracy is improved. Mazzia et al. [7] scholars have proposed an LC&CC deep learning model that combines recurrent neural networks (RNNs) with convolutional neural networks (CNNs) combined, which reduces manual feature stage modeling. Çetin et al. [8] scholars adopted six different machine learning algorithms (decision tree, DT; random forest, RF; support vector machine, SVM Multiple Linear Regression, MLR; Naive Bayes, NB; and Multilayer Perceptron, MLP) to evaluate and classify six different sunflower oilseed varieties. In order to more effectively control agricultural pests and diseases, minimize the use of pesticides, and achieve better crop management and production based on neural network algorithms and K-means clustering, Scholars Chodey et al. [9] proposed an improved dragonfly algorithm. James and Sujatha [10] scholars proposed a mixed neural clustering (HNC) classifier to classify ten apple fruit diseases in order to reduce the damage of fruit diseases to agricultural economic losses and production. Scholars Bankar et al. [11] proposed a plant disease identification method based on color, edge detection, and histogram matching to solve the effects of crop diseases on plants. Golhani et al. [12] scholars successfully detected virus-infected oil palm seedlings at the nursery stage by means of spectral screening. Scholars such as Kurmi and Gangwar [13] fused information extracted from available resources and optimized it to enhance recognition results. Sakai et al. [14] used deep neural networks (DNNs) to extract and learn targets to achieve target category recognition. Deep learning is applied to vegetable object recognition, and 8 kinds of vegetables and fruits are identified, and the recognition accuracy and accuracy rate have reached a good level. Di and Qu [15] proposed a method for detecting apple leaf diseases based on Tiny-YOLO, with models mAP and mIoU of 99.86% and mIoU, respectively, 83.54%. Li et al. [16] proposed an improved Faster R-CNN bitter melon leaf disease detection method, which was integrated into the characteristic pyramid network (FPN), and the average accuracy was increased by 7.54% compared with the original. In the study by Zhang et al. [17], the recognition accuracy of the tobacco disease identification model based on the transfer learning method of the InceptionV3 network is 90.80%. Fan et al. [18] improved the regional convolutional neural network Faster R-CNN algorithm and optimized the training model by using the stochastic gradient descent algorithm to achieve intelligent diagnosis of maize diseases with complex background and similar spot characteristics in the field environment. Based on previous research, this paper proposes a soybean disease identification method based on deep learning. This method adopts a new spot cutting method and identifies lesions based on continuous convolutional and sparse Maxout convolutional neural networks. The model construction took soybean brown spot as the research object and the model was verified. This study has a positive effect on rapid diagnosis of soybean disease, efficient management of soybean field, and reduction of management cost.


## 2. Soybean Disease Image Acquisition and Pretreatment

### 2.1. Soybean Disease Image Acquisition

The collection of high-quality soybean disease pictures and the pretreatment of the areas of disease that have received research attention are prerequisites for soybean disease classification. If there are few valid pictures in the sample database, or the effect of spot segmentation is not good, it will obviously have a negative impact on the classification and identification work in the later stage. Therefore, when collecting database pictures, this article adopts a high-definition digital camera to ensure the quality of the pictures taken, which avoid collecting pictures of debris such as dirt insects, strong light exposure, and people or other objects in the background during the shooting process.In this paper, many images of soybean plants with brown spot were collected based on soybean brown spot. The high-definition camera is used to collect photos of soybean disease in the early and middle stages, and then the collected pictures are batched into a uniform size through professional tools.


### 2.2. Soybean Disease Image Background Removal

Since the follow-up study was only conducted on the leaves and the collected soybean disease pictures all had complex backgrounds, the first thing to do was to remove the interference caused by the background and separate the soybean leaves from the original picture.The crop disease pictures collected by shooting have complex backgrounds, and the Grabcut algorithm can be used to remove the background information. Its principle is an improvement on the GraphCut algorithm, which is iterative GraphCut. The algorithm uses the texture (color) information and boundary (contrast) information in the image, and a small amount of user interaction can obtain a better segmentation result. This method is used to automatically identify the background area of the entire image and then discard the background area; that is, the RGB pixel value of the background area is set to (0, 0, 0). The original image and the background-removed image are shown in Figure1.Figure 1
The removing-background images with grabcut algorithm.


### 2.3. Spot Cutting Method Based on HSI and Lab Color Space

Since the color difference between the diseased spot and the surrounding normal area of the leaf is clearly expressed, a method of cutting the diseased spot based on Hue-Saturation-Intensity (HSI) and Lab color space is proposed to take advantage of this characteristic. The HSI (Hue-Saturation-Intensity) color model [16] reflects the way the human visual system perceives color and separates the color information from the grayscale information and is not sensitive to changes in light sources, so in HSI Segmenting, the diseased areas of the image are more effective in the color space. In the HSI color model, Hue reflects the human eye’s perception of color attributes such as red, green, and yellow. Saturation indicates the purity of a color. Intensity indicates how bright and dark a color is. The HSI color model is represented as a double hexagonal pyramid model, as shown in Figure 2.Figure 2
HSI model.The RGB color space can be converted to the HSI color space according to(1)H=θ,B≤G,360−θ,B>G,(2)θ=arccos1/2R−G+R−BR−G2+R−GG−B1/2,(3)S=1−3minR,G,BR+G+B,(4)I=R+G+B3.As can be seen from the properties of the HSI color space, the Intensity (I) component has nothing to do with the color information of the image, but Hue (H) and Saturation (S). The portion is closely linked to the way people perceive color. Based on this characteristic, after several experimental tests, when H ∈ [70, 200] and S ∈ [0.17, 1], it can roughly represent the green area of crop leaves. Therefore, in this paper, under the HSI color space, the above areas are erased to achieve the purpose of filtering the green part of the leaf, and then the OTSU algorithm is divided to obtain the disease area.Lab consists of three components, which areL, a, and b. L denotes luminosity and ranging from 0 to 100. a represents the range from magenta to green, with a ranging from +127 to −128, gradually transitioning to −128, where +127 is red and -128 is green. b represents the range from yellow to blue, and the range of b is also from +127 to −128, with +127 being yellow and −128. It is blue. Lab is a uniform, device-independent color model, but unlike XYZ, it can represent the colors that almost all eyes can perceive. Therefore, when using Lab in practice, RGB images are generally converted into XYZ space images using Equation (5) first, and then converted from XYZ space to Lab space:(5)XYZ=0.4124,0.3576,0.18050.2126,0.7152,0.07220.0193,0.1192,0.9505RGB,(6)L=116fY100−16,a=500fX95.047−fY100,b=200fY100−fZ108.883.Here, X, Y, and Z, are the three components corresponding to the three-dimensional space. f (t) satisfies the following expression:(7)ft=t1/3,ift>6293t32962+429,otherwise.After the crop pictures are converted to the grayscale map of the Lab color space, the threshold is segmented by the OTSU algorithm to obtain the divided grayscale disease map. Color reproduction of the grayscale plot against the original RGB image can achieve the desired result. Lab color model has perceptual uniformity, and human perception of color is very close, so this paper combines the two color spaces to achieve the best segmentation effect. According to the above segmentation method, lab operation is performed on the sample image to obtain a segmentation map of the lesion.Finally, in this paper, the partition map under the lab and HSI color spaces is compared and manipulated, and the merged area is the final lesion rendering. The specific operation steps of the segmentation algorithm in this paper are shown in Figure3.Figure 3
Flow chart of disease spot image segmentation algorithm.


### 2.4. Pretreatment Results and Analysis

In order to verify the segmentation effect of the proposed method, a comparative experiment of different algorithms is carried out. The experiment applies OTSU algorithm, Ultragreen feature algorithm, Genetic algorithm, Lab grayscale map + OTSU algorithm, and the method proposed in this paper for disease spot image segmentation, respectively, and show the segmentation effect of 5 algorithms. As can be seen from Figure4, the original image is directly OTSU segmented, and the result is green with many leaves healthy areas, and the segmentation effect is not very ideal. If the genetic algorithm and OTSU combined segmentation method are used, it is determined by Figure 4(c). The final effect can be seen that the effect is similar to or not much improved by direct OTSU segmentation because both methods are based on threshold segmentation, ignoring the important property of color. Although the ultragreen feature method targets the physiological characteristics of green plants, the results are still not ideal, and some green areas are still not removed. The OTSU in the Lab color space has a relatively good effect compared with the previous method, but it is easy to connect the diseased lesions, and the final result is not satisfactory. This method combines the advantages of Lab and HSI color spaces and takes into account the color characteristics of the leaves, through the means of combining the images segmented by the two methods, the difference between the strong points and the contours of the segmented lesions is clear, and the green background residue is less, and the segmentation results are satisfactory.Figure 4
Segmentation effect of different algorithms on brown spot of soybean. (a) Original sample. (b) OTSU algorithm. (c) Ultragreen feature algorithm. (d) Genetic algorithm. (e) Lab grayscale map + OTSU algorithm. (f) Algorithm in this paper.
(a)(b)(c)(d)(e)(f)Although the results obtained in this paper are the best, the time taken is slightly longer than that of the previous methods due to the large number of steps performed. Statistically, the average running time of several segmentation methods described in this study is shown in Table1. The genetic algorithm is too slow to apply to the fragmentation of disease lesions in the database of this article. Although the method proposed in this paper sacrifices part of the running time, it can be seen that the final effect has been greatly improved according to the comparison of Figure 4. For the current level of computer hardware, the millisecond level time increase is completely acceptable, which can meet the actual application requirements.Table 1
Average running time of different segmentation algorithms.
Segmentation algorithmAverage running time (ms)OTSU algorithm62.01Ultragreen feature algorithm118.74Genetic algorithm2936.89Lab grayscale map + OTSU algorithm338.21Algorithm in this paper508.33


## 2.1. Soybean Disease Image Acquisition

The collection of high-quality soybean disease pictures and the pretreatment of the areas of disease that have received research attention are prerequisites for soybean disease classification. If there are few valid pictures in the sample database, or the effect of spot segmentation is not good, it will obviously have a negative impact on the classification and identification work in the later stage. Therefore, when collecting database pictures, this article adopts a high-definition digital camera to ensure the quality of the pictures taken, which avoid collecting pictures of debris such as dirt insects, strong light exposure, and people or other objects in the background during the shooting process.In this paper, many images of soybean plants with brown spot were collected based on soybean brown spot. The high-definition camera is used to collect photos of soybean disease in the early and middle stages, and then the collected pictures are batched into a uniform size through professional tools.


## 2.2. Soybean Disease Image Background Removal

Since the follow-up study was only conducted on the leaves and the collected soybean disease pictures all had complex backgrounds, the first thing to do was to remove the interference caused by the background and separate the soybean leaves from the original picture.The crop disease pictures collected by shooting have complex backgrounds, and the Grabcut algorithm can be used to remove the background information. Its principle is an improvement on the GraphCut algorithm, which is iterative GraphCut. The algorithm uses the texture (color) information and boundary (contrast) information in the image, and a small amount of user interaction can obtain a better segmentation result. This method is used to automatically identify the background area of the entire image and then discard the background area; that is, the RGB pixel value of the background area is set to (0, 0, 0). The original image and the background-removed image are shown in Figure1.Figure 1
The removing-background images with grabcut algorithm.


## 2.3. Spot Cutting Method Based on HSI and Lab Color Space

Since the color difference between the diseased spot and the surrounding normal area of the leaf is clearly expressed, a method of cutting the diseased spot based on Hue-Saturation-Intensity (HSI) and Lab color space is proposed to take advantage of this characteristic. The HSI (Hue-Saturation-Intensity) color model [16] reflects the way the human visual system perceives color and separates the color information from the grayscale information and is not sensitive to changes in light sources, so in HSI Segmenting, the diseased areas of the image are more effective in the color space. In the HSI color model, Hue reflects the human eye’s perception of color attributes such as red, green, and yellow. Saturation indicates the purity of a color. Intensity indicates how bright and dark a color is. The HSI color model is represented as a double hexagonal pyramid model, as shown in Figure 2.Figure 2
HSI model.The RGB color space can be converted to the HSI color space according to(1)H=θ,B≤G,360−θ,B>G,(2)θ=arccos1/2R−G+R−BR−G2+R−GG−B1/2,(3)S=1−3minR,G,BR+G+B,(4)I=R+G+B3.As can be seen from the properties of the HSI color space, the Intensity (I) component has nothing to do with the color information of the image, but Hue (H) and Saturation (S). The portion is closely linked to the way people perceive color. Based on this characteristic, after several experimental tests, when H ∈ [70, 200] and S ∈ [0.17, 1], it can roughly represent the green area of crop leaves. Therefore, in this paper, under the HSI color space, the above areas are erased to achieve the purpose of filtering the green part of the leaf, and then the OTSU algorithm is divided to obtain the disease area.Lab consists of three components, which areL, a, and b. L denotes luminosity and ranging from 0 to 100. a represents the range from magenta to green, with a ranging from +127 to −128, gradually transitioning to −128, where +127 is red and -128 is green. b represents the range from yellow to blue, and the range of b is also from +127 to −128, with +127 being yellow and −128. It is blue. Lab is a uniform, device-independent color model, but unlike XYZ, it can represent the colors that almost all eyes can perceive. Therefore, when using Lab in practice, RGB images are generally converted into XYZ space images using Equation (5) first, and then converted from XYZ space to Lab space:(5)XYZ=0.4124,0.3576,0.18050.2126,0.7152,0.07220.0193,0.1192,0.9505RGB,(6)L=116fY100−16,a=500fX95.047−fY100,b=200fY100−fZ108.883.Here, X, Y, and Z, are the three components corresponding to the three-dimensional space. f (t) satisfies the following expression:(7)ft=t1/3,ift>6293t32962+429,otherwise.After the crop pictures are converted to the grayscale map of the Lab color space, the threshold is segmented by the OTSU algorithm to obtain the divided grayscale disease map. Color reproduction of the grayscale plot against the original RGB image can achieve the desired result. Lab color model has perceptual uniformity, and human perception of color is very close, so this paper combines the two color spaces to achieve the best segmentation effect. According to the above segmentation method, lab operation is performed on the sample image to obtain a segmentation map of the lesion.Finally, in this paper, the partition map under the lab and HSI color spaces is compared and manipulated, and the merged area is the final lesion rendering. The specific operation steps of the segmentation algorithm in this paper are shown in Figure3.Figure 3
Flow chart of disease spot image segmentation algorithm.


## 2.4. Pretreatment Results and Analysis

In order to verify the segmentation effect of the proposed method, a comparative experiment of different algorithms is carried out. The experiment applies OTSU algorithm, Ultragreen feature algorithm, Genetic algorithm, Lab grayscale map + OTSU algorithm, and the method proposed in this paper for disease spot image segmentation, respectively, and show the segmentation effect of 5 algorithms. As can be seen from Figure4, the original image is directly OTSU segmented, and the result is green with many leaves healthy areas, and the segmentation effect is not very ideal. If the genetic algorithm and OTSU combined segmentation method are used, it is determined by Figure 4(c). The final effect can be seen that the effect is similar to or not much improved by direct OTSU segmentation because both methods are based on threshold segmentation, ignoring the important property of color. Although the ultragreen feature method targets the physiological characteristics of green plants, the results are still not ideal, and some green areas are still not removed. The OTSU in the Lab color space has a relatively good effect compared with the previous method, but it is easy to connect the diseased lesions, and the final result is not satisfactory. This method combines the advantages of Lab and HSI color spaces and takes into account the color characteristics of the leaves, through the means of combining the images segmented by the two methods, the difference between the strong points and the contours of the segmented lesions is clear, and the green background residue is less, and the segmentation results are satisfactory.Figure 4
Segmentation effect of different algorithms on brown spot of soybean. (a) Original sample. (b) OTSU algorithm. (c) Ultragreen feature algorithm. (d) Genetic algorithm. (e) Lab grayscale map + OTSU algorithm. (f) Algorithm in this paper.
(a)(b)(c)(d)(e)(f)Although the results obtained in this paper are the best, the time taken is slightly longer than that of the previous methods due to the large number of steps performed. Statistically, the average running time of several segmentation methods described in this study is shown in Table1. The genetic algorithm is too slow to apply to the fragmentation of disease lesions in the database of this article. Although the method proposed in this paper sacrifices part of the running time, it can be seen that the final effect has been greatly improved according to the comparison of Figure 4. For the current level of computer hardware, the millisecond level time increase is completely acceptable, which can meet the actual application requirements.Table 1
Average running time of different segmentation algorithms.
Segmentation algorithmAverage running time (ms)OTSU algorithm62.01Ultragreen feature algorithm118.74Genetic algorithm2936.89Lab grayscale map + OTSU algorithm338.21Algorithm in this paper508.33


## 3. Soybean Disease Identification Based on Deep Learning

### 3.1. Disease Identification Based on Continuous Convolutional and Sparse Maxout Convolutional Neural Network Models

#### 3.1.1. Construction of the Continuous Convolutional Neural Network Model

Convolutional neural network (CNN) is an algorithm that uses a multilayer perceptron (MLP) structure to conduct supervised learning of the entire network through a backpropagation algorithm. It belongs to the feed-forward neural network. It differs from MLP in that the neurons between adjacent layers in CNN are not fully connected, but locally connected, and a weight sharing strategy is adopted, which greatly reduces the complexity of the network. Since CNN adopts end-to-end learning methods, images can be directly used as input to the network, so it is widely used in the field of image recognition. Convolutional neural networks mainly model the visual cortex of animals through three structures: local perception, weight sharing, and pooling. The training process of convolutional neural networks can be divided into two stages: forward propagation and backward propagation. Forward propagation refers to the computation of the output for a given input to be inferred. Backward propagation refers to the calculation of gradients based on losses to update parameters, and the training process of CNN each time can be roughly divided into four stages. (1) Calculate the output and loss (Loss) of each layer according to the forward propagation of the CNN. (2) Call the back propagation of CNN to calculate the gradient (loss is derived from the weightw and bias b of each layer). (3) According to the stochastic gradient descent (SGD) algorithm, the gradient is used to update the parameters. (4) Through continuous learning, after the final loss meets the accuracy, the parameter values of each layer of the network are saved, so that the next time when the network is used, there is no need to initialize it again.In general, the most effective way to improve the accuracy of CNNs is to increase the number of layers of the network. However, this approach will undoubtedly greatly increase the parameters in the network and seriously slow down the computing speed. On the other hand, too many parameters can also cause the entire network to overfit. Niu et al.[19] proposed a continuous convolutional network (CNN) model that repooled a single convolutional layer obtained from a 5 × 5 convolutional kernel. The mode was changed to continuous convolutional repooling by 3 × 3 convolutional nuclei. Because two consecutive 3 × 3 convolutional layers and one 5 × 5 convolutional layer have the same receptive field, one is replaced by two nested nonlinear correction layers, which increases the nonlinear fitting ability of the network. The processing of complex images is more advantageous. In addition, for a convolutional layer with C input images and C feature maps, the parameters generated by a 5 × 5 convolution kernel are (5 × 5 + 1)  × C2 = 26 C2 parameters (plus the bias term). For two consecutive 3 × 3 convolutional layers, the generated are 2 × (3 × 3 + 1)  × C2 = 20 C2 parameters; it can be seen that the continuous convolution design can also play a role in reducing the complexity of the network. Its specific structure is shown in Figure 5.Figure 5
Continuous convolutional layers network architecture of CNN.The structure plus the input layer has a total of 9 layers, 64 × 64 size input images after 3 × 3 convolutional kernels continuous convolution twice after pooling. The size of theS1 layer feature map became 30 × 30, and in order to enrich the extracted feature types, the C1 and C2 layers were selected. There are 32 different convolutional kernels; the C3, C4, and S2 layers operate similarly to the previous one; except that 64 convolutional kernels are used. The fully connected layer of 500 neurons and all nodes of the S2 layer are fully connected, and finally the final classification is output through the Softmax multiclassifier.


#### 3.1.2. Activation Function Layer Based on Sparse Maxout

The function of the activation function is to add a nonlinear factor to the neural network, it requires that it can be derived everywhere, and choosing the appropriate activation function can significantly improve the performance of the network. Commonly used activation functions are sigmoid functions, tanh tangent functions, and ReLU functions, such as (8)–(11). Among them, the sigmoid function and the tanh function have a sudden disappearance of gradients and do not have sparsity, so they are gradually replaced by the ReLU function. The ReLU function has been widely used because the negative value is 0 and the positive number is unchanged, resulting in a sparse characteristic, and its convergence rate is also faster than the previous two functions. However, ReLU also has the disadvantage that it is relatively fragile when training; if there is a very large gradient flowing through a ReLU neuron, after updating the parameters, the neuron will no longer activate any data.(8)sigmoid:fx=11+e−x,(9)tanh:fx=ex−e−xex+e−x,(10)relu:fx=max0,x.GoodFellow et al. [20] proposed the Maxout network in 2013, which has strong fitting capabilities to fit arbitrary convex functions, and there is no ReLU A defect in the activation function. Cai et al. [21] have also experimentally demonstrated that Maxout can achieve good results even without the structure of the dropout layer effect. Maxout is equivalent to adding an “activation function layer” to the network and selecting the maximum value of the output of this layer as the final activation value. Its specific definition is as(11)hix=maxzij,j∈1,k,(12)zij=xTW..ij+bij,W∈Rd×m×k,where d represents the number of nodes in the input layer, m represents the number of nodes in the implicit layer, and k represents the number of nodes in the Maxout layer.Because the excitation function has a maximum operation, the entire Maxout network is also a nonlinear transformation. Whenk = 5 is set, its working principle diagram is shown in Figure 6.Figure 6
Maxout schematic diagram.Although Maxout has a very strong ability to fit, compared to the ReLU function, the activation value may be positive or negative or 0, so it does not have sparsity. In recent years, a sparse Maxout convolutional neural network has been proposed, which combines the advantages of Maxout and ReLU to pass through Maxout at the input layer. After the layer calculates the activation value, it performs a non-negative operation on the activation value through the ReLU function feature, which is a process of maxout first taking the maximum value. The schematic flow is shown in Figure7.Figure 7
Maxout with sparsity.In this way, the activation value of the Maxout convolutional neural network only has a positive number and a state of 0, so it has a sparseness. Therefore, this article uses the sparse Maxout unit as the activation function layer for research.


#### 3.1.3. Model Recognition Ability Test Results and Comparative Analysis

Soybean diseases were classified and tested using a convolutional neural network model that combines a continuous convolutional layer and a sparse Maxout activation function layer and was compared with the traditional discontinuous convolutional layer model (denoted as Model 1) and the continuous convolutional layer, respectively A comparative experiment was conducted with a model that did not improve the Maxout activation function layer (denoted Model 2). The model in this article was tested on soybean brown striae disease samples using model 1 and model 2, respectively. The recognition rate of the test is as follows.As can be seen from Table2, due to the structural design of the continuous convolutional layer, the recognition rate is greatly improved compared with the traditional nonconvolutional layer model, and the accuracy of the comparison model using sparse Maxout is slightly improved because its sparse features can prevent the occurrence of overfitting. Due to the growth in the number of convolutional layers and the Maxout activation function layer, the weight parameters of the entire network are more, so the time of the experiment is slightly increased compared with the traditional model, while the Maxout model is relatively sparse Maxout network model, and the running time is almost unchanged.Table 2
Different model recognition rates.
MethodAverage recognition rate (%)Model 179.25Model 292.8Model in this paper94.87By comparing the samples that identify errors, it is found that the reasons for the errors can be roughly divided into the following two types: (1) because the image acquisition work is not operated by professionals, some of the pictures of the same crops collected are farther away from the crops, and multiple plants are presented in the pictures. Some lenses are close and there is only one plant in the picture, in which case the machine may have a recognition error. (2) Some images have interference items, and their characteristics are similar to the image characteristics of the disease, which is very easy to cause confusion.


## 3.1. Disease Identification Based on Continuous Convolutional and Sparse Maxout Convolutional Neural Network Models

### 3.1.1. Construction of the Continuous Convolutional Neural Network Model

Convolutional neural network (CNN) is an algorithm that uses a multilayer perceptron (MLP) structure to conduct supervised learning of the entire network through a backpropagation algorithm. It belongs to the feed-forward neural network. It differs from MLP in that the neurons between adjacent layers in CNN are not fully connected, but locally connected, and a weight sharing strategy is adopted, which greatly reduces the complexity of the network. Since CNN adopts end-to-end learning methods, images can be directly used as input to the network, so it is widely used in the field of image recognition. Convolutional neural networks mainly model the visual cortex of animals through three structures: local perception, weight sharing, and pooling. The training process of convolutional neural networks can be divided into two stages: forward propagation and backward propagation. Forward propagation refers to the computation of the output for a given input to be inferred. Backward propagation refers to the calculation of gradients based on losses to update parameters, and the training process of CNN each time can be roughly divided into four stages. (1) Calculate the output and loss (Loss) of each layer according to the forward propagation of the CNN. (2) Call the back propagation of CNN to calculate the gradient (loss is derived from the weightw and bias b of each layer). (3) According to the stochastic gradient descent (SGD) algorithm, the gradient is used to update the parameters. (4) Through continuous learning, after the final loss meets the accuracy, the parameter values of each layer of the network are saved, so that the next time when the network is used, there is no need to initialize it again.In general, the most effective way to improve the accuracy of CNNs is to increase the number of layers of the network. However, this approach will undoubtedly greatly increase the parameters in the network and seriously slow down the computing speed. On the other hand, too many parameters can also cause the entire network to overfit. Niu et al.[19] proposed a continuous convolutional network (CNN) model that repooled a single convolutional layer obtained from a 5 × 5 convolutional kernel. The mode was changed to continuous convolutional repooling by 3 × 3 convolutional nuclei. Because two consecutive 3 × 3 convolutional layers and one 5 × 5 convolutional layer have the same receptive field, one is replaced by two nested nonlinear correction layers, which increases the nonlinear fitting ability of the network. The processing of complex images is more advantageous. In addition, for a convolutional layer with C input images and C feature maps, the parameters generated by a 5 × 5 convolution kernel are (5 × 5 + 1)  × C2 = 26 C2 parameters (plus the bias term). For two consecutive 3 × 3 convolutional layers, the generated are 2 × (3 × 3 + 1)  × C2 = 20 C2 parameters; it can be seen that the continuous convolution design can also play a role in reducing the complexity of the network. Its specific structure is shown in Figure 5.Figure 5
Continuous convolutional layers network architecture of CNN.The structure plus the input layer has a total of 9 layers, 64 × 64 size input images after 3 × 3 convolutional kernels continuous convolution twice after pooling. The size of theS1 layer feature map became 30 × 30, and in order to enrich the extracted feature types, the C1 and C2 layers were selected. There are 32 different convolutional kernels; the C3, C4, and S2 layers operate similarly to the previous one; except that 64 convolutional kernels are used. The fully connected layer of 500 neurons and all nodes of the S2 layer are fully connected, and finally the final classification is output through the Softmax multiclassifier.


### 3.1.2. Activation Function Layer Based on Sparse Maxout

The function of the activation function is to add a nonlinear factor to the neural network, it requires that it can be derived everywhere, and choosing the appropriate activation function can significantly improve the performance of the network. Commonly used activation functions are sigmoid functions, tanh tangent functions, and ReLU functions, such as (8)–(11). Among them, the sigmoid function and the tanh function have a sudden disappearance of gradients and do not have sparsity, so they are gradually replaced by the ReLU function. The ReLU function has been widely used because the negative value is 0 and the positive number is unchanged, resulting in a sparse characteristic, and its convergence rate is also faster than the previous two functions. However, ReLU also has the disadvantage that it is relatively fragile when training; if there is a very large gradient flowing through a ReLU neuron, after updating the parameters, the neuron will no longer activate any data.(8)sigmoid:fx=11+e−x,(9)tanh:fx=ex−e−xex+e−x,(10)relu:fx=max0,x.GoodFellow et al. [20] proposed the Maxout network in 2013, which has strong fitting capabilities to fit arbitrary convex functions, and there is no ReLU A defect in the activation function. Cai et al. [21] have also experimentally demonstrated that Maxout can achieve good results even without the structure of the dropout layer effect. Maxout is equivalent to adding an “activation function layer” to the network and selecting the maximum value of the output of this layer as the final activation value. Its specific definition is as(11)hix=maxzij,j∈1,k,(12)zij=xTW..ij+bij,W∈Rd×m×k,where d represents the number of nodes in the input layer, m represents the number of nodes in the implicit layer, and k represents the number of nodes in the Maxout layer.Because the excitation function has a maximum operation, the entire Maxout network is also a nonlinear transformation. Whenk = 5 is set, its working principle diagram is shown in Figure 6.Figure 6
Maxout schematic diagram.Although Maxout has a very strong ability to fit, compared to the ReLU function, the activation value may be positive or negative or 0, so it does not have sparsity. In recent years, a sparse Maxout convolutional neural network has been proposed, which combines the advantages of Maxout and ReLU to pass through Maxout at the input layer. After the layer calculates the activation value, it performs a non-negative operation on the activation value through the ReLU function feature, which is a process of maxout first taking the maximum value. The schematic flow is shown in Figure7.Figure 7
Maxout with sparsity.In this way, the activation value of the Maxout convolutional neural network only has a positive number and a state of 0, so it has a sparseness. Therefore, this article uses the sparse Maxout unit as the activation function layer for research.


### 3.1.3. Model Recognition Ability Test Results and Comparative Analysis

Soybean diseases were classified and tested using a convolutional neural network model that combines a continuous convolutional layer and a sparse Maxout activation function layer and was compared with the traditional discontinuous convolutional layer model (denoted as Model 1) and the continuous convolutional layer, respectively A comparative experiment was conducted with a model that did not improve the Maxout activation function layer (denoted Model 2). The model in this article was tested on soybean brown striae disease samples using model 1 and model 2, respectively. The recognition rate of the test is as follows.As can be seen from Table2, due to the structural design of the continuous convolutional layer, the recognition rate is greatly improved compared with the traditional nonconvolutional layer model, and the accuracy of the comparison model using sparse Maxout is slightly improved because its sparse features can prevent the occurrence of overfitting. Due to the growth in the number of convolutional layers and the Maxout activation function layer, the weight parameters of the entire network are more, so the time of the experiment is slightly increased compared with the traditional model, while the Maxout model is relatively sparse Maxout network model, and the running time is almost unchanged.Table 2
Different model recognition rates.
MethodAverage recognition rate (%)Model 179.25Model 292.8Model in this paper94.87By comparing the samples that identify errors, it is found that the reasons for the errors can be roughly divided into the following two types: (1) because the image acquisition work is not operated by professionals, some of the pictures of the same crops collected are farther away from the crops, and multiple plants are presented in the pictures. Some lenses are close and there is only one plant in the picture, in which case the machine may have a recognition error. (2) Some images have interference items, and their characteristics are similar to the image characteristics of the disease, which is very easy to cause confusion.


## 3.1.1. Construction of the Continuous Convolutional Neural Network Model

Convolutional neural network (CNN) is an algorithm that uses a multilayer perceptron (MLP) structure to conduct supervised learning of the entire network through a backpropagation algorithm. It belongs to the feed-forward neural network. It differs from MLP in that the neurons between adjacent layers in CNN are not fully connected, but locally connected, and a weight sharing strategy is adopted, which greatly reduces the complexity of the network. Since CNN adopts end-to-end learning methods, images can be directly used as input to the network, so it is widely used in the field of image recognition. Convolutional neural networks mainly model the visual cortex of animals through three structures: local perception, weight sharing, and pooling. The training process of convolutional neural networks can be divided into two stages: forward propagation and backward propagation. Forward propagation refers to the computation of the output for a given input to be inferred. Backward propagation refers to the calculation of gradients based on losses to update parameters, and the training process of CNN each time can be roughly divided into four stages. (1) Calculate the output and loss (Loss) of each layer according to the forward propagation of the CNN. (2) Call the back propagation of CNN to calculate the gradient (loss is derived from the weightw and bias b of each layer). (3) According to the stochastic gradient descent (SGD) algorithm, the gradient is used to update the parameters. (4) Through continuous learning, after the final loss meets the accuracy, the parameter values of each layer of the network are saved, so that the next time when the network is used, there is no need to initialize it again.In general, the most effective way to improve the accuracy of CNNs is to increase the number of layers of the network. However, this approach will undoubtedly greatly increase the parameters in the network and seriously slow down the computing speed. On the other hand, too many parameters can also cause the entire network to overfit. Niu et al.[19] proposed a continuous convolutional network (CNN) model that repooled a single convolutional layer obtained from a 5 × 5 convolutional kernel. The mode was changed to continuous convolutional repooling by 3 × 3 convolutional nuclei. Because two consecutive 3 × 3 convolutional layers and one 5 × 5 convolutional layer have the same receptive field, one is replaced by two nested nonlinear correction layers, which increases the nonlinear fitting ability of the network. The processing of complex images is more advantageous. In addition, for a convolutional layer with C input images and C feature maps, the parameters generated by a 5 × 5 convolution kernel are (5 × 5 + 1)  × C2 = 26 C2 parameters (plus the bias term). For two consecutive 3 × 3 convolutional layers, the generated are 2 × (3 × 3 + 1)  × C2 = 20 C2 parameters; it can be seen that the continuous convolution design can also play a role in reducing the complexity of the network. Its specific structure is shown in Figure 5.Figure 5
Continuous convolutional layers network architecture of CNN.The structure plus the input layer has a total of 9 layers, 64 × 64 size input images after 3 × 3 convolutional kernels continuous convolution twice after pooling. The size of theS1 layer feature map became 30 × 30, and in order to enrich the extracted feature types, the C1 and C2 layers were selected. There are 32 different convolutional kernels; the C3, C4, and S2 layers operate similarly to the previous one; except that 64 convolutional kernels are used. The fully connected layer of 500 neurons and all nodes of the S2 layer are fully connected, and finally the final classification is output through the Softmax multiclassifier.


## 3.1.2. Activation Function Layer Based on Sparse Maxout

The function of the activation function is to add a nonlinear factor to the neural network, it requires that it can be derived everywhere, and choosing the appropriate activation function can significantly improve the performance of the network. Commonly used activation functions are sigmoid functions, tanh tangent functions, and ReLU functions, such as (8)–(11). Among them, the sigmoid function and the tanh function have a sudden disappearance of gradients and do not have sparsity, so they are gradually replaced by the ReLU function. The ReLU function has been widely used because the negative value is 0 and the positive number is unchanged, resulting in a sparse characteristic, and its convergence rate is also faster than the previous two functions. However, ReLU also has the disadvantage that it is relatively fragile when training; if there is a very large gradient flowing through a ReLU neuron, after updating the parameters, the neuron will no longer activate any data.(8)sigmoid:fx=11+e−x,(9)tanh:fx=ex−e−xex+e−x,(10)relu:fx=max0,x.GoodFellow et al. [20] proposed the Maxout network in 2013, which has strong fitting capabilities to fit arbitrary convex functions, and there is no ReLU A defect in the activation function. Cai et al. [21] have also experimentally demonstrated that Maxout can achieve good results even without the structure of the dropout layer effect. Maxout is equivalent to adding an “activation function layer” to the network and selecting the maximum value of the output of this layer as the final activation value. Its specific definition is as(11)hix=maxzij,j∈1,k,(12)zij=xTW..ij+bij,W∈Rd×m×k,where d represents the number of nodes in the input layer, m represents the number of nodes in the implicit layer, and k represents the number of nodes in the Maxout layer.Because the excitation function has a maximum operation, the entire Maxout network is also a nonlinear transformation. Whenk = 5 is set, its working principle diagram is shown in Figure 6.Figure 6
Maxout schematic diagram.Although Maxout has a very strong ability to fit, compared to the ReLU function, the activation value may be positive or negative or 0, so it does not have sparsity. In recent years, a sparse Maxout convolutional neural network has been proposed, which combines the advantages of Maxout and ReLU to pass through Maxout at the input layer. After the layer calculates the activation value, it performs a non-negative operation on the activation value through the ReLU function feature, which is a process of maxout first taking the maximum value. The schematic flow is shown in Figure7.Figure 7
Maxout with sparsity.In this way, the activation value of the Maxout convolutional neural network only has a positive number and a state of 0, so it has a sparseness. Therefore, this article uses the sparse Maxout unit as the activation function layer for research.


## 3.1.3. Model Recognition Ability Test Results and Comparative Analysis

Soybean diseases were classified and tested using a convolutional neural network model that combines a continuous convolutional layer and a sparse Maxout activation function layer and was compared with the traditional discontinuous convolutional layer model (denoted as Model 1) and the continuous convolutional layer, respectively A comparative experiment was conducted with a model that did not improve the Maxout activation function layer (denoted Model 2). The model in this article was tested on soybean brown striae disease samples using model 1 and model 2, respectively. The recognition rate of the test is as follows.As can be seen from Table2, due to the structural design of the continuous convolutional layer, the recognition rate is greatly improved compared with the traditional nonconvolutional layer model, and the accuracy of the comparison model using sparse Maxout is slightly improved because its sparse features can prevent the occurrence of overfitting. Due to the growth in the number of convolutional layers and the Maxout activation function layer, the weight parameters of the entire network are more, so the time of the experiment is slightly increased compared with the traditional model, while the Maxout model is relatively sparse Maxout network model, and the running time is almost unchanged.Table 2
Different model recognition rates.
MethodAverage recognition rate (%)Model 179.25Model 292.8Model in this paper94.87By comparing the samples that identify errors, it is found that the reasons for the errors can be roughly divided into the following two types: (1) because the image acquisition work is not operated by professionals, some of the pictures of the same crops collected are farther away from the crops, and multiple plants are presented in the pictures. Some lenses are close and there is only one plant in the picture, in which case the machine may have a recognition error. (2) Some images have interference items, and their characteristics are similar to the image characteristics of the disease, which is very easy to cause confusion.


## 4. Conclusions

In this paper, the brown spot in soybean diseases is used as the research object, and the soybean disease is identified by image processing and pattern recognition. Some common image segmentation algorithms such as OTSU, ultragreen feature method, genetic algorithm, and threshold segmentation under Lab grayscale map are used to segment the lesions, and the results are filtered by median and corroded expansion. In this paper, the lesions obtained by using OTSU segmentation under the Lab color space and the diseased lesions obtained by filtering the green region under the HSI color space will be taken as the final segmented plaque map. By comparing with other methods to split the renderings, the effectiveness of the proposed method is verified.This paper introduces deep learning to deal with the problem of disease classification of large samples of soybeans. Through the structural design of the continuous convolutional layer and the sparse Maxout activation function layer, the entire convolutional neural network not only has strong feature extraction and nonlinear expression capabilities but also ensures that the whole network is not too bloated, and the number of parameters is limited to a certain extent. The convolutional neural network continuously optimizes the weights among layers of the network by repeatedly propagating forward and backward feedback on the training set and the test set and finally realizes the solution of disease multiclassification by the Softmax layer. The experimental results show that the proposed method achieves an average recognition rate of 94.87% in the soybean disease image recognition experiment, which fully proves the excellence of deep learning in dealing with large sample problems. The network structure of continuous convolutional layer combined with sparse Maxout activation function layer has better performance, but the total number of neuron connections in the network increases a lot due to the number of layers. So, how to reduce the dimensionality in this model will be the focus of the next work.



---

*Source: 1952936-2022-08-22.xml*