Next Article in Journal
Applying Monte Carlo Method for Straight-Line Model Sensor Calibration
Previous Article in Journal
Multi-Scale Temporal Coordinate Attention Network with Peak-Aware Mechanism for Rolling Bearing Fault Diagnosis Under Low Signal-to-Noise Ratio Conditions
Previous Article in Special Issue
The Application of Mobile Devices for Measuring Accelerations in Rail Vehicles: Methodology and Field Research Outcomes in Tramway Transport
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

YOLOv12-VSD: A Transfer-Learning-Assisted Real-Time Detection Algorithm for Vehicle Surface Defects

1
Beijing Dublin International College, Beijing University of Technology, Beijing 100124, China
2
School of Information Science and Technology, Beijing University of Technology, Beijing 100124, China
*
Author to whom correspondence should be addressed.
Sensors 2026, 26(9), 2905; https://doi.org/10.3390/s26092905
Submission received: 29 March 2026 / Revised: 15 April 2026 / Accepted: 25 April 2026 / Published: 6 May 2026
(This article belongs to the Collection Sensors and Actuators for Intelligent Vehicles)

Abstract

Vehicle surface defect detection faces three core challenges: classification–localization inconsistency for boundary-sensitive defects, insufficient multi-scale feature response across defect sizes, and cross-scenario generalization degradation caused by domain shift among production lines. This paper proposes YOLOv12-VSD, an improved detection algorithm addressing these issues through coordinated modifications at three levels. An IoU-aware classification loss aligns classification confidence with localization quality. A reparameterized convolution module at the P4 feature level (P4-RepC3) enriches intermediate-layer directional feature diversity without increasing inference cost. A multi-scale spatial pyramid pooling–fast structure at the P5 feature level (P5-SPPF) expands the effective receptive field for large-area defects. A three-stage transfer learning framework comprising source-domain pretraining, target-domain adaptation, and low-learning-rate refinement is further designed to reduce domain shift with limited annotations. Experiments show that YOLOv12-VSD achieves a mean Average Precision at IoU threshold 0.50 (mAP@50) of 0.715, the highest among six comparison models, with only 6.1M parameters and 17.1 giga floating-point operations per second (GFLOPs). After three-stage transfer, mAP@50 improves from 0.531 to 0.652, with training duration reduced by 64%.

1. Introduction

Vehicle surface defect detection is a critical step in automotive end-of-line quality inspection. Undetected defects such as cracks, paint peeling, dents, and corrosion directly affect product appearance and durability, incurring rework costs and brand reputation losses [1]. Traditional manual inspection suffers from low efficiency and strong subjectivity, while threshold-based image processing methods lack robustness under specular reflection and complex paint texture conditions. Deep-learning-based detection models have substantially improved recognition accuracy and real-time performance for this task [2,3]. Nevertheless, three core challenges persist: (1) boundary-sensitive defects with high aspect ratios (e.g., elongated cracks) cause regression deviation and classification–localization inconsistency; (2) the scale span from minute pitting to large-area peeling demands both fine-grained and global feature perception; and (3) domain shift among vehicle models, equipment, and inspection stations constrains cross-scenario generalization.
Accurate localization and classification of boundary-sensitive defects remain difficult. Two-stage detectors such as Faster R-CNN achieve high accuracy through region proposal and refinement [4], and recent variants have introduced deformable convolutions [5] and multi-scale attention [6] to improve boundary regression for irregular defect shapes. However, their cascaded architectures incur high per-frame latency, limiting real-time applicability on production lines. One-stage YOLO detectors offer a favorable speed–accuracy trade-off for industrial deployment [7]. Wang et al. [8] improved YOLOv3 with focal loss to mitigate class imbalance in paint defects, yet the backbone’s limited expressiveness led to high false positive rates. Jiang et al. [9] enhanced boundary regression in YOLOv7 through residual multi-branch modules, at the cost of increased training overhead. Despite these efforts, a common limitation persists: classification confidence is decoupled from localization quality, causing high-confidence predictions with poor boundary fit—a critical issue for elongated cracks where even slight misalignment substantially degrades IoU [10].
The scale diversity of vehicle surface defects adds another layer of difficulty, with damage ranging from minute pitting to large-area paint peeling. Li et al. [11] introduced lightweight attention and adaptive fusion into YOLO to improve efficiency for multi-scale defects, but the compressed high-level features degraded detection of large-area damage. Liu et al. [12] combined YOLOv5 with deflectometry to enhance paint defect contrast, though hardware dependence limits deployment flexibility. Zhang et al. [13] applied deformable convolution and dynamic label assignment in YOLOv8, achieving strong results on steel defects but without validated cross-domain generalization to automotive surfaces. Wei et al. [14] used the Swin Transformer for long-range contextual modeling of large defects, yet the quadratic attention complexity constrains real-time operation [15]. YOLOv12 [16], a recent high-performing YOLO iteration with area attention, improves general detection but lacks explicit multi-scale pooling at the P5 layer and sufficient directional diversity at the P4 layer for vehicle-specific defect patterns.
Domain shift across production lines, vehicle models, and acquisition equipment degrades detection performance in cross-scenario deployment [17,18]. Transfer learning mitigates this by reusing source-domain representations under limited target-domain annotation conditions [19]. Kim et al. [20] applied a pretrain–fine-tune paradigm with YOLOv5, shortening training cycles but achieving limited generalization with large domain gaps due to a single fixed-rate fine-tuning step. Gao et al. [21] designed a two-stage transfer pipeline for stamped part defects using YOLOv4 with manual freezing-depth tuning, which lacks adaptability across different vehicle models. Park et al. [22] combined domain adversarial training with YOLO to enforce domain-invariant features, though optimization instability with large domain gaps limits practical effectiveness. Fu et al. [23] integrated multi-scale transfer with YOLOv8 for glass defect detection, improving fine-defect recall at the cost of increased complexity. A common shortcoming of existing transfer approaches is the reliance on a simple two-step pipeline (pretrain then fine-tune) without hierarchical adaptation, leading to either catastrophic forgetting or insufficient domain alignment [24,25].
The overarching goal of this work is to achieve fast, high-accuracy defect detection across diverse inspection scenarios—a single problem that decomposes into two sub-problems: (1) how to construct a detection model that attains high accuracy on boundary-sensitive and multi-scale vehicle defects and (2) how to adapt such a model to new production lines with minimal annotation and training time. These two sub-problems motivate, respectively, the algorithm design and the transfer learning framework proposed below. The YOLO architecture is chosen as the backbone because its single-pass inference provides the real-time throughput required by production-line deployment, where Transformer-based alternatives incur prohibitive latency. The main contributions are:
1.
To address sub-problem (1)—high-accuracy detection of boundary-sensitive and multi-scale vehicle defects—the YOLOv12-VSD algorithm is proposed with three targeted modifications, each driven by a specific domain-level deficiency rather than by heuristic combination: (a) classification–localization decoupling in boundary-sensitive defects (e.g., elongated cracks) motivates an IoU-aware classification loss that injects localization quality into sample assignment and classification targets, suppressing high-confidence but poorly localized predictions; (b) insufficient directional feature diversity at the P4 layer for mid-scale defects (e.g., cutouts, localized paint damage) motivates P4-RepC3, a reparameterized convolution module that enriches mid-layer filter diversity during training while folding into a single convolution at inference for zero additional cost; (c) absence of explicit multi-scale pooling at the P5 layer for large-area defects (e.g., paint peeling, pitting) motivates P5-SPPF, a lightweight spatial pyramid pooling structure that expands the effective receptive field through cascaded spatial pooling. The three modifications are not independently arbitrary choices but coordinated responses to three distinct failure modes observed in the baseline.
2.
To address sub-problem (2)—rapid cross-scenario adaptation under limited annotation conditions—a three-stage transfer learning pipeline is designed comprising source-domain pretraining (Stage I), target-domain high-rate adaptation (Stage II), and target-domain low-rate refinement (Stage III). Stage II is initialized from Stage I weights and rapidly aligns feature distributions to the target domain; Stage III is initialized from Stage II weights and conservatively refines discriminative boundaries with a reduced learning rate. This progressive strategy balances rapid domain alignment with preservation of general features, reducing performance fluctuation and training time in cross-scenario deployment.

2. YOLOv12-VSD Algorithm

YOLOv12 achieves competitive performance on general object detection benchmarks. However, when applied to vehicle surface defect detection, three domain-specific issues emerge. Elongated cracks and curved scratches with high aspect ratios are sensitive to boundary fitting accuracy, yet the classification branch of YOLOv12 does not encode localization quality, causing inconsistency between classification confidence and actual IoU. Mid-scale defects such as cutouts and localized paint damage require rich directional feature responses, but the A2C2f topology at the P4 layer offers limited convolutional diversity. Large-area peeling and pitting against complex automotive paint backgrounds demand broad contextual modeling, which the P5 layer cannot provide without explicit multi-scale pooling.
To address these three issues, the improved model YOLOv12-VSD is proposed with targeted modifications at three levels. An IoU-aware classification loss injects localization quality into sample assignment and classification targets, suppressing high-confidence but poorly localized predictions. A reparameterized convolution module deployed at the P4 feature level (P4-RepC3) enriches mid-layer filter diversity through multi-branch training while folding into a single convolution at inference for zero additional cost. A multi-scale spatial pyramid pooling–fast structure at the P5 feature level (P5-SPPF) expands the effective receptive field through cascaded spatial pooling, enhancing discriminability for large-area defects. The overall framework is shown in Figure 1.

2.1. YOLOv12 Baseline

YOLOv12 [16] is a recent high-performing iteration of the YOLO single-stage detection family [3], building upon YOLOv9 [26] with area attention and reparameterized convolution. The nano-scale variant (YOLOv12-N) was selected as the architectural baseline because it provides a compact and efficient single-stage foundation for real-time inspection while satisfying the memory and latency constraints typical of automotive production-line hardware. It also exposes several task-relevant bottlenecks in classification-localization consistency and multi-scale feature representation, making it a suitable starting point for the proposed targeted improvements. In addition, adopting YOLOv12 as the unified base model facilitates controlled ablation, fair comparison, and integration with the three-stage transfer learning framework. As shown in Figure 2, it retains the backbone–neck–head architecture. The backbone extracts multi-level features through hierarchical convolutions with cross-stage partial connections. The neck performs multi-scale fusion via feature pyramid and path aggregation [27]. The detection head adopts an anchor-free decoupled design, predicting bounding boxes, categories, and confidence scores at multiple scales.
Despite its strong general-purpose performance, YOLOv12 exhibits three limitations when applied to vehicle surface defects. (1) The CIoU-based regression loss is decoupled from the classification loss, resulting in weak correlation between classification confidence and localization quality. (2) The A2C2f stacking at the P4 layer provides limited directional diversity, constraining mid-scale feature expressiveness. (3) The P5 layer relies on standard convolutions without explicit multi-scale pooling, limiting contextual modeling for large-area defects.

2.2. IoU-Aware Classification Loss

Vehicle surface defects such as elongated cracks (aspect ratios up to 20:1), curved scratches, and irregular paint peeling are highly sensitive to boundary fitting accuracy. A slight misalignment between the predicted box and the actual defect contour can cause the detector to assign a high classification score to a poorly localized prediction. This arises because YOLOv12 decouples classification from regression: the classification branch learns only category discrimination without encoding localization quality. As a result, high-confidence predictions may correspond to low IoU, degrading non-maximum suppression and increasing false positives.
To resolve this inconsistency, the IoU-aware mechanism [28] is introduced. Its core idea is to use the IoU between each prediction box and its matched ground-truth box as a quality prior, injecting it into both sample assignment and classification loss. This ensures that classification scores maintain a monotonically positive correlation with localization precision.
This modification does not redesign the regression head. Instead, it operates at the supervision level by injecting IoU-derived quality information into sample assignment and classification target/loss construction.
Given a prediction box B and a ground-truth box G, their IoU is defined as
IoU ( B , G ) = | B G | | B G |
CIoU (Complete IoU) [29] extends IoU with center-point distance penalty and aspect ratio consistency constraints and was adopted as the regression metric. The boundary regression loss is
L IoU = 1 N i = 1 N 1 CIoU ( B i , G i )
where N is the total number of positive samples.
In the positive–negative sample assignment stage, the model follows the Task-Aligned Assignment (TAA) [30] strategy. The task alignment metric can be expressed as
A i j = p i j γ · IoU ( B i , G j ) δ
where p i j is the predicted confidence that anchor point i belongs to the j-th defect class. γ and δ are weight coefficients.
Let G i denote the ground-truth box to which anchor point i is ultimately assigned and its one-hot category label be
y i { 0 , 1 } C
After completing positive sample assignment, IoU quality weights are introduced on top of the one-hot category labels, constructing a quality-aware target vector:
q i c = IoU ( B i , G i ) · y i c
The classification branch is optimized using binary cross-entropy loss with q i c as soft labels:
L cls = 1 S i = 1 N c = 1 C q i c log σ ( p i c ) ( 1 q i c ) log ( 1 σ ( p i c ) )
where N is the number of positive sample anchor points, C is the number of defect categories, and S is a normalization factor.
In addition to regression and classification losses, Distribution Focal Loss (DFL) [28] is employed to refine bounding box coordinates by learning a discretized probability distribution over candidate positions:
L DFL = ( y i + 1 y ) log ( p i ) + ( y y i ) log ( p i + 1 )
where y is the continuous regression target, y i and y i + 1 are the two nearest discrete positions satisfying y i y y i + 1 , and p i , p i + 1 are their predicted probabilities.
The complete loss function is
L = λ box L IoU + λ cls L cls ( p , q ) + λ dfl L DFL
Through this design, classification scores are tightly bound to localization quality. Defects with accurate boundary fitting receive higher classification confidence, while poorly localized candidates are naturally suppressed. Importantly, the mechanism operates entirely at the loss level by reconstructing supervision labels and sample assignment criteria. It introduces no additional network parameters or inference-time computation.

2.3. P4-RepC3

Mid-scale vehicle surface defects, such as cutouts, localized paint damage, and short cracks, exhibit diverse geometric morphologies including irregular edges, varying orientations, and fine-grained texture gradients against specular automotive paint. Capturing these patterns requires rich directional and scale diversity in intermediate-layer convolution filters. However, the P4 layer of YOLOv12 employs an A2C2f module driven by area attention, which re-weights existing features but does not introduce explicit multi-directional convolutional decomposition. To address this limitation, the P4-RepC3 [31] reparameterized convolution module is introduced at the P4 layer.
Given the P4 input feature X R C × H × W , the P4-RepC3 module first constructs complementary intermediate representations through two 1×1 convolution branches:
U 0 = Conv 1 × 1 ( 1 ) ( X ) , V 0 = Conv 1 × 1 ( 2 ) ( X ) , U 0 , V 0 R C × H × W
The main branch U 0 passes sequentially through n RepConv units:
U k = ϕ ( k ) ( U k 1 ) , k = 1 , , n
During training, each RepConv unit consists of a 3 × 3 convolution branch and a 1 × 1 convolution branch in parallel:
ϕ ( k ) ( U ) = σ W 3 × 3 ( k ) U + b 3 × 3 ( k ) + W 1 × 1 ( k ) U + b 1 × 1 ( k )
After completing multi-layer RepConv stacking, P4-RepC3 performs element-wise residual fusion:
Y = U n + V 0
During inference, the dual-branch convolutions are equivalently folded into a single 3 × 3 convolution kernel:
ϕ infer ( k ) ( U ) = σ W ( k ) U + b ( k )
where the equivalent parameters are
W ( k ) = W 3 × 3 ( k ) + pad ( W 1 × 1 ( k ) ) , b ( k ) = b 3 × 3 ( k ) + b 1 × 1 ( k )
The schematic diagram of P4-RepC3 is shown in Figure 3.

2.4. P5-SPPF

Large-area defects on vehicle surfaces, including paint peeling spanning tens of pixels, extensive pitting clusters, and spidery glass fractures, require the detector to aggregate broad spatial context while preserving edge detail. These defects often appear against complex automotive paint backgrounds with specular highlights and color gradients, making them prone to background confusion when the receptive field is insufficient. The P5 layer of YOLOv12 relies solely on standard convolution stacking, which lacks explicit multi-scale contextual modeling. To address this, a lightweight P5-SPPF (SPPF [32] + RepC3 [31]) joint structure is introduced at the P5 layer.
For the input feature X R C × H × W , SPPF first compresses the channel dimension:
y 0 = Conv 1 × 1 ( 1 ) ( X ) , y 0 R C × H × W , C = C / 2
Three sequential pooling operations construct multi-scale contextual representations:
y 1 = MaxPool k ( y 0 ) , y 2 = MaxPool k ( y 1 ) , y 3 = MaxPool k ( y 2 )
The features at four scales are concatenated along the channel dimension:
Z = Concat ( y 0 , y 1 , y 2 , y 3 ) R 4 C × H × W
A 1 × 1 convolution maps back to the original channel count:
X SPPF = Conv 1 × 1 ( 2 ) ( Z ) R C × H × W
Subsequently, X SPPF is fed into the RepC3 block within the P5-SPPF module:
Y P 5 = f RepC 3 ( X SPPF )
The overall information flow is illustrated in Figure 4.

3. Three-Stage Transfer Learning Framework

In real-world vehicle quality inspection, imaging conditions vary considerably across production lines, vehicle models, and acquisition equipment. Differences in lighting, paint color, camera angle, and inspection station layout introduce significant domain shift between the data used for model training and the actual deployment environment [19]. Moreover, collecting and annotating large-scale defect samples for every new production scenario is costly and time-consuming. A staged fine-tuning strategy can mitigate these issues by first learning general defect representations on a data-rich source domain and then progressively adapting to the target domain under limited annotation conditions [24]. Accordingly, a three-stage transfer learning framework is designed around YOLOv12-VSD, comprising source-domain pretraining, target-domain adaptation, and low-learning-rate refinement.

3.1. Source and Target Domain Datasets

This study uses the NCAT12-DET vehicle surface defect dataset [33] as the source domain. The original image collection comprises over 20,000 images; a curated subset of 7200 high-resolution images was selected to ensure balanced coverage across all eight defect categories, using stratified sampling within each train/valid/test split to preserve the original class distribution. The subset covers eight typical vehicle surface states and defect types spanning three groups: glass surface defects (Clear Glass, Hairline Glass, and Spidery Glass), coating damage (Crack, Defaced Paint, and Paint-Peel), and structural anomalies (Cutouts and Inclusion).
To further verify the model’s adaptability and effectiveness, a task-aligned target-domain evaluation set was derived from the publicly available CarDD dataset [34]. Starting from an initial target size of 2000 images, we first defined an eligible category pool based on semantic correspondence with the vehicle surface defect inspection task and then randomly sampled images within the official train/valid/test splits in proportion to the original split sizes. After annotation verification, 1998 valid images were retained. Category remapping was used only to align semantically comparable defect concepts across domains for transfer evaluation. The resulting target subset should therefore be interpreted as a task-aligned CarDD-derived evaluation set rather than a reproduction of the full category space and exact marginal distribution of the original CarDD benchmark. No image was reassigned across official splits, and no image-level overlap was introduced between the source- and target-domain subsets. A partial comparison of source-domain and target-domain images is shown in Figure 5.

3.2. Framework Design

A naive two-step approach (pretrain then fine-tune) often leads to either catastrophic forgetting of source-domain features or insufficient adaptation to the target distribution. To balance feature retention and domain alignment, a three-stage framework was constructed. The schematic diagram is shown in Figure 6.
Stage I: Source-domain pretraining (Figure 6a). The model is trained on the large-scale source-domain dataset with a standard learning rate (0.008). The objective is to learn general defect representations, including local texture patterns (scratches and pitting) and geometric morphologies (cracks and peeling contours), that are shared across vehicle inspection scenarios. The resulting optimal weights serve as the initialization for the subsequent stage.
Stage II: Target-domain high-rate adaptation (Figure 6b). Starting from Stage I weights, the model is trained on the target-domain dataset with the same learning rate (0.008). The high learning rate enables rapid alignment of feature distributions to the new domain. Because all parameters are updated, the network can reorganize both low-level texture filters and high-level semantic representations to accommodate target-specific characteristics such as different paint colors, lighting conditions, and defect distributions.
Stage III: Target-domain low-rate refinement (Figure 6c). Initialized from Stage II weights, the model is further fine-tuned on the same target-domain data with a reduced learning rate (0.001). The low learning rate preserves the domain-aligned features acquired in Stage II while making conservative adjustments to the high-level discriminative boundaries. This progressive refinement is particularly beneficial for rare and hard-to-detect categories (e.g., hairline glass cracks), where aggressive parameter updates in Stage II may introduce instability. The best checkpoint within Stage III was selected as the final model.

3.3. Summary of Modifications Relative to Baseline YOLOv12

Table 1 provides a structured overview of all proposed modifications relative to the baseline YOLOv12, including the insertion position, purpose, and computational cost of each component.

4. Experiments and Analysis

4.1. Experimental Setup

The experiments were conducted on a high-performance cloud-based GPU server with an Intel Xeon Gold 6430 processor, an NVIDIA RTX 4090 GPU (24 GB), and 120 GB system memory. Python 3.12, PyTorch 2.5.1 with CUDA 12.4, and Ultralytics YOLO framework were employed. The specific configuration is listed in Table 2.
Training was performed with a batch size of 16 for 400 epochs, with input images resized to 640 × 640. The optimizer was SGD with an initial learning rate of 0.008, momentum of 0.937, and weight decay of 0.0005. Early stopping used a patience of 100 epochs, AMP was enabled, and the random seed was set to 0. Key augmentation and loss settings are summarized in Table 3, while unspecified options followed the default Ultralytics configuration.

4.2. Evaluation Metrics

Model performance is evaluated from two aspects: detection accuracy and computational efficiency. For accuracy, precision (P) and recall (R) characterize prediction correctness and defect coverage, respectively, with mAP@50 and mAP@50:95 serving as comprehensive metrics. For efficiency, GFLOPs measure inference-phase computational cost, FPS characterizes real-time inference throughput, and Training time records overall training overhead.
Precision (P) measures the proportion of true positives among all positive predictions:
P = TP TP + FP
where TP is true positives and FP is false positives. Recall (R) measures the proportion of actual defects successfully detected:
R = TP TP + FN
where FN is false negatives. mAP@50 averages the per-category average precision at IoU threshold 0.5:
mAP @ 50 = 1 C c = 1 C AP c | IoU = 0.5
where C is the number of categories and AP c is the area under the precision–recall curve for class c. mAP@50:95 extends this by averaging over IoU thresholds from 0.50 to 0.95:
mAP @ 50 : 95 = 1 C · T c = 1 C t = 1 T AP c | IoU = τ t
where τ t { 0.50 , 0.55 , , 0.95 } and T is the number of thresholds. GFLOPs normalizes the raw floating-point operation count to billions:
GFLOPs = FLOPs 10 9
Training time records the wall-clock duration from initialization to training completion:
T train = t end t start
where t start and t end are the start and end timestamps, respectively.
Frames Per Second (FPS) quantifies inference throughput as the number of images processed per second under single-image batch conditions:
FPS = M T inf
where M is the number of test images and T inf is the total wall-clock inference time excluding data loading and result post-processing.

4.3. Training Process Analysis

YOLOv12-VSD is trained systematically on the source domain. The resulting curves are shown in Figure 7.
As shown in Figure 7, the DFL loss decreases monotonically and converges to approximately 1.36 near epoch 245. mAP@50 reaches 0.711 by epoch 390 and stabilizes in the 0.71–0.72 range. The loss and accuracy curves converge smoothly in parallel, with no pronounced late-epoch oscillation. This pattern is consistent with the IoU-aware classification loss maintaining stable localization-aware confidence learning throughout training. Per-class evaluation results are shown in Table 4.
Per-class performance falls into three groups. Spidery Glass (mAP@50: 0.924), Crack (0.818), Inclusion (0.779), and Defaced Paint (0.719) are the top-performing categories. Their distinct edge contrast and moderate spatial scale are well matched to the multi-scale feature representations provided by P4-RepC3 and P5-SPPF. Paint-Peel (0.667) and Cutouts (0.636) sit in the middle tier, with adequate recall but limited high-IoU precision, a difficulty common to targets without sharply defined contours. Hairline Glass (0.630) and Clear Glass (0.550) remain the hardest classes because specular reflections and weak edge gradients reduce feature discriminability under standard RGB imaging conditions. The structural improvements proposed here address coarse-to-mid-scale defects effectively. Fine-grained specular categories remain the main area for further improvement.
Detection results of the proposed model are shown in Figure 8.
The detection results in Figure 8 are consistent with the quantitative findings. Large-area defects are enclosed with high-confidence boxes, while hairline cracks and similar fine-scale targets receive lower but above-threshold scores that reflect genuine boundary uncertainty. The confidence values are well stratified across defect sizes, which is useful for production-line deployment where a single threshold must balance detection rate against false-alarm rate. The representative failure cases indicate that the remaining errors are mainly associated with reflective interference, bright non-defect structures, and partial occlusion. In these scenarios, subtle Hairline Glass patterns may be confused with Paint-Peel-like regions or suppressed by stronger local distractors. Thin linear non-glass traces may also occasionally trigger false positives.

4.4. Ablation Experiments

To verify the contribution of each proposed module, ablation experiments were conducted across all eight combinations of IoU-aware classification, P5-SPPF, and P4-RepC3. The complete results are summarized in Table 5.
Adding IoU-aware classification alone raises precision from 0.677 to 0.704 (+2.7 pp) at no additional inference cost (GFLOPs remain at 18.3). The gain is concentrated in boundary-sensitive categories, which is consistent with the idea that tying classification confidence to localization quality can suppress some high-confidence false positives. When structural modules are applied individually without IoU-aware classification, P5-SPPF alone reaches mAP@50 = 0.704 and P4-RepC3 alone reaches 0.696, both above the baseline (0.688). In this setting, P5-SPPF shows the larger standalone gain. Combining structural modules with IoU-aware classification is associated here with concurrent gains in precision and recall. IoU-aware classification combined with P4-RepC3 achieves mAP@50 = 0.698, while adding P5-SPPF to P4-RepC3 (without IoU-aware classification) reaches 0.710 with higher recall (R = 0.707). The full three-component model yields the most balanced overall result (P = 0.684, R = 0.697, mAP@50 = 0.715) and ranks highest among the evaluated configurations. The IoU-aware+P5-SPPF configuration achieves the highest mAP@50:95 (0.380), slightly above the full model (0.379). This 0.001 gap may indicate a mild precision–localization trade-off after adding P4-RepC3: recall rises from 0.689 to 0.697 and mAP@50 increases from 0.712 to 0.715, while the stricter mAP@50:95 decreases by 0.001. In the current experiments, this trade-off appears minor relative to the corresponding mAP@50 gain and the FPS improvement from 67.2 to 104.3. Despite the cumulative module additions, total GFLOPs drop from 18.3 to 17.1 in the full model. P4-RepC3 folds its multi-branch training convolutions into a single 3 × 3 kernel at inference, which helps offset the modest overhead introduced by P5-SPPF. This efficiency is also reflected in measured inference speed. YOLOv12-VSD reaches 104.3 FPS—the highest among all eight configurations—compared with 69.2 FPS for the unmodified baseline. Adding P5-SPPF alone reduces throughput slightly to 67.2 FPS, whereas the P4-RepC3+P5-SPPF combinations recover speed to 104.3 FPS. This pattern is consistent with the lower inference overhead of reparameterized convolution in this setting.

4.5. Comparison Experiments

To evaluate the overall competitiveness of YOLOv12-VSD, six representative improved YOLO models were used as comparison baselines. These models were reimplemented according to the corresponding original papers and retrained locally in a unified experimental pipeline. All models were trained and evaluated with identical settings to ensure a fair comparison. The results are recorded in Table 6.
For each model in Table 6, the second row reports the standard deviation (std) across N = 5 independent training runs with fixed seeds (42, 123, 456, 789, 1024). Bold values in the std rows mark the most stable result within each metric column.
As shown in Table 6, YOLOv12-VSD records the highest mAP@50 (0.715) and mAP@50:95 (0.379) among the compared methods. It also delivers the highest inference throughput at 104.3 FPS on a single NVIDIA RTX 4090. With 6.1 M parameters, the proposed model remains in the lightweight range of the compared methods, suggesting a favorable balance between accuracy and real-time latency in this setting.
Among the three models whose mAP@50 exceeds 0.710, YOLOv12-VSD shows clear advantages in both throughput and training reproducibility. LDBF-YOLO is the closest accuracy competitor (mAP@50 = 0.712, trailing by 0.003). However, its cross-run standard deviations for precision and recall (0.034 and 0.039) are approximately twice those of YOLOv12-VSD (0.017 and 0.008), which suggests greater sensitivity to random initialization across runs. Although LDBF-YOLO uses fewer parameters (4.7 M vs. 6.1 M) and a slightly lower computational budget (15.6 vs. 17.1 GFLOPs), it operates at 92.1 FPS, 13.2 percent below the proposed model. DART-YOLO reaches mAP@50 = 0.711 (trailing by 0.004) with 5.1 M parameters, yet its inference speed is only 55.8 FPS, approximately half that of YOLOv12-VSD. Its mAP@50 standard deviation (0.008) is also twice that of YOLOv12-VSD (0.004), which likewise suggests lower run-to-run stability in the current experiments.
The remaining four baselines show larger accuracy deficits. SCBF-YOLO (mAP@50 = 0.704) employs BiFPN with channel and spatial attention, uses 5.3 M parameters, and reaches 67.3 FPS in the current setting. TRS-YOLO (mAP@50 = 0.700) uses 7.5 M parameters and carries the highest computational load among all compared models (19.4 GFLOPs). It also exhibits a precision–recall imbalance (P = 0.716, R = 0.670), consistent with a higher-confidence but lower-recall operating profile. YOLOv12-VSD exceeds it by 0.015 in mAP@50, with a more balanced P/R profile and nearly twice the throughput (104.3 vs. 60.6 FPS). DCTL-YOLO (mAP@50 = 0.693) and FAST-YOLO (mAP@50 = 0.684) are both compact designs at 4.7 M parameters, yet their measured throughput remains 61.1 and 79.6 FPS, respectively. These comparisons indicate that parameter count alone does not determine deployment efficiency in the present setting. The proposed combination of module design and a reparameterized inference path is also important. Across all six baselines, YOLOv12-VSD records the lowest cross-run standard deviation for mAP@50 (0.004), indicating that its accuracy advantage is reproducible rather than appearing only with a single seed. The compact footprint (6.1 M parameters, 17.1 GFLOPs) therefore remains compatible with deployment on resource-constrained embedded vision hardware.

4.6. Transfer Framework Validation

Figure 9 provides a visual illustration of the quantitative trends above. Without target-domain adaptation, the model mislabels several instance types and produces fragmented, low-confidence detections, most visibly for fine-grained categories such as Hairline Glass and paint scratches. After Stage III fine-tuning, category labels are more often correctly assigned and predicted boxes appear tighter, consistent with the mAP@50:95/mAP@50 localization ratio increase from 0.476 to 0.525. Confidence scores also rise across many defect classes. Qualitative gains are most visible in spectrally subtle (Hairline Glass, Clear Glass) and geometrically irregular (Cutouts, Paint-Peel) categories, which is consistent with the recall-driven improvement in Table 7.
From the observed category-confusion patterns in the qualitative results, a common source of false positives before fine-tuning is cross-category misclassification between Hairline Glass and Clear Glass (overlapping spectral response for standard RGB imaging) and between Cutouts and Inclusion (similar concave contours and local texture gradients). Stage III fine-tuning appears to reduce these cross-category errors for both pairs. At the same time, the representative failure cases in Figure 8 indicate that the main remaining limitations are concentrated in scenes with reflective backgrounds, bright foreign objects, or partial occlusion, where the local appearance of thin defects can be distorted or visually suppressed. Under these conditions, Hairline Glass may still shift toward visually broader categories. Weak crack evidence may also remain difficult to preserve consistently.

4.6.1. Transfer Learning Ablation Experiments

Three training configurations were compared. The results are shown in Table 8.
Switching from random to VSD.pt initialization improves mAP@50 by 2.0 pp (0.529 to 0.549) and reduces training time by 28.6% (1.301 h to 0.929 h). This pattern is consistent with the transferability of general defect feature representations learned in Stage I. The largest jump is observed after Stage III low-learning-rate fine-tuning: mAP@50 advances a further 10.7 pp to 0.656, and training time falls to 0.318 h. This may be related to Stage III starting from weights already close to the target optimum and therefore requiring only a brief refinement pass. Applying high learning rates directly to domain-shifted data may disrupt the general features acquired in Stage I. In the current experiments, the staged progression is associated with a more stable convergence trajectory.

4.6.2. Transfer Learning Comparison Experiments

Six improved YOLO variants initialized from matching general pretrained checkpoints are compared with YOLOv12-VSD initialized from VSD.pt. The results are shown in Table 9.
Among all transfer learning baselines, YOLOv12-VSD records the highest mAP@50 (0.656), recall (0.596), and precision (0.668), leading the second-ranked SCBF-YOLO by 5.1 pp in mAP@50. The training-time gap is also large: YOLOv12-VSD completes fine-tuning in 0.318 h, compared to 3.241 h for TRS-YOLO, 3.473 h for LDBF-YOLO, and 7.135 h for DART-YOLO. This corresponds to a speedup of more than five times relative to those three models. Two factors may contribute to this gap. First, the compact architecture (6.1 M parameters, 17.1 GFLOPs) reduces per-epoch computation. Second, Stage III starts from weights already adapted by Stage II, so only a short refinement pass is required before convergence. The combined accuracy and efficiency profile is therefore consistent with the practical feasibility of deploying YOLOv12-VSD across different production scenarios with limited additional annotation effort.

5. Conclusions

This paper proposes YOLOv12-VSD and a coordinated three-stage transfer learning framework to address boundary localization inconsistency, insufficient multi-scale feature response, and cross-scenario generalization degradation in vehicle surface defect detection. On the source domain, YOLOv12-VSD improves mAP@50 from 0.688 to 0.715 over the baseline and records the highest mAP@50 among six comparison models while maintaining a compact 6.1 M-parameter, 17.1 GFLOP design. After three-stage transfer to the target domain, mean mAP@50 increases from 0.531 to 0.652, while training duration decreases from 0.794 h to 0.289 h. These results suggest that the proposed design is promising for balancing accuracy, efficiency, and transferability in this setting. Limitations include reliance on a single publicly available target-domain dataset and the absence of layer-freezing or knowledge distillation in the transfer pipeline. Future work will explore self-supervised pretraining, active learning for annotation reduction, and cross-dataset validation on public automotive defect benchmarks.

Author Contributions

Conceptualization, H.L. and Y.L.; methodology, H.L.; software, H.L.; validation, H.L.; formal analysis, H.L.; investigation, H.L.; resources, Y.L.; data curation, H.L.; writing—original draft preparation, H.L.; writing—review and editing, Y.L. and D.Z.; visualization, H.L.; supervision, Y.L. and D.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the National Key Research and Development Program of China (2021YFA0715101) and the Natural Science Foundation of China (42376178).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The source-domain dataset (NCAT12-DET) used in this study is publicly available at https://github.com/Brym-Gyimah/NCAT12-DET (accessed on 14 April 2026) [33]. The target-domain dataset was reorganized from the publicly available CarDD dataset [34] (https://cardd-ustc.github.io (accessed on 14 April 2026)); the reorganized subset is available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
YOLOYou Only Look Once
VSDVehicle Surface Defect
IoUIntersection over Union
CIoUComplete Intersection over Union
P4-RepC3Reparameterized Convolution at P4 Layer
P5-SPPFSpatial Pyramid Pooling–Fast at P5 Layer
SPPFSpatial Pyramid Pooling Fast
mAPMean Average Precision
GFLOPsGiga Floating-Point Operations

References

  1. Ma, Y.; Yin, J.; Huang, F.; Li, Q. Surface defect inspection of industrial products with object detection: A comprehensive survey. Artif. Intell. Rev. 2024, 57, 333. [Google Scholar] [CrossRef] [Scilit]
  2. Mou, H.; Zhang, M. A lightweight detection network for vehicle paint defects in specular surfaces. Digit. Signal Process. 2025, 168, 105704. [Google Scholar] [CrossRef] [Scilit]
  3. Hussain, M. YOLO-v1 to YOLO-v8, the rise of YOLO and its complementary nature toward digital manufacturing and industrial defect detection. Machines 2023, 11, 677. [Google Scholar] [CrossRef] [Scilit]
  4. Zou, Z.; Chen, K.; Shi, Z.; Guo, Y.; Ye, J. Object detection in 20 years: A survey. Proc. IEEE 2023, 111, 257–276. [Google Scholar] [CrossRef] [Scilit]
  5. Wi, T.; Yang, M.; Park, S.; Jeong, J. D2-SPDM: Faster R-CNN-based defect detection and surface pixel defect mapping with label enhancement in steel manufacturing processes. Appl. Sci. 2024, 14, 9836. [Google Scholar] [CrossRef] [Scilit]
  6. Zhang, C.; Yu, B.; Wang, W. Steel surface defect detection based on improved Mask RCNN. In Proceedings of the 2022 IEEE 8th International Conference on Computer and Communications (ICCC), Chengdu, China, 9–12 December 2022. [Google Scholar] [CrossRef] [Scilit]
  7. Terven, J.; Cordova-Esparza, D. A comprehensive review of YOLO architectures in computer vision: From YOLOv1 to YOLOv8 and YOLO-NAS. Mach. Learn. Knowl. Extr. 2023, 5, 1680–1716. [Google Scholar] [CrossRef] [Scilit]
  8. Wang, J.; Su, S.; Wang, W.; Chu, C.; Jiang, L.; Ji, Y. An object detection model for paint surface detection based on improved YOLOv3. Machines 2022, 10, 261. [Google Scholar] [CrossRef] [Scilit]
  9. Wang, C.; Sun, Q.; Dong, X.; Chen, J. Automotive adhesive defect detection based on improved YOLOv8. Signal Image Video Process. 2024, 18, 2583–2595. [Google Scholar] [CrossRef] [Scilit]
  10. Leng, Y.; Liu, J. Improved Faster R-CNN for steel surface defect detection in industrial quality control. Sci. Rep. 2025, 15, 30093. [Google Scholar] [CrossRef] [Scilit]
  11. Huang, H.; Zhu, K. Automotive parts defect detection based on YOLOv7. Electronics 2024, 13, 1817. [Google Scholar] [CrossRef] [Scilit]
  12. Liu, J.; Zhao, S.; Jin, J.; Wang, Q. Car paint defect detection with YOLOv5 based on phase measuring deflectometry. In Proceedings of the IEEE International Conference on Mechatronics and Automation, Glasgow, UK, 20–23 May 2024; pp. 1–6. [Google Scholar]
  13. Zhao, D.; Sun, R.; Li, W.; Ma, Y.; Tong, T.; Yuan, X.; Wang, D.; Liu, P.; Li, B.; Kong, D.; et al. LAM-YOLOv10: Lightweight and multiscale feature enhancement for paint surface defect detection model. J. Electron. Imaging 2025, 34, 33022. [Google Scholar] [CrossRef] [Scilit]
  14. Xu, S.; Shao, Z. An improved Faster RCNN based on Swin Transformer for surface defect detection. In Proceedings of the ACM International Conference on Computer Science and Artificial Intelligence; Association for Computing Machinery: New York, NY, USA, 2023. [Google Scholar] [CrossRef] [Scilit]
  15. Zhao, Y.; Lv, W.; Xu, S.; Wei, J.; Wang, G.; Dang, Q.; Liu, Y.; Chen, J. DETRs beat YOLOs on real-time object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2024; pp. 16965–16974. [Google Scholar]
  16. Tian, Y.; Ye, Q.; Doermann, D. YOLOv12: Attention-centric real-time object detectors. arXiv 2025, arXiv:2502.12524. [Google Scholar]
  17. Zajec, P.; Rožanec, J.M.; Theodoropoulos, S.; Fontul, M.; Koehorst, E.; Fortuna, B.; Mladenić, D. Few-shot learning for defect detection in manufacturing. Int. J. Prod. Res. 2024, 62, 6979–6998. [Google Scholar] [CrossRef] [Scilit]
  18. Liu, Y.; Zhang, C.; Dong, X. A survey of real-time surface defect inspection methods based on deep learning. Artif. Intell. Rev. 2023, 56, 12131–12170. [Google Scholar] [CrossRef] [Scilit]
  19. Iman, M.; Arabnia, H.; Rasheed, K. A review of deep transfer learning and recent advancements. Technologies 2023, 11, 40. [Google Scholar] [CrossRef] [Scilit]
  20. Jung, D.Y.; Oh, Y.J.; Kim, N.H. A study on GAN-based car body part defect detection process and comparative analysis of YOLO v7 and YOLO v8 object detection performance. Electronics 2024, 13, 2598. [Google Scholar] [CrossRef] [Scilit]
  21. Shi, W.; Dai, J.; Li, C.; Niu, N. YOLOv11-EMD: An enhanced object detection algorithm assisted by multi-stage transfer learning. Mathematics 2025, 13, 2769. [Google Scholar] [CrossRef] [Scilit]
  22. Oquab, M.; Darcet, T.; Moutakanni, T.; Vo, H.; Szafraniec, M.; Khalidov, V.; Fernandez, P.; Haziza, D.; Massa, F.; El-Nouby, A.; et al. DINOv2: Learning robust visual features without supervision. arXiv 2023, arXiv:2304.07193. [Google Scholar]
  23. Dhrangdhariya, P.; Saini, P.; Maiti, S.; Rai, B. Multi-class classification of paint/coating defects using transfer learning. Eng. Appl. Artif. Intell. 2025, 148, 111320. [Google Scholar] [CrossRef] [Scilit]
  24. Alzubaidi, L.; Bazi, J.; Al-Sabaawi, A.; Santamaría, J.; Albahri, A.S.; Al-Dabbagh, B.S.N.; Fadhel, M.A.; Manoufali, M.; Zhang, J.; Al-Timemy, A.H.; et al. A survey on deep learning tools dealing with data scarcity: Definitions, challenges, solutions, tips, and applications. J. Big Data 2023, 10, 46. [Google Scholar] [CrossRef] [Scilit]
  25. Nahar, L.; Awrangjeb, M.; Islam, M.S. AI-enabled defect detection in industrial products: A comprehensive survey, key insights and future research challenges. Adv. Eng. Inform. 2026, 69, 104067. [Google Scholar] [CrossRef] [Scilit]
  26. Wang, C.; Yeh, I.; Liao, H. YOLOv9: Learning what you want to learn using programmable gradient information. In Proceedings of the Computer Vision—ECCV 2024; ECCV 2024; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2024; Volume 15089, pp. 1–21. [Google Scholar] [CrossRef] [Scilit]
  27. Li, C.; Li, L.; Geng, Y.; Jiang, H.; Cheng, M.; Zhang, B.; Ke, Z.; Xu, X.; Chu, X. YOLOv6 v3.0: A full-scale reloading. arXiv 2023, arXiv:2301.05586. [Google Scholar] [CrossRef] [Scilit]
  28. Li, X.; Wang, W.; Wu, L.; Chen, S.; Hu, X.; Li, J.; Tang, J.; Yang, J. Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection. Adv. Neural Inf. Process. Syst. 2020, 33, 21002–21012. [Google Scholar]
  29. Zheng, Z.; Wang, P.; Liu, W.; Li, J.; Ye, R.; Ren, D. Distance-IoU loss: Faster and better learning for bounding box regression. In Proceedings of the AAAI Conference on Artificial Intelligence; AAAI Press: Palo Alto, CA, USA, 2020; Volume 34, pp. 12993–13000. [Google Scholar]
  30. Feng, C.; Zhong, Y.; Gao, Y.; Scott, M.R.; Huang, W. TOOD: Task-aligned one-stage object detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: New York, NY, USA, 2021; pp. 3490–3499. [Google Scholar]
  31. Ding, X.; Zhang, X.; Ma, N.; Han, J.; Ding, G.; Sun, J. RepVGG: Making VGG-style ConvNets great again. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2021; pp. 13733–13742. [Google Scholar]
  32. He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  33. Gyimah, N.; Akinie, R.; Yan, X.; Nabil, M.; Gupta, K.D.; Homaifar, A.; Hemmati, V.; Opoku, D. NCAT12-DET: A new benchmark dataset for surface defect detection and a comparative study. IEEE Access 2024, 12, 72607–72618. [Google Scholar] [CrossRef] [Scilit]
  34. Wang, X.; Li, W.; Wu, Z. CarDD: A new dataset for vision-based car damage detection. IEEE Trans. Intell. Transp. Syst. 2023, 24, 7202–7214. [Google Scholar] [CrossRef] [Scilit]
Figure 1. Architecture of YOLOv12-VSD. The red dashed box highlights the two novel modules (P4-RepC3 and P5-SPPF) introduced relative to the original YOLOv12 baseline.
Figure 1. Architecture of YOLOv12-VSD. The red dashed box highlights the two novel modules (P4-RepC3 and P5-SPPF) introduced relative to the original YOLOv12 baseline.
Sensors 26 02905 g001
Figure 2. Architecture of YOLOv12.
Figure 2. Architecture of YOLOv12.
Sensors 26 02905 g002
Figure 3. Schematic diagram of P4-RepC3 structure.
Figure 3. Schematic diagram of P4-RepC3 structure.
Sensors 26 02905 g003
Figure 4. Schematic diagram of P5-SPPF structure.
Figure 4. Schematic diagram of P5-SPPF structure.
Sensors 26 02905 g004
Figure 5. Partial image comparison between source-domain and target-domain data.
Figure 5. Partial image comparison between source-domain and target-domain data.
Sensors 26 02905 g005
Figure 6. Schematic diagram of the three-stage transfer learning framework.
Figure 6. Schematic diagram of the three-stage transfer learning framework.
Sensors 26 02905 g006
Figure 7. DFL loss convergence curve and mAP@50 evolution curve.
Figure 7. DFL loss convergence curve and mAP@50 evolution curve.
Sensors 26 02905 g007
Figure 8. Detection results of the YOLOv12-VSD model. The rightmost column shows representative failure cases.
Figure 8. Detection results of the YOLOv12-VSD model. The rightmost column shows representative failure cases.
Sensors 26 02905 g008
Figure 9. Comparison of detection results before and after fine-tuning.
Figure 9. Comparison of detection results before and after fine-tuning.
Sensors 26 02905 g009
Table 1. Summary of the proposed modifications relative to baseline YOLOv12.
Table 1. Summary of the proposed modifications relative to baseline YOLOv12.
ModulePositionMain PurposeCost Note
IoU-aware classification lossDetection loss/classification supervisionImprove localization-aware confidence learningTraining only; no inference overhead
P4-RepC3Neck, P4 feature layerStrengthen mid-scale feature extractionReparameterized to a single convolution at inference
P5-SPPFNeck, P5 feature layerImprove high-level contextual aggregationSlight additional inference computation
Three-stage transfer learning frameworkTraining pipelineImprove cross-domain adaptation efficiencyNo effect on the inference graph
Table 2. Simulation environment.
Table 2. Simulation environment.
ItemConfiguration
Operating SystemLinux
CPUIntel Xeon Gold 6430 (16 cores)
GPUNVIDIA RTX 4090
Video Memory24 GB
Python3.12
PyTorch2.5.1 + CUDA 12.4
Table 3. Training parameter configuration.
Table 3. Training parameter configuration.
ParameterValueDescription
Epochs400Total training epochs
Batch16Samples per minibatch
Imgsz640Input image resolution (pixels)
lr00.008Initial learning rate
Lrf0.01Final learning-rate factor
Momentum0.937SGD momentum
Weight decay0.0005Weight decay coefficient
Patience100Early stopping patience
Seed0Random seed for reproducibility
AmpTrueAutomatic mixed precision
Close_mosaic10Disable mosaic in the last 10 epochs
Box loss7.5Bounding-box loss gain
Cls loss0.5Classification loss gain
DFL loss1.5Distribution focal loss gain
Table 4. Detection metrics for each defect class.
Table 4. Detection metrics for each defect class.
ClassPrecisionRecallmAP@50mAP@50:95
Clear Glass0.560.5270.550.237
Crack0.8210.7890.8180.414
Cutouts0.6080.6440.6360.285
Defaced Paint0.6850.730.7190.425
Hairline Glass0.6560.5440.630.332
Inclusion0.7000.7310.7790.385
Paint-Peel0.6210.7140.6670.303
Spidery Glass0.8200.8980.9240.649
Total0.6840.6970.7150.379
Table 5. Ablation experiment results. P: precision; R: recall. ✓: module enabled; –: module absent. Bold values indicate the best result achieved by YOLOv12-VSD across module configurations.
Table 5. Ablation experiment results. P: precision; R: recall. ✓: module enabled; –: module absent. Bold values indicate the best result achieved by YOLOv12-VSD across module configurations.
MethodIoUP5P4PRmAP@50mAP@50:95GFLOPsFPS
YOLOv120.6770.6580.6880.36918.369.2
0.7040.6490.6940.36418.369.2
0.6680.6980.7040.37318.967.2
0.6690.6660.6960.36916.583.4
0.6950.6570.6980.37016.583.4
0.6580.7070.7100.37717.1104.3
0.6930.6890.7120.38018.967.2
YOLOv12-VSD0.6840.6970.7150.37917.1104.3
Table 6. Comparison experiment results. Italicized rows beneath each model report the standard deviation across N = 5 independent training runs with fixed seeds; bold values mark the best result in each metric column.
Table 6. Comparison experiment results. Italicized rows beneath each model report the standard deviation across N = 5 independent training runs with fixed seeds; bold values mark the best result in each metric column.
MethodPRmAP@50mAP@50:95Params (M)GFLOPsFPS
DART-YOLO0.6640.6890.7110.3725.116.055.8
±std±0.016±0.014±0.008±0.007
LDBF-YOLO0.6730.7020.7120.3764.715.692.1
±std±0.034±0.039±0.012±0.011
DCTL-YOLO0.6790.6630.6930.3394.715.261.1
±std±0.029±0.013±0.014±0.012
FAST-YOLO0.6460.6670.6840.3714.715.579.6
±std±0.018±0.012±0.015±0.013
SCBF-YOLO0.6560.6870.7040.3775.316.067.3
±std±0.018±0.010±0.013±0.005
TRS-YOLO0.7160.6700.7000.3747.519.460.6
±std±0.021±0.013±0.010±0.009
YOLOv12-VSD0.6840.6970.7150.3796.117.1104.3
±std±0.017±0.008±0.004±0.006
Table 7. Comparison of results before and after applying the transfer learning framework.
Table 7. Comparison of results before and after applying the transfer learning framework.
TrialBeforeAfter
PRmAP@50mAP@50:95Dur.(h)PRmAP@50mAP@50:95Dur.(h)
10.6600.5010.5310.2540.8140.6750.5830.6590.3440.307
20.6250.5050.5280.2510.7910.6770.5800.6510.3410.308
30.6700.4580.5310.2540.7800.6320.5920.6470.3400.293
40.6700.4570.5300.2530.7880.6810.5910.6590.3450.280
50.6580.4850.5290.2520.7990.6180.5920.6450.3400.257
Mean0.6570.4810.5310.2530.7940.6570.5880.6520.3420.289
Table 8. Performance comparison using transfer learning.
Table 8. Performance comparison using transfer learning.
P (%)R (%)mAP@50 (%)Duration (h)
YOLOv12-VSD0.6530.5100.5291.301
YOLOv12-VSD + VSD.pt0.6380.5250.5490.929
YOLOv12-VSD + VSD.pt + Fine-tuning0.6680.5960.6560.318
Table 9. Performance comparison of each model.
Table 9. Performance comparison of each model.
Model + WeightsP (%)R (%)mAP@50 (%)Duration (h)
SCBF-YOLO + s.pt0.6430.530.6051.614
TRS-YOLO + m.pt0.6520.5350.6013.241
LDBF-YOLO + m.pt0.6320.5150.5943.473
DART-YOLO + l.pt0.6250.5080.5907.135
DCTL-YOLO + s.pt0.6150.4900.5781.486
FAST-YOLO + n.pt0.5980.4700.5650.615
YOLOv12-VSD + VSD.pt0.6680.5960.6560.318
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Liu, H.; Zhao, D.; Li, Y. YOLOv12-VSD: A Transfer-Learning-Assisted Real-Time Detection Algorithm for Vehicle Surface Defects. Sensors 2026, 26, 2905. https://doi.org/10.3390/s26092905

AMA Style

Liu H, Zhao D, Li Y. YOLOv12-VSD: A Transfer-Learning-Assisted Real-Time Detection Algorithm for Vehicle Surface Defects. Sensors. 2026; 26(9):2905. https://doi.org/10.3390/s26092905

Chicago/Turabian Style

Liu, Haopu, Dequn Zhao, and Yu Li. 2026. "YOLOv12-VSD: A Transfer-Learning-Assisted Real-Time Detection Algorithm for Vehicle Surface Defects" Sensors 26, no. 9: 2905. https://doi.org/10.3390/s26092905

APA Style

Liu, H., Zhao, D., & Li, Y. (2026). YOLOv12-VSD: A Transfer-Learning-Assisted Real-Time Detection Algorithm for Vehicle Surface Defects. Sensors, 26(9), 2905. https://doi.org/10.3390/s26092905

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop