# Bird Detection on Power Transmission Lines Based on Improved YOLOv7
## 2 YOLOv7 Model  
The YOLOv7 model, developed in 2022 by [PERSON], [PERSON], and their team [16], implements a range of strategies to enhance its performance. These strategies include E-ELAN (Efficient Layer Aggregation Network) [17], model scaling through the serial connection of models [18], and model reparameterization. These techniques are applied to strike a favorable balance between detection efficiency and accuracy [19]. The YOLOv7 architecture comprises three separate modules: the input module, the backbone module, and the head module, as visualized in Figure 1, offering a glimpse into the network's overall structure.  
By incorporating tactics such as E-ELAN, model scaling via concatenation-based models, and convolutional reparameterization, this algorithm successfully strikes an impressive equilibrium between detection efficiency and accuracy. The YOLOv7 network is structured around four essential modules: input, backbone, head, and prediction.  
The input module standardizes the input image to a uniform pixel size, ensuring compatibility with the input size requirements of the backbone network. Within the backbone module, various convolutional layers are utilized, encompassing CBSConv, E-ELAN, and MPConv layers. CBSConv layers combine convolutional layers, batch normalization (BN) layers, and LeakyReLU activation functions to capture features across various image scales [20]. E-ELAN convolutional layers preserve the original ELAN design, enabling diverse feature learning by guiding computation blocks within various feature groups. This augmentation enhances the network's learning capacity without disrupting the original gradient pathways. MPConv convolutional layers augment CBSConv layers by addingMaxpool layers to create upper and lower branches. The upper branch reduces image size by half via Maxpool and reduces image channels by half through CBSConv layers. Meanwhile, the lower branch reduces image channels by half via the first CBSConv layer, decreases image size by half using the second CBSConv layer, and ultimately employs the Cat operation to combine features extracted from the upper and lower branches. This procedure augments the network's ability to extract features.  
The head module incorporates the Path Aggregation Feature Pyramid Network (PAFPN) structure [21], which introduces bottom-up pathways, enabling the transfer of low-level information to higher levels and effectively consolidating features across various levels. In the prediction module, the image channel count for the three different feature scales generated by PAFPN is adapted using the REP (RepVGGBlock) structure. Subsequently, it utilizes \(1\times 1\) convolutions to make predictions related to confidence, class, and anchor boxes.  
The generated three network feature layers are repeatedly fused and extracted. Finally, feature maps of sizes 20 \(\times\) 20, 40 \(\times\) 40, and 80 \(\times\) 80 are generated, which are utilized for the detection of objects of different sizes in the image, including large, medium, and small items, respectively. With these generated feature maps, YOLOv7 follows the category prediction approach established in the YOLO series. Firstly, the feature maps are divided into \(S\times S\) grids, and each grid is responsible for detecting objects whose center points fall within that grid. Three bounding box predictions are calculated for each grid, and each prediction consists of five parameters: the coordinates of the box center (x, y), the box's width and height (w, h), and the confidence score of the prediction. The confidence score represents the probability of whether an object exists inside the predicted box. The structure of YOLOv7 is shown in Figure 1.