All models

UniFormaly

A unified visual anomaly detector that matches self-supervised ViT patch features to a memory bank of normal ones.

904 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (666 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
85.8M
Operations
904
Framework
PyTorch
Recurrent
No
Published
Pattern Recognition (arXiv 2023)
Cited by
13 (as of 28 October 2026)
Authors
Yujin Lee, Harin Lim, Seoyoon Jang, Hyunsoo Yoon
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m21187
Graph hash
24c6af08db173ecdaa3f6200d81eb3982734797fe229d4b47d03b1115fa44db4
Skeleton hash
0be31b581cae25537044b470fe94873f10a2c11e765848b2c475096733aeb93b
Architecture hash
02b43f76a73b99633c1254090fb1e4317535536a1f9215da26de8d34a2b0fad1
Diagram SHA-256
33a988cfc7d853d43a08f396951b25040adfc9c1ae7549fa7173679f7379bb04
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

UniFormaly is an anomaly detection framework for images that aims to cover several anomaly detection tasks with one method. The paper describes existing approaches as fragmented across defect detection, semantic anomaly detection, multi-class anomaly detection and anomaly clustering, with one model per task.

It works with fixed pre-trained encoders: patch embeddings of normal images, taken from self-supervised pre-trained ViTs, are aggregated into a memory bank. For a new image, the method extracts patch features and computes the nearest distance to that bank. Back Patch Masking (BPM) removes irrelevant background regions using a self-attention map from the ViT, which also reduces the size of the memory bank. Top k-ratio feature matching then scores the image from only the top k% most anomalous patches, which the paper frames as multiple instance learning.

The paper's two configurations take patch embeddings from layers 3 to 10 of DINO ViT-B/8 and iBOT ViT-B/16. The same settings are used for all tasks, including a top k-ratio of 5% and a binary masking threshold of 0.1. The paper reports an AUROC of 99.32 on MVTecAD and 97.6 on ImageNet-30.

Key idea. UniFormaly unifies several visual anomaly detection tasks by adding Back Patch Masking and top k-ratio feature matching to pre-trained self-supervised ViT features.

  • uniformaly
  • visual anomaly detection
  • anomaly detection
  • unified anomaly detection
  • defect detection
  • semantic anomaly detection
  • anomaly clustering
  • back patch masking
  • top k-ratio feature matching
  • memory bank

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{lee2023uniformalytaskagnosticunifiedframework,
      title={UniFormaly: Towards Task-Agnostic Unified Framework for Visual Anomaly Detection}, 
      author={Yujin Lee and Harin Lim and Seoyoon Jang and Hyunsoo Yoon},
      year={2023},
      eprint={2307.12540},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2307.12540}, 
}