cs.CVApr 6, 2026

InCTRLv2: Generalist Residual Models for Few-Shot Anomaly Detection and Segmentation

Authors: Jiawen Zhu, Mengjia Niu, Guansong Pang

Organizations: School of Computing and Information Systems, Singapore Management University, Singapore. · Dyson School of Design Engineering, Imperial College London, United Kingdom.

Abstract

While recent anomaly detection (AD) methods have made substantial progress in recognizing abnormal patterns within specific domains, most of them are specialist models that are trained on large training samples from a specific target dataset, struggling to generalize to unseen datasets. To address this limitation, the paradigm of Generalist Anomaly Detection (GAD) has emerged in recent years, aiming to learn a single generalist model to detect anomalies across diverse domains without retraining. To this end, this work introduces InCTRLv2, a novel few-shot Generalist Anomaly Detection and Segmentation (GADS) framework that significantly extends our previously proposed GAD model, InCTRL. Building on the idea of learning in-context residuals with few-shot normal examples to detect anomalies as in InCTRL, InCTRLv2 introduces two new, complementary perspectives of anomaly perception under a dual-branch framework. This is accomplished by two novel modules upon InCTRL: i) Discriminative Anomaly Score Learning (DASL) with both normal and abnormal data in the main branch, which learns a semantic-guided abnormality and normality space that supports the classification of query samples from both the abnormality and normality perspectives; and ii) One-class Anomaly Score Learning (OASL) using only the normal data, which learns generalized normality patterns in a semantic space via an auxiliary branch, focusing on detecting anomalies through the lens of normality solely. Both branches are guided by rich visual-text semantic priors encoded by large-scale vision-language models. Together, they offer a dual semantic perspective for AD: one emphasizes normal-abnormal discriminations, while the other emphasizes normality-deviated semantics. Extensive experiments on ten AD datasets demonstrate that InCTRLv2 achieves SotA performance in both anomaly detection and segmentation tasks across various settings.

Figures & tables

Explore similar work

CardsList
  1. Hypergraph-Enhanced Training-Free and Language-Free Few-Shot Anomaly Detection

    May 11, 2026Guohuan Xie, Xin He, Dingying Fan +2Few-Shot Anomaly DetectionMedical Image Anomaly Detection

  2. DuoAD: Leveraging [CLS] Dual Characteristics for Training-Free Few-Shot Anomaly Detection

    Jul 27, 2026Jyun-Ze Tang, Po-Han Huang, Ming-Ching Chang +2Few-Shot Anomaly DetectionAnomaly Localization

  3. Beyond Normal References: Discriminative Few-Shot Anomaly Detection

    May 22, 2026Huan Wang, Jun Shen, Jun Yan +1Few-Shot Anomaly DetectionFew-Shot Learning