Fabric Anomaly Detection

Anomaly Detection of Defects in Fabric Images

Introduction

This demo showcases the anomaly detection approach developed in the SIC&FIT project for fabric defect identification. The solution focuses specifically on detecting critical areas in textile images where defects are likely present. By leveraging advanced deep learning techniques, our system can automatically identify unusual patterns and anomalies in fabric surfaces without requiring extensive labeled training data. This approach is particularly valuable in manufacturing environments where rapid, accurate detection of defects is essential for quality control.

Key Features

  • Unsupervised anomaly detection: Identifies fabric defects without requiring extensive labeled training data
  • Critical area highlighting: Precisely localizes regions containing potential defects in fabric images
  • Integration capability: Can be combined with classification systems for complete defect identification
  • Real-time processing: Analyzes fabric images at production speeds for immediate quality control

Technologies Used

  • Python: Core programming language with libraries such as NumPy, SciPy, and scikit-learn.
  • PyTorch: Deep learning framework for implementing the anomaly detection models.
  • Computer Vision: OpenCV and torchvision for image preprocessing and visualization.
  • Deep Learning: Vision Transformer (ViT) and Fast Flow architecture adapted for anomaly detection tasks.
  • CUDA: GPU acceleration for faster model training and inference.

Fastflow

Use Cases

Automated quality control in textile manufacturing, enabling rapid identification and classification of fabric defects to optimize production and reduce waste.

Live Demo

Input

High-resolution fabric images without the need for defect annotations or labels.

How it works

The anomaly detection system employs a specialized Vision Transformer (ViT) architecture trained on defect-free fabric samples. The model learns the normal appearance patterns of fabrics through self-attention mechanisms and positional encoding. When presented with a new image, the system identifies regions that deviate significantly from these learned patterns, flagging them as potential defects without requiring explicit defect labels during training.

Output

Heatmap visualization of the fabric image with highlighted anomalous regions indicating potential defects, along with anomaly scores quantifying the severity of detected irregularities.

Try it out

Try out the solution in real time on Hugging Face Spaces:

👉 Launch Demo

Benefits

  • Increased efficiency
  • Time savings
  • Cost optimization
  • Improved accuracy

Integration

The solution can be integrated into existing quality control systems via API or automated pipelines, enabling real-time analysis of images acquired during production.