CNN Filter DB: An Empirical Investigation of Trained Convolutional Filters

Paul Gavrikov, Janis Keuper

Abstract

Understanding the internal representations of Convolutional Neural Networks (CNNs) is crucial for improving model robustness and generalization. This study introduces CNN Filter DB, a massive repository containing over 1.4 billion trained $3 \times 3$ convolutional filters extracted from 647 diverse models across 11 tasks and 71 datasets. By analyzing this "weight space" through Principal Component Analysis (PCA) and novel metrics for sparsity and entropy, we characterize the "health" of trained models. Our findings reveal that many public models suffer from significant degeneration, yet healthy filter distributions remain remarkably consistent across disparate tasks. This consistency explains the efficacy of transfer learning from both natural and synthetic data.

1. Introduction

While the impact of input data distributions on model performance is well-documented, the internal "weight space" of trained CNNs remains relatively opaque. Most research focuses on the image domain—how lighting, weather, or noise affects output. However, the filters themselves—the fundamental building blocks of feature extraction—contain untapped information about a model's capacity, health, and robustness.

This paper addresses two primary gaps in our understanding of deep learning:

  1. Model Health: The prevalence of "degenerated" layers—those containing redundant or near-zero filters—which compromises robustness and fine-tuning potential.
  2. Transferability: The underlying reason why pre-training on one dataset (e.g., ImageNet) or even synthetic data (e.g., fractals) generalizes so effectively to unrelated tasks.

2. The CNN Filter DB

The authors constructed the CNN Filter DB, a ~100 GB dataset comprising:

  • 1.4 Billion $3 \times 3$ filters extracted from 21,436 layers.
  • 647 models in ONNX format, spanning classification, GANs, segmentation, and more.
  • 71 datasets, including natural images (ImageNet, CIFAR), medical imaging, and satellite imagery.

2.1 Analytical Framework

To navigate this high-dimensional data, the researchers employed several key techniques:

  • PCA-based Basis: A common 9-dimensional basis was established for all $3 \times 3$ filters, allowing any filter to be represented as a set of coefficients.
  • Drift Metric ($D$): Calculated using symmetric Kullback-Leibler (KL) divergence between PCA coefficient distributions to measure the "distance" between models or layers.
  • Degeneration Metrics: Sparsity ($S$) measures the ratio of near-zero filters, while Entropy ($H$) quantifies the structural diversity of filters.
  • Phenotyping: Filter distributions were categorized into four "phenotypes": sun (healthy/Gaussian), spikes (low variance), symbols (multi-modal), and point (extreme sparsity).

3. Key Insights into Filter Distributions

3.1 Robustness and Diversity

A significant finding is the structural difference in adversarially trained (robust) models. Unlike standard models, robust networks almost never develop sparse filters in deeper layers. They maintain high filter entropy throughout their architecture, suggesting that diversity in the weight space is a prerequisite for adversarial resilience.

3.2 The "Fractal" Mystery and Transfer Learning

The study provides a quantitative explanation for why pre-training on synthetic fractal data is effective. The filter distributions resulting from fractal training are nearly identical to those trained on natural images. This suggests that if a dataset is sufficiently large and varied, filters converge toward a "natural" distribution regardless of the specific semantic content. Furthermore, the "drift" ($D$) between different tasks (e.g., classification vs. segmentation) is surprisingly low when using similar backbones, justifying the ubiquitous use of classification pre-training.

3.3 Re-evaluating Fine-Tuning Heuristics

The common practice of freezing early layers during fine-tuning assumes these layers are "universal." However, the authors observed significant distribution shifts in both the first and last layers across different domains. This indicates that early layers may be more specialized to the specific input domain than previously assumed, suggesting that selective unfreezing might be necessary for optimal transfer.

4. Empirical Results

The analysis of the CNN Filter DB reveals several trends in modern deep learning:

  • Prevalent Sparsity: The average sparsity across the database is 0.12, but nearly 10% of layers exhibit sparsity greater than 0.5, indicating that half the filters in those layers are effectively "dead."
  • Overparameterization: Models trained on simpler datasets (e.g., CIFAR-10) show higher rates of degeneration and sparsity as depth increases compared to those trained on complex datasets like ImageNet.
  • GAN Discriminator Instability: Filters in GAN discriminators often resemble random noise, characterized by high entropy but low structure. This "confused" state may explain why discriminators eventually fail to provide useful gradients to generators.

5. Limitations and Future Work

While the CNN Filter DB is a landmark resource, it currently leans toward classification models and natural image domains. Future iterations aim to include a broader range of architectures and specialized domains. The authors suggest that this database can inform better pruning criteria, improved model initialization, and more sophisticated transfer learning strategies by matching the filter distributions of source and target models.

6. Conclusion

By shifting the focus from image-space to weight-space, the CNN Filter DB provides a new lens for evaluating model health and generalization. The discovery of a "natural" filter distribution that transcends specific datasets offers a theoretical foundation for the success of diverse pre-training regimes and highlights the importance of maintaining filter diversity for model robustness.

Summary updated

BibTeX
@inproceedings{gavrikov2022cnn,
  author = {Paul Gavrikov and Janis Keuper},
  title = {{CNN Filter DB: An Empirical Investigation of Trained Convolutional Filters}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
}
Figure