## 3 Experiment and Analysis  
### Experiment  
#### 3.1.1 Processing of Data Sets  
In order to make the experimental results more general and accurate, the experimental data of this paper mainly included the pictures of nine major diseases and pests in Section 1.2 for the experiment. Table 1 shows the numbers of various pests and diseases. Figure 3: Structure of the yolov5 algorithm. In order to make the picture data of the experiment reliable and diverse, we mainly used the Paititi artificial intelligence data set service platform and manual shooting by the team to collect the picture data set for the experiment. According to the actual situation of the team, about 80% of the data set used for the experiment came from the Paititi artificial intelligence data set service platform and 20% came from manual shooting. The hand-shot data set was compiled in several farmlands in a village and town in Xiantao City, and the shooting and collection was completed in July 2021. In order to restore the detection situation in the actual scene, the distance between the device and the blade was 0.1-0.4 m when shooting so as to collect pictures of different scales and light intensities. The public data sets about rice pests and diseases were downloaded from the Paititi artificial intelligence data set service platform and screened, and the data suitable for the experiment were selected and integrated with the picture data taken to form a new data set. Public data sets on rice pests and diseases on the Payititi AI Dataset Service platform are available at the following links on the website: [[https://www.payititi.com/opendatasets/show-16.html](https://www.payititi.com/opendatasets/show-16.html)]([https://www.payititi.com/opendatasets/show-16.html](https://www.payititi.com/opendatasets/show-16.html)) (accessed on 24 March 2023) and [[https://www.payititi.com/opendatasets/show-26239.html](https://www.payititi.com/opendatasets/show-26239.html)]([https://www.payititi.com/opendatasets/show-26239.html](https://www.payititi.com/opendatasets/show-26239.html)) (accessed on 5 April 2023). In addition, in order to ensure the validity of the data set in this experiment, the identification of the types of diseases and pests in the pictures screened from the public data set and the pictures taken by hand was verified by searching for information on the Internet and consulting professional teachers at our school. The data on and pictures of the nine major rice pests and diseases listed in this paper were searched for online to verify the experimental results of the data set. The acquired data set was cleaned, renamed, and de-weighted, and the diseases and pests were marked using the labelimg marking tool, while the target in the fuzzy part of each picture was not marked. The feature extraction of rice pests and diseases was improved by using data enhancement methods such as flipping, the random addition of Gaussian noise, filling, and random brightness transformation. The prepared data set was divided into the training set, verification set, and test set at the ratio of 8:1:1, as shown in Table 2. \begin{table}
\begin{tabular}{c c} \hline
**Name of Disease and Pest** & **Number of Pictures Collected in the Experiment (Photos)** \\ \hline Rice blast & 365 \\ Sheath blight & 402 \\ Malignant seedling disease & 380 \\ Smut & 410 \\ Borer & 350 \\ Rice leaf twister & 364 \\ Rice planthopper & 403 \\ Oryzacris sinensis & 412 \\ Rice leafhopper & 375 \\ \hline \end{tabular}
\end{table} 
Table 1: Numbers of various pests and diseases.