Analyzing and Quantifying Generalization in Convolutional Neural Networks

Yang Zhao, Hao ZhangarXiv 2021

Abstract

Deep Neural Networks (DNNs) often possess an overabundance of parameters, enabling them to memorize training data rather than learning generalizable patterns. This paper presents a novel framework for estimating the generalization gap of a DNN by analyzing its internal functional sparsity through Cumulative Unit Ablation. By ranking and progressively removing neurons based on activity, the authors derive two metrics, $\zeta$ and $\kappa$, which exhibit a strong linear correlation with a model's ability to generalize. Experimental results across CIFAR-100 and ImageNet demonstrate that this sparsity-based approach significantly outperforms traditional margin-based estimation methods.

Introduction

The challenge of overparameterization in deep learning is that models can achieve near-perfect training accuracy while failing to generalize to unseen data. This phenomenon, often termed "memorization," occurs when a network fits individual training samples—even those with randomized labels—rather than capturing the underlying data distribution. Traditional theoretical bounds like VC dimension are frequently too loose for practical application in modern architectures. Consequently, there is a critical need for empirical metrics that can reliably predict a model's real-world performance based solely on its internal state.

Methodology

The authors introduce Cumulative Unit Ablation as a diagnostic tool for functional sparsity. The process begins by ranking units (neurons or filters) in a specific layer according to the L1-norm of their activations for a particular class. Two distinct accuracy curves are then generated:

  • $E(n)$: Removing units from most active to least active.
  • $E_r(n)$: Removing units from least active to most active.
Figure 4: Cumulative unit ablation curves for well-generalized versus poorly-generalized DNNs. Panel A defines the metrics, while Panel B compares the functional sparsity profiles.

From these curves, two primary metrics are extracted:

  1. $\zeta$ (Zeta): Derived from the "turning points" where accuracy significantly shifts.
  2. $\kappa$ (Kappa): Representing the area enclosed between the $E(n)$ and $E_r(n)$ curves.

These metrics were validated using VGG16, MobileNet, and ResNet34 architectures on CIFAR-100 and ImageNet. To simulate varying degrees of generalization, the researchers utilized datasets with controlled levels of label corruption (0% to 100%).

Results and Insights

The core finding is that generalization is intrinsically linked to functional sparsity. In a well-generalized model, a small subset of specialized units is responsible for class identification. Removing these "important" units causes an immediate collapse in accuracy. Conversely, in models that have memorized data, the representation is more diffuse; accuracy drops more gradually as units are ablated.

Figure 6: Evolution of ablation curves and sparsity metrics across varying levels of label corruption. As corruption increases, the area between curves ($\kappa$) decreases and the metrics cluster differently.

Quantitatively, the proposed linear model using $\zeta$ and $\kappa$ achieved a Pearson correlation coefficient of 0.979 on CIFAR-100 with VGG16. This method proved far more robust than margin-based estimation, which showed a lower correlation (0.75) and higher error rates. The stability of these metrics across different architectures and large-scale datasets like ImageNet suggests that functional sparsity is a fundamental indicator of generalization in convolutional neural networks.

Discussion

While effective, the method currently requires manual selection of the target layer (e.g., block5_conv3 in VGG16), and deeper layers generally yield more significant results. Future work could focus on automating layer selection and reducing the computational overhead of multiple inference passes required for ablation. Additionally, extending this analysis to non-convolutional architectures like Transformers remains a promising avenue for research.

Summary updated

BibTeX
@misc{zhao2021analyzing,
  author = {Yang Zhao and Hao Zhang},
  title = {{Analyzing and Quantifying Generalization in Convolutional Neural Networks}},
  year = {2021},
  eprint = {2104.00851},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.00851},
}
Figure