DriftAD: Visually-Guided Text Drift for Few-Shot Industrial Anomaly Detection

Wenyang Liu, Tianyi Liu, Dongshuo Zhang, Kejun Wu, Adams Wai-Kin Kong
8/24/2026
cs.CV

Official code: wenyang001/DriftAD (5 stars, Python, last commit 2026-09-10).

Abstract

Few-shot anomaly detection (FSAD) has recently benefited from vision-language models such as CLIP, which enable anomaly de?tection by aligning visual features with text descriptions of normal and abnormal states. However, existing methods typically rely on static text prompts that are applied uniformly across the entire feature hierarchy and spatial dimensions.

Show full abstract

This rigid global-to-local matching fails to capture the highly localized and scale-dependent physical variations of industrial defects. To address this, we propose DriftAD, a FSAD framework built on three key modules. First, an Anomaly Signal Amplification (ASA) module enhances subtle defect signals through spatial and frequency branches before text-visual matching. Second, Visually-Guided Text Drift (VGTD) dynamically transforms frozen CLIP text embeddings, steering them into layer?wise, spatially-adaptive anomaly descriptors conditioned on local visual context at each encoder depth. Third, Drift-Guided Spatial Gating (DGSG) uses the drifted abnormal descriptor as a spatial probe to selectively enhance anomaly-relevant visual features. Addi?tionally, a drift separation loss prevents representational collapse of the drifted descriptors, and a gate supervision loss enforces spatially discriminative gating in DGSG. Extensive experiments on MVTec?AD and VisA demonstrate state-of-the-art performance across all 1-, 2-, and 4-shot settings on both image-level and pixel-level metrics. Code is available at https://github.com/wenyang001/DriftAD.

View on arXivView PDF

Code Implementations(1)

wenyang001/DriftADOfficial100%

Official implementation of DriftAD: Visually-Guided Text Drift for Few-Shot Industrial Anomaly Detection (ACM MM 2026).

50Python, ShellAug 5, 20262 months agoNOASSERTION

Similar Papers

Cite this paper

@article{liu2026driftad,
  title  = {DriftAD: Visually-Guided Text Drift for Few-Shot Industrial Anomaly Detection},
  author = {Wenyang Liu and Tianyi Liu and Dongshuo Zhang and Kejun Wu and Adams Wai-Kin Kong},
  year   = {2026},
  eprint = {2608.23723},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.23723v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.23723.svg)](https://codeofpaper.com/paper/2608.23723)

Discussion