Interpretable Disentanglement of Neural Networks by Extracting Class-Specific Subnetwork

Yulong Wang, Xiaolin Hu, Hang SuarXiv 2019

Abstract

Deep Neural Networks (DNNs) are powerful but often lack transparency, leading to noisy visual explanations and vulnerability to adversarial attacks. This paper proposes a method to "disentangle" pre-trained DNNs into smaller, class-specific subnetworks using knowledge distillation and pruning. These subnetworks reveal that models organize knowledge semantically and provide a more robust framework for interpreting model decisions and detecting adversarial perturbations.

Introduction

Despite their success, the "black box" nature of DNNs poses significant challenges. We often cannot identify which specific neurons are responsible for a particular classification. This lack of transparency leads to two primary issues: noisy saliency maps that highlight irrelevant background features and a high susceptibility to adversarial examples—subtle image perturbations that cause misclassification. This research addresses these gaps by isolating the specific circuits within a network that drive individual class predictions.

Methods

The researchers treat a pre-trained "full" model as a teacher and extract a "student" subnetwork for each individual class. This is achieved by adding "control gates" to the output channels of multiple layers. These gates act like dimmers, modulating information flow without retraining the underlying weights.

Conceptual overview of extracting class-specific subnetworks.

The extraction process involves:

  1. Knowledge Distillation: Optimizing gates so the subnetwork's output for a specific class matches the full model's output as closely as possible.
  2. Sparsity Regularization: Using $L_1$ regularization to force the subnetwork to be as small as possible, identifying the minimum set of neurons required to maintain performance for that class.
  3. Application: Once extracted, these subnetworks are used to generate cleaner visual explanations and calculate Mahalanobis distance scores for adversarial detection.

Key Insights: Semantic Architecture

By visualizing the structure of these extracted subnetworks using UMAP (a dimensionality reduction technique), the authors discovered that the model naturally develops "semantic circuits." Subnetworks for related concepts (e.g., different dog breeds or types of birds) cluster together in the feature space, suggesting that the model organizes internal knowledge logically.

UMAP visualization showing semantic clustering of subnetworks across AlexNet, VGG16, and ResNet50.

Furthermore, by stripping away non-essential neurons, the authors effectively "purify" the features. This allows visual explanation methods like GradCAM to focus strictly on the object of interest rather than background noise. In adversarial contexts, these subnetworks help identify "off-path" signals—activations that are atypical for the target class—making adversarial samples much easier to spot.

Key Results

The proposed "Subnet" approach demonstrated significant improvements across several benchmarks:

  • Visual Explanation: The approach consistently reduced localization errors. For ResNet50, the Saliency method's error dropped from 49.20% to 41.64%.
  • Adversarial Detection: On the CIFAR-10 dataset, the method achieved an AUROC of 91.91% for detecting DeepFool attacks, outperforming previous state-of-the-art methods like LID (88.47%).
  • Robustness: The detector remained effective even against novel, "unknown" attacks that it was not specifically trained to recognize.

Conclusion

This research provides a valuable tool for peering into the internal logic of DNNs. By disentangling class-specific subnetworks, we gain both better interpretability and enhanced security. While challenges remain regarding the computational cost of scaling this to thousands of classes, the work provides a clear path toward more transparent and robust AI systems.

Summary updated

BibTeX
@misc{wang2019interpretable,
  author = {Yulong Wang and Xiaolin Hu and Hang Su},
  title = {{Interpretable Disentanglement of Neural Networks by Extracting Class-Specific Subnetwork}},
  year = {2019},
  eprint = {1910.02673},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.02673},
}
Figure