Two-Layer Convolutional Autoencoders Trained on Normal Data Provably Detect Unseen Anomalies

Yanbo Chen, Weiwei LiuICLR 2026

TL;DR

Reconstruction-based anomaly detection (RBAD) is a popular technique where models trained only on normal data naturally struggle to reconstruct anomalies. However, the theoretical reasons why this happens have remained elusive. This paper provides a rigorous mathematical foundation for RBAD by analyzing a two-layer convolutional autoencoder. It proves that the network's kernels get "absorbed" into the directions of normal features during training, acting as a filter that inherently fails to reconstruct unseen anomalous patterns.

The Challenge of Unseen Anomalies

In anomaly detection, obtaining negative samples (anomalies) during the training phase is notoriously difficult. To get around this, practitioners often use Reconstruction-Based Anomaly Detection (RBAD). The premise is simple: train a generative model (like an autoencoder) exclusively on normal data. When the model is fed an anomaly at inference time, it fails to reconstruct it accurately, yielding a high reconstruction error that flags the data as suspicious.

While RBAD is highly successful in practice, its theoretical underpinnings are limited. Why exactly are anomalies harder to reconstruct? How do the features learned from normal data behave during the reconstruction phase? This paper aims to demystify the training dynamics of RBAD, establishing a theoretical framework to explain how neural networks extract features and why they provably fail to reconstruct anomalies.

Demystifying RBAD: The "Cone Set" Intuition

The authors analyze a two-layer convolutional autoencoder trained via standard gradient descent (empirical risk minimization). To make the math tractable, they use a $P$-patch data model, characterizing images as arrays of $P$ patches, where each patch is a combination of a ground-truth feature and random noise.

The core methodological novelty is the introduction of the "cone set" intuition using tools from feature learning:

  • Cone Sets: The authors mathematically define a high-dimensional "cone" around each normal feature's direction.
  • Absorption: They prove that during random initialization, kernels fall into these cone sets. As training progresses, the cones effectively "sharpen." Kernels inside a cone grow faster along the feature's direction than any other direction, meaning they get permanently "absorbed" and align closely with the normal features.
Illustration of a kernel absorbed into a feature's cone set at convergence.
  • Max Pooling as a Filter: The network utilizes a smoothed ReLU activation and a max-pooling operation. During reconstruction, the aligned kernels produce strong signals for normal patches but weak signals for anomalous patches. The max-pooling operation filters out these weak signals, preventing the anomaly from being reconstructed.

Key Insights and Mechanisms

  • The Mechanics of Feature Extraction: The paper mathematically proves that neural networks learn features by trapping convolutional kernels in sharpening geometric cones. Once a kernel is absorbed by a feature's cone, it never escapes, eventually approximating the exact direction of that feature.
  • Why Anomalies Fail to Reconstruct: Because the kernels are strictly aligned with normal features, their mathematical convolution with random, non-semantic anomalous patches yields very small values. The network's max-pooling layer acts as a gatekeeper, dropping these weak signals and causing the reconstruction to fail.
Comparison of normal data, non-semantic anomalies, and semantic anomalies.
  • The Semantic Anomaly Blindspot: The theory elegantly explains a known empirical flaw of RBAD: it struggles to detect semantic anomalies (e.g., a different digit in MNIST) compared to non-semantic anomalies (e.g., random sensory noise). Because semantic anomalies share structural sub-features with normal data, the network still partially learns them, making their reconstruction errors deceptively low and harder to threshold.

Experimental Validation

The theoretical findings are backed by experiments on both synthesized and real-world datasets:

  • Theoretical Proof: The authors successfully prove that a two-layer convolutional autoencoder trained on normal data cannot accurately reconstruct non-semantic anomalies with high probability.
  • Empirical Validation: On custom-generated synthesized datasets (following the $P$-patch structure with controlled noise levels), experiments showed a clear, consistent gap in reconstruction loss between normal data and non-semantic anomalies across various over-parameterized network configurations.
  • Visual Proof of Cone Sets: Visualizations of kernels trained on MNIST and CIFAR-10 over 50 epochs show kernels locking onto distinct structural features early on and maintaining those shapes through convergence, directly supporting the claim that kernels are "absorbed" by feature cone sets.

Limitations and Future Work

To make the theoretical analysis feasible, the authors had to make a few structural simplifications. First, they assume that image patches are non-overlapping, whereas real-world convolutional networks process overlapping patches. Second, the max-pooling operation is simplified to calculate the maximum value across all patches globally, rather than locally.

While the authors argue these simplifications do not change the intrinsic quality of the problem, future work could look into relaxing these assumptions to better match practical CNN architectures, or extending this feature learning framework to analyze more complex generative models like diffusion models.

Summary updated

BibTeX
@inproceedings{chen2026two,
  author = {Yanbo Chen and Weiwei Liu},
  title = {{Two-Layer Convolutional Autoencoders Trained on Normal Data Provably Detect Unseen Anomalies}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=FnbGlnKbIU},
}
Figure