# Transfer Learning Model for Crack Detection in Side SlopesBased on Crack-Net
## 3 Materials and Methods
### Detection Model with Crack-Net
#### 3.1.2 Frequency-Domain Nonlinear Mapping Module  
In slope crack detection, the inherent challenge lies in the inherent sparsity and small size of these cracks, which often lead to a significant imbalance between the cracks and their background features. This imbalance poses a significant threat to the efficacy of crack detection, as it can easily mask or weaken the crack areas, consequently impacting the detection outcomes. To address this challenge, this paper puts forward a frequency-domain nonlinear mapping module (FDNM), a methodology that, in principle, can be outlined as follows: First, an input is normalized and subsequently fed to a dynamic spectrum processing module, where a \(1\times 1\) convolution adjusts the number of channels. Thereafter, the result of the first residual connection receives another normalization, a process that further stabilizes the feature distribution. The normalized features, thus prepared, are then entered into the feedforward neural network layer (FFN), consisting of multiple fully connected layers, which are employed to perform nonlinear transformations and information integration on the features. This FFN is a key element in the overall system, as it is instrumental in performing these critical functions. Finally, the output of the FFN is summed element-wise with the input before normalization to complete the second residual connection, and the result is output. Given that the detection process both must capture local detailed features and understand global contextual information, the present paper designs a dynamic frequency spectrum processing module (DFSP) whose detailed structure is shown in Figure 2a. When processing frequency-domain features, the module is divided into two parallel processing paths: one for processing amplitude information and the other for processing phase information. The input feature map is converted to the frequency domain using a fast Fourier transform (FFT). After these two processing paths, the module adds the original amplitude and phase features to the processed results, forming enhanced amplitude and phase features. The enhanced features are then converted back to the spatial domain and fused with the original features, effectively enhancing the diversity and richness of the feature representation. First, the input feature (\(x\)) is subjected to a fast Fourier transform to obtain its representation in the frequency domain:  
\[\mathbf{X}_{freq}=\mathrm{FFT}(x) \tag{1}\]  
Secondly, the magnitude (\(|X_{freq}|\)) and phase (\(\angle X_{freq}\)) are transmitted to two parallel pathways for processing. Each pathway comprises a \(1\times 1\) convolution operation and an SE module. The SE layer employs an adaptive channel attention mechanism to accentuate salient feature channels (Figure 2b). The specific formula for this process is expressed as follows:  
\[ \begin{split}\mathbf{\widehat{X}}_{mag}&=\mathrm{ processmag}(|\mathbf{X}_{freq}|)\\ \mathbf{\widehat{X}}_{pha}&=\mathrm{ processpha}(\angle X_{freq})\end{split}  \tag{2}\]In each path, the features undergo nonlinear activation and an attention-based mechanism, subsequently integrating with the original amplitude and phase to yield the enhanced amplitude (\(\hat{X}^{{}^{\prime}}_{mag}\)) and phase (\(\hat{X}^{{}^{\prime}}_{pha}\)):  
\[ \begin{split}\widehat{\mathbf{X}}_{mag^{\prime}}&=| \mathbf{X}_{freq}|+\widehat{\mathbf{X}}_{mag}\\ \widehat{\mathbf{X}}_{pha^{\prime}}&=\mathbf{X}_{freq }+\widehat{\mathbf{X}}_{pha}\end{split}