TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Papers/SAM-LAD: Segment Anything Model Meets Zero-Shot Logic Anom...

SAM-LAD: Segment Anything Model Meets Zero-Shot Logic Anomaly Detection

Yun Peng, Xiao Lin, Nachuan Ma, Jiayuan Du, Chuangwei Liu, Chengju Liu, Qijun Chen

2024-06-02Medical DiagnosisDefect DetectionAnomaly DetectionGraph Attention
PaperPDF

Abstract

Visual anomaly detection is vital in real-world applications, such as industrial defect detection and medical diagnosis. However, most existing methods focus on local structural anomalies and fail to detect higher-level functional anomalies under logical conditions. Although recent studies have explored logical anomaly detection, they can only address simple anomalies like missing or addition and show poor generalizability due to being heavily data-driven. To fill this gap, we propose SAM-LAD, a zero-shot, plug-and-play framework for logical anomaly detection in any scene. First, we obtain a query image's feature map using a pre-trained backbone. Simultaneously, we retrieve the reference images and their corresponding feature maps via the nearest neighbor search of the query image. Then, we introduce the Segment Anything Model (SAM) to obtain object masks of the query and reference images. Each object mask is multiplied with the entire image's feature map to obtain object feature maps. Next, an Object Matching Model (OMM) is proposed to match objects in the query and reference images. To facilitate object matching, we further propose a Dynamic Channel Graph Attention (DCGA) module, treating each object as a keypoint and converting its feature maps into feature vectors. Finally, based on the object matching relations, an Anomaly Measurement Model (AMM) is proposed to detect objects with logical anomalies. Structural anomalies in the objects can also be detected. We validate our proposed SAM-LAD using various benchmarks, including industrial datasets (MVTec Loco AD, MVTec AD), and the logical dataset (DigitAnatomy). Extensive experimental results demonstrate that SAM-LAD outperforms existing SoTA methods, particularly in detecting logical anomalies.

Results

TaskDatasetMetricValueModel
Anomaly DetectionMVTec ADDetection AUROC98.4SAM-LAD
Anomaly DetectionMVTec ADSegmentation AUROC98.5SAM-LAD
Anomaly DetectionMVTec LOCO ADAvg. Detection AUROC90.7SAM-LAD
Anomaly DetectionMVTec LOCO ADSegmentation AU-sPRO (until FPR 5%)83.2SAM-LAD

Related Papers

Multi-Stage Prompt Inference Attacks on Enterprise LLM Systems2025-07-21Hear Your Code Fail, Voice-Assisted Debugging for Python2025-07-203DKeyAD: High-Resolution 3D Point Cloud Anomaly Detection via Keypoint-Guided Point Clustering2025-07-17A Semi-Supervised Learning Method for the Identification of Bad Exposures in Large Imaging Surveys2025-07-17A Privacy-Preserving Framework for Advertising Personalization Incorporating Federated Learning and Differential Privacy2025-07-16Catching Bid-rigging Cartels with Graph Attention Neural Networks2025-07-16Bridge Feature Matching and Cross-Modal Alignment with Mutual-filtering for Zero-shot Anomaly Detection2025-07-15Wavelet-Enhanced Neural ODE and Graph Attention for Interpretable Energy Forecasting2025-07-14