A versatile synthetic data generation framework for crack detection
Deep learning has shown remarkable promise in automating crack detection for civil infrastructure inspection, yet collecting and annotating large, high-quality datasets remains a major bottleneck. To address this challenge, we propose CrackGen—a versatile, fully controllable framework for synthetic data generation. By integrating fine-tuned Stable Diffusion models with ControlNet, CrackGen synthesizes unlimited crack images that closely mimic real-world variability in material textures, crack patterns, and morphological features. A pivotal innovation of our approach is that the same control conditions used to steer image creation naturally serve as ground truth labels, eliminating the need for labor-intensive post-generation annotation. This feature is especially critical for large-scale dataset construction. Through fine-tuning on extremely small training sets, CrackGen inherits the learned knowledge of Stable Diffusion, enabling users to adjust crack widths, orientations, and background materials through simple prompt adjustments. Our experiments systematically analyze how different parameter settings affect the fidelity and diversity of generated images. Additionally, we propose novel crack sketching methods, including a Rapidly-exploring Random Trees (RRT) algorithm that emulates real-world crack propagation paths to produce complex, fractal-like crack networks. Extensive experiments demonstrate that models trained purely on CrackGen-generated data achieve consistent, high-quality results on real-world crack detection tasks, validating the synthetic data’s robustness and practicality. This robustness was further confirmed through cross-domain validation on rock surfaces. The source code and datasets are freely available from GitHub repository ( https://github.com/GEO-ATLAS/CrackGen ). • CrackGen combines Stable Diffusion and ControlNet for realistic synthetic cracks. • Simultaneous image and label generation removes the need for manual annotation. • Controlled prompts allow full customization of backgrounds and crack properties. • RRT-based crack sketches yield fractal-like patterns mirroring real crack growth. • Purely synthetic data from CrackGen matches real detection performance.
Authors
- Jinsong Huang (ORCID: https://orcid.org/0000-0002-5159-1635)
- Umair Iqbal (ORCID: https://orcid.org/0000-0003-0894-0489)
- Anna Giacomini (ORCID: https://orcid.org/0000-0001-5115-3216)
- Hongyu Guo (ORCID: https://orcid.org/0000-0003-0487-3610)
- Baolin Chen (ORCID: https://orcid.org/0000-0002-3686-1625)
- Junyao Xie
Institutions
- Zhejiang Institute of Communications (CN)
- University of Newcastle Australia (AU)
Publication Details
- Journal
- Engineering Structures
- Published
- 2025-09-24
- DOI
- https://doi.org/10.1016/j.engstruct.2025.121428
- Citations
- 1
- Primary Topic
- Infrastructure Maintenance and Monitoring
- Type
- article
- Field-Weighted Citation Impact
- 0.95