NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Small Object Few-Shot Segmentation for Vision-Based Industrial Inspection

Zilong Zhang, Chang Niu, Zhibin Zhao, Xingwu Zhang, Xuefeng Chen

TL;DR

This paper introduces SOFS, a novel few-shot semantic segmentation model designed to tackle the challenge of identifying small, diverse defects in industrial settings. By avoiding image resizing and introducing a prototype intensity downsampling, SOFS effectively preserves target semantics and reduces false positives, achieving state-of-the-art performance in both few-shot segmentation and anomaly detection.

What Problem Does This Paper Address?

Vision-based industrial inspection (VII) is crucial for ensuring product quality, but it faces significant challenges. Traditional supervised learning methods require vast amounts of labeled defect data, which is often scarce and difficult to obtain, especially for rare or novel defects. Industrial anomaly detection (IAD) offers a solution by learning from normal samples, but it struggles to differentiate between various types of defects, which is critical as different defects can have vastly different impacts on product functionality and safety. Furthermore, defects in industrial settings are often very small, making them difficult to detect and segment accurately, and existing few-shot segmentation (FSS) methods, designed for more prominent objects, often fail or produce numerous false positives when applied to these small industrial defects.

Methods

The proposed SOFS model addresses these challenges through several key innovations:

  • Non-resizing Procedure: To prevent the distortion of small object semantics, SOFS avoids resizing the original images during training. Instead, it crops small object regions and uses a sliding window approach during testing. This ensures that the encoded pixel area of small objects remains consistent with their original size.
  • Prototype Intensity Downsampling: Traditional downsampling methods can lose crucial information for small objects. SOFS introduces a prototype intensity downsampling that uses a 1x1 convolution to process the support mask. This method considers all pixels within a region, providing a more accurate estimate of target semantics compared to interpolation methods.
  • Abnormal Prior Map (APM): To combat false positives, especially for "missing defects" where the defect is an absence of a component, SOFS generates an abnormal prior map. This map highlights semantic regions while downplaying normal backgrounds, guiding the model to focus on actual defects and ignore normal areas. This also enables the model to perform few-shot anomaly detection (FAD).
  • Mixed Normal Dice Loss (MNDL): To further reduce false positives and prevent overfitting, a novel mixed normal Dice loss is proposed. This loss imposes a larger penalty on false positive predictions for normal samples, encouraging the model to be more conservative in its predictions.
  • Non-learnable Feature Fusion and Meta Prediction: The model utilizes a non-learnable feature fusion mechanism and a class-agnostic meta prediction approach, which helps prevent overfitting to specific categories and improves generalization.

Datasets

The paper evaluates SOFS on two primary datasets:

  • VISION V1: A large and diverse dataset for vision-based industrial inspection, featuring 14 objects and 44 defect types. A significant characteristic of this dataset is that 84% of defect types have area proportions less than 0.3%, and 38% have pixel areas less than 900 pixels.
  • Defect Spectrum: This dataset includes 97 defect types, with 63% having area proportions less than 2%. It is noted that defects in this dataset are generally larger than those in VISION V1.

Additionally, for few-shot anomaly detection (FAD) tasks, the authors use two benchmark datasets:

  • MVTec AD
  • VisA

Key Insights and Ideas

  • Small object segmentation is fundamentally different: The paper highlights that standard FSS techniques, optimized for more prominent objects, struggle with the unique challenges posed by small industrial defects, particularly regarding semantic distortion and false positives.
  • Avoiding resizing is key for small objects: The non-resizing procedure is crucial for preserving the integrity of small object features, preventing information loss that occurs during standard resizing operations.
  • Abnormal prior maps are powerful for missing defects: The introduction of an abnormal prior map effectively addresses the challenge of detecting defects that are characterized by the absence of components, a common issue in industrial inspection.
  • Combined FSS and FAD capabilities: SOFS demonstrates that a single model can effectively handle both fine-grained defect segmentation (FSS) and general anomaly detection (FAD), offering a more versatile solution for industrial inspection.
  • Loss function design matters for defect detection: The mixed normal Dice loss is shown to be critical in mitigating overfitting and reducing false positives, a common pitfall in defect detection tasks.

Key Results

  • State-of-the-art performance: SOFS achieves state-of-the-art results on the VISION V1 dataset, outperforming previous methods like SegGPT by a significant margin (11.4% for 1-shot and 12.2% for 5-shot mean IoU improvements when using the DINO v2 Base encoder).
  • Robustness across datasets: The model also shows competitive performance on the Defect Spectrum dataset, even with larger defects.
  • Effective FAD: SOFS demonstrates strong performance in few-shot anomaly detection tasks on MVTec AD and VisA, competing well with multi-modal approaches despite only using image information.
  • Ablation studies confirm component effectiveness: Experiments show that each proposed component (non-resizing, prototype intensity downsampling, abnormal prior map, and mixed normal Dice loss) contributes positively to the overall performance.

Limitations and Future Work

  • False positives on similar defects: The paper acknowledges that slight differences between defects can still lead to some false positives. The authors suggest test-time training/adaptation as a potential future direction to address this.
  • False negatives for extreme aspect ratios: SOFS may produce false negatives for defects with extreme aspect ratios, possibly due to limitations in the encoder's receptive field.
  • Latency for high-resolution images: The sliding window mechanism used during testing can lead to high latency when processing high-resolution images. Future work aims to explore designs to reduce latency and improve the detection of defects with extreme aspect ratios.
  • Potential for mixture of support images: The authors suggest that SOFS could be extended to incorporate a mixture of normal and defective support images for training and inference, which is more representative of real-world scenarios.

Summary updated

BibTeX
@article{zhang2025small,
  author = {Zilong Zhang and Chang Niu and Zhibin Zhao and Xingwu Zhang and Xuefeng Chen},
  title = {{Small Object Few-Shot Segmentation for Vision-Based Industrial Inspection}},
  journal = {IEEE Trans. Industrial Informatics},
  year = {2025},
  doi = {10.1109/tii.2025.3538070},
}
Figure