Classifying the Classifier: Dissecting the Weight Space of Neural Networks

Gabriel Eilertsen, Daniel Jönsson, Timo Ropinski, Jonas Unger, Anders Ynnerman

Abstract

Deep Neural Networks (DNNs) are frequently criticized as "black boxes," where the internal logic and the impact of training configurations remain opaque. This study explores the "Neural Weight Space" (NWS) by investigating whether a model's training parameters can be reverse-engineered from its weights alone. By training meta-classifiers on a massive dataset of 16,000 CNNs, we demonstrate that weights contain a distinct "footprint" of the optimizer, dataset, and initialization scheme used during training. Our findings reveal that these footprints are often localized and detectable even from small subsets of the model, posing significant implications for model interpretability and privacy.

Introduction

Standard Explainable AI (XAI) techniques typically focus on how a model processes specific inputs. However, the weight space itself—the physical distribution of parameters resulting from training—remains poorly understood. Every decision made during the training pipeline, from the choice of activation function to the initialization strategy, shapes the final distribution of weights. This research treats every trained model as a single point in a high-dimensional space to determine if the training setup can be identified solely by inspecting these weights.

Methods

To investigate the NWS, we generated a comprehensive dataset consisting of 320,000 weight snapshots from 16,000 individually trained CNNs. These models were trained across five diverse datasets (MNIST, CIFAR-10, SVHN, STL-10, and Fashion-MNIST) with randomly sampled hyperparameters, including learning rate, batch size, and architectural variations.

We developed two primary types of "meta-classifiers":

  1. Global Meta-Classifiers: These include traditional SVMs trained on statistical features and Deep Meta-Classifiers (DMCs)—1D CNNs that operate directly on raw, vectorized weight sequences.
  2. Local Meta-Classifiers: DMCs designed to operate on tiny, random subsets (e.g., 5,000 consecutive weights) to test if training signatures are distributed or localized.

Key Results and Insights

Our experiments confirm that weights possess a "memory" of their training process. The DMC achieved high accuracy in identifying the initialization and activation functions, significantly outperforming baseline statistical methods.

Meta-classification accuracy across various hyperparameters, comparing SVM baselines with Deep Meta-Classifiers (DMC) across different layer types.

Initialization and Activation Dominance

The choice of initialization (e.g., Glorot vs. Random Normal) emerged as the most distinguishing feature in the weight space. Even after extensive training, the "starting point" leaves a massive signature that meta-classifiers can identify with near-perfect accuracy. Similarly, activation functions leave a consistent "texture" across the entire network.

Spatial and Type-Specific Encoding

Information is not uniformly distributed across the network. We found that:

  • Dataset information is most prominent in early convolutional layers, which act as feature extractors.
  • Optimizer footprints are largely concentrated in the bias weights of convolutional layers.
  • Local Encoding: A DMC can identify training properties by looking at just 5% of the weights, suggesting that hyperparameters impose a consistent statistical signature throughout the model.
Weight norms across layers for dataset and optimizer meta-classification, illustrating how different training information is localized in specific weight types and layers.

Discussion and Privacy Implications

The ability to "fingerprint" a model has profound implications for AI security. If an attacker can identify the training dataset or proprietary pipeline from a black-box model's weights, it represents a significant privacy risk. Furthermore, the discovery that initialization is the most influential factor on final accuracy suggests that we might eventually be able to "learn" optimal initializations for specific tasks, potentially bypassing traditional training cycles.

Limitations and Future Work

This study focused on relatively small CNN architectures. Future research is required to determine if these weight-space signatures persist in massive architectures like Transformers or ResNets. Additionally, developing representations that account for the permutation invariance of neural networks could further enhance meta-classification accuracy.

Conclusion

By dissecting the neural weight space, we move closer to opening the black box of deep learning. The physical state of a network is not just a functional tool for inference, but a rich historical record of the choices made during its creation.

Summary updated

Abstract

This paper presents an empirical study on the weights of neural networks, where we interpret each model as a point in a high-dimensional space – the neural weight space. To explore the complex structure of this space, we sample from a diverse selection of training variations (dataset, optimization procedure, architecture, etc.) of neural network classifiers, and train a large number of models to represent the weight space. Then, we use a machine learning approach for analyzing and extracting information from this space. Most centrally, we train a number of novel deep meta-classifiers with the objective of classifying different properties of the training setup by identifying their footprints in the weight space. Thus, the meta-classifiers probe for patterns induced by hyper-parameters, so that we can quantify how much, where, and when these are encoded through the optimization process. This provides a novel and complementary view for explainable AI, and we show how meta-classifiers can reveal a great deal of information about the training setup and optimization, by only considering a small subset of randomly selected consecutive weights. To promote further research on the weight space, we release the neural weight space (NWS) dataset – a collection of 320K weight snapshots from 16K individually trained deep neural networks.
BibTeX
@inproceedings{eilertsen2020classifying,
  author = {Gabriel Eilertsen and Daniel Jönsson and Timo Ropinski and Jonas Unger and Anders Ynnerman},
  title = {{Classifying the Classifier: Dissecting the Weight Space of Neural Networks}},
  booktitle = {ECAI},
  year = {2020},
  url = {https://openreview.net/forum?id=Qg0TqdGJqNd},
}
Figure