# A Nested U-Shaped Residual Codec Network for Strip Steel Defect Detection
## 3 Methodology
### Decoder Network  
Inspired by U2-Net [13], a U-shaped residual decoder network is proposed by composing a convolutional network with designed U-shaped residual blocks (URB) which draw multi-scale features without degrading the feature map resolution. In salient object detection and other segmentation tasks, convolution kernels with a size of 1 \(\times\) 1 or 3 \(\times\) 3 are often used by classic convolutional models, including ResNet [29] and VGG [20] for feature extraction. However, the receptive field of the convolution kernel is too small to capture global information and, thus, the output features of the shallow layer only contain local feature size. As discussed in Section 3.1, dilated convolution can be used to enlarge the receptive fields to extract both local and non-local features [32]. The shortcoming of running multiple dilated convolutions is that it consumes much more computation time and memory resources [31]. Pooling techniques, including upsampling and downsampling, are often used to prevent this issue [23]. Therefore, URB is designed by combining dilated convolutions and pooling techniques into U-shape residual blocks, as shown in Figure 2.  
Figure 4 shows the structure detail of each URB (C\({}_{\text{in}}\), k, and C\({}_{\text{out}}\)), where k represents the number of channels in the internal layers, and Cin and Cout represent the input and output channels, respectively. The URB firstly obtains the intermediate feature map G\({}_{1}\)(**x**) from the input feature mapping **x** with size of H \(\times\) W \(\times\) C\({}_{\text{in}}\) using a convolutional layer with a kernel size of 3 \(\times\) 3 and a channel number equal to C\({}_{\text{in}}\). Then, URB feeds G\({}_{1}\)(**x**) as input into a U-shaped structure pyramidal feature hierarchy network with downsampling (upsampling) pools to reduce (expend) feature map sizes, where the bottom-up pathway is to extract multi-scale space and context features, outputting U (G\({}_{1}\)(**x**)). The top-down  
Figure 3: The structure of the attention module (RM).  
pathway and concatenation connections of the U-shaped network fuse low-level feature maps with high space information and high-level maps with high semantical information to enhance the ability of locating defect objects. Finally, there is a skip connection that merges local features and multiscale features \(G_{1}\left(\mathbf{x}\right)+U(G_{1}(\mathbf{x}))\) through addition. This structure is designed to enable the URB to immediately extract features of multiple scales from the residual block.  
The computational overhead of the URB is small due to downsampling (upsampling) used for reducing (expending) feature map sizes. In order to further reduce the computing complexity, two convolutional layers with kernel sizes of \(1\times 3\) and \(3\times 1\) were used to replace a convolutional layer with a kernel size of \(3\times 3\). Furthermore, a dilated convolution layers with a kernel size of \(3\times 3\) and dilation rate equal to 2 was designed as the bridge between the bottom-up pathway and top-down pathway to extend the URBs' receptive fields.