Dinomaly is a reconstruction-based anomaly detector that is mostly attention and MLPs
[CVPR 2025] Official Implementation of "Dinomaly: The Less Is More Philosophy in Multi-Class Unsupervised Anomaly Detection". The first multi-class UAD model that can compete with single-class SOTAs
At a glance
- What is it?
- Dinomaly is the official PyTorch implementation of a CVPR 2025 paper on multi-class unsupervised anomaly detection, built on a plain Transformer reconstruction backbone with four named components and no additional modules or tricks. It suits a researcher reproducing multi-class anomaly detection results on MVTec-AD, VisA or Real-IAD, and it pins an old Python and PyTorch stack.
- Who is it for?
- Dinomaly fits a researcher who needs to reproduce or build on the CVPR 2025 multi-class anomaly detection result, since the code, the paper and the benchmark protocols are all published and the design is small enough to read. It does not fit a production deployment on a current stack, because the requirements pin torch 1.12 with CUDA 11.3 and Python 3.8.12, and the DINOv3 variant needs Python above 3.10 and PyTorch above 2.7, which is not in this repository.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 36 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What the paper claims, in the authors' own terms
Dinomaly is the official implementation of a CVPR 2025 paper, and the README states the ambition plainly: it is the first multi-class UAD model that can compete with single-class state of the art.
The abstract sets out the gap. Recent studies highlighted a practical setting of unsupervised anomaly detection that builds a unified model for multi-class images, and despite advancements the detection performance under the multi-class setting still lags far behind state-of-the-art class-separated models. The aim is to bridge that gap.
The reported figures are image-level AUROC of 99.6%, 98.7% and 89.3% on MVTec-AD, VisA and Real-IAD respectively, with 99.8%, 98.9% and 90.1% when using ViT-L. The paper states this is superior to state-of-the-art multi-class UAD methods and also achieves the most advanced class-separated UAD records.
Those numbers are the paper's, quoted from the abstract rather than measured here, and the README carries Papers with Code badges marking the method as SOTA in the unified multi-class setting on each of the three datasets.
The framework itself is described as minimalistic and reconstruction-based, using pure Transformer architectures without relying on complex designs, additional modules or specialized tricks. That last clause is the interesting design claim: the paper argues the gap was closed by removing machinery rather than adding it.
Four components, and the backbone that holds them
The abstract is unusually precise about what the method needs, which makes it easy to grasp the contribution.
Given that the framework consists only of attentions and MLPs, the authors found four simple components essential to multi-class anomaly detection.
The first is Foundation Transformers, which extract universal and discriminative features. The second is Noisy Bottleneck, where pre-existing Dropouts do all the noise injection tricks, which is a nice piece of economy, since the dropout that would be there anyway is repurposed as the noise source rather than requiring a separate noise module.
The third is Linear Attention that naturally cannot focus, described in the abstract with the appealing phrase that it naturally cannot focus. The fourth is Loose Reconstruction, which does not force layer-to-layer and point-by-point reconstruction.
The names are the interesting part. A method whose contributions are described as a backbone, a bottleneck, an attention variant and a relaxation of the reconstruction objective is a method you can hold in your head, and the less is more in the title is a literal description of the contribution rather than a marketing phrase.
The repository layout backs this up. There are beit/, dinov1/ and dinov2/ directories for the transformer backbones, a models/ directory, optimizers/, utils.py, dataset.py, a flops_profiler/ directory for the compute profiling, and separate top-level scripts per dataset and per setting, which is how you tell what the code actually supports.
The scripts tell you which settings are supported
The repository root is a set of entry points rather than a single runnable module, and their names are the clearest documentation of the experimental matrix.
There are dinomaly_mvtec_uni.py and dinomaly_mvtec_sep.py for MVTec-AD in unified multi-class and class-separated settings. There is the same pair for VisA with dinomaly_visa_uni.py and dinomaly_visa_sep.py, and again for Real-IAD with dinomaly_realiad_uni.py and dinomaly_realiad_sep.py. And there is dinomaly_mpdd_sep.py for MPDD, which has no unified variant listed.
The uni and sep suffixes correspond directly to the paper's distinction between the unified multi-class setting and the class-separated one, so you can reproduce either side of the comparison the paper makes.
There are also recontrast_mvtec_uni.py, recontrast_realiad_uni.py and recontrast_visa_uni.py, which are the ReContrast baseline scripts, so the comparison methods are in the tree and not only in the paper.
The prepare_data/ directory holds the dataset preparation code, and the split_csv/ directory holds the official split files, one of which is referenced by name in the VisA preprocessing command.
Setting up the environment and the datasets
The environment setup is three commands in a fresh conda environment.
conda create -n my_env python=3.8.12
conda activate my_env
pip install -r requirements.txtThe README states that experiments are conducted on an NVIDIA GeForce RTX 3090 with 24GB, and that the same GPU and package version are recommended.
That recommendation is a real constraint. The requirements.txt pins torch 1.12.0+cu113 and torchvision 0.13.0+cu113, with CUDA 11.3, and alongside them matplotlib 3.2.1, numpy 1.18.4, opencv_python_headless 4.6.0.66, pandas 1.3.5, Pillow 9.0.1, scikit_image 0.19.3, scikit_learn 0.22.2.post1, scipy 1.4.1, tqdm 4.64.1, ptflops 0.7 and timm 0.9.12. The first line is a find-links pointer to the PyTorch wheel index for the CUDA build.
Datasets live one directory above the code by default, and the README says you can change that as long as you remember to modify the data_path in the code. MVTec-AD is unzipped to ../mvtec_anomaly_detection, with one directory per category.
VisA needs a preprocessing step, because the official splitting has to be applied in one-class mode. The README gives the command that does it.
python ./prepare_data/prepare_visa.py --split-type 1cls --data-folder ../VisA --save-folder ../VisA_pytorch --split-file ./prepare_data/split_csv/1cls.csvThe output goes to ../VisA_pytorch with a 1cls directory containing one folder per category, each with its own ground_truth.
What came after, and the licence condition you should not miss
Two of the README's news items matter more than the rest for anyone deciding what to use.
The first is the DINOv3 implementation, from 08.2025. The author reports successfully implementing DINOv3 on Dinomaly, with much better pixel-level performance and slightly lower image-level performance, giving MVTecAD figures for DINOv3-Large of image-level AUROC 0.9970, pixel AUROC 0.9878, pixel AP 0.7422, pixel F1 0.7184 and pixel AUPRO 0.9580. Because DINOv3 requires newer versions of Python above 3.10 and PyTorch above 2.7, it is not provided in this repository, and the author points at a forked branch instead.
The second is Dinomaly2, announced in 10.2025 as the first unified framework for full-spectrum UAD, handling diverse data modalities (2D, multi-view, RGB-3D, RGB-IR), task settings (single-class, multi-class, inference-unified multi-class, few-shot) and application domains (industrial, biological, outdoor). The preview code was released in 05.2026, and it supports super-large multi-class datasets with Real-IAD Variety at 160 classes and ADNet at 380 classes.
So the current version of this work is Dinomaly2, and the Dinomaly repository you are looking at is the CVPR 2025 paper's implementation.
There is also a licence condition worth reading carefully. The project is released under the Apache-2.0 licence, and if your method is based on Dinomaly the README asks you to acknowledge it in your work, papers, products, patents or competitions, preferably as a Preliminary section. That is a request rather than a licence term, and the licence file itself is at the root.
One more integration is worth knowing: Dinomaly was integrated into Intel open-edge Anomalib in v2.1.0, so if you want to benchmark it as part of a standard anomaly detection suite rather than as a standalone script, Anomalib is the route.
Where Dinomaly is the wrong choice
Four cases argue against it.
The first is a current production stack. The environment pins Python 3.8.12 and torch 1.12 with CUDA 11.3, and the DINOv3 variant needs Python above 3.10 and PyTorch above 2.7 but is not in this repository. Reproducing the paper's numbers means recreating a 2024-era environment, and if your cluster has modern CUDA drivers that is work in itself.
The second is a large class count. The Dinomaly2 preview supports Real-IAD Variety at 160 classes and ADNet at 380 classes, and the README presents that super-large multi-class support as part of the newer work. If your problem is many classes, the Dinomaly2 repository is the one to read.
The third is if you want a library rather than a reproduction. This is a research implementation: a set of scripts per dataset and setting, with data paths hardcoded relative to the repository, and no packaged API for training on your own data. Using Anomalib, where Dinomaly was integrated in v2.1.0, is the way to get the same method into a benchmarking and deployment framework with a proper interface.
The alternative in the same direction is a foundation-model anomaly detection approach built on DINOv2 or DINOv3 features directly, since the README's own DINOv3 note points at a fork rather than including it. The difference in approach is that Dinomaly's contribution is a reconstruction framework with four named components that works with any backbone, while a foundation-feature approach does no reconstruction at all and instead scores features directly. The reconstruction route is slower at inference and needs a training phase; the feature route is often faster and simpler. Dinomaly is the one to pick if you want the multi-class unified setting handled by a trained model rather than by per-class thresholds.
Editorial conclusion
Dinomaly fits a researcher who needs to reproduce or build on the CVPR 2025 multi-class anomaly detection result, since the code, the paper and the benchmark protocols are all published and the design is small enough to read. It does not fit a production deployment on a current stack, because the requirements pin torch 1.12 with CUDA 11.3 and Python 3.8.12, and the DINOv3 variant needs Python above 3.10 and PyTorch above 2.7, which is not in this repository. Cite it in your work, as the README asks, and check the Dinomaly2 repository if you need the unified multi-modal framework.
Frequently asked questions
What is Dinomaly?
Dinomaly is the official PyTorch implementation of the CVPR 2025 paper Dinomaly: The Less Is More Philosophy in Multi-Class Unsupervised Anomaly Detection. It is a minimalistic reconstruction-based framework using pure Transformer architectures without complex designs, additional modules or specialized tricks.
What are the four components of Dinomaly?
Foundation Transformers that extract universal and discriminative features, Noisy Bottleneck where pre-existing Dropouts do the noise injection, Linear Attention that naturally cannot focus, and Loose Reconstruction which does not force layer-to-layer and point-by-point reconstruction.
How do I set up the Dinomaly environment?
Create a conda environment with `conda create -n my_env python=3.8.12`, activate it and run `pip install -r requirements.txt`. The README recommends an NVIDIA GeForce RTX 3090 with 24GB and the same package versions, which pin torch 1.12.0+cu113 and torchvision 0.13.0+cu113.
Which datasets does Dinomaly support?
MVTec-AD, VisA, Real-IAD and MPDD, with separate scripts for the unified multi-class and class-separated settings such as dinomaly_mvtec_uni.py and dinomaly_mvtec_sep.py. The VisA dataset needs preprocessing with prepare_data/prepare_visa.py using the official one-class split before training.
What licence is Dinomaly released under and what does it ask of users?
Apache-2.0, with the LICENSE file at the repository root. The README asks that if your method is based on Dinomaly you acknowledge it in your work, whether papers, products, patents or competitions, preferably as a Preliminary section.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/guojiajeremy-dinomaly)Was this useful?