Can convolutional ResNets approximately preserve input distances? A frequency analysis perspective

Lewis Smith, Joost van Amersfoort, Haiwen Huang, Stephen J. Roberts, Yarin GalarXiv 2021 · arXiv

Abstract

Recent advancements in uncertainty quantification for deep learning rely on "distance-preserving" (bi-Lipschitz) residual networks (ResNets) to prevent feature collapse. However, standard architectures employing downsampling operations like strided convolutions or pooling mathematically cannot satisfy the bi-Lipschitz condition. This paper resolves this contradiction through a frequency analysis lens. We demonstrate that while global distance preservation is impossible, these networks effectively preserve distances within the low-frequency components of images. Our findings suggest that the empirical success of distance-aware models is due to the low-frequency dominance of natural images and a training process that naturally encourages low-frequency distance preservation.

Introduction

Reliable uncertainty estimation is vital for deploying deep learning in safety-critical applications. A prominent approach involves "distance-aware" neural networks, which aim to map inputs far from the training distribution to distant points in the latent space. To achieve this, researchers often apply spectral normalization to residual connections, theoretically bounding the network's Lipschitz constant to ensure bi-Lipschitz behavior.

Despite this, a fundamental topological issue persists: any mapping that reduces dimensionality—standard in image classification via downsampling—cannot be bi-Lipschitz. This paper investigates the mechanism behind the empirical success of these models, proposing that distance preservation occurs selectively in the frequency domain.

Methods

We analyze downsampling as a sequence of dense operations followed by decimation. According to the Nyquist-Shannon sampling theorem, decimation preserves low-frequency information while discarding or aliasing high frequencies. We further examine the ReLU nonlinearity, showing it functions as a convolution in the frequency domain.

Visualizing frequency components in image data.

By establishing mathematical bounds, we prove that if the difference between two inputs is dominated by low frequencies, residual blocks will preserve the distance between their low-pass filtered representations. To test the limits of this theory, we developed an adversarial search algorithm designed to find "feature collapse" pairs—images that are distant in pixel space but identical in the latent space.

Results and Analysis

Our empirical evaluation on MNIST, FashionMNIST, and CIFAR10 confirms our theoretical predictions. For models with a strict Lipschitz constant < 1, the low-frequency contraction condition held in 100% of tested cases. Interestingly, even models trained with looser constraints (Lipschitz constants between 3.0 and 9.0) exhibited a "convergence to compliance" during training, reaching 85-100% adherence to low-frequency distance preservation by the end of the optimization process.

2D Fourier transform illustrating the concentration of energy in low-frequency bands typical of natural images.

The "bi-Lipschitz myth" is thus clarified: while global distance preservation is impossible, the network preserves distances where it matters most. Since natural images concentrate most of their power in low frequencies, the information lost during downsampling is typically negligible for distance-aware tasks.

Conclusion

This work provides a frequency-domain explanation for the effectiveness of distance-aware ResNets. We show that while downsampling inherently prevents a network from being strictly bi-Lipschitz, the preservation of low-frequency components allows for approximate distance awareness in practice. However, our adversarial results indicate that high-frequency perturbations can still trigger feature collapse. Future research should explore architectural modifications, such as explicit low-pass filtering, to robustly enforce these properties without sacrificing classification performance.

Summary updated

Abstract

ResNets constrained to be bi-Lipschitz, that is, approximately distance preserving, have been a crucial component of recently proposed techniques for deterministic uncertainty quantification in neural models. We show that theoretical justifications for recent regularisation schemes trying to enforce such a constraint suffer from a crucial flaw -- the theoretical link between the regularisation scheme used and bi-Lipschitzness is only valid under conditions which do not hold in practice, rendering existing theory of limited use, despite the strong empirical performance of these models. We provide a theoretical explanation for the effectiveness of these regularisation schemes using a frequency analysis perspective, showing that under mild conditions these schemes will enforce a lower Lipschitz bound on the low-frequency projection of images. We then provide empirical evidence supporting our theoretical claims, and perform further experiments which demonstrate that our broader conclusions appear to hold when some of the mathematical assumptions of our proof are relaxed, corresponding to the setup used in prior work. In addition, we present a simple constructive algorithm to search for counter examples to the distance preservation condition, and discuss possible implications of our theory for future model design.
BibTeX
@misc{smith2021can,
  author = {Lewis Smith and Joost van Amersfoort and Haiwen Huang and Stephen J. Roberts and Yarin Gal},
  title = {{Can convolutional ResNets approximately preserve input distances? A frequency analysis perspective}},
  year = {2021},
  eprint = {2106.02469},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.02469},
}
Figure