Looking 3D: Anomaly Detection with 2D-3D Alignment

Ankan Bhunia, Changjian Li, Hakan Bilen

Introduction: The Challenge of Conditional Anomaly Detection

Standard anomaly detection (AD) typically identifies outliers based on a general distribution of "normal" training data. However, in industrial quality control and manufacturing, "normality" is often context-dependent and defined by a specific design reference. For instance, a chair with three legs might be perfectly normal if that is its design, but it constitutes an anomaly if the reference blueprint specifies four.

This paper introduces Conditional Anomaly Detection (CAD), a task where a model must identify defects in a 2D query image by comparing it to a specific 3D reference model. This task is significantly more complex than standard AD due to the "domain gap" (comparing textureless 3D geometry to realistic 2D images) and the "viewpoint gap" (the query image is often taken from an unknown camera angle).

Overview of the Conditional Anomaly Detection pipeline, showing the alignment between a 3D reference shape and a 2D query image to classify and localize defects.

Methodology: The Correspondence Matching Transformer (CMT)

To address these challenges, the authors propose the Correspondence Matching Transformer (CMT). The architecture leverages three core innovations to bridge the gap between 2D pixels and 3D geometry:

  1. 3D Positional Encoding (3DPE): Unlike standard 2D transformers, CMT maps image patches to their actual 3D coordinates in world space. This allows the model to maintain spatial consistency and "understand" part locations regardless of the camera viewpoint.
  2. Top-k Sparse Cross-Attention (TKCA): To reduce noise and improve efficiency, the model employs a sparse attention mechanism. It only attends to the $k$ most relevant patches in the reference views, filtering out background noise and irrelevant object parts.
  3. View-Agnostic Local Feature Alignment (VLFA): Through an auxiliary self-supervised task, the model learns to map features from both the query image and the 3D reference into a shared, view-invariant latent space where the same physical part has the same mathematical representation from any angle.

The BrokenChairs-180K Dataset

The researchers introduced BrokenChairs-180K, a large-scale benchmark specifically for this task. It contains approximately 180,000 images paired with 8,143 unique 3D chair models from the PartNet dataset. The benchmark includes five distinct synthetic defect types: Positional (misaligned parts), Rotational (crooked parts), Broken (fractured geometry), Swapped (parts from different models), and Missing components.

A 'Positional' anomaly example from the BrokenChairs-180K dataset, where an armrest is misaligned relative to the reference geometry.

Key Results and Insights

The CMT model demonstrated superior performance across several metrics, proving the value of 3D-aware architectures:

  • State-of-the-Art Performance: CMT achieved an AUC of 84.7 and an accuracy of 75.4%, significantly outperforming standard Vision Transformer (ViT) and ResNet baselines. The inclusion of 3D reference data alone improved accuracy by over 10%.
  • Surpassing Human Observers: In a perceptual study with 100 participants, humans achieved 70.6% accuracy on a data subset. The CMT model reached 74.8% on the same subset, demonstrating its ability to spot subtle geometric flaws that the human eye might miss.
  • Implicit Viewpoint Learning: Even without explicit camera data, the model's internal alignment allowed it to predict the closest reference viewpoint with 89% accuracy.
  • Real-World Generalization: Despite being trained on synthetic data, the model successfully localized anomalies in real-world photographs of chairs, suggesting high potential for actual factory floor applications.

Conclusion and Future Work

While CMT sets a new benchmark for conditional anomaly detection, several limitations remain. The current study focuses exclusively on rigid objects (chairs) and single-anomaly scenarios. Future research will explore expanding to non-rigid objects, multi-anomaly detection, and reducing the dependency on high-fidelity 3D reference models, which may not always be available for legacy products.

Summary updated

BibTeX
@inproceedings{bhunia2024looking,
  author = {Ankan Bhunia and Changjian Li and Hakan Bilen},
  title = {{Looking 3D: Anomaly Detection with 2D-3D Alignment}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
}
Figure