**4. Deep learning network construction**

The network architecture designed in this manuscript was improved based on the classic model AlexNet model, named as LeafNet. The total number of parameters (weights and deviations) of the classic AlexNet network reaches more than 60 million, the parameters of the convolution layer comprises 3.8% of the total network parameters, and the parameters of the fully connected layer comprises 96.2% of the total. Therefore, by reducing the number of LeafNet's convolutional layer filters and the number of fully connected layer nodes, the total number of network parameters is reduced, and the computational complexity is reduced. The recognition model has a relatively simple structure and a small amount of calculation, which effectively reduces the problem of overfitting.

#### **4.1 Network structure**

LeafNet consists of five convolutional layers, two fully connected layers, and a classification layer. The number of filters for the first, second, and fifth convolutional layers is half of those used in AlexNet's filters. In addition, the number of neurons in the fully connected layer is set to 500, 100, and 7, respectively. The entire network structure is shown in in **Table 2**.

In this experiment, except for the last layer, the rectified linear unit (ReLU) activation function is selected instead of the traditional sigmoid and tanh functions. The main disadvantages of the sigmoid and tanh functions are the large amount of calculations, and when the input is large or small, the output is relatively smooth, the gradient is small, and it is not conducive to the weight update, which ultimately cause the network to fail to complete the training. ReLU is more in line with the


#### **Table 2.** *Layer parameters for the LeafNet.*

#### *Automatic Recognition of Tea Diseases Based on Deep Learning DOI: http://dx.doi.org/10.5772/intechopen.91953*

principle of neuron signal excitation. It will make some neurons' output 0, making the network sparse and reducing the interdependence of parameters, effectively alleviating overfitting. At the same time, ReLU has better transmission error characteristics and solves the problem of gradient disappearance, so it makes the training network converge faster.

After the nonlinear neuron output of the first two convolutional layers, a local response normalization operation is introduced. It is a normalization operation and mimics the lateral inhibition phenomenon of neurobiology. Local response normalization creates a competition mechanism for the output of local neurons. Local response normalization creates a competition mechanism for the output of local neurons, making the neurons with large responses larger, thereby enhancing the generalization ability of the model.

The first two fully connected layers have introduced the dropout operation. The dropout technique is an effective solution to overfitting via the training of only some of the randomly selected nodes rather than the entire network [37]. In this article, the dropout ratio is set to 0.5.

Softmax is the activation function of the last fully connected layer, which is mainly used in the output layer of multi-classification problems. It can make the sum of all output values equal to 1. That is, the output value of multiple classifications is converted into a relative probability, in which the category which has a high relative probability is the predicted value.

#### **4.2 Training network**

hidden layer contains 100 nodes, and the output layer contains 7 nodes, which refer

The network architecture designed in this manuscript was improved based on the classic model AlexNet model, named as LeafNet. The total number of parameters (weights and deviations) of the classic AlexNet network reaches more than 60 million, the parameters of the convolution layer comprises 3.8% of the total network parameters, and the parameters of the fully connected layer comprises 96.2% of the total. Therefore, by reducing the number of LeafNet's convolutional layer filters and the number of fully connected layer nodes, the total number of network parameters is reduced, and the computational complexity is reduced. The recognition model has a relatively simple structure and a small amount of calculation,

LeafNet consists of five convolutional layers, two fully connected layers, and a

convolutional layers is half of those used in AlexNet's filters. In addition, the number of neurons in the fully connected layer is set to 500, 100, and 7, respectively.

In this experiment, except for the last layer, the rectified linear unit (ReLU) activation function is selected instead of the traditional sigmoid and tanh functions. The main disadvantages of the sigmoid and tanh functions are the large amount of calculations, and when the input is large or small, the output is relatively smooth, the gradient is small, and it is not conducive to the weight update, which ultimately cause the network to fail to complete the training. ReLU is more in line with the

**Layer Parameters Activity function**

Input 227 227 3 Convolution1(Conv1) 24 convolution filters (11 11) 4 stride ReLU Pooling1(Pool1) Max pooling (3 3) 2 stride Convolution2(Conv2) 64 convolution filters (5 5) 1 stride ReLU Pooling2(Pool2) Max pooling (3 3) 2 stride Convolution3(Conv3) 96 convolution filters (3 3) 1 stride ReLU Convolution4(Conv4) 96 convolution filters (3 3) 1 stride ReLU Convolution5(Conv5) 64 convolution filters (3 3) 1stride ReLU Pooling5(Pool5) Max pooling (3 3) 2 stride Full Connect 6(fc6) 500 nodes 1 stride ReLU Full Connect 7(fc7) 100 nodes 1 stride ReLU Full Connect8(fc8) 7 nodes 1 stride ReLU Output 1 node Softmax

classification layer. The number of filters for the first, second, and fifth

to the number of types of tea leaf disease.

*Advances in Forest Management under Global Change*

**4. Deep learning network construction**

which effectively reduces the problem of overfitting.

The entire network structure is shown in in **Table 2**.

**4.1 Network structure**

**Table 2.**

**146**

*Layer parameters for the LeafNet.*

LeafNet's training uses stochastic gradient descent (SGD) technique. The weight values of all convolutional layers and fully connected layers are initialized with a Gaussian distribution, and the bias is initialized with a constant of 1. This setting guarantees that the input of the ReLU activation function is a positive number and can also speed up the training speed of the network [25]. Because the number of samples is small, the batch size is set to 16. Batch training can improve the convergence speed of the network and keep the memory usage at a low level. The initial learning rate of all layers of the network is set to 0.1. The learning rate is reduced according to the decline of the error, and each time it is reduced to 0.1 times the original learning rate in subsequent iterations, with the minimum threshold of the learning rate set to 0.0001. The number of epochs was set as 100, while the weight of decay was set to 0.0005 and the momentum was set to 0.9 [38]. LeafNet is implemented using Matlab's MatConvNet toolbox. The network training is performed on a Windows system, configured with a Core i7-3770K CPU, 8 GB of RAM, and accelerated training via two NVIDIA GeForce GTX 980 GPUs.

#### **5. Performance measurements**

As mentioned in [39], the classification accuracy and mean class accuracy (MCA) are used to evaluate the performance of the algorithm. CCRk is first defined as the correct classification rate for class k, as shown in Eq. (1):

$$\text{CCR}\_{\mathbf{k}} = \frac{\mathbf{C}\_{\mathbf{k}}}{\mathbf{N}\_{\mathbf{k}}} \tag{1}$$

Where Ck is the number of correctly identified for class k and Nk is the total number of elements in class k. Classification accuracy is then defined by Eq. (2): *Advances in Forest Management under Global Change*

$$\text{Accuracy} = \frac{\sum\_{\mathbf{k}} \text{CCR}\_{\mathbf{k}} \cdot \text{N}\_{\mathbf{k}}}{\sum\_{\mathbf{k}} \text{N}\_{\mathbf{k}}} \tag{2}$$

Lastly, MCA is determined using Eq. (3):

$$\text{MCA} = \frac{1}{\text{k}} \sum\_{\text{k}} \text{CCR}\_{\text{k}} \tag{3}$$

#### **6. Results and analysis**

In this study, the accuracy of the SVM, MLP, and CNN classifiers in determining disease states for tea leaves from images was evaluated. The results of these analyses are shown in **Figure 3**. Error matrices were used to evaluate the accuracy of tea leaf disease recognition classifiers (**Tables 3**–**5**). From these data, although LeafNet algorithms are significantly better than SVM and MLP algorithms, three recognition algorithms can usually correctly identify most tea leaf diseases. Traditional machine learning algorithms extract the surface features of images, and the number is limited. The ability to represent image features is not strong, resulting in a low accuracy rate for identifying diseases. However, the CNN can automatically extract the deep features of the image, which can more accurately express the features of the disease image, so its recognition accuracy is higher.

It can be seen from the error matrix that the recognition accuracy of MLP and SVM for the seven tea leaf diseases is 70.94% and 60.91%, respectively, and the MCA is 70.77% and 60.62%, respectively. In the two algorithms, the correct rate of the bird's-eye spot is the highest, but there is no obvious regularity for the rest of diseases. The bird's-eye spot is clearly distinguishable, characterized by small and dense red-brown dots, which are significantly different from other disease characteristics, so its accuracy of identification is high.

The recognition accuracy of tea leaf disease by SVM and MLP algorithm is not high, which is caused by artificial selection of features. The recognition effect of SVM and MLP algorithm largely depends on whether the artificially selected features are reasonable, and researchers usually rely on personal experience when selecting features. Although better results can be obtained using artificial feature

**White spot**

**149**

White spot Bird's-eye spot

Red leaf spot

Gray blight Anthracnose

Brown blight

Algal leaf spot

**Table 3.**

*Error matrix showing the* 

*classification*

 *accuracy of the LeafNet algorithm.*

 0

 1

5

0 1 1

2

2

1

0

98

93.33%

15

2

0

97

0

84.35%

1

6

97

1

0

88.18%

 1

 0 0

0

4

96

3

7

1

86.49%

117

0

95

7

0

8

1

85.59%

0

0

0

0

1

98.32%

111

3

0

0

3

0

0

94.87%

 90.23%

 90.16%

 **Bird's-eye spot**

 **Red leaf spot**

 **Gray blight**

**Anthracnose**

 **Brown blight**

 **Algal leaf spot**

 **Sensitivity**

 **Accuracy**

 **MCA**

*Automatic Recognition of Tea Diseases Based on Deep Learning*

*DOI: http://dx.doi.org/10.5772/intechopen.91953*

#### **Figure 3.**

*Accuracy (%) of disease classification for each of the three classification models in recognizing the seven candidate tea diseases.*


**Table 3.**

*Error matrix showing the classification accuracy of the LeafNet algorithm.*

Accuracy ¼

MCA <sup>¼</sup> <sup>1</sup>

Lastly, MCA is determined using Eq. (3):

*Advances in Forest Management under Global Change*

disease image, so its recognition accuracy is higher.

characteristics, so its accuracy of identification is high.

**6. Results and analysis**

**Figure 3.**

**148**

*candidate tea diseases.*

P <sup>k</sup>CCR P

k X k

In this study, the accuracy of the SVM, MLP, and CNN classifiers in determining disease states for tea leaves from images was evaluated. The results of these analyses are shown in **Figure 3**. Error matrices were used to evaluate the accuracy of tea leaf disease recognition classifiers (**Tables 3**–**5**). From these data, although LeafNet algorithms are significantly better than SVM and MLP algorithms, three recognition algorithms can usually correctly identify most tea leaf diseases. Traditional machine learning algorithms extract the surface features of images, and the number is limited. The ability to represent image features is not strong, resulting in a low accuracy rate for identifying diseases. However, the CNN can automatically extract the deep features of the image, which can more accurately express the features of the

It can be seen from the error matrix that the recognition accuracy of MLP and SVM for the seven tea leaf diseases is 70.94% and 60.91%, respectively, and the MCA is 70.77% and 60.62%, respectively. In the two algorithms, the correct rate of the bird's-eye spot is the highest, but there is no obvious regularity for the rest of diseases. The bird's-eye spot is clearly distinguishable, characterized by small and dense red-brown dots, which are significantly different from other disease

The recognition accuracy of tea leaf disease by SVM and MLP algorithm is not high, which is caused by artificial selection of features. The recognition effect of SVM and MLP algorithm largely depends on whether the artificially selected features are reasonable, and researchers usually rely on personal experience when selecting features. Although better results can be obtained using artificial feature

*Accuracy (%) of disease classification for each of the three classification models in recognizing the seven*

<sup>k</sup> � Nk <sup>k</sup>Nk

CCRk (3)

(2)


#### **Table 4.**

*Error matrix showing the classification accuracy of the SVM algorithm.*

**White spot**

**151**

White spot Bird's-eye spot

Red leaf spot

Gray blight Anthracnose

Brown blight

Algal leaf spot

**Table 5.**

*Error matrix showing the* 

*classification*

 *accuracy of the MLP algorithm.*

 13

 0

 6

5

9

10

4

4

67

63.81%

5

16

15

3

75

1

65.22%

 6 1 0

0 0

4

10

73

8

2

66.36%

9

81

6

14

1

72.97%

1

80

17

0

11

1

72.07%

83

13 100

0

6

1

5

1

84.03%

0

3

15

1

2

70.94%

 70.94%

 70.77%

 **Bird's-eye spot**

 **Red leaf spot**

 **Gray blight**

**Anthracnose**

 **Brown blight**

 **Algal leaf Spot**

 **Sensitivity**

 **Accuracy**

 **MCA**

*Automatic Recognition of Tea Diseases Based on Deep Learning*

*DOI: http://dx.doi.org/10.5772/intechopen.91953*


**Table 5.**

*Error matrix showing the classification accuracy of the MLP algorithm.*

**White spot**

**150**

White spot Bird's-eye spot

Red leaf spot

Gray blight Anthracnose

Brown blight Algal leaf spot

**Table 4.** *Error matrix showing the* 

*classification*

 *accuracy of the SVM algorithm.*

 19

 0

 9

10

12

13

3

4

54

51.43%

 12

2 0

0 0 2

19

17

3

73

1

63.48%

5

13

56

11

6

50.91%

13

70

8

17

3

63.06%

4

59

23

2

19

2

53.15%

79

11 89

0

4

1

10

3

74.79%

0

2

19

1

5

67.52%

 60.91%

 60.62%

 **Bird's-eye spot**

 **Red leaf spot**

 **Gray blight**

**Anthracnose**

 **Brown blight**

 **Algal leaf spot**

 **Sensitivity**

 **Accuracy**

 **MCA**

*Advances in Forest Management under Global Change*

classification, these features are specific to certain datasets. If you use the same features to analyze different data sets, the results may be very different, which is a problem inherent in these technologies.

number of tea tree disease images will continue to increase, so we must collect images of different morphological features in the early, middle, and late stages of each disease and continuously expand the tea tree disease data set to make the data

At present, disease recognition is based on computer system operations. However, as the performance of smartphones continues to improve, the recognition model of deep convolutional neural networks is migrated to android-based mobile applications. It can timely and accurately obtain relevant information about diseases

We acknowledge the funding support by key R&D projects of Ningxia Hui Autonomous Region (2017BY080) and the National Natural Science Foundation of China (M1942001) and Natural Science Foundation of Inner Mongolia Autonomous

College of Agronomy, Inner Mongolia University for Nationalities, Tongliao, China

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

set more detailed and comprehensive.

*DOI: http://dx.doi.org/10.5772/intechopen.91953*

**Acknowledgements**

Region (2019MS08168).

**Conflict of interest**

**Author details**

**153**

Jing Chen\* and Junying Jia

\*Address all correspondence to: cj-yx2004@163.com

provided the original work is properly cited.

and can provide help for the control of tea tree diseases.

*Automatic Recognition of Tea Diseases Based on Deep Learning*

The authors declare no conflict of interest.

LeafNet has the best recognition effect on the bird's-eye spot, which may be due to the obvious plant pathological symptoms and the strong recognition ability of the LeafNet algorithm. The white spot disease was the second, while the other diseases range from 84 to 93%. Because of the similar pathological characteristics of the gray blight, red leaf spot, and brown blight, the classification accuracy of the three diseases is lowest. The symptoms of gray blight and brown blight diseases are too similar, which both exhibit annulations in their late stage and cannot be distinguished. In addition, the symptoms of white spot and bird's-eye spot diseases both include reddish brown spots at early stages. In addition, both anthracnose and brown blight diseases are typified by waterlogged leaves during early disease stages, while symptoms are different in the later stages. Some diseases can occur in tea plants throughout the year, although some diseases occur at distinct times. Consequently, diseases diagnosed at different times may affect the accuracy of disease identification. Another factor that affects the accuracy may be that the tea leaf can be infected with two or more diseases at the same time. This is because when the tea leaf is infected by one pathogen, the leaves are suffering from physiological weakness, and the second pathogen can easily infect. Therefore, the above factors explain the main reasons for the low accuracy of the test model in some diseases.

In addition, the performance of LeafNet is compared with the method of Reference [40], which contains 10 diseases of 3 crops with a maximum accuracy of 97.3%. Therefore, the performance of LeafNet is slightly lower than Reference [40], which used currently popular transfer learning algorithm. The main advantages of this algorithm are as follows: the network can converge quickly when the data set is small; easy to implement; and shorter training time. Therefore, in the future we will continue to research on and apply transfer learning algorithms to identify more plant diseases.

### **7. Conclusion**

CNNs have developed into mature techniques that have been increasingly applied in image recognition. The computational complexity needed for neural network analyses is considerably reduced compared to other algorithms, and it also significantly improves computing precision. Concomitantly, the high fault tolerance of CNNs allows the use of incomplete or fuzzy background images, thereby effectively enhancing the precision of image recognition.

Feature extraction is an important step in image classification and directly affects classification accuracies. Thus, two feature extraction methods and three classifiers were compared in their abilities to identify seven tea leaf diseases in the present manuscript. These analyses revealed that LeafNet yielded the highest accuracies among SVM and MLP classification algorithms. CNNs thus have obvious advantages for identifying tea leaf diseases. Importantly, the results from the present study highlight the feasibility of applying CNNs in the identification of tea leaf diseases, which would significantly improve disease recognition for tea plant agriculture. Although the disease classification accuracy of the LeafNet was not 100%, improvements upon the present method can be implemented in future studies to improve the method and provide more efficient and accurate guidance for the control of tea leaf diseases.

In this manuscript, the expansion process of sample data is a time-consuming process, but with the continuous growth of network information resources, the

*Automatic Recognition of Tea Diseases Based on Deep Learning DOI: http://dx.doi.org/10.5772/intechopen.91953*

number of tea tree disease images will continue to increase, so we must collect images of different morphological features in the early, middle, and late stages of each disease and continuously expand the tea tree disease data set to make the data set more detailed and comprehensive.

At present, disease recognition is based on computer system operations. However, as the performance of smartphones continues to improve, the recognition model of deep convolutional neural networks is migrated to android-based mobile applications. It can timely and accurately obtain relevant information about diseases and can provide help for the control of tea tree diseases.
