# Crack Defect Detection Method for Plunge Pool Corridor Based on the Improved U-Net Network
## 2 Methods
### Morphological Irregular Dynamic Convolution Method  
The morphological irregular dynamic convolution (MIDConv) method is a feature extraction approach, based on deformable convolution [29], aimed at extracting features according to the morphological characteristics of cracks. Deformable convolution enhances feature extraction by introducing offsets to the original convolution operation, allowing the convolutional kernel to dynamically adjust according to the input feature map, thereby improving the model's ability to handle irregular shapes and structures. Inspired by deformable convolution, this paper integrates the morphological features of cracks into the convolution process, introducing deformable offsets to enhance the model's ability to extract crack features. However, if the convolution kernel can freely deform and shift, the feature extraction area may gradually deviate from the target, especially in images of cracks with complex shapes. Therefore, it is necessary to restrict the introduced offsets to ensure that the feature extraction process does not deviate from the target region. The process is shown in Figure 3.  
Figure 1: U-Net model.  
Figure 2: Improved U-Net model.  
In MIDConv, the convolution kernel is straightened along the X-axis and Y-axis. Taking a convolution kernel of size \(3\times 3\) as an example, the coordinates of the convolution kernel along the X-axis are \(K_{i\pm b}=(x_{i\pm b},y_{i\pm b}),b=(0,1,2,3,4)\), where \(b\) represents the horizontal distance from each convolution grid to the center grid. The selection of each grid position in the convolution kernel is progressively accumulated, starting from the central grid position of the kernel. The position of the kernel center grid is determined by the previous grid position. Compared to the central grid \(K_{i}\), the grid position \(K_{i+1}\) is offset by a value of \(\sigma\{\sigma\in-1,1\}\). The offset values in different convolution kernel positions need to be continually accumulated to ensure that the convolution kernel conforms to a linear morphological structure. Therefore, the coordinates of each grid position in the convolution kernel along the X-axis can be represented as follows:  
\[K_{i\pm b}=\begin{cases}(x_{i+b},y_{i+b})=\left(x_{i+b},y_{i}+\sum_{i}^{i+b} \sigma y\right)\\ (x_{i-b},y_{i-b})=\left(x_{i-b},y_{i}-\sum_{i-b}^{i}\sigma y\right)\end{cases} \tag{1}\]  
From the above equation, the coordinates of each grid position in the convolution kernel along the Y-axis can be represented as follows:  
\[K_{j\pm b}=\begin{cases}\left(x_{j+b},y_{j+b}\right)=\left(x_{j+b}+\sum_{j}^{j +b}\sigma x,y_{j}\right)\\ x_{j-b},y_{j-b}\right)=\left(x_{j-b}-\sum_{j-b}^{j}\sigma x,y_{j}\right)\end{cases} \tag{2}\]  
Since the offset \(\sigma\{\sigma\in-1,1\}\) is usually not an integer, the coordinates of the convolution kernel \(K\) can be obtained through bilinear interpolation and are represented as follows:  
\[K=\sum_{K}B_{I}\left(K^{\prime},K\right)\cdot K^{\prime} \tag{3}\]  
where \(K\) represents the fractional part of the coordinate offset along the X-axis and Y-axis, \(K^{\prime}\) denotes the integer spatial coordinates of the corresponding grid point in the convolution kernel, and \(B_{I}\) represents the bilinear interpolation operation.  
As shown in Figure 4, after processing the input features using the morphological irregular dynamic convolution method, the receptive field of the features is expanded, allowing for more detailed information about the crack features to be obtained, thereby enhancing the model's ability to extract crack features.  
Figure 3: Morphological irregular dynamic convolution method.