Manuscript Offprint
arXiv:2609.02075DPA: Decoupling Product-Agnostic Anomaly Representations for Zero-shot Anomaly Generation
Hang Yao, Yansheng Fu, Ming Liu, Zifei Yan, Yanli Ji, Hongzhi Zhang, Wangmeng Zuo

Fig. 1: Comparison of zero-shot anomaly generation setting with different anomaly source. (a) shows the real target-product anomalies. Texture pasting-based setting in (b) uses generic texture images as the anomaly source and often generate unrealistic anomaly patterns. Text description-based setting in (c) uses text descriptions as anomaly source. However, text cannot fully specify diverse anomaly appearances, and pre-trained anomaly concepts may diverge from real manufacturing anomalies. Our anomaly transfer-based setting in (d) instead learns a anomaly concept from real anomalies of other product and transfers it to a normal target image. This enables generating anomalies that closely resemble the real anomalies in (a).
Abstract—Industrial anomaly detection benefits from anomaly samples, yet newly deployed products typically provide only normal images, making anomaly samples difficult to collect. Zero-shot anomaly generation offers a promising solution which avoids collection of target-product anomalies. However, existing methods mainly rely on texture images or text descriptions as anomaly sources, which often produce unrealistic anomalies. Observing that similar anomalies can recur across different products, we propose anomaly transfer-based zero-shot generation, which reuses real anomalies from existing source products, making target-product anomalies no longer necessary to generate realistic anomalous samples for unseen target products. Since not every anomaly type suits the target product, an anomaly type filtering mechanism first selects plausible source types. To transfer selected anomaly, we propose DPA, a diffusion-based framework that decouples product-agnostic anomaly representations. Instead of directly extracting anomaly representations, DPA learns product-irrelevant anomaly embeddings through training with the mismatched data pair, enabling transferable anomaly concept learning across products. Furthermore, we design an adaptive mask-guided pipeline that leverages adaptive masks to control the positional and geometric plausibility of generated anomalies during generation. A training-free anomaly labeling module is further introduced to produce pixel-level annotations aligned with generated anomalies. Extensive experiments on MVTec-AD, VisA, and a dedicated anomaly-transfer benchmark demonstrate that the proposed setting and DPA generate
more realistic anomalies and significantly improve downstream anomaly detection performance under both zero-shot and few-shot settings. Source code and models will be released.
Index Terms—Anomaly detection, anomaly generation, zero-shot learning.
I. INTRODUCTION
INDUSTRIAL anomaly detection (IAD) [1]–[3], as a critical step of quality control, is drawing increasing attention in the intelligent industry era. Meanwhile, the rapid development of modern manufacturing has led to diversified demands and constant product iteration. When deploying IAD models [4]–[6] to these continuously introduced new products, both normal and anomalous samples are required for training is typically. In practice, however, while normal samples are readily obtainable, anomalous samples are extremely scarce. To alleviate this data scarcity, a straightforward and practical solution is to generate sufficient and diverse anomalous samples using only normal data, i.e., zero-shot anomaly generation.
Despite their diversity, zero-shot anomaly generation methods follow the same general formulation: an anomaly source is combined with a normal target image to produce a target anomalous image and its annotation. Within this formulation, the most critical element is the anomaly source, that is, the information that specifies what the anomaly should look like. The real target anomalies shown in Fig.1(a) represent the desired output and, ideally, the most reliable anomaly source. However, they are inaccessible under zero-shot setting. Early texture pasting-based methods [7]–[9] use external texture images as anomaly source and insert them into randomly sampled regions of normal images. Though efficient, they produce anomalies that are often unnatural and deviate significantly from real anomaly patterns, as illustrated in Fig.1(b). Recent, text description-base methods [10] use text descriptions as the source and prompt a pre-trained diffusion model (Fig.1(c)). However, text cannot fully specify the appearance of diverse industrial anomalies, and the anomaly concepts learned by the pre-trained generation model diverge from real manufacturing anomalies. Therefore, this anomaly source still lack authenticity, resulting in a substantial gap in visual appearance between generated anomalies and the expected target anomalies.
Although anomalous data are difficult to collect for a newly deployed product, factories often retain real anomaly samples from existing production. Many anomaly concepts, such as scratches, cracks, discoloration, and bent components, recur across related product families and exhibit similar visual patterns. This cross-product commonality makes existing anomalies a more faithful anomaly source than generic textures or text descriptions, while avoiding the costly collection of target-product anomalies. Motivated by this observation, we propose anomaly transfer-based zero-shot generation, illustrated in Fig.1(d). In this setting, anomaly concepts extracted from real anomalies of source products are transferred to unseen target products, with no real target anomaly samples required.
However, not every source anomaly is meaningful for the given target product. For example, a bent-lead anomaly is applicable only to products containing leads, whereas transferring it to a bottle would create semantically invalid training data. We therefore introduce a product-aware anomaly type filtering mechanism before transfer. For each target product, semantically incompatible source anomaly types are discarded, and only reasonable types are retained for generation. In practice, we use the vision-language model Qwen3-VL to make this compatibility decision before generation, after which the compatibility decision is cached and reused for all subsequent samples. Importantly, the vision-language model only decides whether an anomaly is suitable for the product. The anomaly concept itself is learned from the selected source anomaly.
A straightforward approach to achieve the transfer of selected anomaly types, is to use existing anomaly generation methods [11], [12] to extract anomaly representations from the source anomaly and apply it to a normal target-product image . However, such direct adaptation either fails to inject the anomaly into the target image or produces obvious artifacts, as shown in Fig.2(b) and (c). We attribute such failures to the impure anomaly representations extracted with these methods, where the vanilla feature extraction module inevitably couples anomaly representations with product representations.

Fig. 2: Results of direct cross-product anomaly transfer and the proposed DPA. (a) A source anomalous image contains both anomaly and source-product appearance. Directly applying existing anomaly generators to cross-product transfer, as illustrated by (b) AnomalyDiffusion [11] and (c) AnoGen [12], may transfer source-product information together with the anomaly and produce randomly located or misaligned masks. (d) DPA transfers a decoupled anomaly concept to a reasonable location of the target product and produces a mask aligned with the generated anomaly.
This entanglement motivates our Anomaly Concept Decoupling (ACD). First, ACD introduces two learnable embeddings: a product embedding shared across normal and anomalous samples to represent product appearance, and an anomaly embedding dedicated to anomaly semantics. And then, to assign complementary responsibilities to these embeddings, we construct three types of input-target pairs for embeddings training: masked anomaly masked anomaly, anomaly normal, and normal anomaly. Guided by the corresponding embeddings, these pairs require the frozen diffusion model to perform three tasks: preserving, removing, and inserting anomalies, respectively. The preserve pair directly learns from the anomalous region to capture visual anomaly appearance, whereas the remove and insert pairs encourage the embedding to understand abstract anomaly concepts by erasing and adding anomalies. Together, these complementary tasks encourage it to decouple an abstract and transferable anomaly concept, rather than memorizing source-product appearance.
Another problem of these generation methods is the unreasonable mask, which is also shown in Fig.2(b) and (c). Existing methods typically use predefined masks as both generation constraints and ground-truth annotations. On the one hand, the masks are generated via random algorithms, which means that the mask regions may not be the place where a specific anomaly occurs. On the other hand, the generated anomalies are often unaligned with the masks (typically a circle or square), leading to imprecise annotations.
To address the mask issues, we propose an adaptive mask-guided pipeline comprising three modules: Initial Mask Generation (IMG), Mask Refinement(MR), and Anomaly Labeling(AL), which operate before, during, and after generation, respectively. Before generation, IMG determines the anomaly location via attention maps between anomaly embeddings and normal image features, and sets the size by sampling from the prior size distribution of existing anomalies, yielding a circular coarse mask as an initial estimate. During generation, MR dynamically refines this mask, aligning it with the evolving anomaly and guiding the anomaly shape toward more plausible forms. After generation, to further produce a high-resolution
Although these methods are few-shot methods that require target anomaly data, replacing target anomalies with source anomalies makes them formally applicable to anomaly transfer.
mask, AL incorporates the refined masks, attention maps, and multi-scale VAE decoder features of normal and anomalous samples, to produce pixel-level precise annotations. These three modules jointly ensure the generated anomalies have reasonable spatial locations and shapes with accurate labels.
To verify the effectiveness of our anomaly transfer-based generation setting and generation pipeline, extensive experiments are conducted on two widely-used datasets (i.e., MVTec-AD [13] and VisA [14], where anomaly embeddings are extracted from one of these two datasets and evaluated on the other one. We also integrate a dedicated dataset for anomaly transfer, comprising both source data for extracting anomaly and target data for anomaly generation. Furthermore, we evaluate our model under the few-shot anomaly generation setting (where a small number of target anomaly samples are allowed), demonstrating the generality and effectiveness of our anomaly generation method. The contributions of this paper are summarized as follows.
-
We unify zero-shot anomaly generation as the composition of an anomaly source and a normal target image, and formulate anomaly transfer-based zero-shot generation setting, which uses real anomalies from existing products as a more faithful source.
-
A anomaly concept decoupling method is proposed, which decouples product appearance and anomaly concept to two learnable embeddings through complementary preserve, remove, and add tasks.
-
We introduce an adaptive mask-guided generation and labeling pipeline which considers location and shape of generated anomalies, and produces high-precision annotations aligned with the generated anomalies.
-
Experiments on three datasets, multiple downstream detection methods, and both zero-shot and few-shot settings consistently validate the proposed setting and method.
A. Industrial Anomaly Detection
Due to the scarcity of anomaly data, mainstream IAD algorithms adopt an unsupervised paradigm [2], [9], [15], [16], relying solely on normal samples for detection. Some of these methods design complex network architectures to fit the normal data distribution and treat anomalies as outliers [17]–[21]. Although these algorithms achieve good performance, their complex network structures lead to slow inference speed. In contrast to these architecture-oriented approaches, another line of unsupervised IAD focuses on data synthesis [7], [22], [23]. These methods design simple anomaly synthesis strategies and combine them with lightweight detection networks, achieving decent detection performance. Specifically, they mainly paste texture data onto normal samples to simulate anomalies. These methods are highly efficient and well-suited for practical production deployment. However, due to the significant gap between synthetic anomalies and real anomalies, there is room for further performance improvement. Our goal is to design a zero-shot anomaly generation method that produces more realistic anomalies than the aforementioned synthesis strategies. By using the generated anomalies to train such lightweight
detection models, we aim to maintain their low computational cost while further improving detection performance, enabling fast and accurate anomaly detection.
B. Diffusion model
Based on principles of nonequilibrium thermodynamics [24], diffusion model (DM) [25]–[27] is proposed for image generation, and utilized in a variety of downstream tasks [28]–[31]. Denoising diffusion implicit model (DDIM) [32] considers the reverse process of DM as a non-Markovian process, which speeds up the inference greatly. The latent diffusion model (LDM) [33] conducts training and inference in the latent space, further reducing the resource and time costs. Recently, Text inversion [34] and Dreambooth [35] learn the concept of subjects in a given reference set and synthesize novel renditions of them in different contexts for customized generation. However, these methods heavily rely on real anomaly data, requiring the collection and annotation of target-specific anomalous samples, which significantly hinders the practical deployment of anomaly generation models.
C. Anomaly Generation
The scarcity of anomaly data has drawn considerable research attention, prompting the development of various anomaly generation methods to address this challenge. Conventional methods [7], [23], [36] do not rely on target anomaly data and can be regarded as zero-shot anomaly generation approaches. These methods simulate anomalies by replicating normal regions, texture patches, or adding noise perturbations. Although capable of synthesizing anomalies, they suffer from limited realism. Inspired by diffusion-based customized generation approaches [34], [35], few-shot anomaly generation methods [11], [12], [37]–[39] learn anomaly concepts from target anomaly samples to generate anomalies with enhanced realism. However, such methods require prior collection and annotation of anomalous samples, which is difficult under the premise of anomaly data scarcity. Recent zero-shot anomaly generation methods [10], [40] employ detailed textual descriptions to guide pretrained generation models for zero-shot anomaly generation. Nevertheless, for common pretrained generation models, the textual descriptions of certain anomaly concepts often misalign with the desired visual characteristics. In summary, existing methods struggle to simultaneously achieve realistic anomaly generation and freedom from collecting target anomaly data, leading to significant limitations in practical applications.
III. METHODOLOGY
We first define a common paradigm for zero-shot anomaly generation:
where provides the anomaly prior, is a normal image of target product , and produces a target anomalous image and its label . Texture-pasting methods instantiate the

Fig. 3: Decoupling training with three input–target pairs. The preserve, remove, and add tasks force the anomaly embeddings to learn pure anomaly concept form product appearance.
paradigm as , where is a generic texture image; text-guided methods use , where is an anomaly description. DPA instead uses , where contains real anomalous images, providing a substantially more faithful anomaly source.
Accordingly, DPA follows a training-to-inference pipeline. During training, Anomaly Concept Decoupling (ACD) learns a decoupled anomaly embedding from real source anomalies, by trained with the preserve, remove, and add training pairs. Once the anomaly representations have been decoupled, inference begins with product-aware anomaly type filtering. For each target product, DPA evaluates the available source anomaly types and retains only those that are semantically compatible with the product. For every retained anomaly-product pair, the decoupled anomaly is combined with the target-product to construct a joint text prompt, e.g., “A [bent_lead] [pcb3].” This prompt is encoded as learned embeddings, and conditions the frozen diffusion model to transfer the selected anomaly to a target normal image. The subsequent Adaptive Mask-Guided Generation determines a plausible location and size and progressively controls the anomaly shape with adaptive masks. After generation, a training-free Anomaly Labeling converts the guided mask into an aligned high-resolution mask.
A. Anomaly Concept Decoupling
Although a real source anomaly provides a faithful visual prior in 1, it contains two inseparable factors: the source product and its anomaly. To obtain the product-irrelevant anomaly concept, we decouple the anomaly concept from product information. The design of the training strategy is illustrated in Fig.3. We first introduce two learnable embeddings: a product embedding shared by both normal and anomalous samples, alongside a dedicated anomaly embedding activated
only for abnormal samples. Guided by different embeddings, the diffusion model is required to complete three tasks by training with intentionally mismatched input-target pairs: retaining the anomaly, removing real anomalies and adding non-existent ones. This training strategy enhances the semantic representation of the anomaly embedding beyond pixel-level reconstruction, effectively decoupling anomaly patterns from product-specific information.
- Decoupling Training Strategy.: Given a spatially aligned anomalous–normal pair (the normal counterpart is obtained by completing the masked anomalous region with inpainting model [33]), we encode them as latent features and using a pre-trained VAE. Let and denote the learnable product and anomaly embeddings, respectively. As shown in Fig.3, the input feature , target feature , and conditioning embedding are sampled from
(2)
where is the source anomaly mask. The three configurations respectively require the model to (1) preserve the masked anomaly pattern under , (2) remove the anomaly from under the product embedding , and (3) add the anomaly to under the joint condition . Because the add and remove tasks share the same product embedding, this construction encourages source-product information to be captured by and the anomaly concept by .
- Diffusion loss for mismatched pairs: The standard diffusion objective assumes identical input and target features and therefore does not directly provide the correction required by the add and remove pairs above. We adopt the Anomaly-oriented Training Paradigm (ATP) loss [9] for training, which supports reconstruction toward a different target. Let be the noisy input latent at diffusion timestep t. The ACD objective is
where is the Gaussian noise that is added to the input feature , and alpha is the diffusion coefficient at timestep t.
This loss renders the same denoiser compatible with preservation, remove, and add pairs. Importantly, the novelty of ACD lies not in designing a new diffusion loss, but in a training strategy that constructs three input-target pairs to endow the two embeddings with complementary and decoupled semantic concepts.
B. Adaptive Mask-Guided Generation
After obtaining the decoupled anomaly embeddings, we transfer the learned anomaly concepts to normal images of target products. As illustrated in Fig. 4, we introduce an adaptive mask-guided process for anomaly generation. in which we control the generated content with from two aspects, and spatial attributes with adaptive masks, respectively.
For training stability, conventional matched pairs, i.e., or , are used with a probability of 50%; the equation lists the proposed configurations.

Fig. 4: Overview of the cross-product anomaly transfer pipeline in DPA. The Adaptive mask-guide generation process proceeds through follows a remove-insert-refine process to generate anomaly. Each stage is controlled by a distinct text prompt and corresponding adaptive masks. For text prompt, we first filter a reasonable anomaly type and build corresponding text prompt. For adaptive masks, (a) initial mask generation first generates an initial mask , which provides location and size priors. (b) mask refinement then derives three different adaptive masks from to govern the spatial attributes of the three stages, respectively. Finally, (b) an anomaly labeling module fuses refined mask, attention maps and multi-scale VAE feature differences to produce pixel-level labels precisely aligned with the generated anomalies.
Regarding anomaly content, not every source anomaly type is applicable to given target product. Therefore, before generation, we employ a product-aware anomaly type filtering mechanism to filter anomaly type. Then, each reasonable type is combined with the target-product category to construct a text prompt, which is subsequently encoded into embeddings as the text condition.
To control the spatial attributes of the anomaly, we introduce an adaptive mask-guided process to manipulate these attributes in a stage-wise manner. There are two key modules are involved, including Initial Mask Generation and Mask Refinement. Initial Mask Generation first generates initial mask for controlling plausible location and size. Mask Refinement further refines initial mask to produce three adaptive masks for removing conflicting normal content, inserting anomaly concept and refining the anomaly shape.
Furthermore, after generation, a Generated-Sample Verification is utilized for discarding failed outputs.
- Product-Aware Anomaly Type Filtering: The availability of real source anomalies does not imply that all of them should be transferred to every target. Let denote a source anomalous image, its mask, and its anomaly type, and let denote a normal exemplar and the category of target product . Before generation, Qwen3-VL [41] receives and judges whether anomaly type could
plausibly occur on product . If the answer is negative, DPA skips this anomaly type and tests the next candidate. If the answer is positive, DPA accepts the source-anomaly-target-product pair and executes the subsequent transfer.
This compatibility decision is performed offline once for each source-anomaly-type-target-product candidate and cached for all subsequent samples. Qwen is therefore not invoked during diffusion sampling or downstream detector training and inference.
- Initial Mask Generation: Initial Mask Generation provides the coarse spatial constraint that determines the anomaly location and size. We construct a circular mask whose center controls location and whose radius controls size. The circle is only an initialization and its shape is refined during diffusion rather than used as the final annotation.
Anomalies usually occur in regions that are semantically relevant to the anomaly type. For example, a bent-lead anomaly can only appear in lead regions rather than arbitrary background areas. Therefore, instead of randomly sampling anomaly locations, we first identify potential anomaly regions according to the semantic relationship between the target product and the transferred anomaly concept.
Specifically, we compute a cross-attention map between anomaly text features and target-normal image features from the Stable Dif-fusion UNet [33]. The text transformer maps the anomaly embedding to Z token features. We aggregate attention over these tokens and over UNet layers k through L:
Here, Q and K are the projected query and key features, and d is their channel dimension. Because ACD suppresses source-product appearance in , high responses in indicate target regions semantically associated with the anomaly rather than regions resembling the source product.
The attention map is subsequently binarized and constrained within the object region mask to obtain the potential anomaly region mask :
The anomaly center is randomly sampled from the potential region:
After determining the location, we control anomaly size with statistics from the source anomaly data. We compute the range of circumcircle radii and sample
The sampled center and radius define , providing semantic location and empirical size priors while retaining diversity across generated samples.
- Mask Refinement: The coarse masks can only roughly constrain the position and size of generated anomalies. However, there are two finer masks are required to remove exiting normal contents and refine the shape of generated anomalies, respectively. For these two purposes, mask refinement refines the initial masks under different conditions.
First, although specifies the generation region, normal product structures may still remain within this area and interfere with subsequent anomaly generation. For example, when generating a bent-lead anomaly, the original normal lead should be removed before introducing the anomaly. Therefore, a dedicated removal mask is required to identify the normal product regions that should be erased and to guide unconditional generation for normal-content removal. We obtain such a mask by intersecting the initial mask with the potential anomaly-prone region :
The removal mask therefore erases only the normal structure that occupies the intended anomaly region, preparing it for anomaly insertion while preserving the surrounding target content.
Second, the coarse mask itself cannot accurately align the shape of the generated anomaly. Consequently, it provides only limited spatial guidance and may restrict precise shape control during the later stages of generation. To obtain a mask that better aligns with the generated anomaly, we further refine the initial mask according to the anomaly-related attention map:
where is recomputed according to Eq.4 after anomaly content has begun to emerge. Unlike the fixed circle, follows the current anomaly response and provides a shape-aware constraint for the final diffusion stage.
Thus, and serve different purposes: the former clears conflicting normal content, whereas the latter aligns subsequent generation with the emerging anomaly shape.
- Generation with Adaptive Masks: During generation, we start from a noisy normal latent and generate anomaly with different masks, which are activated at different stages of the remove-insert-refine process to progressively control anomaly generation. Specifically, the removal mask is first used to remove residual normal content within the designated region by unconditional generation. Subsequently, under the guidance of the learned embedding, anomaly content is generated within the coarse mask , which provides a reasonable constraint on anomaly location and size. Finally, the refined mask is employed to provide more accurate shape-aware spatial constraints, enabling finer control over anomaly shapes and producing more realistic anomaly structures.
Formally, the mask-guided latent update at timestep t is defined as
where denotes the denoised latent feature at timestep t, and represents the noisy latent feature of the normal sample. The mask m corresponds to the active adaptive mask at the current generation stage, namely , , or .
Progressively switching from to and then mirrors the required operations: remove conflicting normal content, insert the anomaly at a plausible position and scale, and refine its final shape.
- Generated-Sample Verification: Product-aware filtering decides whether an anomaly type is semantically suitable before generation, but diffusion may still fail to express an accepted concept in an sample. We therefore apply a separate output-level check that rejects failed samples. We define the anomaly saliency score s as the difference between the mean attention inside and outside :
If is below a predefined threshold , the generated sample is discarded. If more than one third of an inference batch fails this test, we stop the remaining generation for that source-target pair. This is an operational safeguard for synthesis failure and is distinct from the semantic compatibility decision made before transfer.
C. Anomaly Labeling
The generation masks control diffusion but are not yet suitable as segmentation labels. In particular, is only
and remains a spatial constraint rather than a pixel-accurate description of the generated appearance. We therefore derive the final label from the actual change between the normal and anomalous outputs.
The VAE decoder exposes this change at progressively higher resolutions. Because mask-guided generation preserves content outside the controlled region, discrepancies between the normal and generated features are concentrated within the anomaly regions. Comparing the two multi-scale decoder features therefore complements the semantic but low-resolution attention masks.
Specifically, we consider the latent features and decoded images as the first and final layers of the decoder, denoted by and for the anomalous and normal samples, respectively. For each scale , we compute the cosine distance between and , multiply it by , normalize, and upsample to obtain multi-scale masks:
Finally, the multi-scale masks are integrated with the attention maps to produce the final high-resolution ground-truth mask:
The fusion uses to suppress irrelevant changes, to retain anomaly semantics, and the multi-scale feature distances to recover boundaries. The resulting is therefore aligned with the generated anomaly rather than inherited from the initial circle.
IV. EXPERIMENTS
A. Datasets
We conduct experiments on two widely used industrial anomaly detection datasets, MVTec-AD [13] and VisA [14]. To test cross-dataset transfer, each dataset serves as the source of real anomaly concepts when the other serves as the unseen target; no anomalous image from the target dataset is used for generation training.
Moroverov, we further construct a dedicated benchmark, Anomaly Transfer-based Anomaly Detection (ATAD), to isolate the transfer setting. ATAD integrates product categories from MVTec-AD, VisA, and two in-the-wild datasets, RealIAD [42] and MANTA [43]. Its source and target partitions contain 13 and 16 product categories, respectively. Every target anomaly type has a semantically corresponding source type, but the source and target products differ. This correspondence is metadata inherent to the benchmark and is reported only to characterize its coverage; neither DPA nor the Qwen prompt accesses the mapping. We learn anomaly concepts only from the source partition, generate training data from normal images in the target partition, and evaluate anomaly detection on held-out target images. Supplementary material provides the category mapping and construction details.
B. Setting
We evaluate two anomaly generation settings:
-
Zero-shot: source normal/anomalous images and target normal training images are available, but no target anomalous image is observed. The complete target test set is reserved for downstream evaluation.
-
Few-shot: a subset of target anomalies is additionally available. Following AnomalyDiffusion [11], we split target anomalous samples by using one third to train the generator and reserving the remaining two thirds for downstream testing.
C. Implementation Details
We use Stable Diffusion 1.5 [33] as the generator. Only the newly introduced text-encoder embeddings are optimized; other pre-trained components remain frozen. We use Qwen3-VL-8B to filter semantically compatible source-anomaly/target-product pairs in an offline preprocessing step, and each decision is cached and reused for all images generated from that pair. Generation conditions are formed only for the accepted pairs, and Qwen is not part of per-image generation or downstream inference. For each target category, we generate 2,000 anomalous images. If N anomaly types are compatible with the category, each type contributes 2000/N samples. We set the initial noise timestep to T = 900 and use 10 inference steps. Unless stated otherwise, DRAEM [7] is the common downstream detector, so differences reflect the generated training data rather than the detection architecture. All baselines use their official code and released models, and all experiments run on one NVIDIA RTX A6000 GPU. Additional hyperparameters are provided in the supplementary material.
D. Evaluation Metrics
We evaluate image-level detection and pixel-level localization with Area Under the Receiver Operating Characteristic Curve (AUROC), Average Precision (AP), and maximum F1-score (F1). The prefixes I- and P- denote image- and pixel-level metrics, respectively. Per-Region Overlap (PRO) additionally measures region-level localization quality. The reported mean averages the seven metrics over the evaluated datasets. More evaluation results are available in the supplementary material.
E. Results of Zero-shot Anomaly Generation
1 ) Comparison with Zero-shot Generation Methods:
We first compare DPA with zero-shot generation methods, including DRAEM [7], CPR [22], RealNet [36], GLASS [23] and AnomalyAny [10]. Here, “DRAEM” denotes its native generation module. Every method supplies generated image-mask pairs to the same DRAEM detector under an identical training protocol, isolating generation quality as the experimental variable.
As reported in Tab I, DPA obtains the best overall mean of 84.91, exceeding the strongest baseline, AnomalyAny (81.44), by 3.47 points. The advantage is particularly clear for localization: relative to the best competing value, DPA improves
TABLE I: Comparison with different zero-shot anomaly generation methods. Each method supplies generated data to the same DRAEM detector. "DRAEM" denotes its native generation module. Bold indicates the best result.
| AG Methods | ATAD | P-AUROC | P-AP | P-F1 | PRO | MVTec-AD | P-AUROC | P-AP | P-F1 | PRO | VisA | P-AUROC | P-AP | P-F1 | PRO | Mean | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| I-AUROC | I-AP | I-FI | P-AUROC | I-AP | P-F1 | PRO | I-AUROC | I-AP | I-FI | P-AUROC | P-AP | P-F1 | PRO | I-AUROC | I-AP | I-FI | P-AUROC | I-AP | P-F1 | PRO | I-AUROC | I-AP | I-FI | P-AUROC | P-AP | P-F1 | PRO | I-AUROC | I-AP | P-F1 | |
| DRAEM | 93.73 | 91.32 | 86.91 | 96.54 | 47.40 | 49.23 | 85.63 | 98.72 | 99.22 | 97.61 | 97.07 | 67.01 | 65.52 | 90.73 | 96.88 | 97.49 | 94.18 | 97.33 | 29.82 | 35.96 | 86.32 | 81.17 | |||||||||
| CPR | 94.37 | 92.41 | 87.81 | 96.16 | 44.14 | 47.25 | 83.67 | 98.82 | 99.32 | 97.76 | 96.48 | 67.27 | 65.86 | 89.54 | 96.22 | 97.00 | 92.64 | 96.30 | 29.70 | 38.12 | 83.87 | 80.70 | |||||||||
| RealNet | 93.12 | 89.50 | 85.16 | 95.54 | 42.94 | 46.61 | 84.53 | 98.76 | 99.25 | 97.60 | 96.92 | 67.09 | 64.63 | 90.62 | 96.93 | 97.33 | 93.88 | 96.69 | 29.95 | 36.99 | 87.21 | 80.54 | |||||||||
| GLASS | 94.81 | 92.79 | 89.53 | 96.30 | 36.46 | 43.04 | 86.74 | 98.89 | 99.30 | 97.95 | 97.15 | 67.36 | 65.92 | 90.82 | 97.28 | 97.52 | 94.50 | 97.32 | 25.81 | 35.43 | 89.06 | 80.67 | |||||||||
| AnomalyAny | 93.87 | 91.30 | 86.50 | 97.81 | 42.85 | 48.19 | 88.17 | 98.60 | 98.86 | 97.86 | 97.65 | 66.95 | 64.51 | 91.25 | 96.63 | 97.50 | 92.52 | 98.50 | 32.06 | 40.15 | 88.48 | 81.44 | |||||||||
| Ours | 96.65 | 94.66 | 90.80 | 98.89 | 55.42 | 57.00 | 91.67 | 99.25 | 99.60 | 98.34 | 98.06 | 75.44 | 71.40 | 94.10 | 98.23 | 98.50 | 95.79 | 98.47 | 38.33 | 43.35 | 89.17 | 84.91 | |||||||||
TABLE II: Combination with different synthesis-based anomaly detection methods. Bold represents optimal results.
| AD Methods | ATAD | P-AUROC | P-AP | P-F1 | PRO | MVTec-AD | P-AUROC | P-AP | P-F1 | PRO | VisA | P-AUROC | P-AP | P-F1 | PRO | Mean | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| I-AUROC | I-AP | I-FI | P-AUROC | I-AP | P-F1 | PRO | I-AUROC | I-AP | I-FI | P-AUROC | P-AP | P-F1 | PRO | I-AUROC | I-AP | I-FI | P-AUROC | I-AP | P-F1 | PRO | I-AUROC | I-AP | P-F1 | PRO | I-AUROC | I-AP | P-F1 | PRO | I-AUROC | I-AP | |
| DRAEM | 93.73 | 91.32 | 86.91 | 96.54 | 47.40 | 49.23 | 85.63 | 98.72 | 99.22 | 97.61 | 97.07 | 67.01 | 65.52 | 90.73 | 96.88 | 97.49 | 94.18 | 97.33 | 29.82 | 35.96 | 86.32 | 81.17 | |||||||||
| +Ours | 96.65 | 94.66 | 90.80 | 98.89 | 55.42 | 57.00 | 91.67 | 99.25 | 99.60 | 98.34 | 98.06 | 75.44 | 71.40 | 94.10 | 98.23 | 98.50 | 95.79 | 98.47 | 38.33 | 43.35 | 89.17 | 84.91 | |||||||||
| CPR | 96.12 | 94.94 | 91.30 | 99.01 | 54.96 | 55.62 | 93.69 | 99.65 | 99.87 | 99.34 | 99.19 | 81.91 | 75.41 | 97.73 | 97.02 | 97.46 | 93.98 | 99.12 | 51.92 | 53.03 | 94.23 | 86.93 | |||||||||
| +Ours | 96.65 | 95.69 | 91.98 | 99.23 | 57.66 | 57.00 | 95.13 | 99.68 | 99.89 | 99.34 | 99.21 | 82.34 | 75.84 | 97.83 | 97.37 | 97.71 | 94.83 | 99.25 | 54.40 | 55.17 | 94.69 | 87.66 | |||||||||
| GLASS | 95.08 | 93.78 | 90.43 | 99.18 | 39.17 | 49.28 | 94.61 | 99.71 | 99.89 | 99.54 | 99.11 | 69.32 | 70.96 | 95.28 | 97.78 | 98.08 | 95.14 | 98.82 | 43.72 | 47.58 | 91.77 | 84.24 | |||||||||
| +Ours | 96.42 | 94.85 | 90.93 | 99.32 | 41.52 | 50.89 | 95.88 | 99.73 | 99.91 | 99.33 | 99.10 | 70.47 | 71.44 | 95.41 | 97.79 | 98.08 | 95.24 | 98.85 | 45.93 | 48.21 | 93.32 | 84.89 | |||||||||
P-AP by 8.02 points on ATAD and 8.08 points on MVTec-AD, and improves P-F1 by 3.20 points on VisA. These gains support effectiveness of DPA.
-
Combination with Different Detection Frameworks: The preceding comparison fixes the detector to isolate generation quality. We next replace the native synthesized data of DRAEM [7], CPR [22], and GLASS [23] with DPA-generated data while retaining each detection framework. As shown in Tab II, the overall mean increases from 81.17 to 84.91 for DRAEM, from 86.93 to 87.66 for CPR, and from 84.24 to 84.89 for GLASS. The consistent improvements observed across three different detection pipelines suggest that the performance gains of DPA originate from the generated anomaly data, rather than from reliance on any specific detection method.
-
Qualitative Evaluation: Fig.5 presents qualitative comparisons of different zero-shot anomaly generation methods, which use different anomaly-source. Across zipper, pill, and cashew targets, DRAEM pastes fragments of generic texture images that do not reproduce the realistic anomalies. AnomalyAny struggles to describe diverse abnormal appearances such as tooth separation in detail, and its understanding of 'crack' is inconsistent with the real concept of cracks. Consequently, there remains a certain gap between the generated anomalies and real-world anomalies. DPA instead conditions generation on existing source anomaly data to produce more realistic anomalies. Additional examples are provided in the supplementary material.
F. Results of few-shot Anomaly Generation
- Performance Against Anomaly Generation Methods: Although our method is primarily designed for zero-shot anomaly generation, it can be naturally applied to few-shot settings by using a small number of target anomaly samples for training. We compare our method with several representative few-shot generation approaches, including AnomalyDiffusion [11], AnoGen [12], and TF-IDG [39].
As shown in Tab III, DPA ranks first on ATAD (82.22), MVTec-AD (91.28), and VisA (82.37), yielding an overall mean of 85.29. This is 1.16 points above AnomalyDiffusion, the strongest baseline at 84.13. The same spatial-control and

Fig. 5: Qualitative comparison of different zero-shot anomaly generation methods. The first column shows real target anomalies. DRAEM uses the texture images as its anomaly source, AnomalyAny uses the displayed text descriptions, and DPA uses real source-product anomalies. Each generated image includes its predicted mask in the bottom-right inset.
TABLE III: Comparison with different few-shot anomaly generation methods. Results for each dataset represent the mean of all metrics. Bold represents optimal results.
| AG Methods | ATAD | MVTec-AD | VisA | Mean |
|---|---|---|---|---|
| AnomalyDiffusion | 81.74 | 90.94 | 79.72 | 84.13 |
| AnoGen | 79.79 | 89.93 | 79.60 | 83.10 |
| TF-IDG | 79.10 | 88.73 | 78.41 | 82.08 |
| Ours | 82.22 | 91.28 | 82.37 | 85.29 |

Fig. 6: Qualitative comparison under the few-shot setting. The first column shows real target anomalies, and the remaining columns show results from AnomalyDiffusion, AnoGen, TF-IDG, and DPA. The bottom-right inset of each generated image is its mask.
labeling mechanisms therefore remain useful even when the anomaly embeddings are learned directly from target anomaly data. Thus, DPA is not limited to the zero-shot generation setting.
- Qualitative Evaluation: Fig.6 shows the generation results under the few-shot generation setting. AnomalyDiffusion and TF-IDG can place masks on background regions, causing failures for scratch_neck on screw and bent_lead on pcb1. AnoGen restricts generation to the foreground product, but this constraint is insufficient. Defects such as bent_lead may appear in positions without any leads. Our method produces physically plausible anomalies accompanied by well-aligned annotations. Additional results are provided in the supplementary material.
G. Ablation Study
We now isolate the contribution of each module and test the assumptions behind cross-product transfer. Additional ablations are provided in the supplementary material.
- Effectiveness of Each Proposed Module: We train DRAEM on MVTec-AD with each variant's generated samples. Without ACD, anomaly embeddings are learned directly from source anomalies; without IMG, the initial circle is placed randomly; without MR, the initial mask remains fixed throughout generation; and without AL, the low-resolution
TABLE IV: Ablation of DPA modules on MVTec-AD. “Baseline” uses DRAEM's native generator; “w/o” removes the indicated DPA module. Bold denotes the best result.
| Methods | I-AUROC | I-AP | -max | P-AUROC | P-AP | -max | PRO | Mean |
|---|---|---|---|---|---|---|---|---|
| baseline | 98.72 | 99.22 | 97.61 | 97.07 | 67.01 | 65.52 | 90.73 | 87.98 |
| w/o ACD | 99.18 | 99.48 | 97.91 | 98.14 | 72.97 | 69.85 | 93.67 | 90.17 |
| w/o IMG | 99.20 | 99.55 | 98.09 | 97.70 | 72.57 | 69.25 | 93.70 | 90.01 |
| w/o MR | 98.98 | 99.49 | 97.73 | 97.71 | 72.88 | 68.77 | 92.65 | 89.74 |
| w/o AL | 99.14 | 99.50 | 98.33 | 98.12 | 73.39 | 69.34 | 93.67 | 90.21 |
| ours | 99.25 | 99.60 | 98.34 | 98.06 | 75.44 | 71.40 | 94.10 | 90.88 |

Fig. 7: Cross-attention maps generated in IMG with and without ACD. After decoupling, the anomaly representation localizes semantically corresponding regions across different products, indicating a more transferable concept that is less dominated by source-product appearance.
is used as the segmentation label. In Tab IV, the complete model reaches a mean of 90.88, 2.90 points above the native DRAEM-generation baseline. Removing any module reduces the performance of anomaly detection. Each module is therefore necessary for anomaly transfer-based anomaly generation.
-
Qualitative Analysis of Anomaly Concept Decoupling: To show the affect of ACD, Fig.7 visualizes the cross attention map in IMG, when transfer bent_lead from source product pcb1 to pcb2 and transistor. Without ACD, attention is scattered across structures resembling the source product and fails to reliably localize the target leads. With ACD enabled, the same anomaly embedding attends to the lead regions on both targets, even though the transistor differs substantially in appearance from the source PCB. This visualization thus demonstrates that our ACD helps learn anomaly concepts that are disentangled from product-specific features.
-
Impact of Transferring Unreasonable Anomalies: In real-world anomaly transfer scenarios, not all source anomalies are semantically compatible with a given target product. To investigate the effect of transferring such unreasonable anomalies, we consider three settings: (1) transferring only unreasonable anomaly types, which are semantically incompatible with the target product, (2) transferring only reasonable anomaly types, which are compatible and used in our default setting, and (3) transferring all anomaly types without filtering.
As shown in Tab V, transferring only reasonable anomaly types yields better performance compared with transferring unreasonable anomalies. Furthermore, the intermediate result for all types also demonstrates that DPA is not catastrophically sensitive to occasional selection errors, even though reasonable
TABLE V: Impact of transferring reasonable and unreasonable anomaly types. Bold represents optimal results.
| transferred anomaly | I-AUROC | I-AP | I-F1 | P-AUROC | P-AP | P-F1 | PRO | Mean |
|---|---|---|---|---|---|---|---|---|
| Unreasonable | 99.07 | 99.33 | 98.12 | 97.91 | 72.83 | 69.39 | 93.33 | 89.99 |
| Reasonable type (Ours) | 99.25 | 99.60 | 98.34 | 98.06 | 75.44 | 71.40 | 94.10 | 90.88 |
| All type | 99.23 | 99.59 | 98.21 | 98.15 | 73.96 | 70.25 | 93.70 | 90.44 |

Fig. 8: Results of transferring unreasonable anomalies.
types provide the optimal generated results. In addition, Fig.8 presents several transfer results for unreasonable anomaly types, whose generated outputs are physically unrealistic.
- Impact of Target Anomaly Coverage: The proposed anomaly transfer paradigm aims to transfer generic and common anomaly types across products that are prevalent in real-world manufacturing scenarios (e.g., scratches, cracks, bent lead), rather than product-specific anomalies. Consequently, some target anomalies may not have corresponding counterparts in the source domain. To investigate the impact of such cases, we compare two experimental results: (1) transferring anomaly types that include the target anomaly category, and (2) transferring only anomaly types that exclude the target anomaly category.
As shown in Tab VI, source coverage of the target anomaly type raises the performance of anomaly detection. The gap confirms that a matching source concept is useful, but the model remains competitive without one because other transferred anomalies still teach the detector to separate normal from abnormal appearance. Thus, anomaly transfer is most effective when source coverage is broad, yet it does not require a one-to-one source counterpart for every future target anomaly. If a specific uncovered type is essential, the few-shot protocol provides a natural extension.
H. Computational Cost
Tab VII reports the cost of generating 2,000 images for each product of MVTec-AD dataset. DPA has a total runtime
TABLE VI: Impact of target anomaly type coverage. Bold represents the best result.
| transferred anomaly | I-AUROC | I-AP | I-F1 | P-AUROC | P-AP | P-F1 | PRO | Mean |
|---|---|---|---|---|---|---|---|---|
| w/o target type | 99.20 | 99.50 | 98.30 | 97.99 | 72.83 | 69.86 | 94.01 | 90.24 |
| with target type (Ours) | 99.25 | 99.60 | 98.34 | 98.06 | 75.44 | 71.40 | 94.10 | 90.88 |
TABLE VII: Train and test time cost on MVTec-AD dataset.
| Method | Resolution | Train/hours | Test/hours | Total/hours |
|---|---|---|---|---|
| DRAEM | - | - | 0.25 | 0.25 |
| AnomalyDiffusion | 256 | 153.7 | 51.7 | 205.4 |
| AnoGen | 256 | 30.5 | 12.7 | 43.2 |
| TF-IDG | 512 | - | 124 | 124 |
| AnomalyAny | 512 | - | 291.5 | 291.5 |
| Ours | 512 | 70.9 | 5.5 | 76.4 |
of 76.4 hours, which is lower than AnomalyDiffusion (205.4 hours), TF-IDG (124 hours) and AnomalyAny (291.5 hours). Although AnoGen is faster, it only generates images at a resolution of 256 × 256, whereas DPA operates at 512 × 512. Furthermore, DPA outperforms AnoGen in inference speed, which yields greater advantages when numerous generated samples are required.
V. CONCLUSION
We introduced anomaly transfer-based zero-shot generation, which converts anomaly scarcity on a new product to a cross-product transfer problem. The real anomalies from existing products can provide the visual prior, while no anomalous target image is required. Because not every anomaly is suitable for every product, DPA first uses product-aware filtering to retain only reasonable source anomaly types. It then decouples anomaly concept from source-product appearance, and generates the anomaly with adaptive masks, finally deriving a high-resolution label from the generated anomaly. Results on MVTec-AD, VisA, and ATAD show that the resulting data outperform existing zero-shot generate methods, improve multiple downstream detectors, and remain effective under the few-shot generation setting.
REFERENCES
[1] H. Zhu, Z. Liu, Z. Sun, W. Dong, X. Xiao, Z. Zhang, and Y. Xu, "Anomaly or characteristic: Memory-based coarse-to-fine feature fusion for industrial anomaly detection," IEEE Transactions on Multimedia, 2026. [2] B.-B. Gao, "Dual-masked and discriminative reconstruction for unified vision anomaly detection," IEEE Transactions on Image Processing, 2026. [3] T. Zhang, W. Pang, and X. Lu, "Tunclip: Adaptive multi-scale zero-shot anomaly detection via vision-language feature infiltration and semantic enhancement," IEEE Transactions on Multimedia, 2026. [4] L. Gao, J. Zhang, C. Yang, and Y. Zhou, "Cas-vswin transformer: A variant swin transformer for surface-defect detection," Computers in Industry, vol. 140, p. 103689, 2022. [5] Q. Zou, Z. Zhang, Q. Li, X. Qi, Q. Wang, and S. Wang, "Deepcrack: Learning hierarchical convolutional features for crack detection," IEEE transactions on image processing, vol. 28, no. 3, pp. 1498–1512, 2018. [6] H. Li, J. Wu, D. Liu, L. Y. Wu, H. Chen, and C. Shen, "Accurate industrial anomaly detection and localization using weakly-supervised residual transformers," IEEE Transactions on Image Processing, 2026. [7] V. Zavrtanik, M. Kristan, and D. Skočaj, "Draem-a discriminatively trained reconstruction embedding for surface anomaly detection," in Proceedings of the IEEE/CVF international conference on computer vision, 2021, pp. 8330–8339. [8] H. Zhang, Z. Wang, D. Zeng, Z. Wu, and Y.-G. Jiang, "Diffusionad: Norm-guided one-step denoising diffusion for anomaly detection," IEEE Transactions on Pattern Analysis and Machine Intelligence, 2025. [9] H. Yao, M. Liu, Z. Yin, Z. Yan, X. Hong, and W. Zuo, "Glad: Towards better reconstruction with global and local adaptive diffusion models for unsupervised anomaly detection," in European Conference on Computer Vision. Springer, 2024, pp. 1–17.
[10] H. Sun, Y. Cao, H. Dong, and O. Fink, "Unseen visual anomaly generation," in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 25 508–25 517.
[11] T. Hu, J. Zhang, R. Yi, Y. Du, X. Chen, L. Liu, Y. Wang, and C. Wang, "Anomalydiffusion: Few-shot anomaly image generation with diffusion model," in Proceedings of the AAAI conference on artificial intelligence, vol. 38, no. 8, 2024, pp. 8526–8534.
[12] G. Gui, B.-B. Gao, J. Liu, C. Wang, and Y. Wu, “Few-shot anomaly-driven generation for anomaly classification and segmentation,” in European Conference on Computer Vision. Springer, 2024, pp. 210–226.
[13] P. Bergmann, M. Fauser, D. Sattlegger, and C. Steger, “Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2019, pp. 9592–9600.
[14] Y. Zou, J. Jeong, L. Pemula, D. Zhang, and O. Dabeer, “Spot-the-difference self-supervised pre-training for anomaly detection and segmentation,” in European conference on computer vision. Springer, 2022, pp. 392–408.
[15] F. Yang, P. Jing, W. Wang, F. L. Wang, and Y. Su, “Padnet: Progressive-difference-aware feature reconstruction mechanism for anomaly detection,” IEEE Transactions on Multimedia, 2025.
[16] Z. Yang, T. Zheng, X. Ni, Z. Yan, S. Liu, Y. Yu, H. Chen, Y. Wang, L. Fang, and W. Hao, “Open set industrial surface defect recognition with high frequency feature enhancement and class mutual-information constraint,” IEEE Transactions on Multimedia, 2026.
[17] A. Mousakhan, T. Brox, and J. Tayyub, “Anomaly detection with conditioned denoising diffusion models,” arXiv preprint arXiv:2305.15956, 2023.
[18] J. Guo, S. Lu, W. Zhang, F. Chen, H. Li, and H. Liao, “Dinomaly: The less is more philosophy in multi-class unsupervised anomaly detection,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 20405–20415.
[19] W. Luo, Y. Cao, H. Yao, X. Zhang, J. Lou, Y. Cheng, W. Shen, and W. Yu, “Exploring intrinsic normal prototypes within a single image for universal anomaly detection,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 9974–9983.
[20] T. Defard, A. Setkov, A. Loesch, and R. Audigier, “Padim: a patch distribution modeling framework for anomaly detection and localization,” in International Conference on Pattern Recognition. Springer, 2021, pp. 475–489.
[21] K. Roth, L. Pemula, J. Zepeda, B. Schölkopf, T. Brox, and P. Gehler, “Towards total recall in industrial anomaly detection,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, pp. 14318–14328.
[22] H. Li, J. Hu, B. Li, H. Chen, Y. Zheng, and C. Shen, “Target before shooting: Accurate anomaly detection and localization under one millisecond via cascade patch retrieval,” IEEE Transactions on Image Processing, 2024.
[23] Q. Chen, H. Luo, C. Lv, and Z. Zhang, “A unified anomaly synthesis strategy with gradient ascent for industrial anomaly detection and localization,” in European Conference on Computer Vision. Springer, 2024, pp. 37–54.
[24] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli, “Deep unsupervised learning using nonequilibrium thermodynamics,” in International conference on machine learning. PMLR, 2015, pp. 2256–2265.
[25] J. Ho, A. Jain, and P. Abbeel, “Denoising diffusion probabilistic models,” Advances in neural information processing systems, vol. 33, pp. 6840–6851, 2020.
[26] A. Q. Nichol and P. Dhariwal, “Improved denoising diffusion probabilistic models,” in International conference on machine learning. PMLR, 2021, pp. 8162–8171.
[27] P. Dhariwal and A. Nichol, “Diffusion models beat gans on image synthesis,” Advances in neural information processing systems, vol. 34, pp. 8780–8794, 2021.
[28] X. Liu, Y. Wei, M. Liu, X. Lin, P. Ren, X. Xie, and W. Zuo, “Smartcontrol: Enhancing controlnet for handling rough visual conditions,” arXiv preprint arXiv:2404.06451, 2024.
[29] Y. Wei, Y. Zhang, Z. Ji, J. Bai, L. Zhang, and W. Zuo, “Elite: Encoding visual concepts into textual embeddings for customized text-to-image generation,” in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023, pp. 15 943–15 953.
[30] Y. Zhang, Y. Wei, D. Jiang, X. ZHANG, W. Zuo, and Q. Tian, “Controlvideo: Training-free controllable text-to-video generation,” in The Twelfth International Conference on Learning Representations, 2023.
[31] Y. Zhang, Y. Wei, X. Lin, Z. Hui, P. Ren, X. Xie, X. Ji, and W. Zuo, "Videoelevator: Elevating video generation quality with versatile text-to-image diffusion models," arXiv preprint arXiv:2403.05438, 2024.
[32] J. Song, C. Meng, and S. Ermon, “Denoising diffusion implicit models,” in International Conference on Learning Representations, 2020.
[33] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer, “High-resolution image synthesis with latent diffusion models,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2022, pp. 10684–10695.
[34] R. Gal, Y. Alaluf, Y. Atzmon, O. Patashnik, A. H. Bermano, G. Chechik, and D. Cohen-Or, “An image is worth one word: Personalizing text-to-image generation using textual inversion,” arXiv preprint arXiv:2208.01618, 2022.
[35] N. Ruiz, Y. Li, V. Jampani, Y. Pritch, M. Rubinstein, and K. Aberman, “Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2023, pp. 22 500–22 510.
[36] X. Zhang, M. Xu, and X. Zhou, “Realnet: A feature selection network with realistic synthetic anomaly for anomaly detection,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2024, pp. 16699–16708.
[37] Z. Dai, S. Zeng, H. Liu, X. Li, F. Xue, and Y. Zhou, “Seas: few-shot industrial anomaly image generation with separation and sharing fine-tuning,” in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2025, pp. 23 135–23 144.
[38] Y. Jin, J. Peng, Q. He, T. Hu, J. Wu, H. Chen, H. Wang, W. Zhu, M. Chi, J. Liu et al., “Dual-interrelated diffusion model for few-shot anomaly image generation,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 30420–30429.
[39] R. Xu, Y.-T. Chiu, T.-I. Chen, O. Chew, Y.-Y. Chuang, and W.-H. Cheng, “Training-free industrial defect generation with diffusion models,” in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2025, pp. 24 214–24 223.
[40] Z. Lai, Y. Lu, X. Li, J. Lin, Y. Qu, L. Cao, M. Li, and R. Ji, “Anomalypainter: Vision-language-diffusion synergy for zero-shot realistic and diverse industrial anomaly synthesis,” arXiv preprint arXiv:2503.07253, 2025.
[41] S. Bai, Y. Cai, R. Chen, K. Chen, X. Chen, Z. Cheng, L. Deng, W. Ding, C. Gao, C. Ge et al., “Qwen3-vl technical report,” arXiv preprint arXiv:2511.21631, 2025.
[42] C. Wang, W. Zhu, B.-B. Gao, Z. Gan, J. Zhang, Z. Gu, S. Qian, M. Chen, and L. Ma, “Real-iad: A real-world multi-view dataset for benchmarking versatile industrial anomaly detection,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2024, pp. 22 883–22 892.
[43] L. Fan, D. Fan, Z. Hu, Y. Ding, D. Di, K. Yi, M. Pagnucco, and Y. Song, “Manta: A large-scale multi-view and visual-text anomaly detection dataset for tiny objects,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 25 518–25 527.
Supplementary Material
I. APPENDIX
The content of this supplementary material is organized as follows:
• More implementation details in section II.
• Additional Metrics in section III.
• ATAD dataset in section IV.
• Additional Ablation Study in section V.
• Discussion on Inpainting Image Quality in section VI.
• Results of Anomaly Type Filtering in section VII.
• Additional Results of Anomaly Generation in section VIII
• Additional Results of Anomaly Detection in section IX.
• Additional Visualization in section X.
II. MORE IMPLEMENTATION DETAILS
A. More Training Details
In our method, anomaly types and product categories are represented as bracketed text, such as “a [bent_lead]”, “a [pcb1]”, and “a [pcb1] with [bent_lead]”, respectively. To learn these concepts, we adopt Textual Inversion [1], which adds token ids and corresponding learnable embeddings for each new word in the tokenizer and text encoder. Each product category is represented by 8 learnable embeddings, while each anomaly type is represented by 4 learnable embeddings. These embeddings are jointly optimized during training and serve as the textual representations of products and anomalies throughout the generation process.
During the decoupling training phase, the batch size is set to 6, and the learning rate is 0.032 without scaling. We train the learning embeddings for 3000 steps per anomaly type. In the zero-shot setting, we additionally train the product embeddings with the same training parameters as in the decoupling phase, except for a batch size of 16. In the few-shot setting, we directly use the trained decoupled product embeddings without further training.
For downstream anomaly detection, we directly adopt parameters of the original algorithm.
B. More inference details
During generation, we load the decoupled anomaly embeddings and the additionally trained target-product embeddings into the text encoder. The prompt combines the target product with the selected anomaly type. Starting from a noisy normal sample at timestep , the diffusion model performs 10 denoising steps to generate an anomalous image. The adaptive mask is switched progressively during these 10 steps. Specifically, step 0 uses the removal mask to remove conflicting normal content, steps 1–6 use the initial mask to insert the anomaly with plausible location and size, and steps 7–9 use the refined mask to refine the anomaly shape. In the Generated-Sample Verification, the anomaly saliency threshold is set to .
III. ADDITIONAL METRICS
Besides the standard anomaly detection metrics, we additionally report Accuracy (ACC) and Intersection over Union (IoU) for methods with binary segmentation outputs of DRAEM [2] in section IX. These metrics are particularly relevant in practical industrial applications.
In addition, to evaluate the quality of generated anomalies, we adopt three commonly used metrics. For zero-shot generation, since there is no strict target category sample, we evaluate the Inception Score (IS). For few-shot generation, we use the commonly used LPIPS (IC-LPIPS) [3] and Kernel Inception Distance (KID) [4].
IV. ATAD DATASET
To facilitate research on anomaly transfer, we construct a new benchmark named the Anomaly Transfer-based Anomaly Detection dataset (ATAD) by integrating product categories and anomaly types from four widely used industrial anomaly detection datasets, including the manually curated datasets MVTec-AD [5] and VisA [6], as well as the in-the-wild datasets Real-IAD [7] and MANTA [8].
ATAD is divided into a source subset that provides reference anomalies and a target subset used for generation and detection. Each target anomaly category has at least one semantically corresponding source type. Example correspondences are shown in fig. 1, and the complete many-to-many mapping is provided in ATAD_anomaly_type_match.csv. The mapping is metadata inherent to the benchmark and is provided only to document its anomaly-type coverage. It is not an input to DPA, the Qwen prompt, prompt construction, training, or hyperparameter selection. Our experiments instead use Qwen3-VL-8B to select plausible source-target pairs without consulting the mapping or any target anomaly label.
Detailed dataset statistics are summarized in table I. The source subset contains 13 product categories, including 6,308 normal training images, 2,170 normal test images, and 1,886 anomalous test images. The target subset contains 16 product categories, including 8,555 normal training images, 2,858 normal test images, and 1,993 anomalous test images. The selected products cover diverse industrial scenarios, ranging from single-instance objects to multi-instance products (e.g., candles, capsules, and macaroni2) and structurally complex products (e.g., pcb2 and pcb3), providing a challenging and diverse benchmark for anomaly transfer research.
V. ADDITIONAL ABLATION STUDY
Influences of Threshold in Mask Binarization. We further investigate the impact of different threshold values in the mask binarization process during generation. The results presented in the table II indicate that a threshold of 0.55 yields the optimal detection performance overall.

Fig. 1. Similarity between source and target anomalies in ATAD dataset.
TABLE I
STATISTICAL OVERVIEW OF THE ATAD DATASET. FOR EACH CATEGORY, THE NUMBER OF TRAINING SAMPLES, NORMAL TEST SAMPLES, ANOMALOUS TEST SAMPLES AND ANOMALY TYPES IS PROVIDED.
| dataset | category | train (normal) | test (normal) | test (anomalous) | anomaly type |
|---|---|---|---|---|---|
| source sub-dataset | bottle_cap | 370 | 369 | 263 | 3 |
| capsule_mvtec | 219 | 23 | 109 | 5 | |
| fire_hood | 418 | 418 | 169 | 4 | |
| hazelnut | 391 | 40 | 70 | 4 | |
| macaroni1 | 900 | 100 | 100 | 5 | |
| oblong_tab t | 509 | 194 | 36 | 4 | |
| pcb1 | 904 | 100 | 100 | 5 | |
| pcb4 | 904 | 101 | 100 | 6 | |
| red_washer | 578 | 148 | 38 | 3 | |
| transistor1 | 266 | 265 | 469 | 3 | |
| usb_adaptor | 362 | 361 | 280 | 4 | |
| wood | 247 | 19 | 49 | 4 | |
| zipper_mvtec | 240 | 32 | 103 | 6 | |
| total | 6308 | 2170 | 1886 | 56 | |
| target sub-dataset | cable | 224 | 58 | 35 | 3 |
| candle | 900 | 100 | 90 | 4 | |
| capsule_manta | 500 | 200 | 40 | 2 | |
| capsules | 542 | 60 | 50 | 3 | |
| cashew | 450 | 50 | 78 | 4 | |
| eraser | 389 | 389 | 235 | 4 | |
| fryum | 450 | 50 | 80 | 4 | |
| macaroni2 | 900 | 100 | 100 | 5 | |
| pcb2 | 901 | 100 | 86 | 4 | |
| pcb3 | 905 | 101 | 77 | 4 | |
| pill | 267 | 26 | 96 | 4 | |
| plastic_nut | 442 | 442 | 118 | 4 | |
| toy_brick | 371 | 370 | 261 | 4 | |
| type_c | 620 | 120 | 31 | 2 | |
| woodstick | 443 | 442 | 116 | 4 | |
| zipper_realiad | 251 | 250 | 500 | 4 | |
| total | 8555 | 2858 | 1993 | 59 |
TABLE II
COMPARISON OF DIFFERENT THRESHOLDS. BOLD REPRESENTS OPTIMAL RESULTS.
| Threshold | I-AUROC | I-AP | I-F1-max | P-AUROC | P-AP | P-F1-max | PRO | Mean |
|---|---|---|---|---|---|---|---|---|
| 0.45 | 99.07 | 99.43 | 98.11 | 98.16 | 73.00 | 68.83 | 93.26 | 89.98 |
| 0.50 | 99.12 | 99.40 | 97.83 | 98.18 | 73.53 | 69.67 | 93.59 | 90.19 |
| 0.55 (Ours) | 99.25 | 99.60 | 98.34 | 98.06 | 75.44 | 71.40 | 94.10 | 90.88 |
| 0.60 | 99.13 | 99.48 | 98.10 | 97.67 | 71.18 | 68.57 | 93.22 | 89.62 |
TABLE III
ABLATION OF NORMAL REGION REMOVAL (NRR) AND GENERATED-SAMPLE VERIFICATION (GSF). BOLD DENOTES THE BEST RESULT.
| I-AUROC | I-AP | I-F1-max | P-AUROC | P-AP | P-F1-max | PRO | Mean | |
|---|---|---|---|---|---|---|---|---|
| w/o GSF | 98.99 | 99.41 | 97.78 | 97.79 | 72.40 | 68.73 | 93.57 | 89.81 |
| w/o NRR | 99.09 | 99.46 | 98.13 | 97.90 | 73.50 | 69.36 | 93.84 | 90.18 |
| ours | 99.25 | 99.60 | 98.34 | 98.06 | 75.44 | 71.40 | 94.10 | 90.88 |
TABLE IV
QUALITY OF THE COMPLETED INPAINTING-NORMAL COUNTERPARTS ON MVTEC-AD. LOWER KID AND FID INDICATE A DISTRIBUTION CLOSER TO THE REAL NORMAL DATA.
| Computed with real normal images | KID | FID |
|---|---|---|
| real anomalous images | 0.0956 | 114.64 |
| inpainting-normal images | 0.0517 | 71.83 |
Impact of Normal Region Removal and Generated-Sample Verification
As shown in table III, introducing the proposed Normal Region Removal (NRR) module and Generated-Sample Verification (GSF) module consistently improves all evaluation metrics. The NRR module removes normal content within the mask region via unconditional generation before anomaly generation, preventing interference from original structures. GSF removes generated samples that lack visible anomalies despite having anomaly labels. Without such filtering, these mislabeled normal samples would pollute the training set and harm downstream detection. The results confirm the importance of both modules for anomaly detection performance.
VI. DISCUSSION ON INPAINTING IMAGE QUALITY
To rule out the possibility that poor inpainting-normal images degrade anomaly generation, we adopt two complementary measures. First, during training, we paste the original anomaly back onto the inpainted image with mask to further eliminate residual differences in the normal regions. This ensures that even if the inpainted image contains minor artifacts, they will not be mistakenly learned as anomaly patterns. Second, we evaluate the distributional fidelity of the inpainted results. Using KID and FID on MVTec-AD, we compare the distance from inpainted images to real normal samples against that from raw anomalies to normal samples. The significantly smaller distance of inpainted images confirms that the inpainting model produces satisfying counterparts. fig. 1 further show no severe artifacts in the completed regions. This ensures that subsequent training benefits from reliable paired data.
VII. RESULTS OF ANOMALY TYPE FILTERING
Our method transfers source anomalies to target products, which inherently involves the selection of anomaly types. To facilitate anomaly transfer, we systematically split anomaly data and renamed anomaly types. Comprehensive details are included in the additional supplementary materials MVTec-AD_anomaly.csv

Fig. 2. Qualitative examples of inpainted pseudo-normal images.
(for MVTec-AD dataset), VisA_anomaly.csv (for VisA dataset), ATAD_source_anomaly.csv and ATAD_target_anomaly.csv (for ATAD dataset).
Because semantically incompatible transfers can degrade detection, Qwen3-VL filters source-target pairs before generation. It receives the source anomalous image, its mask and type, together with a normal exemplar and the category of the target product, then judges compatibility under a fixed instruction. This is a one-time offline decision for each source-anomaly-type-target-product candidate. The result is cached and reused for all generated samples, so Qwen is not called during diffusion sampling or downstream detector training and inference. The complete filtered outputs are provided in the additional supplementary materials:VisA2MVTec-AD_filter.csv for MVTec-AD, MVTec-AD2VisA_filter.csv for VisA, and source2target_filter.csv for ATAD.
VIII. ADDITIONAL RESULTS OF ANOMALY GENERATION
Tables V and VI quantify generation quality. In the zero-shot generation setting, target anomaly types are unavailable during training, so generated and real defects cannot be paired by type; we therefore report IS but not IC-LPIPS or KID. In the few-shot generation setting, real target anomalies provide valid same-type references, allowing IC-LPIPS and KID to measure diversity. DPA obtains the best mean in both tab s.
IX. ADDITIONAL RESULTS OF ANOMALY DETECTION
Deterministic Detection Performance. Since DRAEM produces binary segmentation outputs, its predictions can be interpreted as deterministic metrics that explicitly identify the presence and location of anomalies within input images. In practical industrial deployment, we require such deterministic outputs to make reliable decisions about whether to accept or reject tested products. As shown in table VII, under both zero-shot and few-shot generation settings, our method brings significant improvements in deterministic metrics, which holds substantial practical importance for real-world industrial applications.
Performance Against Unsupervised IAD Methods. The zero-shot generation setting uses no target anomalous image during training and is therefore comparable to unsupervised IAD. We additionally compare with SimpleNet [9],
TABLE V IS COMPARISON UNDER THE ZERO-SHOT SETTING ON MVTEC-AD. BOLD DENOTES THE BEST RESULT.
| Class | AnomalyAny | DPA |
|---|---|---|
| bottle | 2.17 | 1.47 |
| cable | 2.95 | 1.89 |
| capsule | 1.71 | 1.90 |
| carpet | 1.24 | 1.26 |
| grid | 2.32 | 2.49 |
| hazelnut | 2.19 | 2.06 |
| leather | 1.37 | 3.04 |
| metal_nut | 1.53 | 1.53 |
| pill | 2.40 | 1.91 |
| screw | 1.20 | 1.69 |
| tile | 3.44 | 2.54 |
| toothbrush | 1.59 | 1.51 |
| transistor | 1.50 | 1.67 |
| wood | 1.97 | 3.02 |
| zipper | 1.88 | 1.75 |
| mean | 1.96 | 1.98 |
TABLE VI IC-LPIPS AND KID COMPARISON UNDER THE FEW-SHOT SETTING ON MVTEC-AD DATASET. BOLD REPRESENT OPTIMAL RESULTS.
| class | Anomalydiffusion | AnoGen | DPA | |||
|---|---|---|---|---|---|---|
| IC-L↑ | KID↓ | IC-L↑ | KID↓ | IC-L↑ | KID↓ | |
| bottle | 0.15 | 0.07 | 0.12 | 0.12 | 0.15 | 0.09 |
| cable | 0.38 | 0.07 | 0.36 | 0.11 | 0.38 | 0.04 |
| capsule | 0.16 | 0.04 | 0.17 | 0.05 | 0.19 | 0.11 |
| carpet | 0.21 | 0.13 | 0.22 | 0.12 | 0.25 | 0.10 |
| grid | 0.39 | 0.08 | 0.41 | 0.09 | 0.34 | 0.05 |
| hazelnut | 0.27 | 0.02 | 0.29 | 0.02 | 0.29 | 0.02 |
| leather | 0.33 | 0.15 | 0.35 | 0.13 | 0.32 | 0.10 |
| metal_nut | 0.24 | 0.08 | 0.21 | 0.12 | 0.23 | 0.08 |
| pill | 0.23 | 0.03 | 0.23 | 0.06 | 0.25 | 0.04 |
| screw | 0.25 | 0.01 | 0.26 | 0.02 | 0.27 | 0.02 |
| tile | 0.48 | 0.28 | 0.46 | 0.29 | 0.44 | 0.16 |
| toothbrush | 0.15 | 0.03 | 0.16 | 0.05 | 0.16 | 0.03 |
| transistor | 0.29 | 0.15 | 0.27 | 0.16 | 0.27 | 0.11 |
| wood | 0.33 | 0.11 | 0.34 | 0.07 | 0.36 | 0.07 |
| zipper | 0.23 | 0.11 | 0.23 | 0.13 | 0.20 | 0.04 |
| mean | 0.27 | 0.09 | 0.27 | 0.10 | 0.28 | 0.07 |
Dinomaly [10], and INP-Former [11]. For a fair evaluation, center-crop augmentation is disabled because it can remove anomalous regions. Table VIII shows that detection models trained with DPA-generated data remain competitive with these unsupervised approaches.
Detailed Detection and Segmentation Results. In addition, we also report the detailed detection and segmentation results for each category on the MVTec-AD, VisA and ATAD datasets under zero-shot setting. table IX, table X and table XI to presents the results of two representative methods (DRAEM [2] and AnomalyAny [12]) and our proposed approach.

(a) ATAD
(b) MVTec-AD
(c) VisA
Fig. 3. Anomaly localization results of DRAEM, which is trained with data from different generation methods under zero-shot generation setting. Each group shows the input anomaly, the predictions, and the ground truth.

(a) ATAD

(b) MVTec-AD

(c) VisA
Fig. 4. Anomaly localization results of DRAEM, which is trained with data from different generation methods under few-shot generation setting. Each group shows the input anomaly, the predictions, and the ground truth.
TABLE VII
COMPARISON OF DETERMINISTIC METRICS UNDER ZERO-SHOT AND FEW-SHOT SETTINGS. BOLD DENOTES THE BEST RESULT.
| AD Methods | ATAD | MVTec-AD | VisA | |||
|---|---|---|---|---|---|---|
| ACC | IoU | ACC | IoU | ACC | IoU | |
| zero-shot setting | ||||||
| DRAEM | 64.85 | 58.62 | 68.81 | 54.14 | 56.67 | 55.14 |
| CPR | 66.01 | 60.08 | 60.19 | 50.28 | 55.78 | 52.06 |
| RealNet | 64.02 | 60.73 | 69.46 | 54.79 | 53.82 | 54.98 |
| GLASS | 60.09 | 55.89 | 67.08 | 55.36 | 52.17 | 52.82 |
| AnomalyAny | 66.47 | 57.09 | 67.14 | 49.56 | 52.47 | 49.36 |
| Ours | 70.15 | 61.96 | 75.45 | 59.26 | 62.93 | 57.90 |
| few-shot setting | ||||||
| AnomalyDiffusion | 73.37 | 65.69 | 74.55 | 62.87 | 62.46 | 61.44 |
| AnoGen | 74.07 | 66.08 | 77.09 | 61.22 | 65.68 | 61.77 |
| TF-IDG | 70.69 | 66.93 | 65.22 | 55.16 | 65.96 | 59.64 |
| Ours | 74.72 | 70.71 | 77.66 | 63.33 | 67.16 | 63.72 |
X. ADDITIONAL VISUALIZATION
Figures 3 and 4 compare localization under the zero-shot and few-shot protocols, respectively. In every case, the same DRAEM anomaly detection model is trained with data produced by the listed generation methods, so differences reflect the generated images and labels.
Additional zero-shot generation results are presented in fig. 5, while few-shot generation results are provided in fig. 6.
REFERENCES
[1] R. Gal, Y. Alaluf, Y. Atzmon, O. Patashnik, A. H. Bermano, G. Chechik, and D. Cohen-Or, "An image is worth one word: Personalizing text-to-image generation using textual inversion," arXiv preprint arXiv:2208.01618, 2022.
[2] V. Zavrtanik, M. Kristan, and D. Skočaj, “Draem-a discriminatively trained reconstruction embedding for surface anomaly detection,” in Proceedings of the IEEE/CVF international conference on computer vision, 2021, pp. 8330–8339.
[3] U. Ojha, Y. Li, J. Lu, A. A. Efros, Y. J. Lee, E. Shechtman, and R. Zhang, "Few-shot image generation via cross-domain correspondence," in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2021, pp. 10743–10752.
[4] M. Bifikowski, D. J. Sutherland, M. Arbel, and A. Gretton, “Demystifying mmd gans,” arXiv preprint arXiv:1801.01401, 2018.
[5] P. Bergmann, M. Fauser, D. Sattlegger, and C. Steger, “Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2019, pp. 9592–9600.
[6] Y. Zou, J. Jeong, L. Pemula, D. Zhang, and O. Dabeer, “Spot-the-difference self-supervised pre-training for anomaly detection and segmentation,” in European conference on computer vision. Springer, 2022, pp. 392–408.
[7] C. Wang, W. Zhu, B.-B. Gao, Z. Gan, J. Zhang, Z. Gu, S. Qian, M. Chen, and L. Ma, "Real-iad: A real-world multi-view dataset for benchmarking versatile industrial anomaly detection," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2024, pp. 22883–22892.

Fig. 5. Additional zero-shot anomaly generation results for DRAEM, AnomalyAny, and DPA.

Fig. 6. Additional few-shot generation results for AnomalyDiffusion, AnoGen, TF-IDG, and DPA.
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2021 6 TABLE VIII COMPARISON WITH SOTA UNSUPERVISED ANOMALY DETECTION METHODS. BOLD REPRESENTS OPTIMAL RESULTS. AD Methods ATAD MVTec-AD VisA Mean I-AUROC I-AP I-F1 P-AUROC P-AP P-F1 PRO I-AUROC I-AP I-F1 P-AUROC P-AP P-F1 PRO I-AUROC I-AP I-F1 P-AUROC P-AP P-F1 PRO DRAEM 93.73 91.32 86.91 96.54 47.40 49.23 85.63 98.72 99.22 97.61 97.07 67.01 65.52 90.73 96.88 97.49 94.18 97.33 29.82 35.96 86.32 81.17 SimpleNet 92.34 91.07 85.24 98.26 30.89 36.62 93.32 98.92 99.55 98.86 97.93 51.94 54.33 92.25 96.16 96.91 92.64 98.46 33.16 37.11 92.29 79.44 CPR 96.12 94.94 91.30 99.01 54.96 55.62 93.69 99.65 99.87 99.34 99.19 81.91 75.41 97.73 97.23 97.62 94.71 99.13 51.46 52.99 93.89 86.94 GLASS 95.98 93.78 90.43 99.18 39.17 49.28 94.61 99.71 99.89 99.54 99.11 69.32 70.96 95.28 97.78 98.08 95.14 98.82 43.72 47.58 91.77 84.24 Dinamaly 96.63 95.25 91.60 99.30 47.63 51.37 96.29 99.69 99.87 99.21 98.55 66.80 67.51 95.37 98.54 98.79 95.48 99.10 49.24 52.88 94.78 85.42 INP-former 96.50 94.81 91.51 99.11 53.01 55.54 95.69 99.47 99.82 98.98 98.52 68.23 67.95 96.38 98.02 98.29 95.06 98.60 49.61 52.73 93.71 85.79 DRAEM+Ours 96.65 94.66 90.80 98.89 55.42 57.00 91.67 99.25 99.60 98.34 98.06 75.44 71.40 94.10 98.23 98.50 95.79 98.47 38.33 43.35 89.17 84.91 CPR+Ours 96.65 95.69 91.98 99.23 57.66 57.00 95.13 99.68 99.89 99.34 99.21 82.34 75.84 97.83 97.37 97.71 94.83 99.25 54.40 55.17 94.69 87.66 GLASS+Ours 96.42 94.85 90.93 99.32 41.52 50.89 95.88 99.73 99.91 99.33 99.10 70.47 71.44 95.41 97.79 98.08 95.24 98.85 45.93 48.21 93.32 84.89 TABLE IX COMPARISON UNDER THE ZERO-SHOT GENERATION SETTING WITH DRAEM ON ATAD DATASETS. BOLD REPRESENT OPTIMAL RESULTS. Class DREAM AnomalyAny DPA I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO cable 94.19 92.90 87.88 78.49 98.14 78.76 70.66 54.86 86.69 94.83 93.18 85.71 83.87 98.16 78.72 69.63 60.37 87.46 98.87 98.31 94.44 91.40 99.62 88.11 78.63 55.19 94.27 candle 88.69 87.52 81.65 53.68 93.06 18.38 28.50 31.35 80.34 96.37 96.47 89.73 53.16 97.05 19.51 28.40 55.19 89.89 97.82 97.35 93.55 72.63 99.12 31.78 37.88 60.96 84.43 capsules 91.60 93.04 85.98 56.36 94.89 24.61 30.28 55.61 88.49 92.43 92.51 85.11 70.91 99.57 40.00 53.52 61.26 93.35 95.90 95.58 90.20 70.91 99.73 73.18 75.98 65.25 95.54 capsule mantan 100.00 100.00 100.00 99.58 91.47 53.61 56.62 79.23 82.79 100.00 100.00 100.00 99.58 98.17 67.83 79.20 52.03 94.87 100.00 100.00 100.00 88.75 98.09 80.86 75.76 28.36 91.38 cashew 94.36 96.33 91.03 39.06 92.13 32.55 42.42 43.78 79.72 95.38 96.98 92.68 40.62 96.27 5.25 12.45 36.67 82.46 97.56 98.33 94.41 39.84 97.66 40.34 43.08 44.72 86.83 eraser 86.25 86.76 80.82 62.98 98.35 49.51 54.62 65.46 85.75 90.09 89.54 80.86 63.78 97.19 51.60 54.23 71.24 81.53 91.80 91.19 83.49 64.58 99.18 60.07 58.80 72.65 91.31 fryum 96.00 97.16 94.61 40.00 94.29 27.33 37.97 42.31 64.99 94.95 96.05 91.61 41.54 98.09 36.31 44.69 48.79 81.92 99.48 99.66 98.16 60.00 99.23 53.90 52.37 44.01 72.76 macaroni2 95.80 96.52 89.36 50.00 98.30 9.13 22.87 67.89 91.80 92.54 92.64 85.45 50.00 99.69 19.08 28.49 56.48 95.82 98.44 98.40 94.69 50.00 99.92 12.67 25.31 59.63 98.02 pcb2 98.21 97.80 93.92 68.28 83.91 0.93 3.83 56.91 60.01 98.45 98.11 94.32 74.73 95.57 19.20 23.97 47.41 84.39 98.62 98.10 96.09 61.29 98.96 29.42 37.26 65.14 86.55 pcb3 97.40 96.07 94.74 56.74 94.27 23.93 38.81 56.97 88.71 99.13 98.72 96.20 58.43 98.54 22.53 36.18 66.71 90.30 98.95 98.61 93.24 58.99 99.06 9.78 21.77 68.34 89.81 pill 97.40 99.33 95.79 29.51 96.21 47.57 49.36 35.26 91.71 96.31 99.00 96.34 40.16 98.55 61.47 61.70 39.60 95.27 98.84 99.70 97.94 63.11 99.64 78.37 74.27 58.44 97.43 plastic nut 87.81 70.37 67.20 79.29 99.22 52.04 51.07 80.04 85.78 84.29 61.16 59.53 80.00 99.53 50.12 50.46 57.08 91.02 91.33 76.60 71.89 80.00 99.87 70.17 65.13 81.02 93.89 toy brick 75.65 73.61 67.06 60.54 98.19 50.47 51.32 60.36 82.30 80.34 80.42 69.94 58.64 98.11 43.41 49.16 57.49 76.29 87.64 87.78 78.08 69.57 97.24 63.42 62.34 64.73 81.14 type c 91.59 83.83 80.65 84.11 90.57 20.80 29.86 63.17 69.55 93.17 79.78 77.97 81.46 92.25 22.16 32.56 76.79 75.75 98.17 91.77 86.96 91.39 98.42 42.70 46.21 79.13 92.71 woodstick 94.05 83.41 77.45 82.08 99.76 22.30 36.09 80.89 95.87 93.64 86.30 78.97 82.97 99.54 86.97 81.84 72.88 93.40 95.04 88.18 82.46 84.05 99.83 89.48 83.92 86.31 96.15 zipper realiad 99.97 99.99 99.60 54.13 93.79 49.04 49.59 56.34 93.45 99.98 99.99 99.60 83.60 98.65 61.44 64.63 53.50 97.00 99.72 99.87 98.39 75.87 97.69 72.40 70.16 57.50 96.23 mean 93.06 90.92 86.73 62.18 94.78 35.06 40.87 58.15 82.99 93.87 91.30 86.50 66.47 97.81 42.85 48.19 57.09 88.17 96.76 94.96 90.87 70.15 98.95 56.04 56.80 61.96 90.53 TABLE X COMPARISON UNDER THE ZERO-SHOT GENERATION SETTING WITH DRAEM ON MVTEC-AD DATASETS. BOLD REPRESENT OPTIMAL RESULTS. Class DRAEM AnomalyAny DPA I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO capsule 98.68 99.74 98.17 29.55 96.78 48.10 49.56 42.06 93.04 97.61 99.50 97.30 24.24 98.70 52.79 52.09 36.11 92.65 97.53 99.52 96.74 28.03 98.37 58.63 54.82 37.63 93.66 screw 96.41 98.58 96.33 27.50 98.44 48.72 49.88 33.89 91.37 100.00 100.00 100.00 31.25 97.94 23.26 31.44 24.31 88.37 98.77 99.56 97.52 56.25 99.41 63.92 61.77 55.22 95.19 carpet 98.72 99.62 97.14 77.78 97.88 68.76 65.06 53.87 92.31 99.32 99.79 97.70 77.78 98.50 71.22 67.42 55.60 93.96 99.08 99.73 97.73 74.36 99.19 78.59 72.43 56.09 95.12 cable 95.65 97.38 92.06 87.33 95.05 61.21 56.61 39.52 81.22 94.40 96.43 90.62 70.67 94.68 62.66 57.54 45.62 81.89 97.32 98.50 93.92 92.67 97.13 71.37 66.34 46.11 90.59 pill 97.95 99.62 97.53 34.73 98.25 57.31 71.39 31.47 88.96 97.44 99.53 97.51 41.32 99.21 85.84 80.85 36.07 94.47 99.51 99.91 98.58 52.10 99.13 81.02 74.47 47.12 95.49 transistor 93.92 93.45 84.62 78.00 80.96 35.26 39.40 59.06 72.00 90.79 87.87 88.61 79.00 88.14 39.09 45.11 62.69 69.18 97.33 96.86 92.11 88.00 85.18 43.89 46.82 67.67 79.14 bottle 99.76 99.93 99.20 95.18 98.36 85.49 78.04 63.24 93.72 99.92 99.98 99.21 90.36 97.63 80.36 72.14 46.94 91.76 99.92 99.98 99.21 93.98 99.11 87.37 79.30 60.92 94.65 hazelnut 100.00 100.00 100.00 66.36 99.27 77.19 70.80 56.74 95.64 99.68 99.82 97.90 69.09 99.49 82.38 74.62 48.80 96.12 100.00 100.00 100.00 80.00 99.84 92.96 86.58 74.84 96.58 metal nut 100.00 100.00 100.00 95.65 99.52 95.51 90.70 77.74 96.74 99.90 99.98 99.47 94.78 97.05 78.73 73.28 53.97 94.98 100.00 100.00 100.00 94.78 98.73 91.53 86.01 69.69 96.31 toothbrush 100.00 100.00 100.00 76.19 99.03 53.70 55.70 56.92 93.10 100.00 100.00 100.00 78.57 98.61 44.14 50.83 50.89 90.14 100.00 100.00 100.00 83.33 99.14 60.54 60.05 57.35 91.17 grid 100.00 100.00 100.00 50.00 99.74 66.00 64.43 64.59 97.83 100.00 100.00 100.00 61.54 99.71 66.42 63.37 62.95 97.27 100.00 100.00 100.00 62.82 99.79 67.03 66.06 65.47 98.05 leather 100.00 100.00 100.00 75.00 98.82 61.45 60.24 60.60 95.03 100.00 100.00 100.00 54.03 99.15 64.93 65.22 61.18 95.29 100.00 100.00 100.00 79.03 99.58 68.35 65.77 62.71 97.59 tile 100.00 100.00 100.00 89.74 99.74 97.24 91.17 78.77 96.83 100.00 100.00 100.00 88.89 99.68 97.20 91.18 77.40 97.55 100.00 100.00 100.00 89.74 99.67 96.83 90.96 78.12 96.85 zipper 100.00 100.00 100.00 93.38 98.98 78.32 73.71 49.33 92.63 99.92 99.98 99.58 86.09 99.11 78.57 73.58 36.93 95.05 100.00 100.00 100.00 93.38 99.52 83.11 77.39 59.67 96.95 wood 99.82 99.95 99.16 55.70 95.26 70.89 66.15 44.30 80.54 100.00 100.00 100.00 59.49 97.15 76.69 69.04 43.96 90.09 100.00 100.00 100.00 63.29 97.53 81.04 74.67 50.23 90.48 mean 98.73 99.22 97.61 68.81 97.07 67.01 65.52 54.14 90.73 98.60 98.86 97.86 67.14 97.65 66.95 64.51 49.56 91.25 99.30 99.60 98.39 75.45 98.09 75.08 70.90 59.26 93.86 TABLE XI COMPARISON UNDER THE ZERO-SHOT GENERATION SETTING WITH DRAEM ON VISA DATASETS. BOLD REPRESENT OPTIMAL RESULTS. Class DRAEM AnomalyAny DPA I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO I-AUROC I-AP I-F1 ACC P-AUROC P-AP P-F1 IOU PRO candle 95.23 96.19 90.43 53.50 95.95 32.44 38.60 61.34 89.06 96.15 96.49 89.55 50.50 96.95 18.77 27.76 52.42 89.16 97.01 97.53 92.86 63.50 99.38 35.49 39.71 56.88 91.19 capsules 96.57 97.75 93.75 54.37 98.60 34.15 41.55 45.62 87.33 95.15 97.21 91.92 62.50 99.56 44.16 52.35 52.19 95.11 98.05 98.78 96.00 62.50 99.81 56.95 65.87 58.29 94.46 cashew 92.78 96.07 91.08 69.33 92.15 22.43 26.37 12.49 77.37 95.42 97.65 93.20 38.00 98.27 44.89 48.21 32.49 82.07 98.90 99.42 97.56 94.67 95.08 24.69 25.15 29.34 85.70 chewinggum 98.62 99.41 96.48 68.00 98.61 35.59 48.17 58.03 79.56 95.24 97.89 91.19 48.67 98.32 37.94 45.47 45.84 75.81 98.92 99.50 96.97 69.33 99.25 39.55 50.20 67.46 79.14 fryum 92.28 96.52 89.95 45.33 94.20 38.08 40.96 48.76 77.14 95.96 97.70 93.33 36.67 98.93 62.46 64.53 42.37 81.96 98.66 99.33 96.52 58.00 94.99 40.09 45.10 53.57 91.19 macaroni1 98.77 98.71 96.52 51.50 99.46 23.10 26.60 75.32 92.60 97.80 97.66 92.38 51.50 99.80 11.78 24.73 59.17 94.41 99.55 99.53 97.54 50.50 99.96 23.08 32.44 66.52 96.63 macaroni2 99.50 99.50 96.62 50.00 99.95 12.50 20.12 71.08 97.16 95.77 96.49 89.36 50.00 98.29 9.12 22.85 67.87 91.80 99.23 99.29 95.61 50.00 99.93 14.89 24.06 59.26 97.24 pcb1 96.47 96.51 91.08 61.50 99.61 70.03 68.25 58.21 88.67 97.46 97.63 91.54 63.50 98.89 21.64 34.50 46.57 90.29 99.02 98.91 96.55 62.50 99.55 66.62 61.98 61.48 89.39 pcb2 99.33 99.32 97.03 60.00 98.37 7.68 16.43 57.53 73.79 98.38 98.31 94.58 74.00 98.26 23.36 30.62 44.58 82.65 99.40 99.40 96.62 61.50 98.46 14.25 21.56 60.43 82.13 pcb3 98.23 96.30 96.04 57.21 96.87 16.80 25.80 66.54 89.25 98.95 98.84 96.12 56.22 97.27 29.09 41.74 62.75 90.08 99.02 98.80 96.62 58.21 98.62 30.82 37.05 64.14 91.00 pcb4 98.80 95.61 97.46 70.65 98.74 43.25 47.91 61.60 93.18 99.55 99.52 97.09 62.69 98.83 34.18 39.38 57.84 93.54 98.51 95.34 96.48 83.08 98.95 45.18 52.06 62.78 92.76 pipe fryum 95.92 97.97 93.66 38.67 95.43 21.83 30.82 45.22 90.75 96.94 98.43 93.84 35.33 97.22 37.41 44.03 39.60 90.89 96.84 98.31 95.00 41.33 96.72 48.80 51.94 54.60 93.74 mean 96.88 97.49 94.18 56.67 97.33 29.82 35.96 55.14 86.32 96.63 97.50 92.52 52.47 98.50 32.06 40.15 49.36 88.48 98.59 98.68 96.19 62.93 98.39 36.70 42.26 57.90 90.38 [8] L. Fan, D. Fan, Z. Hu, Y. Ding, D. Di, K. Yi, M. Pagnucco, and Y. Song, “Manta: A large-scale multi-view and visual-text anomaly detection dataset for tiny objects,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 25 518–25 527. [9] Z. Liu, Y. Zhou, Y. Xu, and Z. Wang, “Simplenet: A simple network for image anomaly detection and localization,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2023, pp. 20 402–20 411. [10] J. Guo, S. Lu, W. Zhang, F. Chen, H. Li, and H. Liao, “Dinomaly: The less is more philosophy in multi-class unsupervised anomaly detection,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 20 405–20 415. [11] W. Luo, Y. Cao, H. Yao, X. Zhang, J. Lou, Y. Cheng, W. Shen, and W. Yu, “Exploring intrinsic normal prototypes within a single image for universal anomaly detection,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 9974–9983. [12] H. Sun, Y. Cao, H. Dong, and O. Fink, “Unseen visual anomaly generation,” in Proceedings of the Computer Vision and Pattern Recognition Conference, 2025, pp. 25 508–25 517.