# Study on Lightweight Model of Maize Seeding Object Detection Based on YOLOv7
## 2 Materials and Methods
### YOLOv7  
In the field of object detection, YOLO has always been one of the most popular deep-learning models. YOLO adopts a single neural network structure that divides the entire image into multiple grids and predicts multiple bounding boxes for each grid, which contains object positions and class information. Therefore, for each bounding box, YOLO predicts four coordinate values that represent the coordinates of the upper-left and lower-right corners of the bounding box, as well as the probabilities of belonging to different categories. Since this prediction process involves regression calculation between input data and model parameters, it can be considered a regression problem. Since 2016, YOLO has released multiple versions, each with different improvements and optimizations. In this paper, we utilized YOLOv7 [38], which is considered to be the most stable and reliable among the released versions. Compared to other YOLO models, YOLOv7 has significantly improved in both detection accuracy and speed during the Maize dataset. Building on its predecessor, YOLOv7 innovatively introduces the extended ELAN architecture that improves the network's self-learning capability without destroying the original gradient path. ELAN is mainly composed of VoVNet combined with CSPNet and optimizes the gradient length of the overall network with the structure of stack in the computational block. By optimizing gradient paths, deeper networks can effectively learn \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \begin{tabular}{c} **Number of** \\ **Original Images** \\ \end{tabular} & \begin{tabular}{c} **Number of** \\ **Random Brightness** \\ **Images** \\ \end{tabular} & \begin{tabular}{c} **Number of** \\ **Cropping Images** \\ \end{tabular} & \
\begin{tabular}{c} **Number of** \\ **Salt and Pepper** \\ **Noise Images** \\ \end{tabular} &
\begin{tabular}{c} **Number of** \\ **Total** \\ **Images** \\ \end{tabular} \\ \hline Training & 1000 & 175 & 255 & 170 & 1600 \\ Validation & 100 & 32 & 30 & 38 & 200 \\ Test & 120 & 27 & 21 & 32 & 200 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Distributions of the dataset. Figure 1: Data-augmentation methods. (**a**) Original image; (**b**) Random brightness; (**c**) Cropping; (**d**) Salt and pepper noise. Figure 2: Labeling and annotations of maize seedlings. and converge. In addition, YOLOv7 incorporates a cascade-based model scaling method, which dynamically adjusts the model size to suit the specific detection requirements. The main purpose of model scaling is to adjust some attributes of the model and generate models at different scales to meet the needs of different inference speeds. For example, the scaling model of EfficientDet [39] considers width, depth, and resolution. As for scaled YOLOv4 [40], its scaling model adjusts the number of stages. However, the above methods are mainly used in PlainNet and ResNet. Therefore, it is necessary to propose corresponding composite model scaling methods for cascaded models. In the YOLOv7 model, when we scale the depth factor of a calculation block, we must also calculate the changes in the output channel of that block. Then, we will scale the width factor of the transition layer by an equal amount of variation. The method can maintain the characteristics of the model during the initial design and maintain the optimal structure. These methods ensure that the model is optimized for the task at hand, further enhancing the effectiveness and performance of YOLO. The research paper adopts YOLOv7 as the baseline model and carries out further optimizations to enhance its performance. The main structure of YOLOv7 consist of three key components: input, backbone, and head. These components work together to enable efficient and accurate object detection. The network structure of YOLOv7 is shown in Figure 3.  
The Input component of YOLOv7 incorporates two key elements: adaptive scaling and adaptive anchor box. Adaptive scaling is primarily used to adjust the size of the input image. This approach offers several advantages.