A Two-Stage Crack Image and Mask Generation Network for Data Augmentation Toward Efficient Crack Detection
Jingqi He, Hao Yang, Xiangyang XuCrack images and their annotation labels constitute a critical foundation for intelligent crack detection, yet manual annotation is time-consuming and labor-intensive with high costs. Existing generative methods face difficulties in simultaneously generating well-matched high-quality images and labels, resulting in insufficient reliability. Therefore, a two-stage crack data generation framework is proposed. The data are manually divided according to crack type, and category-specific mask-generation models are trained accordingly. The generated masks are then converted by E-Pix2Pix into realistic crack images with diverse backgrounds, alleviating class imbalance and data scarcity. First, to tackle discontinuous and noisy masks produced by the traditional Deep Convolutional Generative Adversarial Network (DCGAN), CA-DCGAN is constructed for category mask generation with the existing long-range modeling ConvAttn module. By suppressing image noise via enhanced structural similarity, it enables category-specific label production and addresses data imbalance at the source. Compared to DCGAN baseline, FID decreased by 42.38% and SSIM increased by 2.10%. Second, E-Pix2Pix is constructed for mask-to-image translation using the existing low-light-enhancing EBlock module to generate realistic images with stochastic backgrounds. This approach mitigates edge-feature obscuration in low-contrast environments, enhancing synthesis quality while effectively addressing data scarcity. Compared to Pix2Pix baseline, LPIPS decreased by 46.86% and FID decreased by 42.95%. To validate the authenticity and practical utility of the generated data, synthetic samples were merged with Crack500 to create three augmented datasets. Evaluations on six mainstream models show improved IoU, Dice, and F1, confirming category-based synthesis as a robust solution for data-scarce crack segmentation.