PILAR checkpoints for MVTec AD

These checkpoints contain the trained Feature-PILAR-FCN reconstruction heads and score calibration used for the MVTec AD experiments in the PILAR paper. The implementation is available under MIT at GitHub and in the Hugging Face code repository.

Checkpoints

Archives Seeds Checkpoints
main-seed-*.zip 42–46 75
no_inhibition-seed-42.zip 42 15
no_hard_loss-seed-42.zip 42 15
layer2_only-seed-42.zip 42 15
layer3_only-seed-42.zip 42 15

Each archive contains one final inference checkpoint per MVTec AD category (15 categories). The models were trained for 10 epochs with 512×512 RGB inputs using the official MVTec AD training split. The main configuration reconstructs features from layers 2 and 3 of a frozen ResNet18. Manifest entries include the category, archive member, SHA-256 hashes, and paper evaluation metrics.

The downloads include PILAR weights, inference settings and calibration. The separately sourced frozen backbone is TorchVision's ResNet18_Weights.IMAGENET1K_V1. The reconstruction-head tensors, calibration and restored backbone tensors were checked against all 135 original inference exports. CPU checks with one category per configuration reproduced the original scores and maps exactly on the same input. The archives contain no dataset images or annotations.

Reproduce an evaluation

Download restore_checkpoint.py and the archive you need. Download the dataset separately from the official MVTec AD page. From the PILAR code repository, install its dependencies and reconstruct a checkpoint the evaluator can read. Set DOWNLOADS to the folder containing the archive and the restore script, and MVTEC_ROOT to the extracted dataset.

python -m pip install -r requirements-paper.txt
unzip "$DOWNLOADS/main-seed-42.zip" -d ./pilar-checkpoints
PYTHONPATH="$PWD" python "$DOWNLOADS/restore_checkpoint.py" \
  ./pilar-checkpoints/main-seed-42/model_bottle_layer2+layer3_hard0p1x1_zscore.pt \
  ./restored
python -m scripts.evaluate_checkpoint \
  --checkpoint ./restored/model_bottle_layer2+layer3_hard0p1x1_zscore.pt \
  --dataset mvtec --data-root "$MVTEC_ROOT" --category bottle \
  --output-dir ./evaluation-bottle --device cpu

The restore step obtains the backbone through TorchVision's weight cache. The evaluator produces image scores, localization maps and metrics.

License and dataset credit

The PILAR checkpoints in this repository are distributed under Creative Commons Attribution–NonCommercial–ShareAlike 4.0 International. The restore script is separately licensed under MIT (LICENSE-CODE). MVTec AD is © MVTec Software GmbH and is available under CC BY-NC-SA 4.0. MVTec Software GmbH granted permission to make the trained checkpoints publicly available with appropriate credit to the dataset and its license.

If you use these checkpoints in research, please cite both works:

  • Bruno J. T. Fernandes. “Pyramidal inhibitory lightweight autoassociative reconstruction for cost-constrained visual anomaly detection.” Discover Artificial Intelligence 6, 1829 (2026). DOI 10.1007/s44163-026-02671-5.
  • Paul Bergmann, Kilian Batzner, Michael Fauser, David Sattlegger, and Carsten Steger. “The MVTec Anomaly Detection Dataset: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection.” International Journal of Computer Vision 129, 1038–1059 (2021). DOI 10.1007/s11263-020-01400-4.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support