Official ISP-AD dataset repository, implementing training pipelines, a datamodule and dataset class based on Anomalib and the PyTorch Ecosystem, including PyTorch Lightning. Minimal working examples aim to encourage practitioners to use the ISP-AD dataset for their research and development through easy framework integration.
The ISP-AD Dataset is a large-scale industrial visual anomaly detection benchmark designed for unsupervised, self-supervised, and supervised learning. It features subtle, weakly contrasted surface defects embedded within structured screen-printed patterns with high permitted design variability.
Comprising 559,049 samples, ISP-AD is one of the largest publicly available industrial anomaly detection datasets to date, providing both synthetic and real defects collected directly from the factory floor.
This repository is intended to foster research on industrially applicable anomaly detection approaches including:
-
Novel training strategies using real and synthetic defects as proposed in the accompanying paper [1], as well as unsupervised methods.
-
Zero-shot or few-shot defect synthesis approaches.
-
Emerging vision foundation models:
- (i) for testing their zero-shot performance on challenging industrial textured patterns or
- (ii) by utilizing the large-scale training streams of three modalities as an auxiliary finetuning step for domain adaptation on similar industrial patterns.
-
... and many more!
Presented Dataloaders and minimal working examples, including an unsupervised benchmark pipeline based on the Anomalib framework, aim to simplify the first steps in state-of-the-art industrial visual anomaly detection by presenting a real-world use case in screen printing.
- 📂 ISP-AD Dataset Overview
- ⚙️ Installation & Core Framework
- ⚡ Universal PyTorch Compatibility
- 🎬 ISP-AD Minimal Working Examples and Anomalib Benchmark Pipeline
- 📜 Licenses
- 🎓 Citation & Attribution
- Contact
- Acknowledgements
- References
- Version History
- Total Samples: 559,049 patches
- Fault-Free Data: 312,674 patches
- Defective Data: 246,375 patches (245,664 synthetic, 711 real-world defects)
- Modalities:
LSM_1(Line Scan),LSM_2(Line Scan), andASM(Area Scan)
Publicly available on Zenodo
- Image patches available in 256×256 px and 512×512 px resolutions
- Includes both rgb and grayscale
- Provided in the following formats:
.png.hdf5
The repository is organized to enable research on unsupervised, self-supervised, and supervised approaches.
Due to their size, the files have been split into different downloadable subfolders.
The unsupervised repository contains all available modalities: LSM-1, LSM-2, and ASM, and follows the official MVTec AD [2] scheme:
└── 📁unsupervised
└── 📁LSM_1
└── 📁ground_truth
└── 📁area
└── 📁points
└── 📁test
└── 📁area
└── 📁good
└── 📁points
└── 📁train
└── 📁good
└── 📁good_reduced
...
└── 📁configs
└── 📁ASM
└── 📁LSM_1
└── 📁LSM_2
In addition to the reduced fault-free training splits with a maximum of 500 patches, LSM-1 also includes a larger set of 3678 patches.
💡 Notice on Configuration Files: The YAML config files provided in the unsupervised subfolder represent the original configuration baselines utilized for the benchmarks in the accompanying paper [1]. Please note that these are reference configs of the paper and are not configured to be run with the proposed codebase in this repository.
Data for the mixed supervised training approach [1], containing both synthetic and real defects, is available for download in separate folders, with one folder for each modality.
└── 📁supervised_LSM_1
└── 📁test
└── 📁defects
└── 📁good
└── 📁train
└── 📁defects
└── syn_train_lsm1.hdf5
...
└── 📁additional_LSM_1
└── 📁defects_experiments
└── 📁good
....
To reproduce the experiments in the proposed paper: "ISP-AD: a large-scale real-world dataset for advancing industrial anomaly detection with synthetic and real defects", all defect fractions used for training are included in the /defects_experiments folders.
In addition, to foster research on self-supervised methods, fault-free patches of LSM-1 (20,000), LSM-2 (10,000), and ASM (20,000) are available. These serve as the unaugmented counterparts of the fault-free training data used in the mixed training approach. As described in the paper, this data can be considered noisy.
With a patch size of 512 × 512 px (LSM-1, LSM-2) and 256 × 256 px (ASM), they are ready for additional augmentation, leveraging e.g. defect synthesis methods.
Furthermore, the real defective data described above can be incorporated for additional supervision to investigate mixed approaches that utilize both synthetic and real defects.
For detailed information on dataset generation, data splits and possible applications and research directions, we refer to the underlying publication [1].
💡 Notice on Code Availability: Please note that while the raw supervised data splits and
.hdf5files are fully included and available for download via Zenodo, the corresponding supervised PyTorch dataloaders and training pipelines are not released yet in this repository. The public release of these code packages is currently under review and cannot be guaranteed at this time.
This repository has been developed under the following environment:
Operating System: Windows 11 (Python 3.11/3.12)
Core Framework: Anomalib 2.1/2.5 (utilizing PyTorch 2.5+ and PyTorch Lightning 2.4+)
To set up your local environment and execute the minimal working examples, install the dependencies using your package manager of choice (e.g., pip or uv) based on the versions provided in the requirements.txt file:
git clone https://github.com/p4ulk/isp-ad.git
pip install -r requirements.txt- Project Dataset Root:
../data/ISPAD/unsupervised - Source: Public Zenodo repository
- How to: Manually before starting any experiments, OR via the
DataModuledownload functionality using the--downloadflag.
cd source
python -m examples_ISPAD.visualize_datamodule --download- Note: If you run the Anomalib benchmark pipeline and no dataset is present in the root directory, the download will start automatically!
💡 Notice: As this repository represents a novel research release with limited testing across diverse hardware setups, library versions and experimental recipes, initial minor bugs may be present. To run your own experiments or adapt the configurations, please fork or clone the repository.
The Anomalib-based ISP-AD DataModule and Dataset classes return ImageBatch objects with PyTorch tensors as attributes. This allows you to integrate the data streams into standard, framework-free PyTorch training pipelines.
💡Architectural Dependency Note: Because
ISPADDatasetandISPADinherit from Anomalib's core classes, the library must be installed (pip install anomalib) to instantiate these classes.
If you want to avoid Anomalib inside your training loop, you have two options:
- With Anomalib Dependency: Use torch_usage_pattern.py. It initializes
ISPADDataset, but the resultingDataLoaderyields a standard batch object containing PyTorch tensors (accessible viabatch.image,batch.gt_mask). - Plain Custom Workflow: Copy the static method
ISPADDataset.make_isp_ad_dataset()standalone. It returns a pure PandasDataFrameof all paths and splits. Use this scheme to build a custom PyTorchDatasetfrom scratch if needed.
PyTorch training pattern as demonstrated in torch_usage_pattern.py:
How to Run: To execute the usage pattern correctly from the project root
source/without import errors, run it as a Python module:cd source python -m examples_ISPAD.torch_usage_pattern
import torch
from unsupervised.dataset.isp_ad import ISPADDataset
# 1. Instantiate the dataset split
train_dataset = ISPADDataset(
root,
category=category,
split="train",
train_good_reduced=True,
)
# 2. Create the standard PyTorch DataLoader using the dataset's collate function
train_dataloader = torch.utils.data.DataLoader(
dataset=train_dataset,
batch_size=8,
shuffle=True,
collate_fn=train_dataset.collate_fn,
)
# 3. Run the PyTorch Training Loop
# ...
for idx, batch in enumerate(train_dataloader):
# Unpack framework ImageBatch attributes directly
images = batch.image # PyTorch Tensor: [B, C, H, W]
targets = batch.gt_label # PyTorch Boolean Tensor: [B]
img_paths = batch.image_path # Python List: len = B
masks = batch.gt_mask # PyTorch Boolean Tensor: [B, H, W]
# 4. Write standard, framework-free PyTorch code from here on
# images = images.to(device)
# optimizer.zero_grad()
# outputs = my_autoencoder(images)
# loss = torch.nn.functional.mse_loss(outputs, images)
# loss.backward()
# optimizer.step()
# ...The ISPAD DataModule is a fully compliant LightningDataModule. Plug it into any standard PyTorch Lightning Trainer to train custom models:
import lightning as L
from unsupervised.datamodule.isp_ad import ISPAD
# 1. Initialize the ISP-AD datamodule
datamodule = ISPAD(root="../data/ISPAD/unsupervised", train_batch_size=32)
# 2. Initialize your custom model
model = custom_lightning_model()
# 3. Pass it to the Lightning Trainer
trainer = L.Trainer(max_epochs=10)
trainer.fit(model=model, datamodule=datamodule)Note: Access batch tensors inside your training_step via batch.image.
Minimal working examples are located in ../source/examples_ISPAD, hosting a separate README.md.
Demonstrates direct interfacing with Pandas DataFrame and class distributions of ISP-AD data splits:
python -m examples_ISPAD.visualize_datasetOptional CLI Arguments:
python -m examples_ISPAD.visualize_dataset --root "../data/ISPAD/unsupervised" --category "LSM_1"Implements dataset downloading, parsing, as well as datamodule and image visualizations.
python -m examples_ISPAD.visualize_datamodule Optional CLI Arguments (Automatically downloads archives from Zenodo if missing):
python -m examples_ISPAD.visualize_datamodule --root "../data/ISPAD/unsupervised" --category "ASM" --downloadThe repository provides a training and testing pipeline anomalib_pipeline.py leveraging a YAML configuration file management using OmegaConf to run state-of-the-art anomaly detection benchmarks of the Anomalib framework.
Adapt the configurations to your own experiments within configs/unsupervised/experiments. The folder configs/unsupervised/models has to be extended with the Anomalib model.yaml files of your needs. This version hosts the following config files: cfa.yaml, efficient_ad.yaml, uflow.yaml, glass.yaml and dinomaly.yaml. Take a look at the available Anomalib models for your Anomalib version and copy the model part to your plain model YAML file.
Settings regarding the training engine and the ISP-AD datamodules, including additional Lightning functionality or data augmentations, can be adapted in the separate YAML config files. Regarding preprocessing and interaction of data augmentations, we refer to the official Anomalib Documentation, as they often implement data normalization at the model (PreProcessor) stage.
- Blueprint for prototyping with Anomalib API and CLI: The pipeline combines API functionality with YAML config parsing for easy integration of models from the Anomalib Ecosystem. It combines structured YAML configuration while supporting terminal overrides at runtime using
OmegaConf, ensuring intuitive and reproducible experimental management by using Anomalib's API and config-parsing functionality.
Run commands from the source/ root directory using the Python module option flag:
- Run with Default Configurations (
cfa.yaml):python -m anomalib_pipeline
- CLI Parameter Modifiers over separate recipes:
python -m anomalib_pipeline --config efficient_ad.yaml trainer.max_epochs=50 data.init_args.train_batch_size=1
Experiments are tracked via an experiment-specific and dataset-specific folder structure:
└── 📁logs
└── 📁unsupervised
└── 📁experiment_name*
└── 📁model_name*
└── 📁version_nr
└── full_config.yaml
Model checkpoints and logging results from common loggers—such as TensorBoard—are available within Anomalib's versioned directory structure. Test image outputs are automatically saved inside the respective model_name* sub-directory structure.
The unified experimental configuration, built from the base experiment YAML and additional command-line (CLI) overrides, is parsed by Anomalib's Engine and saved as full_config.yaml. Within each experimental run of the same experiment, a new version_nr folder is created. This folder contains the training checkpoints, logger outputs, additional Lightning configuration files, and the image-level confusion matrix generated during testing.
💡 Notice on Code Base: Please note that the unsupervised pipeline (
anomalib_pipeline.py) provided in this repository represents a clean-room implementation based on parts of the methodology described in the accompanying publication [1]. It is structured specifically for enhanced modularity, and ease of framework integration for future research, and does not represent the exact implementation utilized during the original paper's benchmarking runs.
- Codebase & utilized Frameworks: Licensed under the Apache License 2.0 (Copyright © 2026 Paul Josef Krassnig, utilizing and adapting core structural concepts of the Anomalib [3] Framework licensed under the Apache License 2.0.
- Dataset: Hosted publicly via Zenodo under the CC BY-NC-SA 4.0 license.
If you integrate the ISP-AD dataset or the training pipeline into your scientific research, please cite the primary reference:
@article{krassnig2026isp,
title={ISP-AD: A large-scale real-world dataset for advancing industrial anomaly detection with synthetic and real defects},
author={Krassnig, Paul Josef and Gruber, Dieter Paul},
journal={Journal of Intelligent Manufacturing},
pages={1--26},
year={2026},
publisher={Springer}
}- For formal, dataset-related questions: 📧 paul.krassnig@pccl.at
- For all technical repository questions: Please open a GitHub Issue directly in this repository.
💡 Note on Maintenance: This repository is a research release. Responses to issues and questions are provided on a best-effort basis and may be delayed due to limited availability.
This open-source repository was created as an independent development to support the published research.
The research was performed within the COMET-project: Deep online learning for highly adaptable polymer surface inspection systems (project-no.: 879785) at the Polymer Competence Center Leoben GmbH (PCCL, Austria) within the framework of the COMET-program of the Federal Ministry for Climate Action, Environment, Energy, Mobility, Innovation and Technology and the Federal Ministry for Digital and Economic Affairs. The PCCL is funded by the Austrian Government and the State Governments of Styria, Lower Austria and Upper Austria.
The author would like to thank the PCCL, the Montanuniversität Leoben, and colleagues for the support and the resources provided during the publication of the official paper.
[1] Krassnig, P.J., Gruber, D.P. ISP-AD: a large-scale real-world dataset for advancing industrial anomaly detection with synthetic and real defects. J Intell Manuf (2026). https://doi.org/10.1007/s10845-025-02778-z
[2] Bergmann, P., Fauser, M., Sattlegger, D., & Steger, C. (2021).
MVTec AD — A comprehensive real-world dataset for unsupervised anomaly detection.
International Journal of Computer Vision, 129(4), 1038–1059.
https://doi.org/10.1007/s11263-020-01400-4
[3] Akcay, S., Ameln, D., Vaidya, A., Lakshmanan, B., Ahuja, N., & Genc, U. (2022, October). Anomalib: A deep learning library for anomaly detection. In 2022 IEEE International Conference on Image Processing (ICIP) (pp. 1706-1710). IEEE. https://doi.org/10.1109/ICIP46576.2022.9897283
- Initial release of the ISP-AD dataset repository, including anomalib benchmark pipeline and ISP-AD minimal working examples. Tested on OS Windows 11.
