Abstract
Deep learning's great success motivates many practitioners and students to learn about this exciting technology. However, it is often challenging for beginners to take their first step due to the complexity of understanding and applying deep learning. We present CNN Explainer, an interactive visualization tool designed for non-experts to learn and examine convolutional neural networks (CNNs), a foundational deep learning model architecture. Our tool addresses key challenges that novices face while learning about CNNs, which we identify from interviews with instructors and a survey with past students. CNN Explainer tightly integrates a model overview that summarizes a CNN's structure, and on-demand, dynamic visual explanation views that help users understand the underlying components of CNNs. Through smooth transitions across levels of abstraction, our tool enables users to inspect the interplay between low-level mathematical operations and high-level model structures. A qualitative user study shows that CNN Explainer helps users more easily understand the inner workings of CNNs, and is engaging and enjoyable to use. We also derive design lessons from our study. Developed using modern web technologies, CNN Explainer runs locally in users' web browsers without the need for installation or specialized hardware, broadening the public's education access to modern deep learning techniques.
Introduction
Deep learning has revolutionized computer vision, but for beginners, the path from conceptual understanding to mathematical implementation is fraught with difficulty. Convolutional Neural Networks (CNNs), while foundational, present a significant "gap of abstraction." Students often find themselves oscillating between high-level architectural diagrams and low-level dot-product equations without a clear mental bridge between the two.
To better understand these hurdles, the researchers conducted interviews with instructors and surveys with students. They identified several critical challenges, including the difficulty of connecting math to structure and the "black box" nature of intermediate computations. These findings directly informed the design requirements for a visual learning tool.
The CNN Explainer System
To address these challenges, the authors developed CNN Explainer, an interactive web-based tool that provides a multi-level visualization of a CNN. The system is designed around three hierarchical views that allow users to drill down from a model overview to specific mathematical operations.
- Overview View: This provides a "bird's-eye" perspective of the entire network architecture. In the tool, a "Tiny VGG" model is used. Each neuron is visualized as a heatmap representing its activation for a given input image, such as a coffee cup.
- Elastic Explanation View: This view acts as the bridge. When a user selects a specific neuron, the interface dynamically expands to show how that activation was derived from the previous layer. It uses animations of sliding kernels to visually represent the convolution process, making the abstract concept of "feature extraction" tangible.
- Interactive Formula View: At the most granular level, the tool provides interactive mathematical formulas for operations like Softmax or ReLU. A key feature here is "visual linking": hovering over a number in the formula highlights the corresponding pixel in the network visualization, and vice versa.
Implementation and Accessibility
A core design goal was accessibility. CNN Explainer is built using modern web technologies, specifically TensorFlow.js for on-device inference and D3.js for the interactive visualizations. By running entirely in the browser, the tool eliminates the need for complex software installations or expensive GPU hardware, allowing anyone with a web browser to explore deep learning. The model used is trained on a subset of Tiny ImageNet, featuring 10 everyday classes (e.g., ladybug, pizza, espresso) to make the learning experience relatable. Users can also upload their own custom images to see how the pre-trained model interprets them.
Key Insights and User Study
The researchers found that fluid transitions between these views were essential for "Aha!" moments. The "Elastic View" physically connecting the overview to the math helped students build a cohesive mental model. Additionally, the tool employs a "fisheye" context technique, where neighboring layers remain visible at lower opacity while a user zooms into details, ensuring they never lose their place in the broader architecture.
A qualitative observational study with 16 students confirmed the tool's effectiveness. Participants rated the tool highly for enjoyment (6.88/7) and educational value (6.37/7). Users specifically appreciated the ability to validate their hypotheses—for example, seeing how a specific kernel highlights edges in an image. Despite running in a browser, the "Tiny VGG" model achieved a respectable 70.8% top-1 accuracy on the validation set, proving it was a functional model rather than a toy simulation.
Limitations and Future Work
While successful, CNN Explainer currently focuses on forward propagation. Future iterations could include visualizations for backpropagation and the training process, which students also find challenging. Additionally, while the current version is tailored to VGG-style networks, the authors suggest extending these visualization techniques to more complex structures like ResNets or Transformers.
Summary updated