## 2 The Construction of ECA-YOLOX-Tiny Network Model  
### The Lightweight Attention Module Introduction  
Multiple versions of YOLO target detection algorithms have been proposed after continuous optimization, and a good balance between detection accuracy and speed has been achieved. YOLOX-Tiny is a lightweight model of YOLOX, compared with other versions of YOLOX, the structure size of YOLOX-Tiny is smaller, the required parameters are fewer, and the requirements for hardware conditions are lower. Therefore, YOLOX-Tiny is more suitable for UAV with limited calculative ability.  
The model's detection performance will usually be decreased after the network is lightened. In recent years, the attention mechanism has been widely adopted in deep learning target detection networks to improve the model performance. The more complex network structures are designed in attention modules Squeeze and Excitation (SE) [25] and Convolutional Block Attention Module (CBAM) [26] to improve the performance of the model. The fully connected layers are adopted in SE and CBAM, which substantially increases the number of parameters, the complexity of structure and the cost of computation. The Efficient Channel Attention (ECA) [27] is a lightweight improvement module based on SE. In the ECA module, the two fully connected layers of the SE module are replaced by a kind of 1D convolution with adaptive kernel size, which improves the attention of the original model and only adds a small number of parameters, and the contradiction between model performance and structure complexity is commendably solved. The structures of SE and ECA are respectively shown in Figure 1(a),b.  
In Figure 2, \(\chi\in R^{W\times H\times C}\) is the output of the convolution module. \(W\), \(H\), and \(C\) are the width, height, and channel dimension of feature maps, respectively. The kernel size \(k\) of 1D convolution represents the coverage of cross-channel interaction, which indicates how many neighboring channels are involved in the attention prediction of a channel. The kernel size \(k\) is proportional to the channel dimension \(C\) and can be determined adaptively by a nonlinear mapping of channel dimensions. \(\tau\) is the down-scaling rate, and \(\sigma\) is the sigmoid function, \(\otimes\) represents the element-wise product.  
Figure 2: The structure diagrams of SE and ECA: (**a**) SE module (**b**) ECA module.  
In ECA, the global average pooling (GAP) without channel dimension decline is used to polymerize the global features of images, the 1D convolution is used to learn directly, and then the weight coefficients of the channels are fixed between 0 and 1 by one-time calculation of the sigmoid function. Finally, the weighted multiplication between these coefficients and input features is carried out to increase the interest of important features and suppress the interest of unimportant features.  
Compared with SE, ECA uses 1D convolution to replace fully connected layers to avoid significantly increasing the model parameters and thereby improving the nonlinear capability of the model. The negative impact of dimension decline on the model performance is avoided and the local cross-channel information interaction strategy is used to improve the performance of the ECA model.  
Based on the above analysis, an efficient channel attention module is embedded into the YOLOX-Tiny to enhance the model learning capability and improve the defect detection accuracy for insulators.