UP-CrackNet: Unsupervised Pixel-Wise Road Crack Detection via Adversarial Image Restoration

Nachuan Ma, Rui Fan, Lihua Xie

Abstract

Automated methods for road crack detection aim to replace manual visual inspection with efficient, objective, and accurate pixel-wise analysis. While supervised semantic segmentation algorithms show promise, they require vast amounts of labor-intensive pixel-level annotations and often suffer from poor generalizability. We propose UP-CrackNet, an unsupervised framework that detects cracks by learning to restore "corrupted" images of healthy pavement. By training a Generative Adversarial Network (GAN) exclusively on undamaged road data, the system treats cracks as anomalies to be erased. Experimental results demonstrate that UP-CrackNet outperforms general-purpose unsupervised anomaly detection algorithms and exhibits superior generalizability compared to state-of-the-art supervised methods.

Introduction

Maintaining road infrastructure is a critical but resource-heavy task. Conventional manual inspection is slow, expensive, and subjective. Deep learning has introduced automation through supervised semantic segmentation, but these models face two major hurdles: the labeling bottleneck, where creating pixel-level masks is prohibitively time-consuming, and the generalization gap, where models overfit to specific training environments. UP-CrackNet addresses these by utilizing an unsupervised approach, requiring only images of healthy roads—which are abundant and easy to collect—for training.

Methodology: Adversarial Image Restoration

The core of UP-CrackNet is a three-phase adversarial restoration process designed to learn the semantic context of healthy pavement.

  1. Random Corruption: During training, multi-scale square masks are randomly applied to undamaged road images, removing specific regions.
  2. Adversarial Restoration: A GAN, consisting of a Generator and a Discriminator, is tasked with filling these holes. Since the model only observes healthy pavement, it becomes an expert at inpainting textures like asphalt or concrete based on surrounding context.
  3. Anomaly Detection: During testing, a cracked image is fed into the model. Because the model has never seen a crack, it perceives the defect as "damage" to the expected healthy texture and attempts to "restore" the area with healthy pavement. An error map is then generated by calculating the pixel-wise difference between the original input and the restored output, effectively isolating the crack.
Overview of the UP-CrackNet architecture showing the training and testing pipelines.

The framework utilizes a sophisticated loss function combining Mean Absolute Error (MAE), Structural Similarity (SSIM), Multi-Scale Gradient Magnitude Similarity (MSGMS), and Style Loss to ensure the restored textures are indistinguishable from real pavement.

Experimental Evaluation

The model was evaluated on three prominent public datasets: Crack500 (500 high-resolution images), Deepcrack (537 multi-scale concrete crack images), and CFD (118 images used to test generalizability).

Key Results

UP-CrackNet demonstrates a significant performance leap over existing unsupervised methods and remains competitive with supervised benchmarks.

  • Unsupervised Superiority: UP-CrackNet outperformed unsupervised peers like SCADN and RIAD, showing an Intersection over Union (IoU) improvement of over 30% on the Crack500 and Deepcrack datasets.
  • Competitive Performance: Despite using zero human annotations, the model achieved an F1-score of 61.8% on Crack500, approaching the performance of several supervised models.
  • Robust Generalization: In cross-dataset tests, UP-CrackNet showed IoU improvements ranging from 3% to 45% over supervised methods when applied to unseen data, proving its adaptability for real-world deployment.
Quantitative comparison of UP-CrackNet against various supervised and unsupervised methods.

Discussion and Insights

A critical feature of UP-CrackNet is its avoidance of "identity mapping"—a common failure where models simply pass input to output without learning features. By using multi-scale masks, the network is forced to understand the surrounding context. Furthermore, by framing crack detection as an anomaly detection problem, the model becomes robust to various crack types (longitudinal, transverse, alligator) because it identifies anything that deviates from the learned distribution of "normal" road texture.

Conclusion

UP-CrackNet provides a powerful, annotation-free alternative for road crack detection. While the model occasionally struggles with extremely thin cracks or novel textures (like shadows or watermarks) not present in the training set, its superior generalizability makes it a strong candidate for automated inspection systems. Future work will focus on refining the architecture to improve the detection of fine-line cracks and integrating the system into real-time monitoring robots.

Summary updated

Abstract

Over the past decade, automated methods have been developed to detect cracks more efficiently, accurately, and objectively, with the ultimate goal of replacing conventional manual visual inspection techniques. Among these methods, semantic segmentation algorithms have demonstrated promising results in pixel-wise crack detection tasks. However, training such networks requires a large amount of human-annotated datasets with pixel-level annotations, which is a highly labor-intensive and time-consuming process. Moreover, supervised learning-based methods often struggle with poor generalizability in unseen datasets. Therefore, we propose an unsupervised pixel-wise road crack detection network, known as UP-CrackNet. Our approach first generates multi-scale square masks and randomly selects them to corrupt undamaged road images by removing certain regions. Subsequently, a generative adversarial network is trained to restore the corrupted regions by leveraging the semantic context learned from surrounding uncorrupted regions. During the testing phase, an error map is generated by calculating the difference between the input and restored images, which allows for pixel-wise crack detection. Our comprehensive experimental results demonstrate that UP-CrackNet outperforms other general-purpose unsupervised anomaly detection algorithms, and exhibits satisfactory performance and superior generalizability when compared with state-of-the-art supervised crack segmentation algorithms. Our source code is publicly available at mias.group/UP-CrackNet.
BibTeX
@article{ma2024up,
  author = {Nachuan Ma and Rui Fan and Lihua Xie},
  title = {{UP-CrackNet: Unsupervised Pixel-Wise Road Crack Detection via Adversarial Image Restoration}},
  journal = {IEEE Trans. Intell. Transp. Syst.},
  year = {2024},
  url = {https://openreview.net/forum?id=zK3mVVYnf8},
}
Figure