Do Convolutional Neural Networks Learn Class Hierarchy?

Bilal Alsallakh, Amin Jourabloo, Mao Ye, Xiaoming Liu, Liu Ren · DOI

Abstract

Convolutional Neural Networks (CNNs) are often criticized for being "black boxes," particularly as the number of target classes increases and accuracy declines due to inter-class confusion. This research introduces Blocks, a visual analytics framework designed to explore whether CNNs internally recognize semantic hierarchies. The study reveals that CNNs naturally learn "generalist" features in early layers before "specialist" features in later ones. By explicitly incorporating hierarchical knowledge into the network architecture via a Hierarchy-Aware CNN, the researchers achieved significant improvements in classification accuracy and training speed on the ImageNet dataset.

Introduction

As deep learning models scale to handle thousands of categories, such as the 1,000 classes in ImageNet, they frequently struggle with fine-grained distinctions. Standard training protocols treat all classes as independent entities, ignoring inherent semantic relationships—for instance, the similarity between different dog breeds compared to a toaster. This paper addresses whether CNNs implicitly learn these hierarchies and how this structure can be leveraged to improve model performance and data quality.

The Blocks Visual Analytics Framework

To analyze CNN behavior, the authors developed Blocks, which provides a multi-faceted view of model performance relative to class hierarchies.

The Blocks system interface featuring (a) Hierarchy Viewer, (b) Confusion Matrix, and (c) Sample Viewer.

The system integrates four primary components:

  1. Hierarchy Viewer: An icicle plot organizing classes based on WordNet semantic structures.
  2. Confusion Matrix: A reorderable matrix that reveals "blocks" of confusion among semantically related categories.
  3. Response Map: Visualizes how specific neurons across layers respond to different class groups.
  4. Sample Viewer: Allows for the inspection of individual images and their associated saliency maps.

Using insights from Blocks, the researchers developed a Hierarchy-Aware CNN. This architecture modifies AlexNet by adding auxiliary branch classifiers to intermediate layers, forcing early layers to prioritize high-level group distinctions (e.g., natural vs. man-made objects) early in training.

Key Insights: Generalists and Specialists

The study identifies a clear division of labor within CNN layers. Early layers act as "generalists," developing features that can separate broad categories within just a few epochs. In contrast, later layers are "specialists" that require extensive training to distinguish between fine-grained classes.

Errors are not distributed randomly; they cluster into dense blocks along the diagonal of a hierarchy-ordered confusion matrix. Most failures occur "up" the hierarchy—confusing two types of birds rather than a bird and a vehicle. Furthermore, the system helps identify "block outliers"—misclassifications caused by flawed training data rather than model weakness.

Examples of semantic issues identified by Blocks, including redundancy, subclass relationships, and ambiguity.

Results and Impact

The hierarchy-aware approach yielded substantial improvements on the ImageNet ILSVRC 2012 dataset:

  • Accuracy: The modified AlexNet achieved a Top-1 error of 34.33%, a significant improvement over the standard 42.6%.
  • Efficiency: The model reached a Top-5 error of 24.6% in only 4 epochs, demonstrating that learning the "big picture" first accelerates overall training.
  • Data Auditing: The authors discovered that approximately 5% of ImageNet classes suffer from semantic overlap or ambiguity (e.g., "missile" vs. "projectile"), suggesting a natural ceiling for classification accuracy on the raw dataset.

Conclusion

While Blocks provides deep insights into CNN hierarchies, it faces scalability challenges in visualizing all neurons simultaneously and lacks direct connectivity mapping between layers. Future work may involve more complex regularization strategies and applying these hierarchical insights to non-image data. Ultimately, this research proves that baking semantic structure into neural architectures leads to more robust and interpretable AI systems.

Summary updated

BibTeX
@article{alsallakh2017do,
  author = {Bilal Alsallakh and Amin Jourabloo and Mao Ye and Xiaoming Liu and Liu Ren},
  title = {{Do Convolutional Neural Networks Learn Class Hierarchy?}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2017},
  doi = {10.1109/tvcg.2017.2744683},
}
Figure