TL;DR
Spotting subtle manufacturing defects—like a pushpin bent by 20 degrees or a cracked washer—often stumps standard AI models that try to diagnose an entire image in a single glance. Enter ADClaw, an inspection agent that acts like a methodical engineer: instead of guessing, it formulates hypotheses about what might be wrong and writes custom, executable Python code on the fly to measure, compare, and verify its suspicions. Best of all, it achieves top-tier accuracy across 2D and 3D benchmarks using frozen, off-the-shelf models without any task-specific fine-tuning.
What Problem Does This Paper Address?
Imagine inspecting a compartmented tray of yellow pushpins on a factory line. A lighting glare might make a normal plastic head look weird, while a genuinely bent metal needle occupies just a few pixels. Furthermore, some defects are logical rather than visual: an intact screw placed in the wrong slot looks completely normal in isolation, yet ruins the assembly.
Many Vision-Language Models (VLMs) approach Industrial Anomaly Detection (IAD) in a "single pass"—they look once and guess. If a region is ambiguous, they can't zoom in or measure it. Newer "agentic" systems give VLMs predefined tools (like cropping an image or running a segmentation model). However, fixed tool menus have a hidden bottleneck: they can't easily combine intermediate outputs into bespoke tests. If verifying a bent pin requires taking a segmentation mask from Step 1, tracing its skeleton, and calculating the angle between the needle and the plastic body, a rigid tool-calling interface hits a wall.
Methods
Rather than fine-tuning a massive model on factory data, ADClaw keeps its pretrained backbone (Qwen3.5-9B) and perception tools (SAM3, DINOv3, CLIP, PointMAE) completely frozen. Instead, it upgrades how the agent thinks and acts using three novel mechanisms:
- Structured Normality Prior (SNP): Before inspecting anything, ADClaw consults a blueprint of "what normal looks like." This combines manually reviewed semantic rules (e.g., expected part counts, geometric relationships) with a hierarchical visual memory of normal reference samples stored at global, part, and local patch scales.
- Inspection Workbench (IW): Instead of picking from static menu options, the planner writes executable code in a persistent workspace. This workbench saves every mask, anomaly heatmap, and measurement in an Evidence Registry. Later code blocks can grab a full-image feature map from Step 1 and slice out a newly discovered sub-part in Step 3 without re-running heavy neural networks. For 3D scans, geometric residuals guide where to place virtual 2D cameras next.
- Hypothesis-Guided Evidence Reasoning (HER): After running a code check, HER acts as a strict quality-control supervisor. It checks whether anomaly scores, spatial bounding boxes, and semantic labels actually agree. If evidence is incomplete or contradictory, HER rejects or revises the hypothesis (e.g., switching from "missing screw" to "broken washer") and prompts another targeted code check before locking in a final diagnosis.
Datasets
Because ADClaw requires no task-specific training, datasets are used strictly to build normal reference memories and evaluate performance (no new benchmarks are introduced):
- 2D Anomaly Detection: MVTec AD, VisA, GoodsAD, and MVTec LOCO AD (which specifically tests logical and compositional constraints alongside structural defects).
- 3D Anomaly Detection: Real3D-AD and MVTec 3D-AD (point clouds and 3D scans).
- Anomaly Understanding: MMAD, a comprehensive benchmark evaluating seven tasks ranging from defect localization to root-cause analysis and description.
Key Insights and Ideas
- Code is the ultimate glue for perception tools: Replacing adaptive tool-calling with programmable Python checks boosts image-level AUROC on MVTec LOCO AD from 80.91% to 84.10% while actually using fewer visual-tool calls (4.31 vs. 5.03 per image). Code shines brightest on logical anomalies, where checking relationships between parts is paramount.
- Stateful memory slashes compute: Because the Inspection Workbench saves full-image DINOv3 feature maps and projects them onto part masks later, ADClaw avoids redundant neural network runs—cutting DINO forward passes by 74.0% (from 3.85 down to 1.00 per image) and reducing tool-stage latency by 25.4%.
- Knowing when to stop matters: Using HER to dynamically halt inspection once evidence is sufficient ("Selective continuation") achieves a higher workflow completion rate (94.00%) while cutting latency by 12.2% compared to a fixed 12-step budget.
- 3D geometry guides 2D eyes: Selecting virtual camera angles based on 3D geometric suspicion exposes 71.30% of defect regions in just two views, beating uniform camera spacing by 14.5 percentage points.
Key Results
- 2D Detection: ADClaw takes first place on 7 out of 8 image-level metrics across four benchmarks. Compared to its raw Qwen3.5-9B backbone, it leaps from 71.11% to 84.10% image-AUROC on MVTec LOCO AD, and from 53.53% to 82.94% on GoodsAD.
- 3D Detection: Achieves the highest object-level AUROC on both Real3D-AD (79.92%) and MVTec 3D-AD (84.27%), ranking second on all point-level localization metrics.
- Anomaly Understanding (MMAD): Reaches 82.11% average accuracy across all seven tasks—outperforming specialized fine-tuned models like OmniAD (79.90%) as well as proprietary frontier models like GPT-4o (74.92%) and GPT-5-mini (77.70%).
Limitations and Future Work
- Manual semantic setup: Building the Structured Normality Prior isn't purely automatic—its semantic knowledge (part ontologies and normality rules) is manually organized and reviewed beforehand to establish explicit inspection criteria.
- Multi-step latency: Writing code and reasoning iteratively takes time, averaging 27.4 seconds per image in the selective setting (excluding model preloading).
- Future directions: The authors plan to sharpen local defect inspection, improve cross-modal consistency between 2D and 3D signals, and generalize the framework to unseen industrial product categories without prior setup.
Summary updated