Source-linked AI summary
VID-AD: A Dataset for Image-Level Logical Anomaly Detection under Vision-Induced Distraction
Hiroto Nakata, Yawen Zou, Shunsuke Sakai, Shun Maeda, Chunzhi Gu, Yijin Wei, Shangce Gao, Chao Zhang
TL;DR
Existing benchmarks rarely test logical anomaly detection while visual distractions vary and logical states remain fixed. VID-AD introduces a controlled benchmark and a text-based detection framework trained from normal-image descriptions; experiments report consistent gains over vision-based baselines across capture conditions.
Problem
Existing benchmarks seldom provide controlled evaluation of logical anomaly detection across visual distractions while logical constraints remain fixed.
Source: §1 · p. 2Method
The framework learns logical consistency through contrastive learning on normal-image descriptions and constrained rewritten descriptions, without real anomalous training images.
Source: §1 · p. 2Results
The method consistently outperforms existing vision-based baselines across all capture conditions.
Source: §1 · p. 2Takeaways & Limitations
VID-AD supports evaluating logical-anomaly robustness across capture conditions while scenario rules and logical configurations remain unchanged.
Source: §1 · p. 2, §3.3 · p. 4VID-AD is a one-class benchmark in which models learn logical constraints using only normal samples.
Source: §4.1 · p. 5
Abstract
from arXiv · showhide
Logical anomaly detection in industrial inspection remains challenging due to variations in visual appearance (e.g., background clutter, illumination shift, and blur), which often distract vision-centric detectors from identifying rule-level violations. However, existing benchmarks rarely provide controlled settings where logical states are fixed while such nuisance factors vary. To address this gap, we introduce VID-AD, a dataset for logical anomaly detection under vision-induced distraction. It comprises 10 manufacturing scenarios and five capture conditions, totaling 50 one-class tasks and 10,395 images. Each scenario is defined by two logical constraints selected from quantity, length, type, placement, and relation, with anomalies including both single-constraint and combined violations. We further propose a language-based anomaly detection framework that relies solely on text descriptions generated from normal images. Using contrastive learning with positive texts and contradiction-based negative texts synthesized from these descriptions, our method learns embeddings that capture logical attributes rather than low-level features. Extensive experiments demonstrate consistent improvements over baselines across the evaluated settings. The dataset is available at: https://github.com/nkthiroto/VID-AD.
1. Introduction
The introduction presents VID-AD as a controlled benchmark for logical anomaly detection under visual distraction and proposes a text-based framework for learning logical consistency. The authors report that their method outperforms vision-based baselines across capture conditions.
Introduction
- Logical anomalies violate global constraints such as quantity, length, type, placement, and relations, while patch-centric detectors [9] [16] struggle under visual distractions.These violations can be visually subtle and spatially dispersed; background changes, illumination shifts, and blur can trigger false positives even when the logical state is unchanged.Source: §1 · pp. 1–2
- VID-AD provides 10,395 images across 10 manufacturing scenarios and five capture conditions (50 one-class tasks), varying appearance while holding each scenario’s logical constraints fixed.Each scenario uses two logical constraints, with anomalies defined by single-constraint or combined violations.Source: §1 · p. 2
- The proposed framework learns logical consistency from normal-image text descriptions using contrastive learning with rewritten negative examples, without real anomalous training images.A VLM produces structured descriptions, and replacement-only edits create attribute-level contradictions while preserving the original text structure.Source: §1 · p. 2
- The method consistently outperforms existing vision-based baselines across all capture conditions, achieving state-of-the-art performance.The introduction also reports that representative vision-based baselines degrade under the VID-AD setting.Source: §1 · p. 2
2. Related Work
The section reviews visual-anomaly datasets and methods, identifying limitations that motivate VID-AD and the proposed text-based approach.
2.1. VAD Datasets
- Existing VAD benchmarks emphasize visually explicit structural defects, while even MVTec LOCO AD lacks controlled distractors that preserve logical state, motivating VID-AD.Robustness and multi-view datasets address real-world variation but primarily evaluate visual anomalies rather than logical violations under controlled distraction.Source: §2.1 · p. 3
2.2. VAD Methods
- Vision-centric methods detect local defects effectively but can miss global rule violations and become unstable under appearance changes that leave logical state unchanged.The reviewed approaches include feature deviation, reconstruction, distillation, component consistency, and few-shot matching; the proposed framework instead models logic-focused descriptions in language embedding space to target rule violations and resist appearance distractions.Source: §2.2 · p. 3
3. VID-AD Dataset
VID-AD is a controlled benchmark for evaluating logical anomaly detection under visual distractions: it pairs logical constraints across manufacturing scenarios with varied capture conditions while keeping scenario rules fixed.
3.1. Dataset Overview
- VID-AD provides 50 independent one-class tasks across 10 manufacturing scenarios and five capture conditions, holding logical rules fixed while varying visual appearance.Unlike benchmarks focused on structural defects and MVTec LOCO AD, which mixes logical and structural anomalies, VID-AD focuses exclusively on logical anomalies under environmental variation.Source: §3.1 · pp. 3–4
3.2. Scenarios and Logical Anomaly Taxonomy
- The taxonomy covers quantity, length, type, placement, and relation violations, with ten scenarios pairing two constraints and anomalies violating either or both.Normal samples satisfy both constraints; anomaly subsets isolate violations of the first constraint, the second, or both.Source: §3.2 · p. 4
3.3. Capture Conditions for Vision-Induced Distraction
- Five capture conditions—White BG, Cable BG, Mesh BG, Low-light CD, and Blurry CD—vary backgrounds, illumination, or defocus while preserving scenario rules and forming separate benchmark tasks.Source: §3.3 · p. 4
3.4. Benchmark Protocol and Dataset Statistics
- Across 50 one-class tasks, VID-AD contains 10,395 images (2,500 train; 7,895 test), with training restricted to normal samples and tests containing normal and anomalous images.A typical task has 50 training normal images, 50 testing normal images, and approximately 110 testing anomalous images.Source: §3.4 · p. 4
4. Proposed Method
The method addresses vision-induced appearance distractions by detecting logical consistency from text descriptions rather than raw images. It uses a frozen VLM and synthesized logically inconsistent texts for training without real anomalies.
4.1. Problem Setting and Overview
- VID-AD is a one-class benchmark in which models learn logical constraints from normal samples despite significant appearance variations.The challenge is to decouple underlying logical states from vision-induced distractions.Source: §4.1 · p. 5
- A frozen VLM converts images into logic-focused text descriptions guided by scenario-specific prompts, and detection uses these descriptions rather than raw images.This design prioritizes logical consistency over irrelevant pixel-level fluctuations.Source: §4.1 · p. 5
- To train without real anomalies, the method rewrites normal descriptions into logically inconsistent negative texts.The synthesized negatives remain linguistically coherent.Source: §4.1 · p. 5
S S S
The method represents images as logic-focused text, learns to separate consistent descriptions from text-only contradictions, and scores test images against normal training embeddings. Prompts target scenario-specific logical attributes while suppressing irrelevant appearance variation.
S S S
- The end-to-end detector uses a frozen VLM to generate logic-focused texts, contrastive fine-tuning of BERT, and k-nearest-neighbor aggregation to score test descriptions against training embeddings.The pipeline uses k=5, with larger normality scores indicating samples closer to the normal training distribution.Source: Figure 3 · p. 6, S S S · p. 6
4.4. Inference and Statistical Ensemble Scoring
- At inference, the frozen VLM and same prompt produce test text, whose fine-tuned embedding is compared with normal training embeddings using k=5 nearest neighbors; higher normality scores indicate closer matches.Lower scores indicate a significant logical deviation from the established training patterns.Source: Figure 3 · p. 6, §4.4 · p. 8
4.2. Vision-to-Text Description and Negative
- Scenario-specific prompts and structured descriptions target logical attributes while filtering appearance noise; each image yields one positive text, and replacement-only edits create fluent negatives with at least one attribute contradiction.The same prompt is used for training and testing, with regionwise descriptions for grid layouts or ordered sequences for relational rules.Source: §4.2 · pp. 6–7
4.3. Contrastive Fine-tuning of Text Encoder
- For each task, pretrained BERT is fine-tuned with dropout-generated positive pairs and contradiction-based negatives, using an InfoNCE/NT-Xent-style loss to pull consistent texts together and repel contradictions.Mean-pooled, L2-normalized embeddings represent the texts; dropout provides two stochastic views of each positive description.Source: §4.3 · p. 7
5. Experiments
The experiments evaluate the language-based method against one-class visual anomaly detection baselines on VID-AD. They report robust performance across capture conditions, analyze scenario-level sensitivity and vision-centric localization, and compare VLM choices.
5.1. Experimental Settings
- The method generates one positive text and one contradiction-based negative text per image using Qwen2-VL-7B-Instruct [44], then fine-tunes BERT independently for each task.Positive generation used γ=0.001 and negative rewriting γ=0.9; both used top-p=0.95 and a 512-token limit. Evaluation reports image-level AUROC, using maximum spatial response for pixel-map methods and aggregated pixel reconstruction error for reconstruction methods.Source: §5.1 · p. 8
5.2. Baselines
- The baselines span feature-space methods PaDiM and PatchCore, reconstruction-based AnoGAN and VAE [40], distillation-based EfficientAD, and segmentation-based CSAD [16].Source: §5.2 · p. 8
5.3. Performance under Different Capture Conditions
- Our method achieved the best AUROC under all five capture conditions, beating the second-best method, CSAD, by 0.132–0.207 AUROC and recording a standard deviation of 0.013.Its best-to-worst condition gap was 0.037, compared with 0.033 for UniVAD, whose absolute accuracy was lower.Source: §5.3 · p. 8, Table 4 · p. 9
5.5. Scenario-wise Robustness and Linguistic Expressibility
- Scenario sensitivity was 0.006 for Fruits and 0.009 for Ropes, but 0.096 for Sticks, where descriptions sometimes omitted rule-critical relations such as relative length.The authors relate robustness to linguistic expressibility: Fruits descriptions preserved rule-relevant attributes across conditions, while Sticks descriptions could omit them. Low sensitivity alone does not guarantee strong detection, but the method combined high AUROC with low sensitivity across multiple scenarios.Source: §5.5 · p. 9, Table 5 · p. 10
5.6. Ablation Study
- Qwen2 7B achieved the best mean AUROC (0.831) and smallest cross-condition variance (Std = 0.013), ahead of Llama3.2 11B (0.822±0.036) and LLaVA 13B (0.701±0.034).The prompt, BERT encoder, contrastive objective, and scoring strategy were held constant across the three VLMs; Llama3.2 11B led under White BG, Cable BG, and Mesh BG, but degraded under Low-light CD and Blurry CD.Source: §5.6 · pp. 9–10
5.4. Qualitative Analysis of Vision-centric Evidence
- CSAD’s anomaly maps varied across capture conditions, with Mesh BG inducing spurious activations and Low-light CD or Blurry CD producing diffuse or weakened localization.The proposed language-based method has no pixel-level anomaly maps, so the paper makes no direct map comparison; its scoring instead depends on consistency of logic-focused descriptions.Source: §5.4 · p. 9, Figure 4 · p. 10
6. Discussion
The discussion links robustness to invariant, logic-focused representations and identifies linguistic expressibility as a condition on performance. It proposes richer, less prompt-dependent, and more structured text representations as future directions.
Robustness Under Vision-Induced Distraction
- Language-embedding detection that emphasizes logical attributes over low-level visual features reduces sensitivity to nuisance factors such as background changes and capture degradations.The discussion connects this robustness under vision-induced distraction to representation invariance.Source: §6 · p. 10
Linguistic Expressibility
- Language-based detection is most reliable when rule-critical attributes have stable, complete linguistic grounding, and degrades when relational attributes are expressed inconsistently across capture conditions.Source: §6 · pp. 10–11
Limitations and Future Directions
- Future work could use richer descriptions, reduce prompt dependence, and add structured text such as attribute-value tuples or constraint graphs to model logical rules more explicitly.The current single-text format uses descriptions generated from a fixed prompt; richer strategies may capture finer-grained details for borderline cases, while prompt-free or minimally prompted generation could improve reproducibility and deployment across manufacturing settings.Source: §6 · p. 11
7. Conclusion
VID-AD studies logical anomaly detection under distracting visual variation with a 50-task benchmark and a text-based framework. The framework improves performance across capture conditions, while future work targets reduced prompt dependence.
- Representative vision-based baselines degrade under appearance variations, while the proposed method improves performance across all capture conditions, averaging AUROC 0.831 across 50 tasks.Source: §7 · p. 12
- VID-AD is a one-class benchmark comprising 50 tasks across 10 manufacturing scenarios and five capture conditions.Source: §7 · p. 12
- The language-based framework learns global logical consistency from text descriptions through contrastive learning between normal descriptions and semantically perturbed descriptions generated by constrained rewriting.It learns from text descriptions rather than visual features.Source: §7 · p. 12
- Future work will explore reducing prompt dependence to improve usability and robustness in real deployments.Source: §7 · p. 12
Declaration of competing interest
The authors declare no competing interests relevant to the article.
Declaration of competing interest
- The authors report no financial or nonfinancial interests, affiliations, or involvement related to the manuscript’s subject matter or materials.All authors certify this declaration.Source: Declaration of competing interest · p. 12
Related papers
This paper cites
- Attention Is All You Need2017
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding2018
- Learning Transferable Visual Models From Natural Language Supervision2021
- ADAM: A METHOD FOR STOCHASTIC OPTIMIZATION2014
- Microsoft COCO: Common Objects in Context2014
- Auto-Encoding Variational Bayes2013