## 3 Materials and Methods
### The Edge-YOLO Architecture
Prediction: The prediction module of YOLOv5s adopts a multi-scale feature map approach for comprehensive object detection. Convolutional (Conv) operations generate three feature maps of different scales: 80 \(\times\) 80 \(\times\) 255, 40 \(\times\) 40 \(\times\) 255, and 20 \(\times\) 20 \(\times\) 255. These feature maps enable the model to detect both small and large targets within a single image. By utilizing Conv operations and generating candidate boxes on these feature maps, the model accurately detects the presence and location of objects within the image. Figure 1: The YOLOv5s structure. To further improve accuracy and meet real-time requirements for edge device optimization, this paper proposes an improved model named Edge-YOLO based on the YOLOv5s framework. Figure 2 illustrates the overall architecture of Edge-YOLO. In the backbone structure, we have added the SE module into the bottleneck structure of YOLOv5s to improve detection accuracy. In the head structure, we have designed appropriate detection heads to reduce the model's parameter size. Specifically, we designed the largest header to significantly increase detection speed without a noticeable decline in accuracy, meeting the speed requirements of edge equipment. To ensure high accuracy while meeting the resource constraints of edge devices, we investigated the impact of reducing the detection head of YOLOv5s. We found that the detection accuracy decreased as the size of the head was reduced. To mitigate this decline, we introduced the Squeeze-and-Excitation (SE) module to refine the features. By incorporating the SE module, we were able to improve the detection accuracy while still maintaining a small model size that is well-suited for deployment on edge devices. Figure 3 illustrates the integration of the Squeeze-and-Excitation (SE) module, which serves as a channel attention mechanism. The SE module is added to the original residual block as an additional pathway. It computes the initial channel weights via the global pooling layer and subsequently refines them for each channel using two fully connected layers and a sigmoid activation function. Finally, the original channel is multiplied by the weights for each channel, leading to improved detection accuracy during the learning and training process through the gradient descent method in the network. The formula for the squeezing operation is shown below:  
\[g_{c}=F_{\text{s}}(u_{c})=\frac{1}{H\times W}\sum_{i=1}^{H}\sum_{j=1}^{W}u_{c}( i,j),g\in R^{c} \tag{1}\]  
where \(F_{\text{s}}\) is the squeeze operation, \(u\) denotes the input space, and \(U\in R^{H\times W\times C}\), and \(c\) represents each channel. Furthermore, the excitation formula is given as follows:  
Figure 2: Illustration of the overall Edge-YOLO architecture. (**a**) Backbones, (**b**) Necks, (**c**) Heads, and detection input and results. \[t=F_{e}(g,W)=\alpha(W_{2}Sigmoid(W_{1}g)) \tag{2}\]  
where \(F_{e}\) presents the excitation operation, \(W_{1}\in R^{\frac{C}{r}\times C}\), \(W_{2}\in R^{C\times\frac{C}{r}}\), \(r\) denotes a hyperparameter with a default value of 16, indicating the dimension reduction coefficient of the first fully connected layer. Additionally, the formula of scale is shown as follows:  
\[\widetilde{u}=F_{sc}(u_{c},t_{c})=u_{c}\times t_{c} \tag{3}\]  
where \(F_{sc}\) shows the scale operation. The SE module plays a crucial role in learning the weight coefficients to effectively distinguish features in the model. The embedding of the SE module can significantly enhance the detection accuracy of the model.