An Empirical Investigation of Model-to-Model Distribution Shifts in Trained Convolutional Filters

Paul Gavrikov, Janis Keuper

TL;DR

Instead of measuring distribution shift in pixel space, this paper investigates shifts directly within the learned weights of neural networks. By analyzing over half a billion $3 \times 3$ convolutional filters extracted from 391 pre-trained vision models, the authors discover that architectural choice impacts filter distributions far more than the training domain—explaining why ImageNet pre-training transfers remarkably well across wildly disparate visual domains.

What Problem Does This Paper Address?

Deep convolutional neural networks (CNNs) are notoriously data-hungry and fragile when confronted with dataset distribution shifts. To bypass data scarcity, practitioners rely on transfer learning: fine-tuning a pre-trained network on a target task under the assumption that the pre-training source distribution is "close enough" to the target domain.

However, quantifying distribution shifts directly in pixel space is notoriously difficult and often fails to capture what a neural network actually extracts. The authors propose an alternative: studying distribution shifts in the learned weights of trained CNNs. Because weight distributions reflect the visual sub-features a network actively utilizes, analyzing them can reveal how architectures, tasks, and datasets interact under the hood.

Methods

The authors introduce an empirical framework to analyze filter structures and quantify distribution shifts across models:

  • Filter Normalization & PCA Decomposition: Focusing on standard $3 \times 3$ convolutional kernels, they scale each filter by its maximum absolute weight (decoupling pattern geometry from weight magnitude). They run a full-rank 9-dimensional Principal Component Analysis (PCA) to represent any filter as a linear combination of principal basis components $v_i$ with coefficients $c_i$.
  • Weighted Symmetric KL Divergence ($D$): To measure the divergence between two filter sets $P$ and $Q$, they compute the symmetric Kullback-Leibler (KL) divergence across coefficient distributions along each principal component, weighted by the component's explained variance ratio $q_i$: $$D(P \parallel Q) = \sum_{i} q_i \sum_{x} \left( P_i(x) \log \frac{P_i(x)}{Q_i(x)} + Q_i(x) \log \frac{Q_i(x)}{P_i(x)} \right)$$
  • Phenotype Classification: In the PCA coefficient space, filter distributions fall into three visual phenotypes:
  • Gaussian-like ("sun")
  • Discrete/Degenerate ("spikes"), indicating low feature diversity
  • Multi-modal/Sparse ("symbols")
  • Filter Scale Analysis: Evaluates the unscaled dynamic range ($\max - \min$ raw weight) across network depth deciles.

Datasets

The authors compiled and open-sourced CNN-Filter-DB, containing 524,563,289 individual $3 \times 3$ filters across 13,015 layers from 391 publicly available pre-trained models.

  • Domains & Data Types: Includes natural scenes (ImageNet1k, COCO, Places365, PASCAL VOC), medical imaging (CT, MRI, X-ray), synthetic mathematical patterns (Fractal-DB), textures (DTD), astronomy, seismic imagery, and faces.
  • Tasks: Image classification (dominant with 264 models), semantic segmentation, object detection, GANs (generators and discriminators), depth estimation, super-resolution, and style transfer.

Key Insights and Ideas

  • Architecture Dominates Data: Comparing distinct neural network architectures yielded the largest distribution shifts observed—surpassing shifts caused by completely different datasets or tasks.
  • Why ImageNet Pre-training Works Everywhere: Within an architecture family (e.g., ResNet classifiers), filter distributions shift negligibly, regardless of whether the model was trained on natural images, medical scans, or synthetic fractals. This provides structural evidence for why ImageNet representations transfer so universally.
  • Tasks Differ More than Data: Changing the objective (e.g., classification vs. GAN discrimination) induces larger distribution shifts than changing the visual domain.
  • The "Confused" Discriminator Signature: GAN discriminators display uniform, near-Gaussian coefficient distributions with equal variance across all PCA components—mirroring random initialization and reflecting how hard it is for mature discriminators to pick up distinctive edge patterns.
  • Degenerate Filters & the Lottery Ticket Hypothesis: Many deep, high-performing networks exhibit "spiky" or "symbol-like" coefficient clusters (untrained or redundant filters), corroborating the Lottery Ticket Hypothesis that only a sparse subnetwork does the heavy lifting.

Key Results

  • Distribution Shift Rankings: Pairwise shift ($D$) was highest between different Models (up to $D \approx 4.0$), followed by Tasks and Data Types ($D \approx 0.0\text{--}1.8$). Intra-family architectures (e.g., ResNet-based Classifiers) exhibited minimal shifts ($D < 0.5$).
  • Depth Deciles: Shifts between early and intermediate layers were small ($D \le 0.2$), but the final decile (layers closest to the output) diverged sharply from the rest.
  • Filter Magnitudes: Unscaled weight ranges systematically decreased with layer depth, although the first 20% of layers showed extreme variance in scale across different models.

Limitations and Future Work

  • Filter Geometry Restrictions: The analysis exclusively examines $3 \times 3$ kernels from standard 2D convolutions, omitting $1 \times 1$ projections, depthwise separable kernels, $5 \times 5$/$7 \times 7$ filters, and modern Vision Transformers.
  • Dataset Imbalance: The model pool is heavily skewed toward ImageNet classification backbones (264 of 391 models), with certain tasks represented by only a single model (e.g., super-resolution).
  • Inter-channel Dynamics: Filters were analyzed individually, disregarding cross-channel correlation, tensor rank, or connectivity paths.
  • Future Directions: The authors suggest using filter-space divergences as an automated diagnostic tool to select optimal pre-trained models for transfer learning without requiring test data access.

Summary updated

BibTeX
@inproceedings{gavrikov2021empirical,
  author = {Paul Gavrikov and Janis Keuper},
  title = {{An Empirical Investigation of Model-to-Model Distribution Shifts in Trained Convolutional Filters}},
  booktitle = {DistShift @ NeurIPS},
  year = {2021},
  url = {https://openreview.net/forum?id=2st0AzxC3mh},
}
Figure