CD-Mosaic: A Context-Aware and Domain-Consistent Data Augmentation Method for PCB Micro-Defect Detection

Detecting minute defects, such as spurs on the surface of a Printed Circuit Board (PCB), is extremely challenging due to their small size (average size < 20 pixels), sparse features, and high dependence on circuit topology context. The original Mosaic data augmentation method faces significant challenges with semantic adaptability when dealing with such tasks. Its unrestricted random cropping mechanism easily disrupts the topological structure of minute defects attached to the circuits, leading to the loss of key features. Moreover, a splicing strategy without domain constraints struggles to simulate real texture interference in industrial settings, making it difficult for the model to adapt to the complex and variable industrial inspection environment. To address these issues, this paper proposes a Context-aware and Domain-consistent Mosaic (CD-Mosaic) augmentation algorithm. This algorithm abandons pure randomness and constructs an adaptive augmentation framework that synergizes feature fidelity, geometric generalization, and texture perturbation. Geometrically, an intelligent sampling and dynamic integrity verification mechanism, driven by “utilization-centrality”, is designed to establish a controlled sample quality distribution. This prioritizes the preservation of the topological semantics of dominant samples to guide feature convergence. Meanwhile, an appropriate number of edge-truncated samples are strategically retained as geometric hard examples to enhance the model’s robustness against local occlusion. For texture, a dual-granularity visual perturbation strategy is proposed. Using a homologous texture library, a hard mask is generated in the background area to simulate foreign object interference, and a local transparency soft mask is applied in the defect area to simulate low signal-to-noise ratio imaging. This strategy synthesizes visual hard examples while maintaining photometric consistency. Experiments on an industrial-grade PCB dataset containing 2331 images demonstrate that the YOLOv11m model equipped with CD-Mosaic achieves a significant performance improvement. Compared with the native Mosaic baseline, the core metrics [email protected] and Recall reach 0.923 and 86.1%, respectively, with a net increase of 8.3% and 8.8%; [email protected]:0.95 and APsmall, which characterize high-precision localization and small target detection capabilities, are improved to 0.529 (+3.0%) and 0.534 (+3.3%), respectively; the comprehensive metric F1-score jumps to 0.903 (+6.2%). The experiments prove that this method effectively solves the problem of missed detections of industrial minute defects by balancing sample quality and detection difficulty. Moreover, the inference speed of 84.9 FPS fully meets the requirements of industrial real-time detection.

Authors

Institutions

Publication Details

Journal
Electronics
Published
2026-02-11
DOI
https://doi.org/10.3390/electronics15040767
Primary Topic
Industrial Vision Systems and Defect Detection
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

CD-Mosaic: A Context-Aware and Domain-Consistent Data Augmentation Method for PCB Micro-Defect Detection

Sifan Lai, Xiaoting Guo, Shuangchao Ge, Jie Li
Electronics
Industrial Vision Systems and Defect Detection
article

CD-Mosaic: A Context-Aware and Domain-Consistent Data Augmentation Method for PCB Micro-Defect Detection

Sifan Lai, Xiaoting Guo, Shuangchao Ge, Jie Li
article en

Abstract

Detecting minute defects, such as spurs on the surface of a Printed Circuit Board (PCB), is extremely challenging due to their small size (average size < 20 pixels), sparse features, and high dependence on circuit topology context. The original Mosaic data augmentation method faces significant challenges with semantic adaptability when dealing with such tasks. Its unrestricted random cropping mechanism easily disrupts the topological structure of minute defects attached to the circuits, leading to the loss of key features. Moreover, a splicing strategy without domain constraints struggles to simulate real texture interference in industrial settings, making it difficult for the model to adapt to the complex and variable industrial inspection environment. To address these issues, this paper proposes a Context-aware and Domain-consistent Mosaic (CD-Mosaic) augmentation algorithm. This algorithm abandons pure randomness and constructs an adaptive augmentation framework that synergizes feature fidelity, geometric generalization, and texture perturbation. Geometrically, an intelligent sampling and dynamic integrity verification mechanism, driven by “utilization-centrality”, is designed to establish a controlled sample quality distribution. This prioritizes the preservation of the topological semantics of dominant samples to guide feature convergence. Meanwhile, an appropriate number of edge-truncated samples are strategically retained as geometric hard examples to enhance the model’s robustness against local occlusion. For texture, a dual-granularity visual perturbation strategy is proposed. Using a homologous texture library, a hard mask is generated in the background area to simulate foreign object interference, and a local transparency soft mask is applied in the defect area to simulate low signal-to-noise ratio imaging. This strategy synthesizes visual hard examples while maintaining photometric consistency. Experiments on an industrial-grade PCB dataset containing 2331 images demonstrate that the YOLOv11m model equipped with CD-Mosaic achieves a significant performance improvement. Compared with the native Mosaic baseline, the core metrics [email protected] and Recall reach 0.923 and 86.1%, respectively, with a net increase of 8.3% and 8.8%; [email protected]:0.95 and APsmall, which characterize high-precision localization and small target detection capabilities, are improved to 0.529 (+3.0%) and 0.534 (+3.3%), respectively; the comprehensive metric F1-score jumps to 0.903 (+6.2%). The experiments prove that this method effectively solves the problem of missed detections of industrial minute defects by balancing sample quality and detection difficulty. Moreover, the inference speed of 84.9 FPS fully meets the requirements of industrial real-time detection.

ElectronicsVol. 15(4)
North University of China (CN)
Openalex Percentile: Top 60%
Industrial Vision Systems and Defect Detection
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.