Trustworthy Visual Quality Inspection under Data Scarcity in Manufacturing
Authors: Panagiotis Sapoutzoglou, Jessy Ribaira, Martin Kanounnikoff, Bas Tijsma, Christian Geiß, Maria Pateraki
Organizations: National Technical University of Athens, Athens, Greece · German Aerospace Center (DLR), Germany · Philips, High Tech Campus 52, 5656 AG Eindhoven, The Netherlands · University of Bonn, Bonn, Germany
Automated visual inspection in manufacturing aims to replace slow and inconsistent manual checks, but its economic value depends on whether its decisions can be trusted enough to automate routine inspection while reserving human expertise for ambiguous cases. In production-line settings, defective samples are scarce, since the process is optimized to produce good parts, which limits any learning-based inspector trained on real data alone. Compounding this, defect decisions emitted as hard labels with no confidence estimate carry an asymmetric cost: a false reject wastes a good product, while a false accept may increase the risk of undetected defects progressing through the production process. We address both problems by mitigating data scarcity through the generation of synthetic defective samples with a diffusion model, and meeting the need for confidence-aware decisions with a Bayesian classifier that defers ambiguous units to human review rather than misclassifying them. These components are embedded in a staged pipeline of successive, complementary checks. We evaluate how synthetic augmentation affects classification and localization on a test set of real defects, and examine the system's trustworthiness at three points: the decision, the synthetic data, and the pipeline structure. This work-in-progress reports preliminary results suggesting that diffusion-generated defects, combined with uncertainty-aware classification, can lower the cost of reaching a trustworthy, deployable inspection model under data scarcity.
Figures & tables
Figure 1: Overview of the proposed pipeline. Offline: DualAnoDiff [ 12 ] generates synthetic defects to train the EfficientNet classifier, while EfficientAD [ 1 ] is trained on defect-free samples. Online: a segmented image passes a print check, EfficientAD anomaly detection, and EfficientNet classification, deferring uncertain units to human review.
Figure 2: Synthetic defect samples generated with DualAnoDiff with their corresponding generated masks.
Deep Ensemble
Bayesian
2 Classes
3 Classes
2 Classes
3 Classes
Number of images per class
50
100
500
50
100
500
50
100
500
50
100
500
Performance metrics
Accuracy
1.000
1.000
1.000
0.625
0.750
0.750
1.000
1.000
1.000
0.667
0.750
0.833
Precision
1.000
1.000
1.000
0.500
0.857
0.857
1.000
1.000
1.000
0.500
0.778
0.853
Recall
1.000
1.000
1.000
0.625
0.750
0.750
1.000
1.000
1.000
0.667
0.750
0.833
Table 1: Comparison of Deep Ensemble and Bayesian models under different dataset configurations. The number of images represents the number of images per class.For the calibration metrics and uncertainty, the metric has been multiplied by the given factor in the parenthesis.
Throughput (img/s)
Latency (s)
Segmentation
5.26
0.1911
Print Check
25.96
0.0391
Anomaly
3.99
0.2503
Classification
Bayesian
1.97
0.5073
Deep Ensemble
15.90
0.0629
Table 2: Inference system performance based on the different steps (chassis segmentation, print check, anomaly detection with EfficientAD, and classifier) of the pipeline from Fig 1 .
Industrial inspection uses sensing, computer vision, and robotics to detect, measure, and explain defects and verify product or infrastructure quality.
Industrial visual inspection systems often suffer from a severe scarcity of labeled defect data, particularly during the early stages of New Product Introduction (NPI). This limitation hinders the deployment of robust supervised detectors precisely when automated quality control is most needed. We present an end-to-end generative framework for high-fidelity, few-shot defect synthesis that enables both in-domain augmentation and cross-domain transfer. Our approach disentangles defect morphology from background appearance by combining masked textual inversion for defect representation learning, noise-blended conditioned generation for surface-aware synthesis, and gradient-aware post-processing for seamless visual integration. We evaluate the framework in two practically relevant settings: few-shot data augmentation, where synthetic samples enrich a small set of real defects, and zero-shot adaptation, where defects learned from a source domain are transferred to a novel target surface without any real target-domain defect examples. Using RF-DETR as the downstream detector, we show that the proposed pipeline substantially narrows the domain gap on a private industrial dataset. In the few-shot setting, synthetic augmentation improves mAP from 78.8% to 83.3%. In the zero-shot setting, synthetic domain adaptation improves mAP from 65.0% to 85.1%. These results demonstrate that high-fidelity defect synthesis can meaningfully accelerate NPI by enabling effective inspection models before sufficient real defect data has been collected.
The bottleneck in learning-based industrial defect detection is often limited not by model capacity, but by the scarcity of labeled defect data: defects are rare, annotations are expensive, and collecting balanced training sets is slow. We present an end-to-end pipeline for synthetic defect generation and annotation, combining Vision-Language-Model-based prompts, LoRA-adapted diffusion, mask-guided inpainting, and sample filtering with automatic label derivation, and demonstrates the potential of real data with realistic synthetic samples to overcome data scarcity. The evaluation is conducted on, a challenging dataset of pitting defects on ball screw drives, and then on a subset of the Mobile phone screen surface defect segmentation dataset (MSD) dataset to test cross-domain transfer. Beyond downstream detector performance, we analyze key stages of the pipeline, including prompt construction, LoRA selection, and sample filtering with DreamSim and CLIPScore, to understand which synthetic samples are both realistic and useful. Experiments with YOLOv26, YOLOX, and LW-DETR show that synthetic-only training does not replace real data. When combined with real data, synthetic defects can preserve performance and yield modest gains in selected BSData training regimes. The MSD transfer study shows that the overall pipeline structure carries over to a second industrial inspection domain, while also highlighting the importance of domain-specific adaptation and annotation-quality control. Overall, the paper provides an end-to-end assessment of diffusion-based industrial defect synthesis and shows that its strongest value lies in strengthening scarce real datasets rather than substituting for them.
Paul Julius Kühn, Mika Pommeranz, Arjan Kuijper +1
Class imbalance is a persistent challenge in visual recognition, particularly in safety-critical domains where collecting positive examples is expensive and rare events are inherently underrepresented. We propose a lightweight synthetic data augmentation pipeline that fine-tunes a LoRA adapter on as few as 20-50 real images of a rare class and uses a pretrained diffusion model to generate synthetic samples for training. We systematically vary the synthetic-to-real ratio and evaluate the approach across two structurally different domains: chest X-ray pathology classification (NIH ChestX-ray14) and industrial surface crack detection (Magnetic Tile Defect dataset). All evaluations are performed on held-out sets of real images only. Across both domains, synthetic augmentation consistently improves rare-class recall and F1 compared to training with real data alone. Performance improves with moderate synthetic augmentation and shows diminishing returns as the synthetic ratio increases. These results suggest that LoRA-adapted diffusion models provide a simple and scalable mechanism for augmenting rare classes, enabling effective learning in data-scarce scenarios across heterogeneous visual domains.
Daniil Dushenev, Nazariy Karpov, Daniil Zinovjev +2
National University of Science and Technology MISIS, Moscow, Russia