Understanding the Role of Individual Units in a Deep Neural Network

David Bau, Jun-Yan Zhu, Hendrik Strobelt, Àgata Lapedriza, Bolei Zhou, Antonio Torralba · DOI

Abstract

Deep neural networks excel at finding hierarchical representations that solve complex tasks over large data sets. How can we humans understand these learned representations? In this work, we present network dissection, an analytic framework to systematically identify the semantics of individual hidden units within image classification and image generation networks. First, we analyze a convolutional neural network (CNN) trained on scene classification and discover units that match a diverse set of object concepts. We find evidence that the network has learned many object classes that play crucial roles in classifying scene classes. Second, we use a similar analytic method to analyze a generative adversarial network (GAN) model trained to generate scenes. By analyzing changes made when small sets of units are activated or deactivated, we find that objects can be added and removed from the output scenes while adapting to the context. Finally, we apply our analytic framework to understanding adversarial attacks and to semantic image editing.

Introduction

The "black box" nature of deep neural networks has long been a hurdle for trust and interpretability. While saliency maps can identify where a network focuses, they often fail to explain what specific concepts the network has learned. This research shifts the inquiry from localization to semantics, introducing network dissection: a framework designed to quantify the interpretability of individual units (neurons) and determine if they represent human-understandable concepts like objects, textures, or colors.

The Network Dissection Framework

Network dissection operates through a systematic three-step process. First, the activation maps of every hidden unit are recorded across a diverse dataset. Second, these activations are compared against a library of 1,825 human-labeled semantic concepts from the ADE20K dataset. Finally, the alignment is quantified using the Intersection over Union (IoU) metric. A unit is considered a "concept detector" if its activation consistently overlaps with a specific semantic label.

Overview of Network Dissection and identified semantic units.

Spontaneous Emergence and Causality

A striking finding is that networks trained on high-level tasks, such as scene classification (e.g., "kitchen" or "conference room"), spontaneously develop detectors for constituent objects (e.g., "stoves" or "chairs") without explicit supervision. These units are not merely correlated with the output; they are causal.

For instance, in a model trained to recognize "ski resorts," the researchers identified specific units that detect snow, mountains, and trees. When the top 20 most important units for the "ski resort" class are removed, the classification accuracy plummets from 81.4% to near-chance levels (53.5%), demonstrating that the network relies on these specific semantic handles to make its final prediction.

Impact of unit removal on 'ski resort' classification accuracy.

Applications: Generative Control and Adversarial Attacks

The framework extends beyond classifiers to Generative Adversarial Networks (GANs). By identifying units responsible for specific objects like "trees" or "doors," researchers can manipulate the generation process. Interestingly, these units are context-aware; a "door unit" will only render a door if the surrounding pixels represent a building, adhering to the model's internal logic of the world. This discovery enabled the creation of "semantic paint" tools, allowing users to edit images by activating specific concept neurons rather than manipulating raw pixels.

Furthermore, the framework sheds light on adversarial attacks. The authors found that such attacks often work by suppressing the units responsible for the correct semantic class while artificially boosting units associated with a target "fooling" class, providing a semantic explanation for why these perturbations succeed.

Conclusion

While not all units in a deep network are interpretable—many remain polysemantic or noisy—the existence of clear concept detectors suggests that networks do not represent the world as a purely distributed signal. Future work will focus on training methods that encourage disentanglement, making AI systems more transparent and easier for humans to debug and control.

Summary updated

BibTeX
@article{bau2020understanding,
  author = {David Bau and Jun-Yan Zhu and Hendrik Strobelt and Àgata Lapedriza and Bolei Zhou and Antonio Torralba},
  title = {{Understanding the Role of Individual Units in a Deep Neural Network}},
  journal = {Proc. Natl. Acad. Sci. USA},
  year = {2020},
  doi = {10.1073/pnas.1907375117},
}
Figure