Papers
Topics
Authors
Recent
Search
2000 character limit reached

MRAD-FT: Fine-Tuned Anomaly Detection

Updated 7 February 2026
  • MRAD-FT is a fine-tuning variant of MRAD-TF that employs a two-level memory bank and frozen CLIP backbone to differentiate normal from anomalous samples.
  • It introduces trainable projection matrices and a similarity-dropout operator for optimizing both image-level classification and pixel-level segmentation with minimal computational overhead.
  • Empirical evaluations on industrial and medical benchmarks demonstrate significant AUROC gains, showcasing up to a 6-point improvement over the train-free baseline.

MRAD-FT (Memory-Retrieval Anomaly Detection – Fine-Tuned) refers to a lightweight fine-tuning variant of the MRAD-TF (train-free) model for zero-shot anomaly detection tasks. It is designed to enhance the discrimination between normal and anomalous samples in image-level anomaly classification and pixel-level anomaly segmentation, particularly leveraging large vision-LLMs such as CLIP while maintaining a frozen backbone and offering state-of-the-art performance with minimal computational overhead (Xu et al., 31 Jan 2026).

1. Conceptual Framework and Architecture

MRAD-FT builds upon the MRAD-TF paradigm by incorporating a two-level memory bank and a frozen CLIP ViT-L/14-336 backbone. The model separates the CLIP image encoder into two branches: a global branch Φcls\Phi_{\text{cls}} yielding the class token, and a local V-V attention branch Φvv\Phi_{\text{vv}} producing RR patch tokens. The memory structure consists of:

  • Image-level memory: Kcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d} (class tokens), with corresponding one-hot labels Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2} (normal, anomaly).
  • Pixel-level memory: Kpat∈RNp×dK_{\text{pat}} \in \mathbb{R}^{N_p \times d} (patch tokens), with Vpat∈{0,1}Np×2V_{\text{pat}} \in \{0,1\}^{N_p \times 2}.

All features are â„“2\ell_2-normalized.

MRAD-FT introduces two sets of trainable d×dd \times d projection matrices (Wqcls,Wkcls,Wqseg,Wkseg)(W_q^{\text{cls}}, W_k^{\text{cls}}, W_q^{\text{seg}}, W_k^{\text{seg}}) operating on query and key vectors at image and patch levels, respectively. Given a test image Φvv\Phi_{\text{vv}}0, query features Φvv\Phi_{\text{vv}}1 (class token) and Φvv\Phi_{\text{vv}}2 (patch tokens) are extracted. Retrieval logits in a calibrated subspace are computed:

Φvv\Phi_{\text{vv}}3

Here, Φvv\Phi_{\text{vv}}4 denotes a similarity-dropout operator used during training to mask the top-Φvv\Phi_{\text{vv}}5 similarities, acting as hard negative mining while preventing trivial retrieval. Φvv\Phi_{\text{vv}}6 is the temperature parameter.

2. Training Objective and Optimization

MRAD-FT is trained end-to-end on auxiliary datasets by optimizing both image-level and patch-level objectives. Given ground truth image label Φvv\Phi_{\text{vv}}7 and downsampled pixel mask Φvv\Phi_{\text{vv}}8:

Φvv\Phi_{\text{vv}}9

No additional regularization or margin terms are applied. Instead, RR0 with RR1 (classification) and RR2 (segmentation) acts as hard negative mining. The optimizer is Adam with a learning rate of RR3, batch size 8, for one training epoch. Only RR4 and RR5 (total RR6 parameters; RR72.8M for RR8) are learned, and the CLIP backbone remains frozen throughout.

3. Inference Mechanism and Decision Process

During inference, the similarity-dropout RR9 is disabled. The final anomaly score for a test image Kcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}0 is computed as:

Kcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}1

where Kcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}2 averages the highest Kcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}3 of patch-level anomaly scores, emphasizing the most salient regions and suppressing background noise. An image is classified as anomalous if Kcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}4 exceeds a threshold.

4. Empirical Performance and Comparative Analysis

Across sixteen industrial and medical benchmarks, including MVTec-AD, VisA, BTAD, MPDD, and others, MRAD-FT consistently surpasses the train-free MRAD-TF baseline and other prompt or CLIP-based methods (AdaCLIP, AnomalyCLIP, FAPrompt):

Metric MRAD-TF MRAD-FT
Pixel AUROC (%) 85.5 91.9
Pixel PRO (%) 64.6 78.3
Image AUROC (%) 81.0 92.0
Image AP (%) 83.2 91.9

Notably, on MVTec-AD, MRAD-FT achieves 92.2% pixel-level AUROC and 92.3% image-level AUROC (versus 86.7% and 79.0% for MRAD-TF, respectively), demonstrating up to a 6-point improvement with the addition of only two linear projection layers.

5. Ablation Studies and Design Insights

  • Metric calibration: The anomaly-on-anomaly versus normal-on-anomaly similarity gap (AKcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}5AKcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}6 – NKcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}7AKcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}8) increases from ~0.08 (frozen) to ~0.16 (after fine-tuning), indicating a sharper separation of normal/anomalous features.
  • Two-level memory: Removing the image-level memory branch degrades image-level AUROC by up to 3 points; discarding pixel-level memory reduces both localization (PRO) and image-level AUROC by 2–4 points. This establishes the complementarity of global and local memories.
  • Memory budget: Reducing the patch memory from ~3,000 to 100 entries results in ≤1 point AUROC loss; MRAD-FT is robust to memory size reductions.

6. Implementation and Engineering Details

  • Auxiliary data: VisA (2,162 images, 3,093 patches) or MVTec-AD for memory bank construction.
  • Resolution: Images resized to Kcls∈RNc×dK_{\text{cls}} \in \mathbb{R}^{N_c \times d}9; CLIP ViT-L/14-336 backbone used, always frozen.
  • Feature extraction: Class tokens (Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}0) and Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}1 patch tokens (Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}2) are stored with one-hot labels.
  • Hyperparameters: Temperature Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}3; mask thresholds Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}4, Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}5; top-k pooling fraction Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}6.
  • Computational profile: Peak memory <8 GB; parameter increase <Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}7M; training converges in a single epoch on NVIDIA RTX 3090.
  • Additional techniques: Similarity-dropout Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}8 prevents trivial retrieval; V-V attention (Vcls∈{0,1}Nc×2V_{\text{cls}} \in \{0,1\}^{N_c \times 2}9) preserves local structure; Kpat∈RNp×dK_{\text{pat}} \in \mathbb{R}^{N_p \times d}0 normalization stabilizes similarity computations.

7. Significance and Context Within Anomaly Detection

MRAD-FT exemplifies a non-parametric, memory-driven approach that leverages the empirical distribution of auxiliary data, departing from conventional parametric or prompt-tuned anomaly detection strategies. Its architectural simplicity (adding two learned projections), training efficiency (single-epoch convergence), and frozen backbone requirement position it as a compelling solution for scenarios requiring both high statistical efficiency and cross-domain robustness. The framework sets new baselines in both image- and pixel-level anomaly detection and segmentation across heterogeneous datasets without incurring the high computational or modeling cost of alternative approaches (Xu et al., 31 Jan 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to MRAD-FT.