Spatiotemporal Dynamics-Aware Industrial Anomaly Detection and Reasoning

S-Wei Chen, Siangyu Yang, Yi-Chen Jan, Chun-Yi Lee, Shao-Yuan Lo

TL;DR

MUSTARD is a training-free framework that equips Multimodal Large Language Models (MLLMs) with "motion vision" to detect dynamic industrial defects, such as mechanical jams or abnormal vibrations. By using optical flow to guide keyframe selection and generating motion-aware textual descriptions, it achieves state-of-the-art performance in identifying and explaining anomalies that static image-based methods completely miss.

What Problem Does This Paper Address?

Industrial Anomaly Detection (IAD) has traditionally focused on "static" defects—think of a crack in a bottle or a missing component on a circuit board. These can be identified from a single image. However, real-world manufacturing is full of dynamics-based anomalies: a fan that looks perfect but vibrates excessively, a gear that rotates at the wrong speed, or a component that fails to rebound after being pressed.

Current Multimodal Large Language Models (MLLMs) are surprisingly bad at this. They typically use "uniform sampling" (picking frames at equal intervals), which often skips the exact moment a subtle motion anomaly occurs. Furthermore, they lack an explicit mechanism to understand pixel-level motion over time, leading to "appearance-centric" reasoning that ignores the physics of the scene.

Methods

The authors introduce MUSTARD (MUltimodal SpatioTemporal Anomaly Reasoning and Detection), a framework that translates implicit motion into explicit textual representations for MLLMs to reason over.

The pipeline consists of three main stages:

  1. Spatiotemporal Dynamics Awareness: Instead of uniform sampling, MUSTARD uses the Dual TV-L1 optical flow algorithm to calculate motion between frames. It selects keyframes based on the "Flow Magnitude Curve"—picking moments of peak motion, minimum motion, and transitions. It then creates three modalities for the MLLM to "see":
  2. Raw Frames: For standard visual context.
  3. Trajectory Frames: Keyframes overlaid with directional arrows and motion paths.
  4. Flow Magnitude Curve: A "temporal fingerprint" of the video's global speed.
  5. Normal Pattern Extraction: This is a few-normal-shot approach. The system looks at a small set (e.g., 30) of normal videos, generates descriptions for them, and uses an LLM to consolidate these into a "shared normal pattern." No model weights are updated, making it highly adaptable to new production lines.
  6. Pattern Reasoning (Inference): When a test video arrives, MUSTARD generates its own descriptions and compares them against the stored normal patterns. An LLM then fuses evidence from all three modalities to provide a final anomaly score and a natural language explanation.
Figure 2. An overview of the proposed MUSTARD framework. It consists of three main stages. (1) Spatiotemporal Dynamics Awareness: Leverages optical flow to select keyframes and derive three complementary descriptive modalities, including raw frames for visual context, trajectory frames for visualizing local motion, and a flow magnitude curve for representing global temporal dynamics. (2) Normal Pattern Extraction: Extracts multi-faceted normal patterns from a small set of reference videos. (3) Pattern Reasoning (Inference): Compares the test video’s description with the extracted normal patterns to detect deviations, producing a final anomaly judgment and explanation.

Datasets

The researchers evaluated MUSTARD on two primary benchmarks:

  • Phys-AD: A large-scale, physics-grounded dataset containing over 6,400 videos across 22 object categories (like gears and rubber bands). It focuses on anomalies revealed through physical interaction and dynamics.
  • IPAD: An industrial process dataset that emphasizes the periodicity of equipment operations across 16 different devices.

Key Insights and Ideas

  • Optical Flow as a "Bridge": The core "aha moment" is that MLLMs don't need to "see" motion natively if you can describe it to them. By converting optical flow into trajectory arrows and magnitude curves, the authors turn a difficult temporal problem into a descriptive one that LLMs excel at.
  • Keyframes > All Frames: Uniform sampling is a bottleneck. By letting the motion itself dictate which frames are important (via the flow magnitude curve), the model captures critical transitions (like a magnet falling) that are otherwise lost.
  • Complementary Modalities: As shown in Figure 3, different anomalies require different "eyes." A foreign object in a liquid is best seen in Raw Frames, a stuck wheel is obvious in Trajectory Frames, and abnormal vibration is most clearly visible in the Flow Magnitude Curve.
Figure 3. Illustration of the three derived modalities: raw frames, trajectory frames, and the flow magnitude curve. Different sources excel in different categories of test cases. Integrating them enables the model to leverage complementary strengths across modalities.

Key Results

MUSTARD sets a new state-of-the-art for dynamics-based IAD:

  • Detection Performance: On the Phys-AD dataset, MUSTARD achieved an AUROC of 68.1%, outperforming the previous best MLLM-based methods by nearly 8% and even beating specialized non-LLM models that require full-shot training.
  • Reasoning Quality: Using the PAEval metric (which measures how well the model's explanation matches ground truth), MUSTARD scored 0.456, nearly doubling the scores of general-purpose MLLMs like Video-LLaVA.
  • Interpretability: In "LLM-as-a-Judge" tests, GPT-4o preferred MUSTARD's explanations over baselines in the vast majority of cases, citing its ability to pinpoint specific motion irregularities.
Qualitative comparison showing MUSTARD correctly identifying a bearing that should be rotating but is stationary, while a standard MLLM fails.

Limitations and Future Work

The authors identify two main hurdles:

  1. Backbone Dependency: MUSTARD's performance is capped by the underlying MLLM (e.g., Qwen2.5-VL-7B). If the base model can't describe fine-grained details, MUSTARD struggles.
  2. Subtle Static Anomalies: In cases where the anomaly is a tiny visual change with no associated motion (like a very small toothpaste leak), the motion-aware modules provide no extra help, and the system reverts to the base model's (sometimes limited) visual perception.

Future work involves integrating stronger VLM backbones and exploring ways to incorporate raw visual features directly as complementary evidence alongside textual descriptions.

Summary updated

BibTeX
@misc{chen2026spatiotemporal,
  author = {S-Wei Chen and Siangyu Yang and Yi-Chen Jan and Chun-Yi Lee and Shao-Yuan Lo},
  title = {{Spatiotemporal Dynamics-Aware Industrial Anomaly Detection and Reasoning}},
  year = {2026},
  eprint = {2611.08080},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.08080},
}
Figure