Source-linked AI summary
PyramidFlow: High-Resolution Defect Contrastive Localization using Pyramid Normalizing Flow
Jiarui Lei, Xiaobo Hu, Yue Wang, Dong Liu
TL;DR
Anomaly-based methods locate defects at low pixel-level resolution compared with reconstruction-based methods, usually 1/16th or even lower, limiting practical industrial applications. PyramidFlow performs latent template-based defect contrastive localization with pyramid normalizing flows and volume normalization, without requiring pre-trained models. PyramidFlow outperforms comparable algorithms without external priors and achieves state-of-the-art performance in complex scenarios, but falls short of state-of-the-art on unregistered categories while remaining competitive.
Problem
Anomaly-based methods locate defects at low pixel-level resolution compared with reconstruction-based methods, usually 1/16th or even lower, limiting practical industrial applications.
Source: §2.1 · p. 2Method
PyramidFlow performs latent template-based defect contrastive localization with pyramid normalizing flows and volume normalization, without requiring pre-trained models.
Source: §1 · p. 2Results
PyramidFlow outperforms comparable algorithms without external priors and achieves state-of-the-art performance in complex scenarios, but falls short of state-of-the-art on unregistered categories while remaining competitive.
Source: §5 · p. 8Takeaways & Limitations
PyramidFlow can be trained end-to-end from scratch for high-resolution defect localization.
Source: §5 · p. 8On unregistered categories, PyramidFlow falls short of state-of-the-art performance, though it remains competitive.
Source: §5 · p. 8
Abstract
from arXiv · showhide
During industrial processing, unforeseen defects may arise in products due to uncontrollable factors. Although unsupervised methods have been successful in defect localization, the usual use of pre-trained models results in low-resolution outputs, which damages visual performance. To address this issue, we propose PyramidFlow, the first fully normalizing flow method without pre-trained models that enables high-resolution defect localization. Specifically, we propose a latent template-based defect contrastive localization paradigm to reduce intra-class variance, as the pre-trained models do. In addition, PyramidFlow utilizes pyramid-like normalizing flows for multi-scale fusing and volume normalization to help generalization. Our comprehensive studies on MVTecAD demonstrate the proposed method outperforms the comparable algorithms that do not use external priors, even achieving state-of-the-art performance in more challenging BTAD scenarios.
1. Introduction
Industrial defects motivate automated inspection, but supervised methods need labeled defect samples and unsupervised approaches face a trade-off between reconstruction difficulty and low-resolution localization. PyramidFlow performs template-based contrast in latent space and uses pyramid flows and volume normalization for high-resolution localization and improved generalization.
Motivation and prior approaches
- Automated inspection is receiving increased research attention because large images and tiny defects challenge manual inspection, while supervised learning requires labeled datasets.The introduction also identifies insufficient negative samples and absent prior knowledge as challenges for supervised approaches.Source: §1 · p. 1
- Unsupervised reconstruction methods use reconstructed images for high-resolution contrast, but struggle to reconstruct complex details; pre-trained anomaly methods achieve high image-level performance while damaging pixel-level visual performance.Convolutional normalizing flows model probability distributions from pre-trained features.Source: §1 · p. 1
Contributions
- PyramidFlow extends image-space templates into latent space through normalizing flow, then contrasts latent deviations for high-resolution anomaly localization.The paper describes it as the first fully normalizing flow method without pre-trained models for this purpose.Source: §1 · pp. 1–2
- Latent template-based contrastive localization avoids the ill-posedness of image reconstruction and reduces intra-class variance.The method performs the contrast in latent space rather than image space.Source: §1 · p. 2
- PyramidFlow combines invertible pyramids and pyramid coupling blocks for multi-scale fusion, with volume normalization to improve generalization and enable high-resolution localization.The authors report that it outperforms comparable algorithms without external priors and achieves state-of-the-art performance in complex scenarios.Source: §1 · p. 2
2. Related Work
Prior defect-localization work includes supervised detection and segmentation, as well as unsupervised reconstruction and anomaly-based methods. PyramidFlow addresses limitations in localization resolution and pre-trained flow generalization with latent templates and volume normalization.
2.1. Deep learning-based Defect Localization
- Supervised object detection and semantic segmentation localize defects using annotated boxes or pixel-level masks, but require sufficient defective samples to learn representations.Segmentation is described as suited to complex scenarios with difficult-to-locate boundaries.Source: §2.1 · p. 2
- Unsupervised reconstruction methods contrast a reconstructed defect-free image with the input, but may not generalize to non-textural images because of ill-posedness and degeneracy.Anomaly-based methods instead estimate normality from pre-trained features.Source: §2.1 · p. 2
- Anomaly-based methods usually localize at 1/16th resolution or lower, limiting their practical industrial application; latent template-based contrastive localization is proposed to address this limitation.The paper describes the proposed paradigm as enabling more accurate results.Source: §2.1 · p. 2
2.2. Normalizing Flow
- Normalizing flows are invertible neural networks with bijective mappings and traceable Jacobi determinants; coupling blocks implement nonlinear mappings and calculate the determinants.The passage notes that redundant volume degrees of freedom can increase optimization complexity and may compromise anomaly-detection generalization.Source: §2.2 · p. 2
- Earlier anomaly-localization flows commonly use pre-trained backbones or encoders to address their focus on local rather than semantic correlations, but task-irrelevant external priors may limit generalization in unforeseen scenarios.The related-work discussion cites prior studies on local correlations and earlier methods and recent methods [27] using pre-trained models.Source: §2.2 · p. 2
- PyramidFlow uses volume normalization to preserve mappings that include task-relevant implicit priors, and also offers an option to use pre-trained models.The authors report observing that external priors from pre-trained models can improve generalization.Source: §2.2 · p. 2
3. Methodology
PyramidFlow decomposes and composes features across scales, then uses pyramid coupling and volume normalization to produce latent-space anomaly maps without pretrained encoders. Its training objective contrasts normal-sample latents, while localization compares latent features with their means.
3.1. Invertible Pyramid
- Invertible pyramid decomposition forms level-wise features by subtracting an upsampled coarser representation from a repeatedly downsampled feature, and pyramid composition provides its inverse.Together, decomposition and composition provide the multi-scale feature module used by PyramidFlow.Source: §3.1 · p. 3
3.2. Pyramid Coupling Block
- The pyramid coupling block fuses features across scales and linearly across channels, while CVN and SVN normalize parameters using channel- and spatial-dimension means, respectively.Volume normalization is proposed for volume-preserving mappings because the assumed base distribution can overlook implicit priors relevant to generalization.Source: §3.2 · p. 4, Figure 3 · p. 4
3.3. Pyramid Normalizing Flow
- PyramidFlow maps an image to features, decomposes them into pyramid levels, applies stacked pyramid coupling blocks, and composes the resulting features into latent variables.The architecture stacks blocks along both depth and pyramid layers.Source: §3.3 · pp. 4–5
- Training minimizes the Fourier transform of the composed difference between two normal samples’ latent variables, with the stated aim of emphasizing high-frequency content.The paper says this loss allows faster convergence.Source: §3.3 · p. 5
- For localization, PyramidFlow measures each latent pyramid’s deviation from its mean and composes anomalies across scales; latent means can also be used to recover an image template.The method uses 1×1 convolution rather than pretrained encoders to maintain an end-to-end, near-invertible flow.Source: §3.3 · p. 5
4. Experiment and Discussion
The experiments evaluate unsupervised localization on MVTecAD and BTAD using AUROC and AUPRO. The complexity analysis reports near depth-independent memory usage for the autoFlow implementation, and the volume-normalization study compares CVN and SVN across selected categories.
4. Experiment and Discussion
- Experiments cover 15 MVTecAD categories and three BTAD image types, using AUROC and AUPRO to evaluate anomaly detection and localization.The paper notes that AUROC may fail on small anomaly proportions, motivating the additional localization metric AUPRO.Source: §4 · p. 5
4.1. Complexity Analysis
- Auto-differentiation memory grows linearly with depth D, while autoFlow achieves approximately depth-independent memory usage, enabling training on devices below 4G.The complexity analysis fixes L = 8, image resolution at 256 × 256, and C = 24 while varying D.Source: Figure 5 · p. 5, §4.1 · pp. 5–6
4.2. Study on Volume Normalization
- The volume-normalization study compares CVN and SVN on representative categories without augmentation, using fixed pyramid layers, channels, and image size.The supplied passage identifies Pixel-AUROC and AUPRO as the table metrics but does not give their values.Source: §4.2 · p. 6
CVN SVN
The section examines normalization choices and component ablations, reports benchmark performance, and describes the method’s performance on unregistered categories.
CVN SVN
- CVN outperforms SVN on the first three classes, while SVN performs better on the others; SVN’s larger receptive fields suit broad texture defects, whereas CVN’s channel shuffling supports accurate localization.SVN-superior classes are commonly textures and CVN-superior classes are objects.Source: CVN SVN · p. 6, Figure 6 · p. 6
4.3. Ablation Study
- Ablations show that removing volume normalization causes the largest average degradation, latent templates particularly help object classes, multi-scale differences matter more for textures, and Fourier loss adds improvement.Experiments I–III are described as critical, while experiment IV provides further improvement.Source: §4.3 · pp. 6–7
4.4. Anomaly Localization
- On MVTecAD, FNF outperforms comparable methods without external priors and exceeds S-T, SPADE, and CS-Flow; on BTAD, PyramidFlow achieves state-of-the-art performance.Table 3 reports Pixel-AUROC% and AUPRO%; the BTAD experiments use no data augmentation.Source: Table 3 · p. 7, §4.4 · p. 7, Figure 7 · p. 8
4.5. Study on unregistered categories
- On unregistered categories, ResNet18-based PyramidFlow remains competitive but below state of the art; SPADE performs better, while AE-SSIM’s average AUPRO% decreases.The study covers categories such as grid, metal nut, screw, and hazelnut without registration.Source: §4.5 · p. 8, Table 5 · p. 8
5. Conclusion
PyramidFlow is a fully normalizing-flow method for high-resolution defect contrastive localization, trained end-to-end from scratch. It outperforms comparable methods without external priors, reaches state-of-the-art performance in complex scenarios, and remains competitive but below state of the art on unregistered categories.
5. Conclusion
- PyramidFlow combines latent-template contrastive localization, pyramid-like normalizing flows, and volume normalization for high-resolution defect localization.The method can be trained end-to-end from scratch.Source: §5 · p. 8
Supplementary Material for PyramidFlow: High-Resolution Defect Contrastive Localization using Pyramid
The supplied passage identifies the supplementary material’s arXiv version and date.
- The supplementary material is identified as arXiv:2303.02595v1, dated 5 March 2023.Source: Supplementary Material for… · p. 11
1. Implementation Details
The implementation details specify the training configuration and describe the model architecture’s pyramid operations and volume normalization.
1.1. Experimental Settings
- The baseline uses 256 × 256 images, batch size 2, Adam at learning rate 2 × 10^-4, and gradient clipping at 1.0; the pre-trained variant uses ImageNet-pretrained ResNet18.Experiments ran in Python 3.8 and PyTorch 1.10 on NVIDIA GTX3060 GPUs.Source: §1.1 · p. 11
1.2. Model Architecture
- The invertible pyramid downsamples with Gaussian filtering then nearest-neighbor interpolation, while upsampling reverses that order; volume normalization includes spatial and channel variants.Pyramid coupling blocks use AffineParamBlock, VolumeNorm2d, and InvConv.Source: §1.2 · p. 11
2. More Experiment Results
The additional experiments report visual comparisons across MVTecAD and BTAD, alongside category-dependent ablation effects. PyramidFlow has the strongest reported visual performance on MVTecAD and more accurately localizes BTAD defects than the compared methods.
2.1. Detailed Ablation Results
- Ablations usually reduce performance on textural categories except carpet, while object-category results are more affected by volume normalization and latent templates than by pyramid differences.The authors attribute the category variation to inductive biases and note that multi-scale is not critical for object defect detection.Source: §2.1 · p. 11, Table S1 · p. 12, Table S2 · p. 13
- The Dual Coupling Block resizes and concatenates neighboring scales to derive affine parameters for x1, then outputs unchanged x0 and x2 alongside transformed x1.The pseudocode applies an invertible convolution to the transformed x1.Source: §2.1 · p. 12
2.2. More Visualization Results
- PyramidFlow achieves the best visual performance across all MVTecAD categories.The comparison includes AE-SSIM, SPADE, PaDiM, PyramidFlow, and ground truths.Source: Figure S1 · p. 13, §2.1 · p. 14
- AE-SSIM performs better on simple bottle and zipper images but struggles with patterned carpet and high-frequency-noise pill defects; its template-based processing preserves resolution and details.These visualizations contrast simple and complex cases.Source: §2.1 · p. 13
- On BTAD, PyramidFlow preserves category 01 details and mostly captures defect shapes in categories 02–03, whereas SPADE and PaDiM overshoot or vary from ground truth.The cited comparison covers the three BTAD categories shown in the last columns of Figure S2.Source: Figure S2 · p. 14, §2.1 · p. 14