Cracks are frequent defects that pose significant potential threats to structural safety and property. Due to the inefficiency of traditional crack detection methods, deep learning techniques—particularly convolutional neural networks—have become widely adopted to enhance detection performance. However, existing algorithms lack sufficient attention to the relationship between cracks and their surrounding background. We propose an insertable module called the cracks masked convolution attention block (CMCAB) to optimize the algorithm’s detection performance. This module utilizes masked convolution to explore the relationship between cracks and the background. It enhances feature representation through the channel-attention module, which applies global channel weighting in shallow and midlevel layers of the image. Additionally, a window-based spatial-attention module is employed to encode complex local regions. The synergistic combination of global context modeling and localized pattern refinement significantly enhances the discriminative power of feature representations and improves boundary awareness and topological accuracy in crack localization. Finally, we integrate CMCAB into many crack detection algorithms and test them on public datasets. The results demonstrate that CMCAB enhances the performance of crack detection algorithms regarding various metrics and provides better stability and generalization ability for crack detection.
Ma et al. (Wed,) studied this question.