# Buckwheat Disease Recognition Based on Convolution Neural Network
## 5 Results
### The Performance Analysis of Cosine Similarity Convolution  
We compared the recognition performance of CNN based on traditional convolution, CNN based on other similarity functions, and CNN based on cosine similarity. 1200 samples were selected from eight types of samples including buckwheat spot blight, buckwheat sclerotinia, buckwheat seedling blight, buckwheat ring spot, buckwheat downy mildew, buckwheat brown spot, buckwheat virus disease, and buckwheat white mold. Then, 800 buckwheat image samples without disease were added, and the training set and test set were divided according to the ratio of 4:1. We selected the network structure determined in Section 4.2.1. For disease and non-disease identification, five experiments were performed on several convolution networks, and the results are shown in Table 2. \begin{table}
\begin{tabular}{c c c} \hline
**Network Structure** & **Iterations** & **Accuracy Rate (\%)** \\ \hline Without the Inception & 3500 & 87.47 \\ Only the Inception 1 & 3500 & 90.28 \\ Only the Inception 2 & 3500 & 90.64 \\ The Inception 1 and Inception 2 & 3500 & **91.51** \\ \hline \end{tabular}
\end{table} 
Table 1: Performance evaluation of inception module. Figure 13: Final detection effect of buckwheat ring rot disease. It can be seen from Figures 14 and 15 that the network of traditional convolution gradually converges after about 6000 iterations, while the convolution based on cosine similarity converges after 4000 iterations. Therefore, the network based on cosine similarity convolution converges faster and finds the global optimal solution more easily. The convolution method based on cosine similarity can better evaluate relevancy between the convolution kernel and the features of the input feature map. In this way, a larger activation value can be obtained at a location similar to the convolution kernel feature, while avoiding the influence of noise on feature extraction. It can be found from our study that the convolution based on cosine similarity is more accurate than other convolution in the characterization of buckwheat disease. It is insensitive to noise, and its recognition accuracy is higher than other convolution methods. At the same time, the calculation of cosine similarity convolution is fast, iteration steps are fewer, so the network has a shorter operation time. Due to the influence of sampling period and environment, there are many samples with uneven illumination in the image of buckwheat disease. In this case, the gray value of the image changes significantly, so the activation value obtained by the traditional convolution operation will also change suddenly. Figure 16 shows the output of traditional convolution and cosine similarity convolution. Assuming that the values in Figure 16 represent the pixel gray values of the image, and the difference in these values is mainly caused by the uneven illumination, the convolution kernel in Figure 16a and the input feature map in Figure 16b are used for traditional convolution and cosine similarity based convolution respectively. It can be seen that the output value obtained by the traditional convolution method has obvious differences, and its feature extraction ability is correspondingly weakened, which is obviously not the result we expected. The output value based on the cosine similarity convolution was uniform, which shows that the method can better adapt to the uneven illumination and is more conducive to feature extraction. Figure 17 shows the output feature maps of buckwheat leaf under different lighting environments after implementing the convolution operation based on cosine similarity.