Abstract
Automated surface defect detection often faces a “cold-start” problem due to limited annotated data for new anomalies. Traditional object detectors struggle to converge in such few-shot settings. To address this, we adapt Vision–Language Models (VLMs), specifically YOLO-World. We use semantic pre-training to mitigate data scarcity. We evaluate this approach on the MVTec AD dataset in bounding-box format. We use a strict 1:9 train-validation split, resulting in an average of 11.8 defect instances per category. YOLO-World surpasses traditional baselines, like YOLOv11s and YOLOv26s, in 12 of 15 categories. The optimized VLM pipeline achieves up to 64.9% mAP@50 on texture-heavy categories, such as Tile, with only nine training instances. Ablation studies show standard optimization techniques are limited under 10-shot constraints. We find a critical augmentation divide. Disabling spatial distortions (Mosaic) is vital to preserving rigid-object geometry. The Normalized Wasserstein Distance (NWD) improves the localization of microscopic anomalies. Varifocal Loss (VFL) often causes model collapse. Ultimately, VLMs offer a superior foundation for cold-start inspection but require carefully tailored pipelines for robustness.
1. Introduction
In the Industry 4.0 era, intelligent manufacturing relies on automated quality control to maintain product integrity and efficiency [1,2]. Surface defect detection means identifying anomalies, such as scratches, dents, and structural deformities on parts. This process is vital in intelligent workflows. Historically, inspection used manual methods or traditional machine vision. Both methods are prone to human error and adapt poorly to diverse production lines [3].
Deep learning and convolutional neural networks (CNNs) [4] have revolutionized industrial visual inspection by leveraging large-scale datasets for autonomous, high-precision defect localization [5,6] and classification [7]. Despite these advances, however, new challenges emerge in variable environments. Particularly, the need for extensive data underscores the difficulties encountered in cold-start scenarios [8,9]. This challenge forms the primary focus of our work.
Traditional data-driven object detectors have a core bottleneck: they need large amounts of data. Training a robust model uses thousands of annotated bounding boxes per target class. In dynamic factory environments, this creates a severe “cold-start” problem. When a factory introduces a new product or encounters a rare anomaly, collecting sufficient annotated data can be impractical and expensive. The inspection system must therefore adapt to a few-shot environment [10,11], where only a few examples per defect are available.
In a few-shot environment, there are usually ≈10 labeled examples per class. Models must train with a few labeled examples, which creates strict data constraints. Standard object detection architectures often overfit with so little data. The challenge is even harder in industrial inspection, which requires generalization across subtle geometric and textural differences, such as shape, structure, and surface patterns. These variations range from microscopic scratches on rigid components to large deformities on patterned surfaces, as shown in Figure 1. As a result, traditional architectures struggle to generalize with limited data.
Figure 1.
The visual complexity of the MVTec AD dataset [12]. The proposed automated inspection system must accurately localize highly diverse anomalies—ranging from microscopic scratches on rigid structures to large structural deformations on pattern-based textures—despite operating under extreme few-shot (cold-start) data constraints.
VLMs [13] have emerged as a transformative paradigm in computer vision by replacing fixed-category classification with open-vocabulary semantic alignment. Traditional object detectors, typically pre-trained on closed-set datasets like COCO (which is limited to 80 macroscopic categories such as “person” or “car”), are fundamentally optimized to localize discrete, whole-object boundaries. When confronted with novel, microscopic industrial anomalies—such as a “scratch” or a “bent pin”—these conventional architectures lack the pre-existing filters for these specific concepts and must learn the visual features completely from scratch. Under extreme few-shot constraints (≈10 instances), this reliance on thousands of pixel-level gradient updates invariably leads to gradient starvation, severe overfitting, and background memorization.
In contrast, VLMs utilize text-guided visual attention, having been pre-trained on millions of diverse image-text pairs. Rather than mathematically forcing extracted features into a newly initialized “defect” class using bounding box loss, VLMs inject a text prompt (e.g., “defect” or “scratch”) directly into the visual backbone via cross-modality attention. This top-down semantic guidance acts as a dynamic filter, instructing the network exactly which feature maps to activate before bounding boxes are even generated. Consequently, a VLM does not utilize the limited 10-shot data to learn what a defect is; instead, it bypasses the conventional feature-learning bottleneck entirely. The VLM uses the few available samples solely to align its pre-existing, open-vocabulary semantic knowledge with the factory floor’s specific lighting and textural conditions.
However, deploying massive VLMs in real-time industrial control systems traditionally introduces prohibitive computational latency. To address this, YOLO-World [13] was recently introduced to bridge advanced semantic reasoning with the high-speed inference demands of the YOLO architecture. While YOLO-World was originally designed and validated for macroscopic, open-vocabulary natural image detection, adapting its text-guided semantic heads to detect microscopic, highly irregular industrial anomalies under strict ≈10-shot constraints represents a novel, previously untested application. We hypothesize that this architecture can successfully isolate specific surface anomalies as distinct visual-semantic concepts, fundamentally overcoming the gradient starvation that limits traditional data-driven detectors in cold-start manufacturing environments.
The application of YOLO-World to anomaly localization thus stems from the hypothesis that the model can isolate specific surface defects as distinct visual-semantic concepts, circumventing the exhaustive retraining phases required by traditional detectors. Building on this, our approach assesses how semantic modeling can improve the efficiency of defect detection.
To evaluate VLMs in extreme cold-start scenarios, we propose an object detection pipeline using YOLO-World v2. We test it on the MVTec Anomaly Detection (MVTec AD) dataset [12]. MVTec AD was designed for pixel-level segmentation with a large number of normal samples. We reformulate it by extracting bounding boxes from validation masks to create an object-detection task.
To mimic a real cold-start case, we use a strict 1:9 train-validation split. (1 for training, 9 for validation.) We also impose an extreme few-shot constraint, with very few examples available. Within this setup, we examine how data augmentation and loss-function optimization affect performance. Data augmentation artificially expands or modifies data. Loss function optimization improves how model errors are measured and corrected.
Specifically, we run ablation studies by selectively disabling features or components to analyze their effects. This involves spatial distortion (Mosaic, combining multiple images into a single input) and optimization methods. These optimization methods include Varifocal Loss (VFL, a loss to address class imbalance by focusing learning on challenging examples) for class imbalance and Normalized Wasserstein Distance (NWD, a metric for comparing shapes or distributions) for precise localization.
The main contributions of this study are summarized as follows:
- We demonstrate the superiority of VLM for extreme few-shot defect detection, showing the YOLO-World backbone outperforms traditional COCO-trained baselines [14,15] (YOLOv11s and YOLOv26s) across various industrial categories when limited to ≈10 training instances.
- We identify a key, category-dependent rule for data-driven augmentation. Aggressive spatial distortions, such as the Mosaic technique, must be disabled to preserve the structure of rigid objects in data-scarce environments. These distortions remain useful for data with pattern-based textures. In such cases, maintaining precise spatial arrangements is less critical.
- We expose limits of top optimization algorithms in few-shot regimes. NWD improves microscopic anomaly localization. However, confidence-weighting mechanisms such as VFL consistently lead to model collapse due to gradient starvation early in training.
The rest of this article is organized as follows: Section 2 reviews related work in defect detection, few-shot detection, and VLM. Section 3 details our methodology, including dataset reformulation, VLM adaptation, and loss-function optimization. Section 4 presents experimental results, ablation studies, and qualitative analyses. Section 5 offers a discussion. Section 6 concludes with evidence that VLMs, when tailored, transform cold-start inspection and outline paths for robust, data-driven industrial modeling.
2. Related Work
2.1. Data-Driven Industrial Defect Detection
Advances in Convolutional Neural Networks (CNNs) [4] have driven the transition from manual visual inspection to automated, data-driven modeling. In the MVTec AD dataset, early approaches mostly frame defect detection as an unsupervised anomaly segmentation task. Methods such as PaDiM [7] and PatchCore [16] model the distribution of “normal” feature representations. These methods detect anomalies by measuring deviations from this baseline.
These reconstruction-based methods excel at pixel-level segmentation when sufficient defect-free samples are available. However, they often fail to provide precise bounding-box localization for varied, multi-class defect categories [17]. As a result, supervised object detection architectures, especially the YOLO (You Only Look Once) series [18,19,20,21], have gained popularity for real-time industrial applications. These models optimally balance inference speed and localization accuracy.
However, the success of these traditional detectors depends entirely on the availability of massive, meticulously annotated datasets, making them highly vulnerable to the cold-start problem in dynamic manufacturing environments.
2.2. Few-Shot Object Detection and Optimization Strategies
To address severe data constraints in new manufacturing lines, Few-Shot Object Detection (FSOD) has become a critical research area [22]. FSOD methods use meta-learning [23] (techniques that teach models to learn new tasks with minimal data), metric learning (strategies that measure similarities between data points), or transfer learning (using knowledge gained from previous tasks to improve learning on new tasks). These techniques help models generalize from a minimal number of support examples. Alongside adjustments to model architectures, researchers heavily rely on data-driven optimization algorithms to artificially expand the feature space by creating new or modified features from limited data.
Spatial augmentation techniques such as Mosaic [24] synthesize complex training scenes by combining multiple images. These augmentations force the model to learn scale-invariant features. Furthermore, specialized loss functions are needed to address the severe class imbalances often encountered in few-shot environments.
For instance, Varifocal Loss (VFL) [25] dynamically scales the loss based on target confidence to mitigate extreme background–foreground class imbalance, while the NWD [26] models bounding boxes as Gaussian distributions to improve the localization of microscopic objects where standard Intersection over Union (IoU) metrics fail. Despite these advancements, applying these optimization algorithms to an extreme few-shot scenarios (e.g., ≤10 instances) frequently leads to geometric distortion or gradient starvation, highlighting the need for a fundamentally different foundational architecture.
2.3. Vision–Language Models in Visual Inspection
VLMs have recently disrupted traditional computer vision paradigms by aligning visual features with rich semantic text embeddings [27,28]. Foundational models like CLIP [29] have demonstrated remarkable zero-shot classification capabilities by mapping images and text into a shared latent space, inspiring several recent adaptations specifically tailored for zero-shot and few-shot industrial anomaly detection [30,31,32].
This semantic understanding has been extended to open-vocabulary object detection via frameworks such as Grounding DINO [33], and YOLO-World [13]. By processing class labels as linguistic prompts rather than fixed discrete indices, these models can identify novel objects based on their semantic descriptions. While VLMs have shown immense promise in general-domain zero-shot and few-shot tasks, their rigorous application and optimization for fine-grained industrial defect detection remain largely unexplored.
Specifically, there is a significant gap in the literature regarding how state-of-the-art data pipelines (e.g., spatial augmentations and bounding-box loss functions) interact with VLM backbones under extreme industrial data constraints. This study bridges that gap by systematically adapting YOLO-World to the cold-start inspection problem.
3. Methodology
To systematically evaluate and optimize VLMs for industrial “cold-start” environments, we constructed a highly constrained data pipeline and adapted the YOLO-World architecture. This section details the dataset reformulation, the core VLM architecture, our proposed spatial augmentation strategy, and targeted loss landscape optimizations.
3.1. Dataset Reformulation and Extreme Few-Shot Constraint
The MVTec Anomaly Detection (MVTec AD) dataset is widely recognized as a benchmark for industrial inspection [12]. Originally designed for unsupervised anomaly segmentation, the dataset provides high-resolution images of 15 distinct manufacturing categories (including both rigid objects and textures) along with pixel-level ground-truth masks for various defect types. Because our objective is to adapt VLMs for bounding-box object detection, we algorithmically extracted precise bounding boxes from the provided pixel-level segmentation masks. Specifically, we utilized OpenCV’s topological structural analysis (cv2.findContours with cv2.RETR_EXTERNAL) to isolate distinct anomalous regions. Instead of merging multiple defects in a single image into a single bounding box, each disjoint connected component was processed independently to yield localized bounding boxes.
To mitigate the inclusion of annotation artifacts or negligible noise, we applied a dimensional filter, discarding any bounding box with a width or height of fewer than 5 pixels. The remaining geometries were then normalized relative to the image dimensions (center coordinates, width, and height) to align with the standard YOLO annotation format. As illustrated in Figure 2, this extraction method ensures that multiple small, disjoint defect regions—such as those frequently found in the Grid category—are individually and accurately localized.
Figure 2.
Example of multiple anomaly localization in the Grid category (“broken” class), showing the input image, original segmentation mask, and the extracted bounding boxes (red).
To simulate a rigorous cold-start manufacturing scenario in which data scarcity is the primary bottleneck, we deliberately abandoned the standard 80:20 training-to-validation split. Instead, we imposed an extreme 1:9 train-validation split. As comprehensively detailed in Table 1, this split forces the model to train on an average of only 8 images per category, resulting in a mere 11.8 defect instances per class on average. This formulation ensures the model cannot rely on brute-force data memorization and must strictly use semantic feature adaptation to localize anomalies across the expansive validation set.
Table 1.
Comprehensive breakdown of the MVTec AD dataset split. The 1:9 ratio creates an extreme few-shot constraint, with the model trained on an average of only 8 images and 11.8 defect instances per category.
3.2. Vision–Language Model Adaptation (YOLO-World v2)
Standard object detection frameworks operate on a closed-set paradigm, mapping visual features to predefined numerical class indices. In contrast, YOLO-World v2 leverages an open-vocabulary, vision–language architecture that aligns visual features with semantic text embeddings.
As illustrated in Figure 3, the input image is processed through the Image Encoder (a highly optimized YOLO backbone) to extract multi-scale visual features. Simultaneously, a frozen Text Encoder (CLIP) processes linguistic prompts corresponding to the specific target defect classes. In our adaptation, these prompts were strictly defined using concise, n-word defect descriptors (e.g., “broken,” “bent,” “metal contamination,” “cut inner insulation”). We deliberately excluded the overarching object category name from the prompt; for instance, the Grid category utilized prompts such as “broken” and “glue” rather than “broken grid”.
Figure 3.
Overall architecture of the YOLO-World framework [13] applied to industrial defect detection. As an open-vocabulary detector, the Text Encoder first encodes domain-specific defect prompts (e.g., “scratch” or “dent”) into semantic embeddings. Simultaneously, the Image Encoder processes the factory-floor image into multi-scale visual features. The RepVL-PAN module then performs multi-level cross-modality fusion, aligning visual features with semantic text embeddings. Finally, the model predicts bounding boxes based on these fused semantic concepts rather than relying on discrete pixel matching.
Because the CLIP Text Encoder remains completely frozen to preserve its generalized semantic relationships, our domain-specific adaptation did not involve prompt tuning or updates to the text encoder. Instead, the architecture’s core innovation is its Reparameterized Vision–Language Path Aggregation Network (RepVL-PAN), which we fine-tuned with bounding-box supervision to dynamically execute multi-level cross-modality fusion, aligning visual feature maps with pre-existing text embeddings.
By treating defects as descriptive concepts and leveraging pre-trained cross-modal representations rather than isolated pixel patterns, YOLO-World bypasses the traditional “cold-start” feature-learning phase, providing a stronger initialization that enables robust bounding-box predictions even under extreme few-shot constraints.
3.3. Spatial Augmentation Strategy
In data-driven object detection, spatial augmentations such as Mosaic are routinely used to artificially expand the training distribution [24]. Mosaic augmentation synthesizes a single training image by stitching together four randomly cropped and scaled images, forcing the model to learn scale-invariant and highly contextualized features.
However, we hypothesize that the efficacy of Mosaic augmentation in an extreme few-shot regime is strictly category-dependent. For pattern-based textures (e.g., Carpet, Tile), the spatial distortion introduced by Mosaic mimics natural variations, thereby strengthening feature extraction. Conversely, for highly structured, rigid objects (e.g., Screw, Transistor), aggressively altering the spatial context and aspect ratio destroys the object’s foundational geometric integrity. Consequently, we systematically evaluate pipelines with Mosaic enabled and disabled to define a geometric preservation rule for few-shot anomaly detection.
3.4. Loss Landscape Optimization for Extreme Scarcity
The standard loss formulation for YOLO architectures uses Complete Intersection over Union (CIoU) for bounding-box regression and Binary Cross-Entropy (BCE) for classification. To address the specific challenges of our extreme few-shot constraint, we evaluated two advanced optimization algorithms: NWD and VFL.
Traditional IoU-based metrics degrade rapidly when evaluating microscopic anomalies, as a minor pixel shift within a small bounding box can lead to a significant drop in IoU. To mitigate this, we integrate the NWD, which models bounding boxes as 2D Gaussian distributions. The NWD loss is mathematically expressed as:
In Equation (1), represents the Wasserstein distance metric measuring the similarity between the two Gaussian distributions, and , which denote the ground truth bounding box and the predicted bounding box, respectively. The variable C is a dataset-specific constant used to normalize the distance.
Furthermore, training on a strictly limited set of defect instances against massive background data creates a severe class imbalance. To optimize the classification head under these conditions, we evaluate VFL, defined as:
Unlike standard focal loss, which treats positive and negative samples symmetrically, VFL applies asymmetric weighting. Here, p denotes the model’s predicted classification score, and q represents the target IoU score (where for positive samples and for negative background samples). The scaling factor balances the weights of positive and negative examples, while serves as a focusing parameter that downweights easy negative examples, theoretically concentrating the gradient on difficult anomalies.
3.5. Evaluation Metrics
To quantitatively assess the performance of the proposed detection pipelines, we employ standard object detection metrics derived from the precision–recall curve. The foundational spatial metric is the Intersection over Union (IoU), defined as:
where represents the area of the predicted bounding box and is the area of the ground truth bounding box.
Detection accuracy is evaluated using Average Precision (AP), calculated as the area under the Precision–Recall curve:
In Equation (4), is the precision measured as a function of the recall R.
To establish a comprehensive performance baseline across the diverse MVTec AD dataset, we utilize Mean Average Precision (mAP):
where denotes the total number of defect categories evaluated. For this study, our primary comparative metric is mAP@50, which calculates the mean AP specifically at a strict IoU threshold of 0.50. This threshold ensures that a prediction is only considered a true positive if it achieves highly accurate spatial localization of the industrial defect.
3.6. Experimental Setup
All experiments were conducted on a high-performance workstation equipped with a 12th Gen Intel Core i9-12900F processor and 64 GB of RAM. Deep learning acceleration was provided by an NVIDIA GeForce RTX 3090 GPU with 24 GB of VRAM. The software environment was built upon the PyTorch 2.9.1 framework, and all object detection architectures (including baseline models and YOLO-World) were implemented using the official Ultralytics library [15] to ensure reproducibility.
To ensure reproducibility, all models were trained for 200 epochs using a batch size of 4 and an input image resolution of 640 × 640 pixels. The initial learning rate was set to 0.01. During the adaptation phase, we froze the first 10 layers of the backbone to retain foundational pre-trained visual features. Optimization was performed using Stochastic Gradient Descent (SGD) with a momentum of 0.937 and a weight decay of 0.0005. A linear learning rate schedule was used throughout the training process, following the default configuration of the Ultralytics framework.
4. Results
This section presents the quantitative and qualitative outcomes of the proposed few-shot defect detection pipeline. To maintain rigorous evaluation, all reported metrics, including Mean Average Precision at an Intersection over Union of 0.50 (mAP@50) and F1 Scores, were calculated on the heavily imbalanced validation set, reflecting a true industrial cold-start environment.
4.1. Baseline Comparison: Traditional Models vs. Vision–Language Models
The initial phase of our evaluation benchmarked the zero-shot and few-shot capabilities of the YOLO-World v2 VLM against standard COCO-trained object detectors (YOLOv11s and YOLOv26s). As illustrated in Figure 4, the traditional YOLO architectures exhibited severe performance degradation when restricted to an average of 11.8 training instances. In contrast, the YOLO-World base model successfully leveraged its semantic pre-training to bypass the cold-start feature extraction phase.
Figure 4.
Radar chart comparing the baseline mAP@50 performance of traditional object detectors (YOLOv11s, YOLOv26s) against the YOLO-World base model across all 15 MVTec AD categories. The expanded polygon area of the YOLO-World model visually demonstrates the superior feature extraction and localization capabilities of the Vision–Language Model framework under extreme few-shot constraints.
Quantitatively, the YOLO-World architecture outperformed the best-performing traditional models in 12 out of the 15 MVTec AD categories. The VLM pipeline demonstrated exceptional adaptation on texture-heavy datasets, achieving a peak mAP@50 of 64.9% on the Tile category with only nine training instances. The three categories where traditional models maintained a marginal advantage typically involved highly irregular, unpredictable defect shapes that deviated significantly from standard linguistic prompts.
4.2. Ablation Studies: Spatial Augmentations and Loss Modifications
To visually substantiate the geometric preservation rule, Figure 5 presents a qualitative comparison of the baseline model’s predictions for representative rigid categories when trained with and without Mosaic augmentation. As illustrated, applying Mosaic augmentation introduces severe spatial discontinuities that disrupt the object’s structural integrity, resulting in imprecise bounding boxes and increased false positives. Conversely, disabling Mosaic augmentation preserves the original geometric context, enabling the model to accurately localize defects with high boundary precision.
Figure 5.
Qualitative comparison of defect detection on YOLO-World v2 with Mosaic ON versus Mosaic OFF. Disabling spatial augmentation preserves essential geometric context, resulting in improved boundary precision and classification (top: Leather), accurate separation of overlapping anomalies (middle: Hazelnut), and higher detection recall (bottom: Wood) compared to the baseline.
Within the established Mosaic-ON and Mosaic-OFF pipelines, we evaluated the integration of NWD and VFL optimization algorithms. The performance across all combinations is detailed in the Cleveland dot plots of Figure 6 and Figure 7.
Figure 6.
Cleveland dot plot illustrating the Ablation Study: Loss Modifications on Mosaic ON Pipeline. This visualization tracks the variance in mAP@50 across the fluid and non-rigid categories, demonstrating the performance impact of integrating NWD and VFL while maintaining aggressive spatial augmentation.
Figure 7.
Cleveland dot plot illustrating the Ablation Study: Loss Modifications on Mosaic OFF Pipeline. This plot isolates the performance of the loss functions strictly on the rigid object categories, evaluating the efficacy of NWD and VFL when essential geometric context is preserved.
Based on the mAP@50 evaluations presented in the dot plots, the integration of the NWD yielded strictly localized improvements, offering marginal benefits only for a limited subset of categories.
In contrast, implementing Varifocal Loss (VFL) failed to improve the baseline across any of the 15 categories. In all experimental configurations (both with NWD and as a standalone modification), applying VFL under extreme ≈10 constraints resulted in an immediate and severe decline in mAP@50. To comprehensively understand these performance dynamics and the trade-offs between false positives and false negatives, a detailed analysis of the model’s precision and recall capabilities is required.
4.3. F1-Score and Precision–Recall Evaluation
To further quantify the model’s reliability in balancing false positives and false negatives under extreme few-shot constraints, we analyzed the F1 scores across the entire dataset. Table 2 provides a comprehensive evaluation of all 15 categories, detailing the exact Precision and Recall shifts from the traditional YOLO baseline to the various optimized YOLO-World pipelines.
Table 2.
Comprehensive F1-Score evaluation comparing the Traditional YOLO baseline with optimized YOLO-World pipelines across all 15 MVTec AD categories. Results are formatted as F1 (Precision/Recall). The highest F1-Scores among the VLM configurations are highlighted in bold, and an asterisk (*) denotes categories that use the YOLO-World pipeline and have Mosaic augmentation disabled.
The data reveals a stark contrast in performance based on the physical characteristics of the defects. Categories such as Wood, Metal_nut, and Tile exhibited the highest F1-Score improvements. In these classes, the YOLO-World base pipeline achieved substantial gains in precision without sacrificing recall, validating the VLM’s ability to utilize semantic feature extraction to confidently reject normal background noise. For instance, the Metal_nut category saw a precision increase from 0.52 in the traditional baseline to 0.81 with the adapted YOLO-World architecture.
Conversely, the comprehensive table also details categories where the proposed modifications resulted in minimal improvements or slight declines, such as Capsule, Screw, and Cable. In these highly challenging classes, the addition of the NWD successfully provided marginal recall gains by capturing microscopic anomalies that standard CIoU missed. However, the overall F1-Score in these categories remained heavily constrained by a high rate of background misclassification (low precision).
Furthermore, the table unequivocally demonstrates the detrimental impact of Varifocal Loss (VFL): across nearly all 15 categories, the integration of VFL (+ VFL and + NWD & VFL) led to a sharp decline in both precision and recall. We hypothesize that this behavior strongly points to gradient starvation under extreme few-shot constraints, although explicit gradient-level profiling is required for definitive empirical confirmation.
While NWD increased the F1-Score in only 3 categories, it also caused notable decreases in F1-Score across several other classes, most prominently in Hazelnut, Metal_nut, and Tile. This demonstrates that while NWD offers selective improvements for certain defect types, its overall efficacy across diverse industrial anomalies is highly mixed.
4.4. Qualitative Localization Results
Figure 8 provides a qualitative visual comparison of the detection pipelines, illustrating both the advantages and the practical limitations of the models under extreme data scarcity.
Figure 8.
Qualitative comparison of defect localization under extreme few-shot constraints across Ground Truth, YOLOv11, YOLOv26, and the optimized YOLO-World V2 pipeline.
Row 1 (Tile) demonstrates the VLM’s semantic adaptation capabilities. While YOLOv11 completely misses the textural anomaly and YOLOv26 successfully bounds the defect but assigns an incorrect classification, YOLO-World accurately localizes the target. However, YOLO-World also generates overlapping bounding boxes due to misclassifications, highlighting a persistent challenge of false positives in texture-heavy, few-shot environments.
Row 2 (Cable) illustrates a clear operational advantage for the optimized YOLO-World pipeline. The model successfully detects a microscopic surface defect that both the YOLOv11 and YOLOv26 baselines fail to resolve entirely.
Row 3 (Screw) shows a scenario in which the models perform comparably. When evaluating the structural anomaly on the rigid object, both YOLOv26 and the YOLO-World pipeline (with Mosaic augmentation disabled) accurately bound the defect, demonstrating that the VLM remains competitive with deeper traditional architectures on geometric structures when spatial distortions are removed.
Finally, Row 4 (Grid) illustrates the inherent difficulty of localizing multiple defects on irregular, thin structures. Out of the three ground-truth anomalies, YOLO-World accurately detects two but misses the third. Traditional models exhibit similar struggles: YOLOv26 detects only one anomaly, while YOLOv11 identifies two but overlays a misclassification. This row highlights the persistent challenge of achieving comprehensive recall and precise classification simultaneously when training with fewer than 5 examples.
5. Discussion
The empirical results of this study reveal a fundamental shift in how automated defect detection must be approached in data-scarce manufacturing environments. This section interprets the performance disparities between traditional detectors and VLMs, analyzes the failure modes of standard optimization algorithms under extreme constraints, and proposes a practical deployment workflow.
5.1. Semantic Adaptation over Pixel Memorization
The severe performance degradation of standard COCO-trained architectures (YOLOv11s, YOLOv26s) in the ≈10 regime highlights a critical flaw in traditional data-driven modeling: the reliance on pixel memorization. Without thousands of examples to establish a robust feature distribution, traditional models rapidly overfit to the background noise of the limited training samples rather than isolating the defect itself.
Conversely, the YOLO-World architecture succeeds by bypassing this initial feature-learning bottleneck entirely. Because the VLM is anchored by CLIP-based semantic pre-training, it already possesses a comprehensive mathematical understanding of concepts such as “scratch” and “dent.” The 10-shot training environment is therefore not utilized to teach the model what a defect is, but rather to align its existing semantic knowledge with the specific textural and lighting conditions of the MVTec AD factory environment. This semantic adaptation proves more effective than traditional pixel-level feature extraction for addressing the industrial cold-start problem.
However, as evidenced by the qualitative localization results, this semantic alignment is not entirely immune to the constraints of extreme data scarcity. While YOLO-World successfully bounds novel anomalies, it occasionally generates overlapping false-positive classifications, indicating that, although VLMs excel at answering ‘where’ an anomaly is, resolving exactly ‘what’ it is among highly overlapping semantic prompts remains a challenge for future refinement.
5.2. The Limits of Optimization Algorithms in Extreme Scarcity
A core contribution of this study is exposing the operational limits of advanced bounding-box optimization algorithms in extreme few-shot scenarios. The literature frequently recommends Varifocal Loss (VFL) to combat the severe foreground-background class imbalance inherent in defect detection.
However, our ablation studies showed that VFL consistently induces model collapse under extreme data scarcity. We attribute this performance degradation to a theoretical risk of gradient starvation: because VFL scales the loss gradient by the model’s confidence score, a few-shot environment naturally yields an initial confidence score near zero. This formulation likely weakens the initial learning signal before the network can begin extracting meaningful defect features. While our performance metrics strongly align with this hypothesis, future work should incorporate explicit logging of gradient norms to empirically validate this training dynamic.
Similarly, the NWD yielded highly inconsistent results due to its fundamental mathematical assumptions. While NWD successfully improved recall for microscopic anomalies (e.g., the Cable dataset) by modeling bounding boxes as 2D Gaussian distributions, this assumption is detrimental to detecting macroscopic or highly irregular structural anomalies in categories such as Hazelnut, Metal_nut, and Tile. Industrial defects such as expansive cracks or asymmetrical texture warps cannot be accurately enclosed by a symmetrical Gaussian distribution. Forcing these jagged anomalies into a perfect mathematical distribution strips the model of the boundary precision required for robust inspection. Consequently, we recommend that practitioners strictly limit the application of NWD to datasets featuring microscopic, point-like defects and avoid it when inspecting large or irregular anomalies.
5.3. The Geometric Preservation Rule
Our findings on spatial data augmentation establish a critical geometric-preservation rule for few-shot anomaly detection. In standard object detection, Mosaic augmentation is widely used as a regularization technique. However, we empirically demonstrated that its efficacy depends strictly on the target object’s physical reality.
For continuous, pattern-based materials (e.g., Grid, Tile), the aggressive spatial distortion introduced by Mosaic mimics natural variations and strengthens feature robustness. In stark contrast, applying spatial distortion to rigid, highly structured objects (e.g., Screw, Transistor, and Capsule) destroys their foundational geometric integrity.
In extreme data scarcity, the model lacks sufficient examples to reconstruct the original shape from the distorted inputs. Therefore, disabling Mosaic augmentation is strictly necessary to preserve structural geometry when inspecting rigid industrial components.
5.4. Proposed Industrial Workflow
Translating these data-driven insights into a practical engineering application, we propose the following optimized workflow for deploying automated inspection on newly commissioned production lines:
- 1.
- Deployment and Prompting: Deploy the pre-trained YOLO-World VLM at the edge, initializing the detection head with semantic text prompts tailored to expected manufacturing errors (e.g., “bent pin,” “surface scratch”);
- 2.
- Cold-Start Data Collection: Aggregate a strictly limited batch of initial defect instances (≤15 samples) as the line begins operation;
- 3.
- Category-Dependent Pipeline Configuration: If the product is highly structured (e.g., PCBs), strictly disable spatial augmentations like Mosaic. If inspecting continuous textures (e.g., fabric), enable spatial augmentations;
- 4.
- Standard Optimization: Train the customized head utilizing standard Complete Intersection over Union (CIoU) loss. Strictly avoid confidence-weighting mechanisms such as VFL to prevent gradient starvation during early epochs.
5.5. Future Directions: Leveraging Asymmetric Data Availability
While this study specifically addresses the constraints of a bounding-box-only few-shot regime, real-world automated factory inspections present a unique data asymmetry: acquiring defect-free surface images is trivial, whereas capturing actual anomalies is exceptionally rare. Future research should explore how to actively integrate this large volume of normal data into the VLM pipeline.
Theoretically, using thousands of normal baseline images alongside the 10-shot defect samples could drastically outperform purely few-shot methods by teaching the model a highly robust definition of “normality”.
However, this introduces a severe long-tail class imbalance problem. Future optimization algorithms must be carefully engineered to handle this extreme distribution shift, ensuring that the model does not become overly biased toward the dominant background class and that gradients from rare, anomalous instances are not suppressed during training. Bridging the gap between few-shot VLM adaptation and asymmetric long-tail learning represents the next critical frontier in intelligent industrial modeling.
6. Conclusions
In this study, we addressed the critical “cold-start” challenge in automated industrial inspection by adapting the YOLO-World VLM for extreme few-shot defect detection. Unlike traditional data-driven object detectors that rely on massive annotated datasets and suffer from severe overfitting in data-scarce environments, our proposed VLM pipeline leverages semantic pre-training to bypass the initial feature-learning bottleneck. By formulating a rigorous ≈10 bounding-box constraint utilizing the MVTec AD dataset, we demonstrated that YOLO-World significantly outperforms traditional COCO-trained baselines (YOLOv11s and YOLOv26s) in 12 out of 15 industrial categories. Instead of struggling to extract visual features from a limited pixel distribution, the model successfully aligned its established semantic understanding to the specific factory environment, achieving robust anomaly localization with as few as nine training instances.
Furthermore, our systematic ablation studies exposed critical vulnerabilities when applying standard data-driven optimization algorithms to extreme data-scarce regimes. We established a category-dependent geometric preservation rule and demonstrated experimentally that aggressive spatial distortions, such as Mosaic augmentation, must be strictly disabled to maintain the structural integrity of rigid industrial components. Additionally, we found that while specialized loss functions, such as the NWD, offer marginal improvements for microscopic anomalies, confidence-weighting mechanisms, such as VFL, consistently lead to model collapse due to early-stage gradient starvation. Ultimately, this research provides theoretical perspectives and an effective deployment workflow for integrating data-efficient VLM modeling into constrained manufacturing processes.
While the adaptation of the YOLO-World architecture demonstrates promising capabilities for extreme few-shot defect detection, it is important to acknowledge the operational limitations of the current framework. First, the observed performance improvements remain highly category-dependent. Furthermore, our ablation studies reveal that auxiliary loss modifications do not offer universal solutions; NWD yields benefits only for a limited subset of microscopic anomalies, and VFL consistently degrades performance under extreme data scarcity. Qualitative assessments also indicate that the model remains susceptible to noticeable false positives and overlapping predictions when processing highly complex or irregular textures. Finally, while MVTec AD provides a rigorous baseline across diverse material types, the generalization of this pipeline to other specialized industrial datasets (e.g., NEU-DET or PCB defect datasets) remains untested. Future work will focus on validating across these external datasets, refining post-processing algorithms such as specialized Non-Maximum Suppression (NMS), and exploring more robust, domain-specific prompt engineering to stabilize this category-dependent variance. Additionally, while the current architecture relies on a frozen CLIP encoder, future foundational studies should investigate the impact of alternative text encoders for improving domain-specific vocabulary alignment.
Author Contributions
Conceptualization, C.S.-r.-p.; Formal Analysis, C.S.-r.-p.; Methodology, C.S.-r.-p.; Project Administration, R.-C.C.; Resources, R.-C.C.; Software, C.S.-r.-p.; Supervision, R.-C.C.; Validation, C.S.-r.-p. and R.-C.C.; Visualization, C.S.-r.-p.; Writing—Original Draft, C.S.-r.-p.; Writing—Review and Editing, C.S.-r.-p. and R.-C.C. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the National Science and Technology Council, Taiwan, Grant numbers NSTC-112-2221-E-324-003-MY3, NSTC-112-2221-E-324-011-MY2, and NSTC-114-2637-E-324-003.
Data Availability Statement
The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Lasi, H.; Fettke, P.; Kemper, H.G.; Feld, T.; Hoffmann, M. Industry 4.0. Bus. Inf. Syst. Eng. 2014, 6, 239–242. [Google Scholar] [CrossRef] [Scilit]
- Peres, R.S.; Jia, X.; Lee, J.; Sun, K.; Colombo, A.W.; Barata, J. Industrial artificial intelligence in industry 4.0-systematic review, challenges and outlook. IEEE Access 2020, 8, 220121–220139. [Google Scholar] [CrossRef] [Scilit]
- Angelopoulou, A.; Mykoniatis, K.; Boyapati, N.R. Industry 4.0: The use of simulation for human reliability assessment. Procedia Manuf. 2020, 42, 296–301. [Google Scholar] [CrossRef] [Scilit]
- Chauhan, R.; Ghanshala, K.K.; Joshi, R.C. Convolutional neural network (CNN) for image detection and recognition. In Proceedings of the 2018 First International Conference on Secure Cyber Computing and Communication (ICSCCC); IEEE: Piscataway, NJ, USA, 2018; pp. 278–282. [Google Scholar]
- Chow, J.K.; Su, Z.; Wu, J.; Tan, P.S.; Mao, X.; Wang, Y.H. Anomaly detection of defects on concrete structures with the convolutional autoencoder. Adv. Eng. Inform. 2020, 45, 101105. [Google Scholar] [CrossRef] [Scilit]
- Thota, M.K.; Shajin, F.H.; Rajesh, P. Survey on software defect prediction techniques. Int. J. Appl. Sci. Eng. 2020, 17, 331–344. [Google Scholar]
- Defard, T.; Setkov, A.; Loesch, A.; Audigier, R. Padim: A patch distribution modeling framework for anomaly detection and localization. In Proceedings of the International Conference on Pattern Recognition; Springer: Cham, Switzerland, 2021; pp. 475–489. [Google Scholar]
- Schein, A.I.; Popescul, A.; Ungar, L.H.; Pennock, D.M. Methods and metrics for cold-start recommendations. In Proceedings of the 25th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, Tampere, Finland, 11–15 August 2002; pp. 253–260. [Google Scholar]
- Mishra, K.N.; Mishra, A.; Barwal, P.N.; Lal, R.K. Natural language processing and machine learning-based solution of cold start problem using collaborative filtering approach. Electronics 2024, 13, 4331. [Google Scholar] [CrossRef] [Scilit]
- Wang, Y.; Yao, Q.; Kwok, J.T.; Ni, L.M. Generalizing from a few examples: A survey on few-shot learning. ACM Comput. Surv. (CSUR) 2020, 53, 1–34. [Google Scholar] [CrossRef] [Scilit]
- Song, Y.; Wang, T.; Cai, P.; Mondal, S.K.; Sahoo, J.P. A comprehensive survey of few-shot learning: Evolution, applications, challenges, and opportunities. ACM Comput. Surv. 2023, 55, 1–40. [Google Scholar] [CrossRef] [Scilit]
- Bergmann, P.; Fauser, M.; Sattlegger, D.; Steger, C. MVTec AD–A comprehensive real-world dataset for unsupervised anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 9592–9600. [Google Scholar]
- Cheng, T.; Song, L.; Ge, Y.; Liu, W.; Wang, X.; Shan, Y. Yolo-world: Real-time open-vocabulary object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 16–22 June 2024; pp. 16901–16911. [Google Scholar]
- Lin, T.Y.; Maire, M.; Belongie, S.; Hays, J.; Perona, P.; Ramanan, D.; Dollár, P.; Zitnick, C.L. Microsoft coco: Common objects in context. In Proceedings of the European Conference on Computer Vision; Springer: Cham, Switzerland, 2014; pp. 740–755. [Google Scholar]
- Jocher, G.; Qiu, J. Ultralytics|Revolutionizing the World of Vision AI. 2026. Available online: https://www.ultralytics.com/ (accessed on 26 February 2026).
- Roth, K.; Pemula, L.; Zepeda, J.; Schölkopf, B.; Brox, T.; Gehler, P. Towards total recall in industrial anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 14318–14328. [Google Scholar]
- Valavanis, I.; Kosmopoulos, D. Multiclass defect detection and classification in weld radiographic images using geometric and texture features. Expert Syst. Appl. 2010, 37, 7606–7614. [Google Scholar] [CrossRef] [Scilit]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Jiang, P.; Ergu, D.; Liu, F.; Cai, Y.; Ma, B. A Review of Yolo algorithm developments. Procedia Comput. Sci. 2022, 199, 1066–1073. [Google Scholar] [CrossRef] [Scilit]
- 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]
- Li, Q.; Xue, H.; Li, J. Small target defect detection on steel surface based on multi-scale feature fusion. IEEE Access 2025, 13, 176276–176286. [Google Scholar] [CrossRef] [Scilit]
- Wang, R.; Hong, T. Few-shot defect detection in industrial scenarios: A comprehensive review of challenges, advances, and frontier trends. MATEC Web Conf. 2025, 413, 04005. [Google Scholar] [CrossRef] [Scilit]
- Xin, N.; Yu, C.Y. Few-Shot Learning for Industrial Defect Detection Using Meta-Learning Techniques. Int. J. Sci. Res. Manag. (IJSRM) 2025, 13, 2301–2318. [Google Scholar]
- Dadboud, F.; Patel, V.; Mehta, V.; Bolic, M.; Mantegh, I. Single-stage uav detection and classification with yolov5: Mosaic data augmentation and panet. In Proceedings of the 2021 17th IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS); IEEE: Washington, DC, USA, 2021; pp. 1–8. [Google Scholar]
- Zhang, H.; Wang, Y.; Dayoub, F.; Sunderhauf, N. Varifocalnet: An iou-aware dense object detector. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 8514–8523. [Google Scholar]
- Wang, J.; Xu, C.; Yang, W.; Yu, L. A normalized Gaussian Wasserstein distance for tiny object detection. arXiv 2021, arXiv:2110.13389. [Google Scholar]
- Li, K.; Zhang, Y.; Li, K.; Li, Y.; Fu, Y. Image-text embedding learning via visual and textual semantic reasoning. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 45, 641–656. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, L.; Yang, N.; Huang, X.; Yang, L.; Majumder, R.; Wei, F. Improving text embeddings with large language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Bangkok, Thailand, 11–16 August 2024; pp. 11897–11916. [Google Scholar]
- Radford, A.; Kim, J.W.; Hallacy, C.; Ramesh, A.; Goh, G.; Agarwal, S.; Sastry, G.; Askell, A.; Mishkin, P.; Clark, J.; et al. Learning transferable visual models from natural language supervision. In Proceedings of the International Conference on Machine Learning, Virtual, 18–24 July 2021; pp. 8748–8763. [Google Scholar]
- Jeong, J.; Zou, Y.; Kim, T.; Zhang, D.; Ravichandran, A.; Dabeer, O. Winclip: Zero-/few-shot anomaly classification and segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 19606–19616. [Google Scholar]
- Zhou, Q.; Pang, G.; Tian, Y.; He, S.; Chen, J. Anomalyclip: Object-agnostic prompt learning for zero-shot anomaly detection. arXiv 2023, arXiv:2310.18961. [Google Scholar]
- He, J.; Cao, M.; Peng, S.; Xie, Q. Rareclip: Rarity-aware online zero-shot industrial anomaly detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Honolulu, HI, USA, 19–23 October 2025; pp. 24478–24487. [Google Scholar]
- Liu, S.; Zeng, Z.; Ren, T.; Li, F.; Zhang, H.; Yang, J.; Jiang, Q.; Li, C.; Yang, J.; Su, H.; et al. Grounding dino: Marrying dino with grounded pre-training for open-set object detection. In Proceedings of the European Conference on Computer Vision; Springer: Cham, Switzerland, 2024; pp. 38–55. [Google Scholar]
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







