Understanding the Distributions of Aggregation Layers in Deep Neural Networks

Eng-Jon Ong, Sameed Husain, Miroslaw Bober

Abstract

Aggregation layers, such as Global Average Pooling (GAP), are fundamental components in Deep Neural Networks (DNNs), yet their impact on feature distributions remains poorly understood. This paper presents a novel mathematical framework to analytically model the probability density functions (PDFs) of activations as they propagate through aggregation blocks. By accounting for non-linearities, spatial correlations, and the discrete nature of ReLU-induced zeros, the proposed model accurately predicts the KL-divergence of network outputs. Experimental validation on CIFAR10 and Flowers datasets demonstrates that this theoretical approach provides a robust link between internal layer statistics and overall classification performance.

Introduction

Modern DNN architectures rely heavily on aggregation processes like average or max pooling to consolidate features, provide spatial invariance, and mitigate overfitting. These layers typically precede the final classification stage, making their output distributions critical for class separability. Despite their ubiquity, theoretical modeling of these transformations often relies on simplifying assumptions, such as infinite network width or independent feature distributions. This work addresses this gap by providing an analytical method to trace PDFs through standard aggregation pipelines, offering insights into how architectural choices influence feature statistics.

Methods

The authors propose a step-by-step mathematical derivation for the distributions within an aggregation block, typically following the sequence: Last Conv Layer → Activation → Pooling → Deactivation → FC Layer.

  1. Zero-Gamma Distribution: The output of the last convolutional layer is modeled as a mixture of a point mass at zero (accounting for ReLU-deactivated neurons) and a Gamma distribution for positive values.
  2. Non-linear Transformations: The PDF for exponential activation functions ($g(x) = \alpha(\exp(\beta x) - 1)$) is derived, resulting in a "Zero-ExpGamma" distribution.
  3. Correlated Pooling: A critical contribution is the treatment of Global Average Pooling (GAP). Unlike models that assume pixel independence, this framework uses a 2nd-order Taylor expansion to incorporate spatial covariance, which is essential for accurately predicting the variance of aggregated features.
  4. Central Limit Theorem (CLT): Since the final Fully Connected (FC) layer linearly combines thousands of filter outputs, the authors use the CLT to model the pre-activation output as a Normal distribution.
  5. KL-Divergence Prediction: With the final outputs modeled as Gaussians, standard information-theoretic formulas are used to predict the KL-divergence between classes.
Figure 1: Analytical pipeline for tracking probability distributions through the aggregation block.

Results and Key Insights

The framework was validated using two datasets: CIFAR10 (with a custom 4-block CNN) and Flowers (using a fine-tuned EfficientNetB0). The mathematical models showed excellent agreement with empirical data:

  • Distribution Matching: The predicted PDFs for the GAP and deactivation layers closely match the histograms of actual trained networks.
  • KL-Divergence Accuracy: On CIFAR10, the predicted KL-divergence values for different classes align almost perfectly with observed values. For the Flowers dataset, while absolute values show some offset, the model captures the relative separability accurately.
  • Spatial Correlation: The paper proves that ignoring the covariance between features results in a severe overestimation of KL-divergence, making the network appear more "confident" than it actually is.
Figure 2: Comparison of predicted vs. observed KL-divergence for CIFAR10 and Flowers datasets.

Limitations and Future Work

The current derivations are tailored to a specific aggregation pipeline (Exponential activation followed by GAP). Extending the work to other popular layers like Max Pooling or NetVLAD remains future work. Additionally, while the Gamma distribution assumption holds well for the tested cases, it may vary for extremely deep or specialized architectures. Some steps rely on first-order Taylor expansions, which introduce small inaccuracies that can compound in complex blocks.

Future research could involve using these analytical models to optimize network parameters directly for maximum class separability without traditional backpropagation.

Summary updated

BibTeX
@article{ong2024understanding,
  author = {Eng-Jon Ong and Sameed Husain and Miroslaw Bober},
  title = {{Understanding the Distributions of Aggregation Layers in Deep Neural Networks}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2024},
  doi = {10.1109/tnnls.2022.3207790},
}
Figure