## 3 Instance Segmentation Framework Based on Improved YOLACT
### MobileNetV2 Embedded with Serial-scSE Attention Module  
The original YOLACT network used the ResNet-101 deep residual network as its feature extraction network, which not only ensured the accuracy of YOLACT in detection, but also induced huge computational complexity. In order to reduce the computational complexity of the backbone network, this paper introduces MobileNetV2, which reduces  
Figure 1: Structure of the improved YOLACT network. the parameter and computational complexity of the model by using deep separable convolutions and linear bottlenecks. Compared with ResNet-101, although MobileNetV2 significantly reduces the number of parameters and computation, it does not lose much accuracy [8]. Considering the speed and accuracy performance of the network, it is chosen as the new backbone network. In order to ensure the accuracy of the model to meet the task of insulator segmentation, this paper introduces an attention mechanism for the backbone network. Attention mechanisms have shown outstanding performances in improving the performance of convolutional networks, but most attention methods sacrifice model speed for a better accuracy performance. To balance the accuracy and speed, an S-scSE (Serial-scSE) module based on the scSE mechanism [9] is designed and embedded into MobileNetV2. The structure of Serial-scSE is shown in Figure 2.  
The original scSE block runs two sub-modules independently and in parallel, and sums the feature maps output by the two modules to obtain the final feature map \(\text{U}_{\text{scSE}}\). Due to the small size of the insulator defect, the detection accuracy is very sensitive to the spatial information of the feature map. Referring to the structure of CBAM [31], this paper improves the scSE into a serial structure so that the feature map is first processed by the channel attention module of the cSE (Spatial Squeeze and Channel Excitation Block) and then transmitted to the sSE (Channel Squeeze and Spatial Excitation Block) module. As shown in Figure 2, the Serial-scSE attention structure consists of cSE and sSE through serial connection. As a set of feature maps U is input into the S-scSE module, supposing that the size of the input feature maps is \(\text{H}\times\text{W}\times\text{C}\), they are firstly processed by the channel attention  
Figure 2: Structure of Serial-scSE. module cSE. The cSE first converts the feature maps into another form: U = [\(u_{1}\), \(u_{2}\), \(u_{3}\), \(\ldots\), \(u_{n}\)], where U \(\in R^{\text{H}\times W\times C}\) and \(u_{k}\in R^{\text{H}\times W\times 1}\), then generates a weight vector of Z \(\in R^{1\times 1\times C}\) through the mixed pooling layer, which is global average pooling in the original scSE. In the defect detection, most of the defect parts have a higher brightness, and the mixture of GAP (global average pooling) and GMP (global maximum pooling) is used to better focus on the defective part in the insulator defetct image. The element \(z_{k}\) in Z can be calculated by Equation (1):  
\[z_{k}=\alpha\times\frac{1}{H\times W}\sum_{i}^{H}\sum_{i}^{W}u_{k}(i,j)+\beta \times Max(u_{k}(i,j)) \tag{1}\]  
where \(\alpha\) and \(\beta\) are the weights of GAP and GMP. Z is then converted into a new vector Z\({}^{\prime}\) through two \(1\times 1\) convolution layers, and the non-correlation is increased by the Sigmoid and normalization layer to obtain Sigmoid(Z\({}^{\prime}\)). Finally, U is calibrated by Sigmoid(Z\({}^{\prime}\)) to obtain the feature map U\({}_{\text{cSE}}\). The calculation can be expressed as follows:  
\[\text{U}_{\text{cSE}}=[\sigma(z^{\prime}_{1})u_{1},\sigma(z^{\prime}_{2})u_{2},\sigma(z^{\prime}_{3})u_{3},\ldots,\sigma(z^{\prime}_{c})u_{c}] \tag{2}\]  
where \(\sigma(z^{\prime}_{k})\) represents the relative importance of channel \(k\). After the feature maps are processed by cSE, they are transmitted into the sSE module. The goal of the SSE module is to recalibrate the importance of each element in every channel.