# An Object Detection and Localization Method Based on Improved YOLOv5 for the Teleoperated Robot
## 2 Method
### Coordinate Attention Module Design  
The CA module is a network proposed by [PERSON] et al. [33], as shown in Figure 3. In addition to cross-channel information, it also captures orientation-aware and position-sensitive information, which makes the model accurately locate the exact position of the object of interest and, hence, helps the whole model to recognize better using a small amount of computation. The CA module divides the multichannel attention into two 1-dimensional feature encoding processes, aggregating features along two different spatial directions. Long-range dependencies in one spatial direction are captured while maintaining exact location information in the other. The generated feature maps are then separately encoded to generate a pair of orientation-aware and position-sensitive feature maps, which can be complementarily applied to the input feature maps H \(\times\) W \(\times\) C, focusing not only on reweighing the importance of different channels, but also on encoding the spatial information. The specific addition position of the CA module in the YOLOv5_Tel model is shown in Figure 4. With only a small amount of extra computation, the CA module can improve the network model's performance. Figure 3: CA module structure. Figure 2: Feature network structure. (**a**) The top-down channel provided by the FPN enables for the fusion of multi-scale features from layers 3 to 5(P3–P5); (**b**) On top of the FPN, the PAN establishes a second bottom-up channel; and (**c**) The BiFPN network with weighted feature fusion and repeated bidirectional cross-scale connections. Network Pruning  
We primarily prune the YOLOv5 network model in terms of network depth and network width to decrease the number of calculations, shorten the network's training and inference time, and make it lightweight so that it may be deployed on embedded devices with insufficient computing power. We compressed the depth of the network model by controlling the number of Bottleneck residual components in C3 modules by using a hidden layer pruning method. We adjusted the residual components of the eight C3 modules in the Backbone network and the Neck network to 2, 4, 4, 1, 1, 1, 1, respectively. The number of residual components in the C3 modules of different YOLOv5 models is shown in Table 1.  
We shrink the width of the network model by controlling the number of convolution kernels in Backbone network by using the kernel pruning method. We cut the number of convolution kernels for the Focus module and the four Conv modules to 30, 60, 120, 240, and 480, respectively. The number of convolution kernels in the Focus and Conv modules of different YOLOv5 models is shown in Table 2. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multicolumn{8}{c}{**Number of Residual Components in C3**} \\ \cline{2-9}  & \multicolumn{3}{c}{**Backbone**} & \multicolumn{8}{c}{**Neck**} \\ \cline{2-9}  & **First** & **Second** & **Third** & **First** & **Second** & **Third** & **Fourth** & **Fifth** \\ \hline YOLOv5s & 1 & 3 & 3 & 1 & 1 & 1 & 1 & 1 \\ YOLOv5m & 2 & 6 & 6 & 2 & 2 & 2 & 2 & 2 \\ YOLOv5l & 3 & 9 & 9 & 3 & 3 & 3 & 3 & 3 \\ YOLOv5\_Tel & 2 & 4 & 4 & 1 & 1 & 1 & 1 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Number of residual components in C3 modules in different YOLOv5 models. Figure 4: The YOLOv5_Tel model’s structure. The feature pyramid module is changed to the BiFPN network and the CA module is added to achieve better detection performance. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multicolumn{8}{c}{**Number of Convolution Kernels**} \\ \cline{2-7}  & **Focus** & **First Conv** & **Second Conv** & **Third Conv** & **Fourth Conv** \\ \hline YOLOv5s & 32 & 64 & 128 & 256 & 512 \\ YOLOv5m & 48 & 96 & 192 & 384 & 768 \\ YOLOv5l & 64 & 128 & 256 & 512 & 1024 \\ YOLOv5\_Tel & 30 & 60 & 120 & 240 & 480 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Number of convolution kernels in different YOLOv5 models.