arXiv:2611.12023cs.CVNov 2026

Manuscript Offprint

arXiv:2611.12023

TIRAD: Text-guided Image Residual Learning for Generalist Anomaly Detection

Seongsu Lee, Seunghyun Oh, Seungjae Moon, Youngmin Ro

Seongsu Lee®, Seunghyun Oh®, Seungjae Moon®, and Youngmin Ro*

Machine Intelligence Laboratory,

Dept. of Artificial Intelligence, University of Seoul, Korea

{ssulee0206, osh1795, msj0243, youngmin.ro}@uos.ac.kr

Abstract. Recent anomaly detection studies have shown that residual features, which model the discrepancy between normal and abnormal patterns, provide strong generalization to anomalies unseen during training. However, existing residual-based approaches mainly rely on visual discrepancies derived from image representations, while semantic discrepancies that can be explicitly expressed through language remain largely underexplored. To address this problem, we propose TIRAD, Text-guided Image Residual Learning for Generalist Anomaly Detection, a multimodal residual learning framework that defines the discrepancy between textual representations of normal and abnormal states as a Text Residual Feature and uses it to guide the Image Residual Feature. Specifically, a Text Fusion Module converts patch-level text residuals into a gate that modulates the image residual of each patch. The gate retains the visual discrepancies that the text residual identifies as defect-related and attenuates the others, leading to more discriminative anomaly representations. Extensive experiments on industrial benchmarks and industrial-to-medical transfer demonstrate that the proposed method outperforms existing image-centric residual learning methods.

Keywords: Anomaly Detection · Vision Language Model · Multimodal Learning

1 Introduction

Anomaly Detection (AD) [5, 8, 19, 32] aims to identify abnormal patterns that deviate from normal observations and has been widely adopted in industrial inspection and medical diagnosis [17,34,35,45]. Since anomalous samples are inherently rare, diverse, and often unpredictable, collecting sufficient defect data for every possible abnormal scenario is impractical. This difficulty becomes more severe in real-world deployment, where new object categories, unseen defect types, and domain shifts continuously appear. Consequently, recent studies have increasingly focused on Generalist Anomaly Detection (GAD) [36, 39, 49], which seeks to develop a unified model [37, 41] capable of detecting previously unseen anomalies across diverse object categories and domains without category-specific

  • Corresponding author.

Lee et al.

Figure

Fig. 1: (a) Illustration of the text residual: subtracting the normal text embedding from the abnormal one yields a text residual that markedly reduces the normal-abnormal similarity. (b) Comparison of text features: raw normal and abnormal embeddings are highly similar and entangled, whereas the text residual features separate normal from abnormal consistently across object classes in the t-SNE projection.

retraining. Unlike conventional AD settings that mainly assume the same category distribution between training and testing, GAD requires a model trained on known categories to generalize to unseen target categories and unseen anomaly types.

A key challenge in GAD is to learn anomaly-relevant representations that are less dependent on object-specific appearance. Recent studies address this issue from the perspective of residual learning. In anomaly detection, a residual can be interpreted as the discrepancy between a normal state and an abnormal state. Instead of representing an object by its absolute visual appearance, residual features emphasize how the query deviates from normality. By suppressing category-specific characteristics, residual representations provide transferable cues for detecting unseen anomalies.

Building on this idea, representative residual-based methods [36, 39, 40, 49] exploit image residual features by comparing query image features with normal reference features or by modeling normal-abnormal visual discrepancies, and demonstrate strong generalization to unseen categories. This line of research indicates that residual learning is a promising direction for building generalist anomaly detectors.

However, existing residual-based anomaly detection methods define residuals only in the image feature space. In other words, they assume that abnormality can be sufficiently represented by visual discrepancies between normal and abnormal image features. Although image residuals are effective for many appearance-level defects, they respond to any deviation from the reference features, including variations in texture, pose, or imaging conditions that are not defects. Whether a visual discrepancy is actually anomalous is a semantic judgment, and the defect concepts needed for this judgment, such as a crack, a scratch, or a missing part, can be explicitly described through language. Relying only on image residuals therefore leaves the model without a semantic criterion for deciding which discrepancies correspond to true anomalies, particularly when it must generalize to unseen categories and domains.

Meanwhile, several AD methods based on Vision-Language Models (VLMs) have attempted to incorporate textual information through handcrafted prompts [19, 33] or learnable text representations [21, 47, 48]. However, these methods typically use the resulting text embeddings as semantic references and compute anomaly scores through image-text similarity [3, 13]. Such direct reliance on text embeddings is suboptimal for anomaly detection because VLMs are primarily trained for category-level image-text alignment rather than fine-grained discrimination between normal and abnormal states. As a result, normal and abnormal textual descriptions may remain entangled in the original text feature space, limiting their ability to provide reliable anomaly-aware cues. More importantly, although residual learning has been extensively studied in the image feature space, textual residuals remain largely underexplored in anomaly detection.

To address this gap, we introduce the Text Residual Feature. Given a set of normal and abnormal text candidates, each query patch is softly matched to the candidates, and a normal text anchor is subtracted from the matched text feature. The resulting residual is close to zero for patches consistent with normality and otherwise points toward the defect semantics most consistent with the patch. Removing the shared normal component leaves the part of the text feature that differs from normality. As illustrated in Fig. 1(a), this subtraction sharply reduces the similarity between normal and abnormal descriptions (cosine similarity 0.921 → 0.230). Since defect concepts are often shared across different object categories and domains, text residuals are more transferable for generalist anomaly detection. As further shown in Fig. 1(b), while raw normal and abnormal text features remain entangled, text residual features separate the two consistently across object classes in the t-SNE projection.

Based on this idea, we propose TIRAD (Text-guided Image Residual learning for generalist Anomaly Detection), a multimodal residual learning framework in which text serves as a semantic refinement of image residuals. The image branch computes patch-level image residuals by measuring the discrepancy between query image features and normal reference features, following a nearest-neighbor residual formulation. In parallel, the text branch computes a text residual for each patch by soft matching over multiple normal and abnormal candidates. This text residual is converted into a scalar gate that multiplicatively modulates the image residual of the same patch, producing a text-guided residual score that is merged with the image-only residual score for the final prediction. Because the gate can only attenuate or preserve the image residual, the text branch does not localize anomalies on its own; it retains the visual discrepancies that the text residual identifies as defect-related and attenuates the others, without any per-category parameter.

The main contributions of this work are summarized as follows:

– We introduce the Text Residual Feature, a semantic residual representation that explicitly models the discrepancy between normal and abnormal textual features, addressing the largely underexplored use of residual cues in the textual domain for generalist anomaly detection.

Lee et al.

– We propose TIRAD, a multimodal residual learning framework that leverages text residual features to guide image residual features. Through a Text Fusion Module, our method effectively combines semantic transferability with visual sensitivity.

– Extensive experiments on diverse anomaly detection benchmarks show that our method improves generalization to unseen categories and anomaly types including a challenging cross-domain, industrial-to-medical transfer setting and outperforms existing image-centric residual learning approaches.

References (50)