## 4 Near-Surface Defect Detection and Identification
### Near-Surface Defect Identification Model Based on DenseNet-DSC-CBAM  
DenseNet is a well-designed structure that incorporates continuous backward transmission of shallow features allowing for feature reuse, and thereby improving image classification accuracy. Despite this, its parameter count remains high at approximately seven million, presenting significant complexities for hardware deployment. Further optimization is therefore required. To address this issue, this paper proposes replacing the 3 \(\times\) 3 convolution used in each dense layer with DSC, resulting in reduced computation. Moreover, as the dense layer at the lower end of the network relies on the features of all previous layers, an attention mechanism is introduced to mitigate the interference of non-critical information and enable the network to focus on key information. In particular, a lightweight and effective attention mechanism module, CBAM, is integrated into the classification network, ultimately resulting in an improved blind zone defect recognition model, DenseNet-DSC-CBAM, as illustrated in Figure 12.  
Figure 11: Structure diagram of CBAM.  
The present study utilized a convolutional neural network designed in Pytorch. The network's input layer accepts an RGB three-channel signal SST diagram with an input pixel size of 256 \(\times\) 256. Shallow feature extraction involves the application of a 7 \(\times\) 7 convolution layer and a 3 \(\times\) 3 maximum pooling layer, resulting in feature maps with 64 channels (64 \(\times\) 64 \(\times\) 64) and a reduction in input image dimensions. To enhance the extraction of image information and improve the reusability of features, the DenseNet structure was employed, consisting of four dense block modules and three transition layer modules. The number of dense layers in each of the four dense blocks was 3, 6, 8, and 4, respectively. The dense layer utilized single-point convolution and DSC for feature extraction with a growth rate of 16, leading to the output of 16-channel feature maps per dense layer. The transition layer performs channel dimensionality reduction with a compression ratio of 0.5. This implies that the number of channels transmitted into the next dense block is half of the input, resulting in a change in feature map size from 64 \(\times\) 64 to 32 \(\times\) 32, 16 \(\times\) 16, and 8 \(\times\) 8, through three layers. To reinforce the feature extraction component's channel and space attention, CBAM is incorporated before they are sent to the classification network, which consists of the activation function, global average pooling, and full connection processing. The softmax function is employed to determine the probabilities of an image belonging to a specific defect type with the number of nodes in the output layer equaling the number of possible defects for classification.  
Figure 13 illustrates the impact of different network structures and learning rates on model accuracy.  
The structure of the original DenseNet121 model was adjusted by reducing the number of layers in each denseblock. The denseblocks in the original model had 6, 12, 24, and 16 layers. However, it was observed that reducing the number of layers beyond 3, 6, 8,  
Figure 12: Structure of near-surface defect identification model.  
Figure 13: Impact of different network structures (**left**) and learning rates (**right**) on model accuracy.  
and 4 resulted in decreased accuracy. This suggested that decreasing parameters beyond a certain threshold would lead to a loss in accuracy. Therefore, the model was settled with 3, 6, 8, and 4 dense layers. Multiple comparisons were conducted when making learning rate choices, and the model achieved the highest accuracy at a learning rate of 0.00015. Any value higher or lower than this level led to a decrease in accuracy; hence, 0.00015 was selected as the preferred learning rate.