Residual Networks as Nonlinear Systems: Stability Analysis using Linearization

Kai Rothauge, Zhewei Yao, Zixi Hu, Michael W. MahoneyarXiv 2019

Abstract

This paper investigates the internal stability of pre-trained Residual Networks (ResNets) by treating them as nonlinear dynamical systems. Through linearization and Singular Value Decomposition (SVD) of layer-wise Jacobians, we identify a characteristic "plateau" of singular values at unity, a direct consequence of the skip-connection architecture. Our analysis reveals that while ResNets maintain marginal stability across most layers, adversarial perturbations specifically exploit localized instabilities in the final stages of the network.

Introduction

Deep neural networks, particularly ResNets, have achieved state-of-the-art performance in computer vision. However, their internal dynamics remain poorly understood. Traditional stability analysis often focuses on the training phase; this study shifts the focus to the inference phase of pre-trained models. By viewing a ResNet as a discrete-time dynamical system, we can quantify how perturbations—whether random noise or adversarial attacks—propagate through the network's layers.

Methodology: Linearization and SVD

A ResNet can be described by the state equation $x_{k+1} = x_k + f(x_k, W_k)$, where $x_k$ is the input to the $k$-th residual unit. To analyze local stability, we linearize the system around a specific input image $x^*$ using the Jacobian matrix $J_k = \frac{\partial x_{k+1}}{\partial x_k} = I + \frac{\partial f}{\partial x_k}$.

The stability of each unit is determined by the singular values ($\sigma$) of $J_k$:

  • $\sigma > 1$: The unit is unstable, amplifying perturbations in certain directions.
  • $\sigma < 1$: The unit is stable, dampening perturbations.
  • $\sigma = 1$: The unit is marginally stable.

We apply this analysis to ResNet-56 and ResNet-110 architectures pre-trained on the CIFAR-10 dataset.

Key Findings

The Plateau of Unity

A defining feature of ResNet stability is the "plateau" in the singular value spectrum. For the majority of residual units, a significant portion of the singular values are exactly 1. This is a mathematical artifact of the identity skip connection ($I$ in the Jacobian). This property ensures that the network remains marginally stable, preventing the vanishing or exploding gradient problems during forward propagation.

Singular value distributions across the three stages of ResNet-110. The prominent plateau at 1 indicates marginal stability across most units.

Input Independence

While the Jacobian matrix is technically a function of the input image, the distribution of its singular values remains remarkably consistent across different images. This suggests that the stability profile is an intrinsic property of the network's architecture and learned weights, rather than a response to specific visual features.

Adversarial Alignment and the Final Stage Jump

The effectiveness of adversarial attacks, such as the Fast Gradient Sign Method (FGSM), can be explained through this lens. While random noise is isotropic and largely falls into stable or marginally stable subspaces, adversarial perturbations are specifically constructed to align with the few unstable directions ($\sigma > 1$).

Our analysis shows a dramatic "explosion" in perturbation magnitude in the final units of the third stage. In these layers, the adversarial noise aligns increasingly with the top singular vectors of the Jacobian, exploiting the network's hyper-sensitivity just before the classification layer.

Detailed analysis of the third stage of ResNet-110. The plots show the sharp increase in adversarial perturbation magnitude and its alignment with the most unstable singular vectors.

Conclusion

By applying nonlinear systems theory to ResNets, we gain a clearer picture of their internal mechanics. The skip-connection architecture enforces a baseline of marginal stability, but localized instabilities in the final layers provide a gateway for adversarial exploitation. This framework offers a promising path toward designing more robust architectures by explicitly controlling the singular value spectra of network layers.

Summary updated

Abstract

We regard pre-trained residual networks (ResNets) as nonlinear systems and use linearization, a common method used in the qualitative analysis of nonlinear systems, to understand the behavior of the networks under small perturbations of the input images. We work with ResNet-56 and ResNet-110 trained on the CIFAR-10 data set. We linearize these networks at the level of residual units and network stages, and the singular value decomposition is used in the stability analysis of these components. It is found that most of the singular values of the linearizations of residual units are 1 and, in spite of the fact that the linearizations depend directly on the activation maps, the singular values differ only slightly for different input images. However, adjusting the scaling of the skip connection or the values of the weights in a residual unit has a significant impact on the singular value distributions. Inspection of how random and adversarial perturbations of input images propagate through the network reveals that there is a dramatic jump in the magnitude of adversarial perturbations towards the end of the final stage of the network that is not present in the case of random perturbations. We attempt to gain a better understanding of this phenomenon by projecting the perturbations onto singular vectors of the linearizations of the residual units.
BibTeX
@misc{rothauge2019residual,
  author = {Kai Rothauge and Zhewei Yao and Zixi Hu and Michael W. Mahoney},
  title = {{Residual Networks as Nonlinear Systems: Stability Analysis using Linearization}},
  year = {2019},
  eprint = {1905.13386},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.13386},
}
Figure