Towards Efficient Visual Simplification of Computational Graphs in Deep Neural Networks

Rusheng Pan, Zhiyong Wang, Yating Wei, Han Gao, Gongchang Ou, Caleb Chen Cao, Jingli Xu, Tong Xu, Wei Chen · DOI

Abstract

Visualizing the massive computational graphs of modern deep neural networks (DNNs) often results in a "hairball" of nodes and edges that is impossible to navigate. This paper introduces a suite of simplification techniques—including cycle removal, module-based edge pruning, and isomorphic subgraph stacking—that reduce visual elements by an average of 60% while maintaining the model's logical structure. The proposed system, implemented with a WebGL-based renderer, enables interactive exploration of large-scale architectures like BERT and ResNet-50, significantly improving user performance in network analysis tasks.

Introduction

As DNNs grow in complexity, understanding their internal data flow becomes a significant challenge for researchers and engineers. Standard tools like TensorBoard or VisualDL work well for small models but struggle with large-scale architectures like BERT, which can contain over 5,000 tensors and operators.

The authors identify three core challenges in current visualization tools: deep hierarchies that make navigation cumbersome, visual clutter from high node density, and repetitive structures that consume screen real estate without providing new information. Furthermore, hierarchical grouping often creates "false cycles"—loops in the visualization that do not exist in the model's execution logic—confusing users trying to understand the forward propagation path.

Methods

The authors propose a "Concept Graph" approach that abstracts raw tensors into a more readable format. This is achieved through three primary techniques:

  • Cycle Removing: To restore a clear "forward" direction, the algorithm detects directed cycles created by hierarchical grouping and "splits" offending metanodes to ensure the graph remains a Directed Acyclic Graph (DAG).
  • Module-based Edge Pruning: The system identifies "ModuleNodes" and hides internal "HiddenEdges," replacing them with explicit "ports" on the module boundary. This uses an orthogonal layout (similar to a circuit diagram) to improve readability and reduce edge crossings.
  • Isomorphic Subgraph Stacking: A hash-based algorithm identifies identical subgraphs (e.g., the 12 identical layers in BERT). These are "stacked" into a single "piled node" with a counter, preserving topological context while drastically reducing element count.
The hierarchical node classification system used to organize the computational graph into MetaNodes, OperationNodes, and DataNodes.

The system is implemented as a web-based tool using Django for the backend and PixiJS (WebGL) for the frontend to ensure smooth interaction (20+ FPS) even with 10,000+ elements.

Evaluation and Results

The approach was evaluated using several prominent DNN architectures, including BERT (5,698 nodes), ResNet-50 (1,120 operators), and SSD. Rendering performance was benchmarked using synthetic graphs with up to 14,000 nodes.

The proposed visualization tool showing a simplified 'Main' view of a complex DNN architecture alongside a zoomed-in detail.

Key results include:

  • Complexity Reduction: For the BERT model, the tool reduced visible nodes and edges from over 4,000 to fewer than 100—a 60% average reduction across all tested models.
  • Performance: The WebGL renderer maintained interactive speeds (>20 FPS) for graphs with up to 11,000 nodes, outperforming traditional SVG-based tools.
  • User Study: In a study with 24 participants, the system outperformed TensorBoard in accuracy and speed for tasks like identifying network genealogy and locating specific operators. Users specifically praised the "balanced" layout between overview and detail.

Conclusion

By moving away from raw graph visualization toward a "Concept Graph" that utilizes circuitry-inspired layouts and subgraph stacking, the authors provide a more scalable way to inspect modern DNNs. Future work will focus on resolving visual complexity in bipartite structures and integrating these visualizations into active model debugging and optimization workflows.

Summary updated

BibTeX
@article{pan2022towards,
  author = {Rusheng Pan and Zhiyong Wang and Yating Wei and Han Gao and Gongchang Ou and Caleb Chen Cao and Jingli Xu and Tong Xu and Wei Chen},
  title = {{Towards Efficient Visual Simplification of Computational Graphs in Deep Neural Networks}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2022},
  doi = {10.1109/tvcg.2022.3230832},
}
Figure