Skip to content

title: >- [Paper Note] UniScale: Arbitrary-Scale Anomaly Generation description: >- [ECCV2026][Image Generation][Industrial Anomaly Detection] UniScale introduces Error-Suppressed Multi-Scale Training (EMT) and Generation-then-Fusion Denoising (GFD) to overcome severe latent downsampling degradation, achieving high-fidelity anomaly generation across arbitrary scales. tags: - ECCV2026 - Image Generation - Industrial Anomaly Detection - Diffusion Models - Multi-Scale Learning date: 2026-09-19 content_hash: 1959de9a0e5c32f3

UniScale: Arbitrary-Scale Anomaly Generation

Conference: ECCV 2026
Paper: ECCV Official
Code: https://github.com/HUST-SLOW/UniScale
Area: Image Generation
Keywords: Industrial Anomaly Generation, Small-Scale Anomalies, Diffusion Models, Multi-Scale Training, Generation-then-Fusion Denoising

TL;DR

Addressing the severe information loss of fine-grained defect details in diffusion latent space caused by compounded spatial downsampling, UniScale proposes an Error-Suppressed Multi-Scale Training (EMT) strategy alongside Generation-then-Fusion Denoising (GFD), enabling high-fidelity industrial anomaly synthesis across arbitrary scales while preserving critical location-aware semantics.

Background & Motivation

In modern industrial manufacturing, visual surface defect inspection is vital for ensuring manufacturing quality. However, anomalous samples are inherently scarce in real-world environments, making the acquisition and dense annotation of diverse anomaly patterns prohibitively expensive and time-consuming. While recent generative diffusion paradigms—such as AnomalyDiffusion, SeaS, and DualAnoDiff—have shown promise in synthesizing synthetic defects, they consistently struggle or fail when dealing with small-scale anomalies (defined as smaller than \(32 \times 32\) pixels at standard \(512 \times 512\) resolution). This limitation poses a substantial hurdle, as empirical statistics reveal that small-scale defects are predominant in industrial domains, accounting for 56.33% of all anomaly instances in benchmark datasets like VisA.

The root cause of this failure lies in the extreme spatial downsampling inherent to standard latent diffusion architectures. An input image is first downsampled by an \(8\times\) spatial compression factor via the VAE encoder, and subsequent cross-attention mechanisms responsible for text-image semantic binding operate most effectively at low-resolution bottlenecks (e.g., \(16 \times 16\)), culminating in an effective \(32\times\) downsampling factor. For small-scale defects, high-frequency textural cues are almost entirely erased or severely corrupted in latent representations. Consequently, generative models fine-tuned solely on full-resolution images cannot capture distinctive defect patterns, resulting in blurry, textureless artifacts or complete generation omission during inference.

While isolated cropping and magnification might intuitively seem like a solution, naively training on cropped patches severs the spatial topological relationship between the defect and the surrounding product structure, while standard upsampling interpolation introduces noticeable synthetic distortion. The core idea of UniScale is to formulate a geometric progression of multi-scale crops that joint-optimizes micro-textures and macro location-aware context, enforces a cross-scale perceptual consistency loss to suppress upsampling-induced interpolation artifacts, and employs a Generation-then-Fusion Denoising pipeline to isolate fine defect generation before progressively fusing it back into full-resolution backgrounds.

Method

Overall Architecture

UniScale comprises two synergistic stages: the Error-Suppressed Multi-Scale Training (EMT) strategy for parameter optimization and the Generation-then-Fusion Denoising (GFD) pipeline for test-time synthesis. During training, a multi-scale cropping scheme generates a geometric pyramid ranging from the tightest defect bounding box (MiniSC) through intermediate fields of view (InterSC) up to the full-resolution view (MaxSC). Shared text embeddings are tuned via a Joint-Scale (JS) diffusion loss, while a Cross-Scale Perception (CSP) loss enforces perceptual feature consistency between adjacent scales to eliminate interpolation artifacts. At inference time, GFD first performs high-fidelity defect generation inside the tightest local crop via Blended Diffusion, and subsequently scales, pastes, and performs gentle alignment denoising progressively through larger context crops, preventing fine details from being overwhelmed by the dominant background.

%%{init: {'flowchart': {'rankSpacing': 24, 'nodeSpacing': 28, 'padding': 6, 'wrappingWidth': 400}, 'subGraphTitleMargin': {'top': 8, 'bottom': 16}}}%%
flowchart TD
    subgraph S1["Training Stage: Error-Suppressed Multi-Scale Training (EMT)"]
        direction TB
        A["Input Real Anomaly Image & Mask"] --> B["Multi-Scale Geometric Cropping (MSC)<br/>MaxSC / InterSC / MiniSC"]
        B --> C["Joint-Scale Diffusion Optimization (JS Loss)<br/>Optimize Shared Learnable Text Embedding e"]
        B --> D["Cross-Scale Perceptual Alignment (CSP Loss)<br/>Perceptual Feature Matching Across Scales"]
    end
    subgraph S2["Inference Stage: Generation-then-Fusion Denoising (GFD)"]
        direction TB
        E["Input Normal Image & Synthetic Mask"] --> F["Multi-Scale Crop Preparation<br/>Geometric Normal Pyramids"]
        F --> G["Minimum-Scale Anomaly Generation<br/>50-step Blended Diffusion Focused on Details"]
        G --> H["Progressive Anomaly Fusion<br/>Downsample-Paste + 10-step Alignment Denoising"]
        H --> I["Output Full-Resolution High-Fidelity Anomaly"]
    end
    S1 -.->|Trained Text Embedding e| S2

Key Designs

1. Multi-Scale Cropping (MSC): Harmonizing Macro Location Semantics and Micro Textures

Solely utilizing full-scale images (MaxSC) provides the global receptive field needed for the U-Net's attention mechanism to learn location-dependent appearances—such as breakage appearing dark when exposing background margins but whitish and chalky when located internally on the product body. However, MaxSC severely dilutes the gradients of small-scale anomalies. Conversely, training exclusively on tightly cropped defect patches (MiniSC) isolates fine texture details at the cost of erasing structural context, causing models to incorrectly generate edge-specific dark patterns right in the center of product surfaces. UniScale bridges this polarity by introducing Intermediate Scale Crops (InterSC). The process extracts the minimum square bounding box of length \(l_1\) around the connected anomaly mask as MiniSC, and iteratively expands the crop field centered on the defect's geometric center by \(l_i = l_{i-1} \times \alpha\) (with expansion factor \(\alpha=4\)) until spanning the full resolution \(S \times S\) (MaxSC). All crops are resized to \(S \times S\), yielding a multi-scale sequence \(\{(x_1^d, m_1^d), \dots, (x_n^d, m_n^d)\}\) that shares a single set of learnable text tokens \(e\). This geometric progression smoothly bridges local micro-textures and global macro-context.

2. Cross-Scale Perception (CSP) Loss: Suppressing Interpolation-Induced Artifacts

When diminutive anomaly patches are substantially upsampled to the standard training resolution \(S \times S\), bicubic interpolation unavoidably introduces artificial blurs, unnatural edge transitions, and spurious high frequencies. If unconstrained, the shared text embeddings overfit to these interpolation artifacts, deteriorating the perceptual fidelity of generated samples. To counteract this, UniScale incorporates the Cross-Scale Perception (CSP) loss. During the forward training pass, given the predicted noise \(\epsilon_\theta(z_{i,t}, t, e)\), the model computes the clean latent \(\hat{z}_{i,0}\), decodes it via the VAE decoder into predicted image \(\hat{x}_i^d\), and extracts a centered sub-crop \(\hat{x}_{i+1}^{cd}\) from the adjacent higher-scale reconstruction \(\hat{x}_{i+1}^d\) matching the spatial footprint of scale \(i\). A pre-trained perceptual feature extractor \(\mathcal{P}\) then enforces semantic alignment between the two:

\[ \mathcal{L}_{\text{CSP}} = \sum_{i=1}^{n-1} \mathcal{P}(m_i^d \odot \hat{x}_i^d, \; m_i^d \odot \hat{x}_{i+1}^{cd}) \]

Coupled with the Joint-Scale diffusion loss \(\mathcal{L}_{\text{JS}} = \sum_{i=1}^n m_i^d \odot \|\epsilon_i - \epsilon_\theta(z_{i,t}, t, e)\|_2^2\), the composite training objective is \(\mathcal{L} = \mathcal{L}_{\text{JS}} + \lambda \mathcal{L}_{\text{CSP}}\) (with \(\lambda = 0.001\)). The CSP loss penalizes scale-inconsistent interpolation distortions, compelling the learnable embeddings to anchor strictly on authentic anomaly textures.

3. Generation-then-Fusion Denoising (GFD): Decoupling Anomaly Construction from Background Fusion

Conventional inpainting techniques perform text-conditioned generation and background blending concurrently in a single denoising stage. Under global full-image denoising, cross-attention maps are overwhelmingly dominated by extensive background structures, causing tiny defect latents to be smoothed over and ignored. GFD addresses this by decoupling the process into two phases: In Phase 1 (Anomaly Generation), given a target normal image and a synthetic mask generated via Perlin noise, generation is initiated at the minimum scale \(i=1\). A full \(s=50\) steps of Blended Diffusion are executed on the magnified local crop \(x_1^g\), allowing the learned text embeddings to synthesize intricate, high-contrast defect textures \(\hat{x}_1\) in complete isolation from dominant background interference. In Phase 2 (Progressive Anomaly Fusion), for each subsequent scale \(i > 1\), the previous anomaly output \(\hat{x}_{i-1}\) and its mask \(m_{i-1}^g\) are downsampled by a factor of \(1/\alpha\) and directly pasted into the current crop \(x_i^g\) at the exact mask coordinate: \(x_i^g(m_i^g = 1) \leftarrow \hat{x}_{i-1}^{\downarrow}(m_{i-1}^{\downarrow} = 1)\). To eliminate boundary seams and lighting discontinuities caused by direct pasting, the blended image is mildly noised and subjected to an abbreviated \(s=10\) steps of alignment denoising via Blended Diffusion. This downsample-paste-fuse routine iterates up the pyramid until the full-resolution image \(\hat{x}_n\) is synthesized, ensuring crisp anomaly presentation seamlessly merged into the normal background.

Key Experimental Results

Main Results

Experiments were conducted on the benchmark VisA (12 complex industrial objects) and the challenging MVTec AD 2 (8 product categories, where ~50% of defects are small-scale). Evaluation covers generation fidelity and diversity (IS/IC-LPIPS across whole images, and IS(a)/IC-LPIPS(a) focused specifically on anomaly regions), as well as downstream supervision utility using a BiSeNetV2 segmentation network trained on 1,000 synthetic image-mask pairs per anomaly class.

Dataset Method IS ↑ IC-LPIPS ↑ Anomaly IS(a) ↑ Anomaly IC-L(a) ↑
VisA DFMGAN (AAAI'23) 1.25 0.25 1.38 0.05
VisA AnomalyDiffusion (AAAI'24) 1.26 0.25 1.33 0.04
VisA DualAnoDiff (CVPR'25) 1.26 0.25 1.80 0.06
VisA SeaS (ICCV'25) 1.27 0.26 1.81 0.06
VisA UniScale (Ours) 1.34 0.26 2.64 0.09
MVTec AD 2 DFMGAN (AAAI'23) 1.39 0.29 1.04 0.05
MVTec AD 2 AnomalyDiffusion (AAAI'24) 1.40 0.31 1.02 0.04
MVTec AD 2 DualAnoDiff (CVPR'25) 1.46 0.31 1.19 0.05
MVTec AD 2 SeaS (ICCV'25) 1.42 0.32 1.22 0.05
MVTec AD 2 UniScale (Ours) 1.60 0.33 1.68 0.06

In downstream anomaly segmentation, BiSeNetV2 trained with UniScale-generated samples achieved 30.15% pixel-level IoU on VisA (a +4.22% absolute improvement over SeaS's 25.93%). On the demanding MVTec AD 2 benchmark, UniScale reached 77.67% pixel-level AUROC (outperforming SeaS at 71.12% by +6.55%) and 16.06% pixel-level IoU (compared to 12.37% for SeaS).

Ablation Study

The ablation investigations conducted on VisA scrutinize individual architectural components, crop scale combinations, crop factor \(\alpha\), and denoising configurations.

Configuration / Variant IS(a) ↑ IC-L(a) ↑ Pixel AUROC (%) ↑ Pixel AP (%) ↑ Pixel IoU (%) ↑ Notes
(a) w/o EMT (Original resolution only) 1.84 0.05 93.72 30.76 19.04 Severe loss of small defect textures; lowest AP & IoU
(b) w/o CSP Loss (JS loss only) 2.01 0.05 97.22 31.98 27.07 Interpolation distortions degrade fine texture authenticity
(c) w/o GFD (Standard one-stage denoising) 2.08 0.05 96.03 33.62 27.97 Background attention dominates; small defects smoothed out
(d) Full UniScale Model 2.64 0.09 97.28 42.91 30.15 Optimal synergy across all generation and detection metrics
w/o MaxSC (No full-image scale) 2.58 0.07 96.03 33.62 27.97 Loss of macro location constraints; AP drops sharply
w/o MiniSC (No tightest defect crop) 2.04 0.05 96.43 35.21 28.72 Drastic drop in IS(a), confirming MiniSC drives fine texture
w/o InterSC (Only MaxSC & MiniSC) 2.18 0.05 93.48 34.17 29.97 Scale gap causes structural disconnection and lowest AUROC

In the crop expansion factor ablation, \(\alpha=4\) achieved the best trade-off between performance and GPU memory (20.86 GB), whereas \(\alpha=2\) consumed 24.61 GB with negligible gain, and \(\alpha=16\) suffered degraded IS(a) (2.34) due to abrupt scale transitions. In the GFD ablation, direct copy-paste without alignment denoising yielded an IoU of only 27.65% due to seam artifacts, while one-stage fusion at full scale failed to recover obscured fine details (34.28% AP).

Key Findings

  • Compounded downsampling is the fatal bottleneck for small-target synthesis: Text-guided cross-attention operating at \(16 \times 16\) resolutions fundamentally erases small-scale features; decoupling generation into local high-resolution construction followed by hierarchical fusion is an effective, generalizable remedy.
  • Intermediate scales act as an indispensable bridge: Merely combining global full images and isolated crops fails to correlate texture patterns with physical location; geometric intermediate crops are essential for continuous representation learning across attention layers.
  • Cross-scale perceptual consistency neutralizes interpolation distortion: While magnification is necessary to capture micro-details, bicubic interpolation artifacts can mislead generative tuning; the self-supervised CSP constraint successfully filters artificial blur and spurious frequencies.

Highlights & Insights

  • Decoupled Generation-then-Fusion Paradigm: By moving from single-stage inpainting to a two-phase protocol (50-step high-magnification generation followed by 10-step alignment fusion across pyramids), UniScale prevents small anomalies from being subsumed by background context.
  • Perceptual Error-Suppressed Tuning: Introducing CSP loss elegantly solves the long-standing dilemma where magnification enhances feature visibility but corrupts feature authenticity with interpolation noise.
  • Cross-Domain Transferability: The multi-scale geometric expansion and progressive denoising pipeline can be directly adapted to other small-target generative tasks, including tiny crack/defect generation in aerial infrastructure inspection and micro-lesion synthesis in medical imaging (e.g., early microcalcifications).

Limitations & Future Work

  • Author-Acknowledged Limitations: In scenes with multiple spatially dispersed, heterogeneous anomalies, the current bounding-box expansion must process separate crop hierarchies, linearly multiplying training time and GPU memory footprints.
  • Independent Observations: The method trains an individual generative model per product category and anomaly concept, lacking zero-shot cross-category transferability. Furthermore, the synthetic Perlin noise masks lack explicit geometric priors for ultra-fine structured defects like hairline fractures.
  • Future Directions: Integrating instance-level cross-attention controllers (e.g., MIGC) could allow parallel multi-instance crop conditioning; incorporating explicit structural edge guidance (e.g., ControlNet lineart) could further boost the geometric realism of thin scratch defects.
  • vs SeaS (ICCV 2025): SeaS uses separation and sharing fine-tuning to decouple foreground defects from background semantics, yet its full-resolution denoising still suffers from attention dominance on small defects. UniScale pinpoints this extreme downsampling issue, outperforming SeaS in anomaly fidelity (VisA IS(a) 2.64 vs 1.81) through its EMT and GFD strategies.
  • vs AnomalyDiffusion (AAAI 2024): AnomalyDiffusion decouples appearance features and positional priors, but fails on sub-\(32 \times 32\) defects in single-stage diffusion. UniScale demonstrates that geometric multi-scale pyramid training and perceptual consistency are mandatory to preserve fine textures in latent spaces.
  • vs Text2Traffic / SOEDiff (Small-Subject Editing): Prior small-subject diffusion methods combined magnified crops with full images but neglected interpolation distortions. UniScale is the first to introduce cross-scale perceptual consistency (CSP) to systematically neutralize interpolation artifacts.

Rating

  • Novelty: ⭐⭐⭐⭐☆ [Clearly identifies the compounded downsampling bottleneck in industrial defect synthesis; EMT and GFD are principled and highly effective]
  • Experimental Thoroughness: ⭐⭐⭐⭐⭐ [Extensive evaluations on VisA and MVTec AD 2 spanning generation metrics, diversity, and downstream detection gains with thorough ablations]
  • Writing Quality: ⭐⭐⭐⭐⭐ [Clear motivation, rigorous mathematical formulation, and well-structured comparative narrative]
  • Value: ⭐⭐⭐⭐⭐ [Solves a high-impact bottleneck in industrial automated optical inspection; code is open-sourced with remarkable downstream performance gains]