Best Datasets for Defect Detection Training: Complete 2026 Guide

Resources Datasets

Hardware Used

Training PC with GPU 8GB+ VRAM Storage 50GB+ recommended

Software Stack

Python 3.8+ PyTorch or TensorFlow Pandas Roboflow Kaggle CLI

Use Cases

Model training and evaluation Transfer learning Benchmarking algorithms Research and development Proof of concept projects

Introduction

The quality of your training dataset directly determines your defect detection model’s performance. This comprehensive guide reviews the best public and commercial datasets across multiple industries, helping you choose the right data for your application.

What Makes a Good Defect Detection Dataset

Before diving into specific datasets, understand these critical factors:

Size and Diversity

  • Minimum 500-1000 images per defect class
  • Variety in lighting conditions, angles, and backgrounds
  • Balanced representation of defect types

Annotation Quality

  • Accurate bounding boxes or segmentation masks
  • Consistent labeling across annotators
  • Clear class definitions

Relevance

  • Similar to your target application
  • Representative defect types and severity levels
  • Matching image resolution and quality

Accessibility

  • Clear licensing terms
  • Easy download and format
  • Active maintenance and updates

Public Defect Detection Datasets

Electronics & PCB Defects

1. DeepPCB Dataset

Overview: High-quality PCB defect dataset with 1,500 image pairs containing 6 defect types. Specifications:

  • Images: 1,500 image pairs (template + test)
  • Resolution: 640 x 640 pixels
  • Defect Types: Open circuit, short circuit, mouse bite, spur, copper, pin hole
  • Annotations: Bounding boxes
  • Format: Custom XML format

Download: GitHub - DeepPCB

Best For: PCB manufacturing, electronics assembly QC

Strengths:

  • Template matching capability
  • Real manufacturing data
  • Multiple defect types

Limitations:

  • Relatively small size
  • Single PCB design type
  • Custom annotation format requires conversion

Typical Performance: Recent YOLO11 and the newly released 2026 YOLO26 architectures have pushed the benchmark on DeepPCB to over 98.9% mAP@0.5, a notable gain in both speed and accuracy over older baselines.


2. PCB Defects Dataset (Roboflow Universe)

Overview: Community-contributed PCB defect images with YOLO-format annotations. Specifications:

  • Images: 3,000+ images
  • Resolution: Variable (512-2048px)
  • Defect Types: Missing hole, mouse bite, open circuit, short, spur, spurious copper
  • Annotations: Bounding boxes (YOLO format)
  • Format: YOLO, COCO, Pascal VOC

Download: Roboflow Universe - PCB Defects

Best For: General PCB inspection, prototyping

Strengths:

  • Multiple export formats
  • Regular updates
  • Easy integration with training frameworks

Limitations:

  • Variable image quality
  • Some mislabeled data
  • Mixed PCB types

Textile & Fabric Defects

3. AITEX Fabric Defect Dataset

Overview: Industry-standard textile inspection dataset with 7 defect categories. Specifications:

  • Images: 245 4096 x 256 pixel images
  • Defect Types: 7 different fabric defect types
  • Annotations: Defect masks
  • Format: PNG images with binary masks

Download: AITEX Dataset

Best For: Textile manufacturing, fabric quality control

Strengths:

  • High-resolution images
  • Professional annotations
  • Realistic manufacturing conditions

Limitations:

  • Small dataset size
  • Single fabric type per set
  • Registration required

4. Severstal Steel Defect Dataset

Overview: Steel surface defect dataset from Kaggle competition. Specifications:

  • Images: 18,000+ steel sheet images
  • Resolution: 1600 x 256 pixels
  • Defect Types: 4 classes (rolled-in scale, patches, crazing, pitted surface)
  • Annotations: Segmentation masks (RLE encoded)
  • Format: CSV with run-length encoding

Download: Kaggle - Severstal Steel Defect Detection

Best For: Metal surface inspection, steel manufacturing

Strengths:

  • Large dataset
  • Kaggle competition benchmarks
  • Real industrial data

Limitations:

  • Specific to steel sheets
  • RLE format requires decoding
  • Class imbalance

Surface & Material Defects (The MVTec Family)

5. MVTec Anomaly Detection Dataset (MVTec AD)

Overview: Comprehensive anomaly detection benchmark across 15 object categories. Specifications:

  • Images: 5,354 high-resolution images
  • Categories: 15 (carpet, grid, leather, tile, wood, bottle, cable, capsule, hazelnut, metal nut, pill, screw, toothbrush, transistor, zipper)
  • Resolution: Variable (700-1024px)
  • Defect Types: 73 different anomaly types
  • Annotations: Pixel-level defect masks

Download: MVTec AD Dataset

Best For: Anomaly detection research, unsupervised learning, general surface inspection

Strengths:

  • High-quality annotations
  • Diverse object types
  • Academic benchmark standard

Limitations:

  • Controlled imaging conditions
  • Academic license

Typical Performance: Vision Transformers and memory-bank models dominate here. PatchCore achieves a state-of-the-art image-level anomaly detection AUROC score of 99.6%.


6. MVTec LOCO (Logical Constraints)

Overview: A modern benchmark focusing on logical anomalies rather than just structural ones. Specifications:

  • Images: 3,644 high-resolution images
  • Categories: 5 industrial categories (Breakfast Box, Juice Bottle, Pushpins, Screw Bag, Splicing Connectors)
  • Defect Types: Structural (scratches, dents) and Logical (missing parts, misplacements)
  • Annotations: Pixel-precise anomalous region masks (1-channel PNG)

Download: MVTec LOCO AD Dataset

Best For: Advanced assembly line QA where objects are structurally sound but incorrectly assembled.

Strengths:

  • Solves a major gap in logical defect detection
  • Highly realistic assembly scenarios

Limitations:

  • Logical defects require more complex contextual models to detect
  • Academic license

7. MVTec 3D-AD

Overview: The new standard for multimodal 3D anomaly detection in manufacturing. Specifications:

  • Images/Scans: Over 4,000 high-resolution scans acquired by an industrial 3D sensor
  • Categories: 10 categories (e.g., Bagel, Cable Gland, Dowel, Foam, Tire)
  • Format: 3-channel TIFFs (x, y, z coordinates) paired with 3-channel RGB PNGs
  • Annotations: Precise ground-truth pixel annotations

Download: MVTec 3D-AD Dataset

Best For: Depth-sensitive inspections where RGB imaging fails (e.g., dent detection on unpainted metal).

Strengths:

  • True 3D point clouds paired with RGB
  • Highly precise ground truth

Limitations:

  • Requires specialized 3D processing architectures
  • Large file sizes

8. Kolektor Surface-Defect Dataset (KolektorSDD)

Overview: Surface defect dataset for industrial metal parts. Specifications:

  • Images: 399 grayscale images
  • Resolution: 500+ x 1240+ pixels
  • Defect Types: Various surface defects on commutator segments
  • Annotations: Pixel-level masks
  • Format: BMP images

Download: KolektorSDD on GitHub

Best For: Metal surface inspection, industrial parts QC

Strengths:

  • High-quality real-world data
  • Challenging defects
  • Pixel-perfect annotations

Limitations:

  • Very small dataset
  • Grayscale only

9. NEU Surface Defect Database

Overview: Hot-rolled steel strip surface defects dataset. Specifications:

  • Images: 1,800 grayscale images
  • Resolution: 200 x 200 pixels
  • Defect Types: 6 classes (rolled-in scale, patches, crazing, pitted surface, inclusion, scratches)
  • Annotations: Class labels
  • Format: JPG images

Download: Kaggle Mirror - NEU Surface Defect Database

Best For: Steel manufacturing, surface inspection research

Strengths:

  • Balanced dataset (300 per class)
  • Widely used benchmark

Limitations:

  • Low resolution
  • No bounding boxes, classification only

Semiconductor & Wafer Defects

10. WM-811K Wafer Map Dataset

Overview: Semiconductor wafer defect patterns for failure analysis. Specifications:

  • Images: 811,457 wafer maps
  • Patterns: 9 defect patterns
  • Format: Pickle files
  • Annotations: Pattern labels

Download: Kaggle - WM-811K

Best For: Semiconductor manufacturing, wafer inspection

Strengths:

  • Massive dataset
  • Real manufacturing data

Limitations:

  • Abstract representation (not images)
  • Requires preprocessing

Concrete & Infrastructure Defects

11. Crack Detection Dataset (SDNET2018)

Overview: Concrete crack detection for bridge and infrastructure inspection. Specifications:

  • Images: 56,000+ images
  • Categories: Bridge deck, wall, pavement
  • Resolution: 256 x 256 pixels
  • Classes: Cracked, non-cracked

Download: Utah State University - SDNET2018

Best For: Infrastructure inspection, civil engineering

Strengths:

  • Large dataset
  • Real-world conditions

Limitations:

  • Binary classification only
  • Large download size

12. Concrete Crack Images for Classification

Overview: Simplified crack detection dataset. Specifications:

  • Images: 40,000 images
  • Resolution: 227 x 227 pixels
  • Classes: Positive (crack), negative (no crack)

Download: Mendeley Data - Concrete Crack

Best For: Binary crack detection, educational purposes

Strengths:

  • Large balanced dataset
  • Good for beginners

Limitations:

  • Binary only
  • Low resolution

General Manufacturing Defects

13. DAGM 2007 Defect Dataset

Overview: Synthetically generated texture defect detection. Specifications:

  • Images: 11,000+ images across 10 classes
  • Resolution: 512 x 512 pixels
  • Defects: Subtle texture anomalies
  • Annotations: Binary masks

Download: Kaggle - DAGM 2007 OR Zenodo - DAGM 2007

Best For: Texture defect detection research, algorithm benchmarking

Strengths:

  • Challenging subtle defects
  • Clear ground truth

Limitations:

  • Synthetic data
  • Limited real-world applicability

14. Magnetic Tile Defects Dataset

Overview: Surface defects on magnetic tiles. Specifications:

  • Images: 1,344 images
  • Resolution: 768 x 768 pixels (original 6000+ x 6000)
  • Defect Types: 5 classes (blowhole, break, crack, fray, uneven)
  • Annotations: Bounding boxes

Download: Kaggle - Magnetic Tile Defects

Best For: Ceramic inspection, tile manufacturing

Strengths:

  • High-quality images
  • Real production data

Limitations:

  • Small dataset
  • Specific product type

Commercial & Specialized Datasets

15. Roboflow Universe

Overview: A massive community-driven platform hosting hundreds of thousands of public computer vision datasets, including a vast array of niche manufacturing and defect detection collections. Key Features:

  • Multiple industries covered
  • Various annotation formats
  • Preprocessing and auto-labeling tools

Access: Roboflow Universe Best For: Rapid prototyping, finding niche datasets


16. Kaggle Datasets

Overview: Data science competition platform with numerous manufacturing datasets. Popular Defect Detection Datasets:

  • Severstal Steel Defect Detection: Highly challenging RLE segmentation.
  • Welding Defect Dataset for Object Detection: YOLO-annotated bounding boxes for good welds, bad welds, and porosity.
  • GDXray X-ray Defects: Industrial X-ray inspection for metal casting.
  • Casting Product Image Data: Binary classification dataset for quality inspection in casting manufacturing.

Access: Kaggle Datasets Best For: Benchmark comparisons, competition-grade data


17. Landing AI Dataset Management

Overview: Professional dataset management with data-centric AI tools. Features:

  • Dataset hosting and version control
  • Collaborative annotation
  • Quality analysis

Access: Landing AI


Industry-Specific Dataset Collections

Automotive

  • Datasets: Paint defect detection, car body panel datasets, automotive glass defect datasets.
  • Sources: MVTec HALCON sample datasets, Cognex VisionPro datasets (custom data collection highly recommended).

Food & Beverage

  • Datasets: Fruit defect detection (apples, oranges), packaging, and label inspection.
  • Resources: Search GitHub.

Pharmaceutical

  • Datasets: Tablet inspection, packaging, and capsule defect detection.
  • Note: Most pharmaceutical datasets are proprietary due to strict regulatory requirements.

Dataset Preparation Best Practices

1. Data Augmentation

When working with small datasets, augmentation is essential. Beyond basic adjustments, Mosaic and MixUp augmentations are critical in 2026 for detecting small defects (like pinholes on PCBs). They train the model to look at multiple scales and contexts simultaneously.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
from albumentations import (
    Compose, HorizontalFlip, VerticalFlip, RandomRotate90,
    RandomBrightnessContrast, GaussNoise, Blur
)

# Standard augmentations
augmentation = Compose([
    HorizontalFlip(p=0.5),
    VerticalFlip(p=0.5),
    RandomRotate90(p=0.5),
    RandomBrightnessContrast(p=0.3),
    GaussNoise(p=0.2),
    Blur(blur_limit=3, p=0.2)
])

2. Format Conversion & Standardization

Before splitting your data, ensure all annotations are in a unified format. While COCO JSON and Pascal VOC XML were historically popular, the YOLO TXT format has become the de facto standard for defect detection due to its lightweight nature and native support by modern architectures like YOLO11 and YOLO26.

3. Train/Val/Test Split

Recommended splits for defect detection:

  • Training: 70-80%
  • Validation: 10-15%
  • Test: 10-15%

Crucial Step: Ensure defect classes are perfectly balanced across your splits. A validation set that is 99% “good parts” will give you a dangerously false sense of high performance.

4. Handling Class Imbalance

In manufacturing, perfectly good parts often outnumber defective parts 100-to-1. To prevent your model from simply guessing “no defect” every time:

  • Oversampling: Duplicate your minority defect images during training to match the majority class volume.
  • Weighted Loss Functions: Use techniques like Focal Loss, which assigns a much higher penalty to the model when it misclassifies a rare defect.
  • Anomaly Detection Pivot: If your defects are exceptionally rare (e.g., you only have 5 examples), pivot away from object detection entirely and use unsupervised anomaly detection models (like PatchCore) that are trained exclusively on perfect parts.

5. Annotation Tools & Automation

In 2026, manual polygon drawing is obsolete. Foundation models like SAM 2 (Segment Anything Model 2) act as auto-annotators. They allow for zero-shot or one-click pixel-perfect segmentation, reducing manual annotation time by up to 80%.

For bounding boxes:

  • Roboflow (web-based, collaborative, auto-labeling support)
  • CVAT (advanced, self-hosted)
  • Label Studio (highly customizable)

For segmentation:

  • SAM 2 Integration (automated masking)
  • Supervisely (professional platform)
  • LabelMe (lightweight, offline polygon annotations)

Creating Your Own Dataset

When public datasets don’t meet your needs:

Data Collection Guidelines

Camera Setup:

  • Use industrial cameras with consistent lighting
  • Minimum 1920x1080 resolution
  • 60+ FPS for production lines
  • Fixed focal length lenses

Recommended Hardware:

  • Industrial USB cameras available at major retailers
  • LED panel lights for uniform illumination
  • Camera mounts and fixtures for repeatability

Annotation Guidelines

Best Practices:

  • Multiple annotators for quality
  • Clear defect definitions document
  • Aim for >95% inter-annotator agreement

Minimum Dataset Size by Task:

  • Binary classification: 500+ images per class
  • Object detection: 1,000+ images, 100+ instances per class
  • Segmentation: 1,500+ images with pixel masks

Enhanced 2026 Dataset Comparison Matrix

Dataset Industry Images Defect Types Annotation SOTA Approach (2026) License
DeepPCB Electronics 1,500 6 Bbox YOLO26 / RT-DETR Academic
MVTec AD General 5,354 73 Segmentation PatchCore / ViTs Academic
MVTec 3D-AD 3D / General 4,147 Various 3D Point Cloud Multimodal ViT Academic
AITEX Textile 245 7 Segmentation Mask2Former Academic
NEU Metal 1,800 6 Classification ResNet / EfficientNet Academic
Severstal Steel 18,000+ 4 Segmentation YOLO11-Seg Open
SDNET2018 Infrastructure 56,000 2 Classification MobileNetV3 Open
KolektorSDD Metal 399 Various Segmentation PaDiM Academic
Magnetic Tile Ceramic 1,344 5 Bbox YOLO11 Open

Benchmarking Your Model

While CNNs (like the YOLO family) remain the champions of high-speed object detection, Vision Transformers (ViTs) are now the state-of-the-art for unsupervised anomaly detection (where models are trained only on “good” parts).

Object Detection:

  • mAP@50 (mean Average Precision at IoU 50%)
  • mAP@50-95 (average across IoU thresholds)
  • Inference time (ms per image)

Segmentation:

  • Pixel accuracy
  • Mean IoU (Intersection over Union)
  • Dice coefficient

Classification:

  • Accuracy, Precision, Recall, F1
  • Confusion matrix
  • ROC-AUC score

Dataset Licensing Considerations

Academic Use

Most datasets allow free academic use with proper citation. Include the original paper reference and comply with attribution requirements.

Commercial Use

Check licensing carefully: Some datasets prohibit commercial use or require licensing fees. Contact authors for clarification.

Safer Options for Commercial Projects: Public domain datasets, CC0 or MIT licensed data, or creating custom datasets.


Advanced Dataset Techniques

Synthetic Data Generation via Diffusion Models

While basic augmentations are useful, 2026 relies heavily on Diffusion Models (e.g., fine-tuned Stable Diffusion for industrial data) rather than GANs. They handle complex textures much better, generating highly realistic synthetic defects for rare edge cases.

1
2
3
4
5
6
7
8
9
10
11
from imgaug import augmenters as iaa

# Create basic synthetic defects if diffusion isn't viable
defect_augmenter = iaa.Sequential([
    iaa.SomeOf((1, 3), [
        iaa.Add((-20, 20)),  # Brightness variation
        iaa.AdditiveGaussianNoise(scale=(0, 0.05*255)),
        iaa.ElasticTransformation(alpha=50, sigma=5),
        iaa.PiecewiseAffine(scale=(0.01, 0.05)),
    ])
])

Domain Adaptation

Transfer learning from similar datasets:

  1. Pre-train on a large general dataset (ImageNet, COCO)
  2. Fine-tune on a similar defect dataset (MVTec AD)
  3. Final training on your target application dataset

Active Learning

Optimize your annotation effort:

  1. Train an initial model on a small labeled set
  2. Use the model to find uncertain/difficult examples in unlabeled data
  3. Prioritize those difficult examples for human annotation
  4. Retrain and repeat

Tools & Frameworks for Dataset Management

Data Version Control

DVC (Data Version Control): Git-like versioning for datasets to track experiments, data changes, and collaborate efficiently.

Dataset Hosting

Recommended Platforms:

  • Roboflow: Best for computer vision, excellent UI
  • Hugging Face Datasets: ML community, good for research
  • AWS S3 / Google Cloud Storage: Enterprise solutions
  • Weights & Biases: MLOps with dataset versioning

1. Advanced Synthetic Data

AI-generated defect images via fine-tuned Diffusion models heavily reduce annotation costs by mapping realistic defects onto perfect part renders.

2. Zero-Shot Annotation

Foundation models (like SAM 2) act as auto-annotators, allowing engineers to simply click a defect to generate a perfect polygon mask instantly.

3. Multi-Modal Datasets

Combining data sources such as RGB + thermal imaging, X-ray + visual inspection, and 3D point clouds + 2D images.

4. Continuous Learning Datasets

Dynamic datasets that grow with production through edge case collection, active learning loops, and automated quality control pipelines.


Conclusion

The right dataset is fundamental to building effective defect detection systems. Start with established benchmarks like MVTec AD or DeepPCB for prototyping, then collect custom data for production deployment.

Key Recommendations:

  • For Research: MVTec AD, DeepPCB, NEU Surface
  • For Production: Collect 1,000+ images minimum, balance classes, include edge cases, and validate on separate production data.
  • For Learning: Start with MNIST-like simple datasets, progress to NEU Surface, and tackle MVTec AD for advanced techniques.

Essential Hardware for Dataset Creation

When building custom datasets, quality hardware matters:

Cameras:

  • Industrial USB 3.0 Cameras — Consistent imaging with fixed settings
  • High-Resolution 5MP+ Sensors — Essential for detecting small defects
  • Global Shutter Cameras — No motion blur on moving production lines

Lighting:

  • LED Panel Lights — Uniform illumination for consistent imaging
  • LED Ring Lights — Perfect for reflective surfaces
  • Backlighting Solutions — For transparent material inspection

Computers for Annotation:

  • High-Performance Workstations — Minimum 16GB RAM for smooth annotation
  • Fast NVMe SSDs — Quick image loading is essential
  • Dual Monitor Setups — Dramatically improves annotation efficiency

Frequently Asked Questions

Q: How much data do I need for production-ready models? A: Minimum 1,000 images with 100+ examples per defect type. More is better, especially for rare defects.

Q: Can I mix datasets from different sources? A: Yes, but ensure consistent annotation formats and similar imaging conditions. Domain adaptation may be necessary.

Q: What if my defects are too rare to collect enough samples? A: Use data augmentation, synthetic generation (diffusion models), or anomaly detection approaches that work with “good” samples only.

Q: Should I use public or create custom datasets? A: Start with public for proof-of-concept, create custom for production. Public datasets rarely match real-world conditions exactly.

Q: How do I handle class imbalance? A: Use weighted loss functions, oversample minority classes, or collect/synthesise more examples of rare defects.


Have questions about specific datasets? Need help choosing the right data for your application? Contact us for personalised guidance.

Related Articles:

Don't Miss the Next Insight

Weekly updates on computer vision, defect detection, and practical AI implementation.

Was this article helpful?

Your feedback helps improve future content

Found a bug in the code or spotted an error?

Report an issue
James Lions

James Lions

AI & Computer Vision enthusiast exploring the future of automated defect detection