Topological Approaches to Deep Learning

Gunnar E. Carlsson, Rickard Brüel GabrielssonarXiv 2018

Abstract: We perform topological data analysis on the internal states of convolutional deep neural networks to develop an understanding of the computations that they perform. We apply this understanding to modify the computations so as to (a) speed up computations and (b) improve generalization from one data set of digits to another. One byproduct of the analysis is the production of a geometry on new sets of features on data sets of images, and use this observation to develop a methodology for constructing analogues of CNN's for many other geometries, including the graph structures constructed by topological data analysis.

Introduction

Despite the transformative success of deep neural networks (DNNs) across various domains, they remain fundamentally opaque. This "black box" nature presents significant challenges in interpretability, leading to issues such as overfitting, vulnerability to adversarial perturbations, and poor generalization across domain shifts. For instance, a model trained on the MNIST dataset (clean handwritten digits) often fails when applied to the Street View House Numbers (SVHN) dataset, despite the underlying task—digit recognition—remaining identical.

This research addresses these challenges by applying Topological Data Analysis (TDA) to the internal states of Convolutional Neural Networks (CNNs). By mapping the geometric structure of learned weights, we can not only understand how these networks represent information but also encode these geometric priors directly into the architecture to improve performance and robustness.

Methodology: Mapping the Internal State

The primary tool used in this study is the Mapper algorithm, a central method in TDA that compresses high-dimensional data into a simplified graph or simplicial complex. This topological model captures the fundamental "shape" of the data while reducing noise.

Weight Visualization

The researchers extracted weight vectors from convolutional layers during and after training, treating them as point clouds in high-dimensional space. By applying Mapper to these weights, they could visualize the organizational structure of the features the network learned at different stages of training and at different depths within the architecture.

Geometric Architectures

Based on the topological structures discovered, the authors introduced a framework to inject "angular factors"—features based on circular geometry—directly into the network's structural priors. This approach moves away from forcing a network to learn basic geometric relationships from scratch, instead providing a mathematical foundation for convolutions and pooling operations based on the discovered data geometry.

Key Insights: The Geometry of Learning

Biological Mimicry and the Primary Circle

A significant finding is that the first layers of CNNs naturally organize into a "primary circle" of edge detectors. These detectors represent edges rotating through 360 degrees. This structure mirrors the known statistics of natural image patches and aligns with the tuning of neurons in the mammalian primary visual cortex (V1). This suggests that CNNs, when left to optimize freely, converge on the same efficient geometric solutions evolved by biological systems.

Hierarchical Abstraction

As the analysis moves deeper into the network, the topological structures become increasingly complex. While early layers form simple circles, layer 2 of a CIFAR-10 model develops "bullseye" patterns, and deeper layers in VGG16 (trained on ImageNet) exhibit complex crossing lines and higher-order abstractions. This provides a visual and mathematical confirmation of the hierarchical nature of deep learning.

Dynamic Learning Processes

The topology of weights is not static; it evolves during training. The researchers observed that a clean circle of edges might form early in a layer's training but degrade as the layer begins to capture secondary, more specific features. Interestingly, the subsequent layer often compensates by forming its own primary circle, suggesting a fluid hand-off of topological responsibilities throughout the network hierarchy.

Experimental Results

By explicitly encoding the discovered geometric structures into the network architecture, the researchers achieved significant improvements in both efficiency and robustness:

  • Training Acceleration: The inclusion of angular features led to a 2x training speedup on MNIST and a 3.5x speedup on SVHN. By providing the network with a better starting point (a geometric prior), the optimization process converges much faster.
  • Cross-Dataset Generalization: Standard CNNs trained on MNIST typically achieve near-random accuracy (approx. 10%) when tested on the more complex SVHN dataset. The modified architecture with topological priors improved this to 22% accuracy. While not yet at human-level performance, this represents a doubling of accuracy, demonstrating that geometric priors help bridge the gap between disparate data domains.
  • VGG16 Mapping: The study successfully mapped the layer-by-layer topological responsibilities of the VGG16 network, providing a blueprint for the types of features learned at scale in deep architectures.

Conclusion and Future Work

This research demonstrates that TDA is a powerful lens for interpreting and improving deep learning. By identifying the natural geometry of neural weights, we can design architectures that are more biologically plausible and computationally efficient.

Future work aims to implement fully data-driven Mapper-based pooling architectures for non-image data, such as genomic or financial datasets, where the underlying grid structure is not predefined. Additionally, the authors plan to explore architectures based on more complex topologies, such as the Klein bottle, which has been identified in the statistics of natural image patches but has yet to be fully utilized in deep learning design.

Summary updated

BibTeX
@misc{carlsson2018topological,
  author = {Gunnar E. Carlsson and Rickard Brüel Gabrielsson},
  title = {{Topological Approaches to Deep Learning}},
  year = {2018},
  eprint = {1811.01122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.01122},
}
Figure