AI scratching your car: Using diffusion models for training data generation in automotive damage detection

Julian Strietzel, M. Saquib Sarfraz, Rainer StiefelhagenForum Bildverarbeitung 2024

Abstract

Demand for reliable data remains a major issue in training machine learning models in computer vision. Frequently, datasets are of insufficient scale, imbalanced, not diverse, and of poor quality, potentially resulting in biased, inaccurate, non-robust, and badly generalizing models. Moreover, real-world training data can raise privacy concerns or be extremely expensive to gather, necessitating alternative solutions. This paper investigates the use of diffusion models for generative data augmentation in semantic image segmentation, specifically in the domain of vehicle damage detection. We propose a new approach that utilizes an existing diffusion model ControlNet to generate useful synthetic data depicting realistic vehicles with damages such as scratches, rim damages, dents and etc. Based on this we provide an analysis and show how such a generative data augmentation may help in scenarios where training data is scarce and of low quality.

Introduction

Training deep learning models for semantic segmentation—identifying exactly which pixels belong to a "scratch" vs. a "dent"—requires massive amounts of high-quality, labeled data. In the automotive industry, this is a major bottleneck. Collecting images of damaged vehicles is logistically difficult, expensive, and often results in "imbalanced" datasets where common issues like scratches are overrepresented compared to severe structural deformations. Furthermore, real-world data often carries privacy concerns or is tied to specific lighting conditions of a single inspection scanner, making models "brittle" when moved to a new location. This research explores "Generative Data Augmentation" (GDA) to bridge this gap by "hallucinating" realistic damage on demand.

Methodology: Guided Diffusion with ControlNet

The core of the proposed approach leverages ControlNet, an extension of the Stable Diffusion model that allows for fine-grained spatial control. Unlike standard text-to-image generation, this method provides the model with structural guidance to ensure the generated damage is both realistic and correctly labeled.

  1. Conditional Control: The model is fed edge detection maps (showing the car's structure) overlaid with color patches. These patches act as "labels-in-the-loop": for example, a pink patch on a wheel tells the AI to generate a scratch exactly in that spot.
  2. Prompting Schema: A two-part prompt is used: a specific description of the damage (e.g., "Rim damage at the yellow marking") and a background context prompt (e.g., "side of a car in a workshop, high quality").
  3. Damage-Specific Fine-Tuning: To improve quality, the researchers trained "specialist" models for each class (e.g., a model specifically fine-tuned only on images of dents).
  4. Quality Filtering: To ensure high-quality training data, a pre-trained segmentation model "grades" the synthetic images. Only images where the AI-generated damage aligned well with the intended label (Intersection over Union, IoU > 0.25) were kept.
Conditional control and generated samples for vehicle damage.

Experimental Setup

The study utilized several datasets to evaluate the impact of GDA:

  • real17k: 17,467 manually labeled real-world images from vehicle scanners.
  • real4*x: Downsampled versions (25 to 1000 images per class) to simulate data-scarce environments.
  • specific10k: The newly generated synthetic dataset containing 2,000 samples per damage class.
  • Out-of-domain: 170 images from different locations and scanner types to test generalization.

Key Results and Insights

The experiments revealed several critical insights into the utility of synthetic data for automotive applications.

Addressing the "Deformation" Bottleneck

The most significant gains were observed in the "deformation" class—the rarest and hardest-to-label category in the real dataset. Synthetic data provided a much-needed boost where real data was at its weakest, improving the F-score by approximately 0.03 when added to the real dataset.

Generalization and Out-of-Domain Performance

A striking finding was that synthetic data helps models perform better on unseen scanners. Because the diffusion model can generate various backgrounds and lighting conditions, it prevents the segmentation model from "overfitting" to the specific look of one workshop. In tests on data from unseen locations, the GDA-trained model outperformed the baseline by 25% in the deformation category.

The "Sweet Spot" for Synthetic Data

The authors identified a clear threshold: if fewer than 50–100 real images of a specific damage type are available, synthetic data is almost guaranteed to outperform or significantly augment training. However, training only on synthetic data resulted in poor performance (F-scores < 0.1), indicating that GDA is most effective as a supplement to real data.

Quantitative results on training data composition and generalization.

Conclusion

Generative Data Augmentation using diffusion models like ControlNet offers a powerful solution to the data scarcity problem in automotive damage detection. By providing high-fidelity, pre-labeled images, GDA not only improves performance on rare damage classes but also significantly enhances the robustness and generalization of models to new environments. While a "sim-to-real" gap still exists, the strategic integration of synthetic and real data represents a major step forward in building reliable computer vision systems for the automotive industry.

Summary updated

BibTeX
@inproceedings{strietzel2024ai,
  author = {Julian Strietzel and M. Saquib Sarfraz and Rainer Stiefelhagen},
  title = {{AI scratching your car: Using diffusion models for training data generation in automotive damage detection}},
  booktitle = {Forum Bildverarbeitung},
  year = {2024},
  url = {https://openreview.net/forum?id=I0jwdzPX7b},
}
Figure