acceptodds
Under review as a conference paper at ICLR 2027

AnomalyEditor: Few-Shot Mask-Free Image Editing for High-Fidelity Anomaly Synthesis

Abstract

Realistic anomaly image synthesis can alleviate the scarcity of labeled anomaly data in industrial visual inspection. Existing reference-based methods require explicit anomaly masks, while global synthesis methods can compromise normal-region fidelity. Mask-free image editing offers a promising alternative, but its supervised adaptation requires spatially aligned normal–anomaly pairs, which are rarely available. We observe that such pairs can be constructed more readily in reverse. Adding an anomaly (forward: normalanomaly) requires learning anomalous appearance from scarce examples, whereas removing an anomaly (reverse: anomalynormal) can be formulated as inpainting guided by a normal prior learned from abundant normal images. Based on this observation, we propose AnomalyEditor, a few-shot reverse-to-forward framework for mask-free anomaly editing. Specifically, we first remove annotated anomalies from real images with an inpainter fine-tuned on normal images, then use the resulting aligned pairs to fine-tune a pretrained editor to add them back, guided by text instructions. As a result, AnomalyEditor learns from real anomalies how to add a specified anomaly type to an unseen normal image. During inference, AnomalyEditor generates a realistic anomaly without an input mask while leaving normal regions intact. Additionally, we introduce a spatial anomaly-attentive loss to strengthen supervision on small anomalies and severe-diverse anomaly generation to generate diverse anomalies of varying severity. Experiments on MVTec-AD, VisA, and MVTec-3D demonstrate improved Kernel Inception Distance and higher downstream anomaly classification accuracy than the evaluated synthesis baselines, alongside competitive detection and localization performance.

Primary area:
applications to computer vision, audio, language, and other modalities
Keywords:
anomaly image generation, anomaly classification, anomaly inspection, image editing

Reviews

Among:
Shape:
1234this paper, Top 15%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.00 over 3 reviews, above 85% of the others.
Reviewer_yCnZOpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
1
Presentation
3
Soundness
3
Read review
Paper summary

This paper presents AnomalyEditor, a framework for generating synthetic industrial anomalies using instruction-guided image editing. The approach addresses the lack of spatially aligned normal–anomalous image pairs required to fine-tune existing image editors. To construct such pairs, the authors use a pretrained inpainting model, fine-tuned on normal images, to remove annotated anomalies from real anomalous samples. The resulting pseudo-normal images are paired with the original anomalous images to fine-tune an instruction-guided editor. The framework additionally employs a spatially weighted training loss, randomized guidance scales to diversify anomaly severity, and a filtering procedure to reject unsuccessful edits.

Experiments on MVTec-AD, VisA, and MVTec-3D demonstrate improvements in image-generation quality and downstream defect classification, alongside competitive anomaly detection and localization performance.

Critical strengths
  • The paper addresses a practically relevant problem: generating realistic anomalous images from limited annotated examples.

  • The proposed pipeline is coherent and combines existing techniques in a sensible way.

  • The experimental evaluation covers three established industrial inspection benchmarks and reports substantial improvements in downstream defect classification.

  • The ablation studies provide evidence that constructing aligned training pairs is beneficial compared with directly fine-tuning the editor on unaligned examples.

Critical weaknesses

1. Limited methodological novelty

My main concern is the limited methodological contribution. The proposed framework primarily combines established techniques into an anomaly-generation pipeline.

The central reverse-to-forward procedure uses an existing inpainting model to remove annotated anomalies, thereby constructing the aligned image pairs required to fine-tune an existing instruction-guided editor. While this is a practical solution, using inpainting to reconstruct missing normal regions is a standard application of inpainting models. The methodological novelty of this pair-construction strategy is therefore limited.

The remaining components are also relatively straightforward adaptations of existing techniques:

  • The spatial anomaly-attentive loss is essentially a spatially reweighted version of the standard rectified-flow training objective, with anomaly-region weights normalized by their relative area.
  • Severity-diverse generation uses standard classifier-free guidance with randomly sampled guidance scales.
  • Edit region-aware sampling applies a heuristic filtering procedure to reject unsuccessful generations.

Although these components improve empirical performance, their combination does not appear to introduce a substantially new learning or generation mechanism.

2. Positioning

The terminology used throughout the paper is potentially misleading. Already in the introduction, the authors present anomaly detection and anomaly classification as two closely related tasks, without clearly distinguishing their underlying learning problems. In particular, the term "anomaly synthesis" suggests the generation of deviations from normality, whereas the proposed method, although useful, learns to generate examples of known, annotated defect types. Its primary application is therefore data augmentation for supervised defect classification, which is fundamentally different from anomaly detection, where the anomalies to be detected are not known in advance. This distinction is important because the terminology may create expectations about the scope and capabilities of the method that are not supported by the actual setup.

Questions for authors

see weaknesses

3 comments
AuthorsOpenReview ↗

Response to Reviewer yCnZ (1/2)

Dear Reviewer yCnZ, Thank you for your thoughtful review and for recognizing the practical relevance, coherent framework and downstream improvements. We clarify below the methodological contribution of reverse-to-forward training and the supervision assumptions underlying our evaluation.

\newline

W1-1) Novelty of reverse-to-forward training

Our contribution is a reverse-to-forward learning formulation for few-shot, mask-free anomaly synthesis from unpaired inspection data, and not inpainting in isolation. While the inpainter itself is a standard tool, our claim concerns the supervision structure it enables. The formulation exploits an asymmetry in the available supervision: normal reconstruction can be learned from abundant normal images whereas anomaly appearance must be learned from scarce examples. We therefore construct the missing normal counterparts while retaining the original anomaly images as real editing targets. These aligned pairs enable the forward editor to learn anomaly appearance and image-dependent placement without matched normal-anomaly observations. Masks provide training supervision but do not prescribe the edit region on new normal references.

This addresses the limitations motivating our work: the evaluated mask-conditioned methods require a target region, while global-generation methods synthesize the entire image without conditioning on a normal reference. AnomalyEditor instead learns localized, reference-conditioned edits from real anomaly targets, with reverse construction supplying the otherwise unavailable supervision.

Related removal-based supervision appears in Paint by Inpaint (Wasserman et al., 2025) and ObjectDrop (Winter et al., 2024) for natural-object editing. Our setting differs in that it is few-shot anomaly editing and requires no additional large editing corpus. UniDG (Fan et al., 2026) learns from a large anomaly-editing corpus and uses an explicit target mask in its Anomaly-Context Editing formulation. We will sharpen these distinctions in the related work discussion.

The formulation, rather than the backbone, is the main source of the gain. With the same pretrained forward editor, reverse-to-forward training improves classification accuracy from 58.34% to 81.34% over forward-only fine-tuning (Table 5(a), page 9). With an SD v1.5-based implementation, it achieves 74.5%, exceeding the strongest evaluated SD v1.5-based baseline at 71.3%. Together, these results substantiate effective mask-free editing under scarce anomaly supervision beyond simply choosing a stronger backbone.

\newline

W1-2) Role of the additional components

The additional components address specific difficulties in learning and sampling few-shot anomaly edits, complementing the supervision construction:

  • Small-defect supervision: The spatial anomaly-attentive loss uses inverse-area weighting while retaining normal-region supervision. Removing it reduces classification accuracy from 81.34% to 78.69%.

  • Severity coverage: Guidance contrasts an anomaly instruction with an identity-preserving instruction on the same normal reference. Sampling its strength diversifies the edits; replacing this with the default fixed setting reduces accuracy to 76.80%.

  • Non-edit label noise: Edit region-aware sampling identifies potential failed edits and re-edits the reference, reducing the inclusion of unchanged images labelled as defective. Removing it reduces accuracy to 76.66%.

These components build on established weighting, guidance and filtering principles. Their contribution lies in addressing the identified failure modes within the framework, supported by ablations. We will clarify this hierarchy while retaining reverse-to-forward supervision for few-shot mask-free editing as the central methodological contribution.

AuthorsOpenReview ↗

Response to Reviewer yCnZ (2/2)

W2) Terminology, scope and industrial relevance

AnomalyEditor is a synthesis framework evaluated through defect-type classification and supervised detection/localization, and we think its demonstrated utility is not limited to classification augmentation. Nevertheless, we agree that these tasks and their supervision assumptions should be distinguished more explicitly.

Our main comparisons follow the example-supported setting of the evaluated few-shot synthesis methods (Hu et al., 2024; Rao et al., 2026; Jin et al., 2025): examples of each target anomaly type are available during adaptation or as generation references. Generated examples then train downstream inspection models, which are evaluated on held-out real images. Although the downstream training examples are synthetic, the overall pipeline uses annotated real defects and is therefore not a normal-only approach to detecting unknown anomaly types.

This setting is particularly relevant when a new product variant is introduced (which occurs quite frequently in practice) or an existing design is updated and only a few anomaly examples are available for that product. Anomaly type such as scratches or cracks may already be known, while their appearance and placement on the target product require new examples. Normal product images may be available before enough abnormal examples have been collected. Few-shot synthesis addresses this practical data shortage by expanding the available abnormal examples for supervised inspection. AnomalyEditor directly addresses this imbalance: normal images support restoration learning, while scarce real anomalies remain the editing targets.

We will make these assumptions explicit in the abstract and introduction, distinguish defect-type classification and supervised detection/localization from normal-only anomaly detection, and label Tables 3 and 4 (page 8) accordingly. We will also clarify that the main benchmark split holds out images rather than defect types.

We hope these revisions clarify the evaluation boundary while preserving the central contribution: learning useful, mask-free anomaly editing from scarce annotated examples for multiple supervised inspection tasks.

Thank you for promptly reviewing our rebuttal and for raising the score. We appreciate the time and care you have devoted to the review process. Your feedback has helped us clarify our presentation. If there are any further questions or points that would benefit from further clarification, please let us know, and we will be happy to address them.

Reviewer_XC14OpenReview ↗
Rating
3
Confidence
4
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

In this paper, AnomalyEditor is proposed, which is a few-shot framework for learning mask-free anomaly synthesis through reverse-to-forward training. AnomalyEditor is based on tow-phase, first the reverse stage removes annotated anomalies from real images to obtain paired pseudo-normal samples. Then, the forward stage fine-tunes a pretrained editor to add anomalous regions back with the original anomalous images as targets, guided by text instructions. As a result, AnomalyEditor learns from real anomalies how to add a specified anomaly type to an unseen normal image. Additionally, the authors further introduce a spatial anomaly-attentive loss to strengthen supervision on small anomalies. The intuitive visualization results show that the anomalies generated by this method are indeed very realistic.

Critical strengths
  1. The idea of this paper is good, as directly generating anomalies from normal requires highly aligned normal-anomaly pairs, but such paired data does not actually exist. However, this paper ingeniously constructs normal-anomaly pairs for training the anomaly generation model by first inpainting anomalies as normal through a reverse process, thus resulting in the excellent performance of AnomalyEditor.

  2. The whole framework is simple and easy to understand, and the key advantage is that the generation effect is excellent. Compared to previous methods, the generated anomalies are significantly more realistic. Another advantage is that the generation is mask-free, meaning there is no need to preset an anomaly mask in advance when generating anomalies, which greatly facilitates the anomaly generation process.

Critical weaknesses
  1. Mask-free is an advantage of the method, but it may also pose problems. Without an anomaly mask, how can the shape, size, and position of the generated anomalies be controlled? The generation is based on the text prompt "add [anomaly] to <object>", which only controls the type of anomalies generated. Will this result in anomalies that are relatively consistent? Or will the randomness of the model mean that even with the same text prompt, anomalies with different shapes and positions will be generated.

  2. Since AnomalyEditor requires training on abnormal samples, a crucial issue is whether the trained model can only generate anomalies it has learned, or whether it can be used to generate abnormal patterns different from those during training? For instance, if it is only trained on cracks, can it generate anomalies such as scratches and breaks? It would be beneficial to provide some experiments to discuss this capability.

  3. Another crucial question is whether the model is trained on a specific type of anomaly, a specific category of products, or a dataset. This is crucial for determining the actual training cost.

  4. In Table 1, why does AnomalyEditor consistently perform worse than DualAnoDiff on the IC-L metric?

  5. When comparing with other methods, it is important to compare the base generation model used and the corresponding parameters of the model. The better generation performance achieved by AnomalyEditor is likely due to the use of a superior generation model. Flux, which is used by AnomalyEditor, is a relatively powerful generation model that was not previously employed in previous methods.

  6. In line 440, when conducting anomaly detection tests, it is completely unclear which basic model was used, nor how it was configured during training. Are only the normal samples and generated abnormal samples used to train the anomaly detection model? How many abnormal samples were used under each category? Are the different methods consistent in terms of training data? These are all unclear. You need to provide more details.

Questions for authors

The questions have been written in the Weaknesses part.

7 comments
AuthorsOpenReview ↗

Response to Reviewer XC14 (1/4)

Dear Reviewer XC14, The authors sincerely appreciate your positive assessment and your detailed questions on controllability, unseen anomaly types, training cost, diversity metrics, backbone fairness and the detection protocol. Your comments helped the authors state the scope and protocol of AnomalyEditor precisely and add controlled comparisons. We are also thankful for your acknowledgement of the strengths of this work: an ingenious construction of normal-anomaly pairs, generated anomalies that are significantly more realistic than previous methods, and mask-free generation that greatly facilitates the generation process! We address your concerns and questions in the threads below.

W1) Controllability of the generated anomalies

Mask-conditioned methods may offer more direct control over anomaly shape and position through an input mask, but require that mask to be appropriate for both the defect type and the reference image. Automatically generated masks can be misaligned with the object, as illustrated in Fig. 1 A-(a) and Fig. 5 (pages 2 and 7). Instead, AnomalyEditor infers the edit region from the reference image and instruction.

AnomalyEditor also allows users to adjust anomaly size and severity through the scalar parameter λ\lambda in severity-diverse anomaly generation (Sec. 4.3, page 6). This parameter controls the strength of the anomaly-inducing guidance: Fig. 4 and Fig. 8 (pages 5 and 30) illustrates that increasing λ\lambda produces more pronounced and spatially larger anomalies. It therefore provides coarse control over anomaly extent and severity without prescribing an exact contour or location.

Although users do not specify the exact shape and position, the forward editor learns how defects relate to the object from the aligned pseudo normal-anomaly pairs constructed by reverse-to-forward training. At inference, conditioning on the normal reference allows anomaly placement and shape to adapt to the object’s geometry and pose (Figs. 1 and 5, pages 2 and 7). Annotated anomaly masks are used during training, but no additional per-sample mask annotation or target-mask generation is required at inference.

Regarding randomness, the text prompt specifies an anomaly type rather than a unique instance. Across random seeds, generated anomalies vary in shape, size and position while retaining the visual characteristics of the specified type (Fig. 11, page 33). Additionally, Fig. 9 (page 31) compares generated samples with real training examples, illustrating variation beyond individual examples. Comparing all the real training images and generated images of each anomaly type (Fig 9(a), page 31), we observe that the generated defects are not only different from the training data but appear in diverse shapes and positions. Thus, λ\lambda, the normal reference and the random seed provide complementary ways to diversify the generated training data.

We will clarify these capabilities and the distinction from explicit mask-level spatial control in the revised manuscript.

AuthorsOpenReview ↗

Response to Reviewer XC14 (2/4)

W2) Generation of unseen anomaly types

In few-shot anomaly generation (Hu et al., 2024; Gui et al., 2024; Rao et al., 2026; Jin et al., 2025; Dai et al., 2025), a few real examples of each given anomaly type are used to synthesize more instances of that type (Hu et al., 2024). These instances train supervised inspection models, which are tested on held-out real anomalies of the same types. (This setting serves, e.g. anomaly type classification, which needs labeled examples of every known type). Our main comparisons follow this setting, consistent with all five compared synthesis baselines: AnomalyDiffusion, AnoGen, DualAnoDiff and SeaS learn from real anomaly examples, while O2MAG is training-free but uses a real anomaly reference at generation time. In all cases, examples of the target anomaly type are provided, either for adaptation or as generation references.

Nevertheless, as suggested, we investigated generalization beyond generating new instances of observed types. We evaluated two settings involving unseen anomaly types and a third involving a familiar anomaly type on an unseen object category:

  1. Cross-type: An editor trained on anomaly type A is prompted to generate type B, such as crack → scratch.
  2. Leave-one-type-out: A category-level editor is trained on all anomaly types except one and then prompted to generate the held-out type.
  3. Cross-category: An editor fine-tuned only on anomaly type b from object category A is applied to a normal reference from category B, which was excluded from its anomaly-specific fine-tuning. No further fine-tuning is performed. The anomaly description remains unchanged, while the object name in the prompt is replaced with B.

In settings 1 and 2, the generated anomalies did not faithfully reproduce the requested unseen types (Fig. 12, page 34). We therefore acknowledge that the current framework does not reliably support unseen-type generation, which is distinct from generating varied instances of a learned type.

In setting 3, the target object categories were entirely excluded from fine-tuning: the model saw neither their normal images nor any of their anomalies. At inference, the new category was specified only through a text prompt and a single normal image. Even so, the generated defects appear plausible on these unseen objects and retain the visual characteristics of the trained anomaly types (Fig. 13, page 34).

This suggests that a learned anomaly type can, to some extent, generalize across object categories. We see this as practically relevant: in industrial production, the possible defect types are often determined by the manufacturing process (e.g., scratches or cracks that recur across products on the same line). An editor trained on such defects of one product could therefore be applied to new products with the same defect types without additional training data. An editor trained on such defects of one product could therefore be applied to new products with the same defect types without additional training data although this would require further quantitative validation.

We will make the distinction between new anomaly instances and unseen anomaly types explicit in the manuscript and add these findings to the Limitations section. Extending reverse-to-forward training to unseen types while retaining type fidelity and downstream utility is a promising direction for future work.

AuthorsOpenReview ↗

Response to Reviewer XC14 (3/4)

W3) Training scope and cost

AnomalyEditor consists of two modules with different fine-tuning scopes. The reverse editor, which generates pseudo-normal images, is fine-tuned once per product category (Appendix A.2, page 14). The forward editor is fine-tuned separately for each anomaly type using LoRA (Appendix A.3, page 14). The main benchmark results use this per-anomaly type forward-editor setting.

We additionally evaluate per-product category fine-tuning, where a single forward editor covers all anomaly types within a product category. As shown in Table R2, this setting achieves 76.73% classification accuracy on MVTec-AD, which is 4.61 percentage points below the per-anomaly type setting but remains higher than all evaluated baselines. Since the total budget of 2,000 iterations is shared across anomaly types rather than allocated to each type separately, each type is exposed to fewer training updates than in the per-anomaly type setting, which may contribute to this drop.

The per-iteration computational cost is approximately the same in both settings, and the main difference is the total forward-training budget. For a product category with KK anomaly types, per-anomaly type fine-tuning requires KK forward editors, each trained for 2,000 iterations, whereas per-category fine-tuning uses one forward editor trained for 2,000 iterations across all types. The forward-stage optimization budget is therefore reduced by a factor of KK. For example, for tile, which has five anomaly types, it decreases from 10,000 to 2,000 iterations. (On MVTec-AD, where each category has 4.9 anomaly types on average (73 types over 15 categories), this reduces the forward-editor training cost accordingly.) The reverse-stage training remains unchanged because it is performed once per product category in both settings.

Finally, we think, the per-anomaly type setting also exhibits a practical advantage. When a new anomaly type is identified within an existing product category, a forward editor can be fine-tuned for that type using its annotated examples while reusing the category’s reverse editor. The existing type-specific forward editors remain unchanged, allowing the generator to be extended without retraining them.

Table R2. Comparison of classification accuracies (%) on MVTec-AD.

ModelAnoDiffAnoGenO2MAGDualAnoDiffSeaSOurs (per anomaly type)Ours (per category)
Accuracy (%)64.9056.9271.2768.5052.7381.3476.73

\newline

W4) Performance of IC-LPIPS

We acknowledge that AnomalyEditor obtains lower full-image IC-LPIPS than DualAnoDiff. As discussed in Appendix A.7 (page 15), however, full-image IC-LPIPS captures variation in normal regions and object structures as well as the anomalies themselves. Its difference between methods therefore does not necessarily reflect anomaly diversity alone. We assess it alongside local diversity, distributional fidelity and downstream utility rather than treating a higher score as sufficient evidence of better generation quality.

To examine defect variation more directly, we additionally compute anomaly-region IC-LPIPS on MVTec-AD. Each image is divided into an 8x8 grid, and only grid patches that overlap an anomaly mask are retained. Generated patches are then assigned to their nearest real anomaly patch, and IC-LPIPS is computed among generated patches within each cluster. As a complementary local-fidelity measure, we report anomaly-region KID, computed between defect-containing patches from generated images and real test anomalies: anomaly regions are selected in the same way as for anomaly-region IC-LPIPS.

Table R3 summarizes these results alongside downstream classification accuracy.

The IC-LPIPS gap between DualAnoDiff and AnomalyEditor is 0.08 for full images but only 0.02 for anomaly crops. Our local diversity score remains slightly lower than DualAnoDiff’s, but matches AnoGen and is close to O2MAG. Meanwhile, AnomalyEditor achieves the lowest average anomaly-region KID and highest classification accuracy among the evaluated methods. For example, AnoGen has the same local IC-LPIPS of 0.48 but a substantially higher local KID of 251.4 versus 65.2. Our thoughts are that these results support competitive local diversity together with improved fidelity and downstream utility.

Table R3. Full-image and anomaly-region diversity (IC-L), anomaly fidelity (KID), and downstream classification accuracy (%) on MVTec-AD.

MethodFull-image IC-L ↑Anomaly region IC-L ↑Anomaly region KID ↓Clf. Acc. (%) ↑
AnoDiff0.300.44250.8064.90
AnoGen0.310.48251.4056.92
O2MAG0.300.4972.571.27
DualAnoDiff0.360.50100.068.50
SeaS0.350.53116.652.73
Ours0.280.4865.281.34
Reviewer_AmTwOpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

AnomalyEditor is a few-shot framework for synthesizing industrial anomalies through reverse-to-forward image editing. It first fine-tunes an inpainter on normal images and uses annotated anomaly masks to remove defects from real anomalous images, producing spatially aligned pseudo-normal/anomaly pairs. These pairs are then used to adapt a pretrained mask-free editor with a spatial anomaly-attentive loss. At inference, the editor adds a requested anomaly to a normal image without an input mask; guidance-scale sampling varies anomaly severity, while feature-derived masks support rejection of failed edits and downstream localization. Experiments on MVTec-AD, VisA, and MVTec-3D report improved KID and anomaly-classification accuracy over the evaluated synthesis baselines, competitive detection/localization results, and ablations supporting the reverse-to-forward construction and proposed components.

Critical strengths
  1. The authors proposed a simple and consequential solution to the alignment bottleneck. Constructing aligned pairs by first removing real anomalies is well motivated: the forward editor retains real anomaly targets while avoiding the need to collect the same product in matched normal and defective states. The forward-only ablation indicates that this construction provides substantial benefit beyond the pretrained editor.

  2. The paper evaluates three datasets and reports generation, classification, detection, and localization results, together with component, backbone, computational-cost, and baseline-reproduction analyses, providing broad downstream-oriented validation.

Critical weaknesses
  1. The validity of the reverse-generated training pairs is not directly established. Inpainting may leave boundary artifacts or other residual cues exactly aligned with the anomaly mask. The forward editor could partially learn to invert these artifacts rather than learn transferable anomaly placement and appearance. Moreover, full-image KID is dominated by unchanged normal regions and therefore structurally favors reference-preserving editors. Quantitative evaluation of pseudo-normal fidelity, residual leakage, and anomaly-region-specific realism is needed because the paper’s central mechanism and “high-fidelity” claim depend on this assumption.

  2. It is difficult to determine how much of the reported gain is robust versus split- or model-selection-dependent.

Questions for authors

What is the exact number of real anomaly training images for every class? Can you report mean and standard deviation over multiple random fixed-shot splits, ideally for 1-, 3-, and 5-shot settings, and clarify whether checkpoint selection uses any held-out validation data?

5 comments
AuthorsOpenReview ↗

Response to Reviewer AmTw (1/2)

Dear Reviewer AmTw,

We sincerely appreciate your careful review and constructive comments. Thank you also for recognizing our approach to the alignment bottleneck and our downstream evaluation across three datasets. Your questions helped us evaluate AnomalyEditor’s central mechanism more directly. Figure, table, and section numbers refer to the accompanying revision. Table R1 appears in this response.

W1-1) Validity of the reverse-generated pairs

We first clarify which reference images the forward editor receives during training and generation. During training, we pair each inpainted pseudo-normal image with its original anomalous image. To generate data for downstream tasks, however, the forward editor takes real normal images, which have never been inpainted, as inputs. Therefore, its inputs do not contain any inpainting traces. Nevertheless, we further investigate the quality of the pseudo-normal images and generated abnormal images as detailed below.

To assess the quality of the pseudo-normal images, we used PatchCore (memory bank-based one-class classification AD algorithm) trained exclusively on real normal images that assigns high anomaly scores to patches far from all stored normal features. We compared PatchCore scores within the original anomaly mask before and after inpainting. For the normal reference, we applied the same mask to a separate real normal image of the same category. For the four categories in which orientation varies across images, we aligned the images to a common reference before applying the mask (Appendix B.5, page 18).

Across thresholds, PatchCore responds similarly to the restored pseudo-normal regions and the real normal controls (Appendix B.5, Fig. 7, page 18). At the threshold that detected 80% of the original anomaly pixels, PatchCore flagged 9.6% of pixels in the restored regions and 7.4% of masked pixels in the real normal images. This close agreement provides quantitative support for the fidelity of pseudo-normal images. The close-ups in Appendix C.1 (Fig. 10, page 32) also show that the restored texture blends naturally into its surroundings.

\newline

W1-2) Learning transferable anomaly placement and appearance

We examine transfer beyond the reverse-generated training pairs through spatial and visual comparisons of the generated anomalies. All samples in these analyses are generated from real normal images that have never been inpainted (rather than from the pseudo-normal training references).

For each generated mask, we compute its highest IoU with ground-truth masks of the same anomaly type separately for the training and test sets. For screw, metal nut, grid, and hazelnut, we use the alignment procedure described in Appendix B.5 (page 18) before computing mask IoU. This reduces the effect of object orientation when comparing anomaly locations. We average the nearest-neighbor IoUs within each anomaly type and then across types and categories. Across the 15 MVTec-AD categories, the mean best IoUs are 0.271 against training masks and 0.274 against (unseen) test masks (see Table R1). These scores demonstrate quantitatively that similar aggregate spatial overlap with training and test anomaly masks.

Table R1.

CategoryIoU with NN-train maskIoU with NN-test mask
bottle0.5320.564
cable0.3300.352
capsule0.3290.164
carpet0.1430.175
grid0.0150.032
hazelnut0.2020.281
leather0.0410.065
metal_nut0.4590.464
pill0.2740.292
screw0.3180.340
tile0.2310.274
toothbrush0.3850.277
transistor0.4340.419
wood0.1020.130
zipper0.2770.278
Average0.2710.274

For qualitative comparisons of appearance, Fig. 9(a) (Appendix C.2, page 31) compares generated samples with all real training images for each of five anomaly types. The generated anomalies retain the visual characteristics of their type while differing in appearance from individual training examples, providing complementary qualitative evidence of variation beyond those examples. We select the three generated images with the highest IoU as nearest neighbors of each anomaly type. As shown in Fig. 9(b) (Appendix C.2, page 31), even though these nearest neighbors are selected to have defects at similar locations, we observe their defects still largely differ in shape and size from those in the real images.

Above analyses complement the downstream evidence in Table 5(a) (page 9), where reverse-to-forward training improves MVTec-AD classification accuracy from 58.34% to 81.34% over forward-only training. Here, the classifier is trained exclusively on synthetic images generated from untouched real normal references and evaluated on held-out real anomalies. Together with the pseudo-normal fidelity analysis in W1-1 and the defect-containing-patch evaluation in W1-3, these results support useful anomaly synthesis that transfers beyond reconstructing the original training pairs.

AuthorsOpenReview ↗

Response to Reviewer AmTw (2/2)

W1-3) Full-image KID.

We agree that full-image KID may favor reference-preserving editors because normal regions typically occupy most of an anomaly image. Therefore, we compute anomaly-region KID to evaluate the quality of the anomaly region separately. Each image is divided into an 8×8 grid, and only grid patches that overlap an anomaly mask are retained. KID is then computed between the retained patches from generated images and those from real anomaly images in the test set.

AnomalyEditor achieves the lowest anomaly-region KID on average (65.2), compared with 72.5 for O2MAG, 100.0 for DualAnoDiff, 116.6 for SeaS, and over 250 for AnomalyDiffusion and AnoGen. This shows that the advantage of our method holds even when the evaluation focuses on patches containing anomalies. Table 10 (page 19) reports the per-category results discussed in Appendix B.7.

Anomaly-region KID on MVTec-AD (↓).

MethodAnoDiffAnoGenDualAnoDiffSeaSO2MAGOurs
Anomaly-region KID ↓250.8251.4100.0116.672.565.2

\newline

W2 & Q1-3) Training data, split sensitivity, and checkpoint selection.

We report the exact training counts for every anomaly type and the results of repeated fixed-shot experiments. We also clarify that checkpoint selection uses only training images. Tables 24–26 (pages 26–28) report the exact number of real training images per anomaly type for MVTec-AD, VisA, and MVTec-3D, respectively. We retrained and evaluated the same nine MVTec-AD categories in all settings.

The three standard runs used the full training split. For each fixed-shot run, we randomly sampled the specified number of images per anomaly type from that split and retrained the forward editor. We trained a classifier on the images generated in each run and evaluated it on the same real test set throughout. Accuracy averaged over the nine categories was 80.5 ± 0.6% under the standard protocol, 80.4 ± 0.7% at 5 shots, 79.0 ± 0.8% at 3 shots, and 71.2 ± 1.8% at 1-shot (mean ± standard deviation over three runs, Table 12 on page 21, Appendix B.8). At a given shot count, category-averaged accuracy varied little across draws. The 5- and 3-shot results stayed close to the originally reported performance. Moreover, the standard deviation across random draws was at most 0.8%p at 5- and 3-shot and 1.8%p even at 1-shot, indicating that our model is robust to the choice of real anomaly training images.

The standard protocol has no held-out validation set. After the first 500 iterations, we generate 10 images every 100 iterations and select the forward-editor checkpoint with the lowest KID against the real training images (Section 5 and Appendix A. 10, pages 7 and 17).

Classification accuracy (%) under different training-data settings. Mean ± standard deviation over three runs.

SettingStandard protocol5-shot3-shot1-shot
Accuracy (%)80.5 ± 0.680.4 ± 0.779.0 ± 0.871.2 ± 1.8

We hope our responses address your concerns about the validity of the reverse-built pairs, region-level evaluation and the robustness of the gains. If any question remains or we have overlooked something, please let us know, and we will respond promptly.

AuthorsOpenReview ↗

Brief summary of our responses

Dear Reviewer AmTw,

Thank you again for your thorough review. As the author-reviewer discussion period is nearing the end, we briefly summarize how our responses address your concerns:

  • Validity of the reverse-built pairs (W1-1): When generating data, the forward editor takes only real normal images, which have never been inpainted (Response W1-1). At the threshold that detects 80% of the original anomaly pixels, PatchCore flags 9.6% of pixels in the restored regions, close to 7.4% for the same masked regions in real normal images (Appendix B.5, Fig. 7, p. 18).
  • Transfer beyond the training pairs (W1-2): Generated anomaly masks show comparable overlap with unseen test masks and training masks (mean best IoU 0.274 vs. 0.271, Table R1 in Response W1-2), and reverse-to-forward training raises accuracy from 58.34% to 81.34% over forward-only training (Table 5(a), p. 9).
  • Region-level fidelity (W1-3): AnomalyEditor achieves the best anomaly-region KID among the evaluated methods (65.2, compared with 72.5 for the next-best method, O2MAG; lower is better) (Appendix B.7, Table 10, p. 19).
  • Robustness and protocol (W2, Q1–Q3): Across three runs on nine MVTec-AD categories, accuracy is 80.5 ± 0.6% under the standard protocol, 80.4 ± 0.7% at 5 shots, 79.0 ± 0.8% at 3 shots, and 71.2 ± 1.8% at 1 shot (Appendix B.8, Table 12, p. 21). The exact training counts are in Tables 24–26 (pp. 26–28), and checkpoint selection uses only training images (Sec. 5, p. 7; Appendix A.10, p. 17).

We would very much appreciate it if you could let us know whether these responses address your concerns. If any question remains, we would be glad to answer it before the discussion closes.

Thank you again for your time and consideration.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.