# Research on Intelligent Recognition for Plant Pests and Diseases Based on Improved YOLOv8 Model
## 2 Related Work  
In the One-stage target detection algorithms, the series of YOLO has undergone multiple updates and upgrades. Due to its high accuracy, fast speed, and convenient deployment, it has a wide range of applications. Therefore, the YOLO series was chosen for plant-diseased pest identification. The basic method of YOLO is to adjust the input image to a fixed size, then use the CNN structure to extract features, and finally process the network and output detection results. The early version of YOLO selects partition detection methods instead of sliding windows and classifiers to simplify the operation process. Firstly, divide the input image into a grid of \(n\times n\). Then for each grid, the center point of the target being detected must fall within it. Each grid can predict multiple target boxes and their confidence. The output information of each target box includes location information and target categories. Finally, the detection results can be output by non-maximum suppression. Compared to the two outputs of Fast R-CNN probabilistic classification and the bounding box regression, YOLO reframes object detection as a single regression problem to optimize. The subsequent improvement iterations are based on this to continuously improve the accuracy and speed of detection. At present, YOLOv8 has better performance in the YOLO series, so this paper uses YOLOv8 as the basic model. As a model with good comprehensive performance in the YOLO series, YOLOv8 effectively balances the accuracy and speed of the model as displayed in Figure 1. The network structure of YOLOv8 mainly consists of four parts: Input for input, Backbone for backbone network, Neck for mixed feature, and Head for prediction output.  
In the first part of the input terminal, the input image is reorganized and defined as a \(640\times 640\times 3\) three-channel picture. The second part, the Backbone network, includes CBS modules, C2f modules, and Fast Spatial Pyramid Pooling (SPPF) modules, which extract multi-scale features from the input pictures. The SPPF module is a spatial pyramid pooling layer as shown in Figure 2 that can expand the acceptance region, realize local and global characteristics fusion, and enrich characteristic information. Compared to SPP, this model reduces model computational complexity and improves speed.  
The third part, Neck, including the convolutional layer and the C2f module, conducts a multi-scale deep fusion of the features and transmits the features to the predicted output part. The C2f module in the backbone network and Neck part combines the ELAN structure design of YOLOv7 and replaces the C3 module in YOLOv5. Figure 3 depicts the C2f structure with a richer gradient flow, which enhances the feature fusion capability of the CNN and achieves further network structure lightweighting.  
Figure 1: YOLOv8 network structure diagram.  
The fourth part, Head, is responsible for predicting output. It predicts the characteristic chart after deep fusion, and outputs the target anchor frame position, target types, and confidence information. Unlike previous YOLO series models, the Head part opts for the decoupling head structure instead of the coupling head structure, and chooses the Anchor-free idea instead of the Anchor-Base idea. Because of the different contents focused by the classification and localization, the decoupling head structure uses different branches for operations, enhancing the detection effect. With these improvements in structure, the YOLOv8 model has seen enhancements in both speed and accuracy.