Abstract
Residual Network (ResNet) is the state-of-the-art architecture that realizes successful training of really deep neural network. It is also known that good weight initialization of neural network avoids problem of vanishing/exploding gradients. In this paper, simplified models of ResNets are analyzed. We argue that goodness of ResNet is correlated with the fact that ResNets are relatively insensitive to choice of initial weights. We also demonstrate how batch normalization improves backpropagation of deep ResNets without tuning initial values of weights.
Introduction
Training deep neural networks is notoriously difficult due to the vanishing and exploding gradient problems. If weights are initialized even slightly too large, signals explode exponentially as they pass through layers; if they are too small, the signal vanishes. While standard initialization methods, such as "He initialization," work for "plain" networks, they are incredibly sensitive. A small deviation from the optimal variance can lead to gradients that are $2^{20}$ times larger than intended in a 20-layer network. ResNets were designed to mitigate this via shortcut connections, but the exact mathematical relationship between ResNet architecture, depth, and initialization requires quantification.
Methods
The author performs a variance analysis of the forward and backward passes in simplified ResNet models, analyzing two types of activation functions: Identity (linear) and ReLU.
The key mathematical approach involves:
- Forward Propagation Analysis: Calculating how the variance of the layer outputs ($z^\ell$) evolves.
- Backpropagation Analysis: Calculating how the variance of the "deltas" (gradients) evolves.
- Batch Normalization (BN) Modeling: Mathematically inserting BN layers before the residual addition to see how they "relax" the gradient constraints.
The author derives a specific requirement for ResNet weight initialization to remain stable: $$Var[w] = \frac{c}{nL}$$ Where $L$ is the number of residual blocks and $n$ is the fan-in (number of input units).
Key Insights
- The Robustness of ResNets: Unlike plain networks where signal growth is exponential ($Var \propto \text{variance}^L$), ResNets exhibit polynomial or linear growth. This makes them far less sensitive to "imperfect" initial weights.
- The $1/L$ Rule: For a ResNet to remain stable, the initial weight variance must be inversely proportional to the total depth ($L$). This is a departure from standard "He initialization," which typically only considers the local layer size ($n$).
- BN as a Gradient "Linearizer": The paper shows that Batch Normalization effectively changes the gradient explosion from an exponential problem to a linear one ($L/\ell$). Once BN is added, the gradient variance becomes almost entirely independent of the initial weight variance.
Key Results
The theoretical findings were validated using a ResNet with 100 residual blocks (using $8 \times 8$ convolutions) on the CIFAR-10 dataset.
- Failure of Standard Init: A 100-block ResNet using standard He initialization failed to train, getting trapped on an accuracy plateau from the start.
- Success of Proposed Init: Using the proposed $Var[w] \propto 1/L$ initialization, the same 100-block ResNet trained successfully and stably, even without Batch Normalization.
- Performance Comparison: While the proposed initialization achieved comparable performance to Batch Normalization at the start of training, BN eventually proved slightly more stable and accurate over the full training cycle. However, the proposed initialization is computationally "cheaper" as it requires no extra layers.
Limitations and Future Work
The analysis uses simplified ResNet blocks. In practice, many ResNets include an activation function after the shortcut addition, which this paper omits for simplicity. Additionally, for extremely deep networks, the required initial weights ($1/L$) might become so small that they hit the precision limits of 32-bit or 16-bit floating-point arithmetic, leading to underflow. Future work is needed to see how these rules change when the position of the BN layer is moved or when multiple layers are included within a single residual block.
Conclusion
This work provides a theoretical explanation for why ResNets are more robust to the "initialization lottery" than plain networks. By scaling weight variance inversely with depth, practitioners can train extremely deep models even without Batch Normalization, though BN remains a powerful tool for making networks independent of initialization tuning.
Summary updated