Spatial Autoregressive Modeling of DINOv3 Embeddings for Unsupervised Anomaly Detection

Ertunc Erdil1*, Nico Schulthess1*, Guney Tombak1, Ender Konukoglu1,2
1 Biomedical Image Computing Group, ETH Zurich, Zurich, Switzerland
2 The LOOP Zurich, Medical Research Center, Zurich, Switzerland
* Authors with equal contributions

Abstract

DINO models provide rich patch-level representations that have recently enabled strong performance in unsupervised anomaly detection (UAD). Most existing methods extract patch embeddings from “normal” images and model them independently, ignoring spatial and neighborhood relationships between patches. This implicitly assumes that self-attention and positional encodings sufficiently encode contextual information within each patch embedding. In addition, the normative distribution is often modeled as memory banks or prototype-based representations, which require storing large numbers of features and performing costly comparisons at inference time, leading to substantial memory and computational overhead. In this work, we explicitly model spatial and contextual dependencies between patch embeddings using a 2D autoregressive (AR) model, allowing us to use a simple and efficient model for normative modeling. Instead of storing embeddings or clustering prototypes, our approach learns a compact parametric model of the normative distribution via an AR convolutional neural network (CNN). At test time, anomaly detection reduces to a single forward pass through the network and enables fast and memory-efficient inference. We evaluate our method on the BMAD benchmark, comprising three medical imaging datasets, and the VisA dataset, comprising 12 industrial object categories, and compare it against existing methods, including recent DINO-based approaches. Experimental results demonstrate that explicitly modeling spatial dependencies achieves competitive anomaly detection performance while substantially reducing inference time and memory requirements.

Results

(hover points to see exact values).
BraTS2021 — AUROC vs Runtime
BTCV+LiTs — AUROC vs Runtime
RESC — AUROC vs Runtime
BraTS2021 — AUPR vs Runtime
BTCV+LiTs — AUPR vs Runtime
RESC — AUPR vs Runtime

Acknowledgements

We acknowledge The LOOP Zurich – Medical Research Center, Zurich, Switzerland, Georg and Berta Schwyzer-Winiker Foundation, and Innovationspool University Zurich Hospital for the financial support for this project.