# A Multi-Scale Contextual Information Enhancement Network for Crack Segmentation
## 3 Proposed Method
### Contextual Feature Enhancement Module  
In the practical application of crack segmentation, some complex and variable environmental factors, such as shadow and pitting, are very likely to interfere with the recognition of cracks and lead to the occurrence of segmentation error. This is because the pixel characteristics of these interfering factors are very similar to the cracks and are not easily discernible. In order to accurately distinguish cracks from other interfering factors, it is necessary to obtain accurate scene perception with the help of sufficient contextual information [30]. Based on this, this paper introduces a contextual feature enhancement module (CFEM) to enhance the deep layers of the decoder network to obtain sufficient contextual information.  
Figure 4 shows the structure of the contextual feature enhancement module, which mainly includes two sub-modules of a pyramidal pooling module and a squeeze-and-excitation block. In the convolutional neural network, the size of the receptive field can roughly indicate the extraction of contextual information. Theoretically, convolutional neural networks can expand the receptive field by increasing the network depth, and thus obtain a larger range of contextual information, but it is shown in [30] that the actual receptive field of deep neural networks is much smaller than the theoretical value. To address this problem, global average pooling is often utilized as a typical global contextual prior model in many tasks such as image classification [50,51]. However, in semantic segmentation tasks, this strategy is not enough to cover the necessary contextual information of the complex scene images. Therefore, the pyramid pooling module down-samples the feature map \(X_{1}\) to be enhanced by averaging pooling to four scales, and the sizes are \(1\times 1\), \(2\times 2\), \(3\times 3\), and \(6\times 6\), respectively. The small feature map of each size contains the contextual feature information extracted at that scale. After adjusting the number of channels and bilinear interpolation up-sampling, the four new feature maps are restored to their original size. Then, the four feature maps are concatenated with \(X_{1}\) as the enhanced feature map \(X_{2}\). Note that the number of channels of the feature map \(X_{2}\) becomes twice that of the original feature map \(X_{1}\), which is not adapted to the symmetrical structure of our U-shaped network. So, we reduce it to half via a convolution operation and then obtain feature map \(X_{3}\).  
Figure 3: An illustration of how to construct the feature map of the fourth decoder layer.  
In order to make effective use of the rich semantic information owned by the enhanced feature map \(X_{3}\), a channel attention mechanism is performed to recalibrate the channel weights, which selectively emphasize the important features and suppress unimportant features by learning the global information. Specifically, the channel attention mechanism is a squeeze-and-excitation block consisting of three operations: squeeze \(F_{sq}\), excitation \(F_{ex}\), and the channel-wise multiplication \(F_{scale}\)[52]. The operation \(F_{sq}\) squeezes the feature map to \(1\times 1\times C\) with global average pooling to achieve global information embedding. The operation \(F_{ex}\) transmits the squeezed feature map through a fully connected layer, a RELU activation layer, a fully connected layer, and a sigmoid activation layer in turn to capture the dependency information on the channel dimension. Then, the output \(1\times 1\times C\) feature map will be used as the weight matrix to recalibrate the channel weights of feature map \(X_{3}\) in the operation \(F_{scale}\), and finally we obtain the contextual feature enhanced feature map \(X_{4}\). The channel attention mechanism can guide the network to focus on important channel information, making it more sensitive to critical contextual feature information.