3D Visualization Revealed: How LeNet-5 Recognizes Handwritten Digits

A creative 3D visualization project reveals how LeNet-5 CNN recognizes handwritten digits step by step.
A developer built an interactive 3D visualization of LeNet-5 performing MNIST digit recognition using VRML, Python, JavaScript, and HTML. The project maps each CNN layer — from convolution and pooling to fully connected outputs — into navigable 3D space, turning abstract tensor operations into tangible visual flows. While limited in production value, it serves as a powerful educational tool for understanding CNN internals.
When a Classic CNN Meets 3D Visualization
Deep learning models have long been regarded as "black boxes" — we know they can recognize images, but it's difficult to intuitively understand what's actually happening inside them. Recently, a developer shared a creative project on Reddit: using a VRML + JavaScript + Python + HTML tech stack to build a 3D visualization demo of LeNet-5 performing MNIST handwritten digit recognition.
The core value of this project isn't how advanced the model itself is, but rather how it presents the entire inference process of a Convolutional Neural Network (CNN) in three-dimensional space through a visual, interactive approach — making abstract tensor operations tangible.

LeNet-5: The Pioneering Convolutional Neural Network
Why Choose LeNet-5 for Visualization
LeNet-5 is a classic convolutional neural network proposed by deep learning pioneer Yann LeCun in 1998, originally designed for handwritten digit recognition on bank checks. While its architecture is extremely simple by today's standards, this network established the fundamental paradigm of modern CNNs: the stacked combination of convolutional layers + pooling layers + fully connected layers.
Choosing LeNet-5 as the visualization subject is a wise decision. It has few layers (around 7), a small parameter count, and feature map dimensions at each layer that are easy to display intuitively in 3D space. Compared to modern deep networks with hundreds of layers, LeNet-5 strikes an ideal balance between "complete visualization" and "structural complexity."
MNIST: The "Fruit Fly" Dataset of Machine Learning
The MNIST dataset contains 60,000 training images and 10,000 test images, each a 28×28 pixel grayscale image of a handwritten digit. It's called the "fruit fly" of machine learning — just as biologists use fruit flies for experiments, nearly every beginner uses MNIST to validate their first model. Using it for a visualization demo allows the broadest possible audience to quickly understand what's being demonstrated.
Tech Stack Analysis: New Tricks with Old Technologies
The Retro Choice of VRML
The most surprising aspect of this project is its use of VRML (Virtual Reality Modeling Language). VRML was a standard from the 1990s for describing 3D interactive scenes on the web, and has since been largely replaced by modern technologies like X3D, WebGL, and Three.js.
The developer's choice of VRML may stem from nostalgia for classic technology, or perhaps an appreciation for its simplicity in describing static 3D geometric structures. Using a "retro" technology to visualize another "classic" model (LeNet-5) — the pairing itself is quite charming.
The Collaborative Division of Four Technologies
From the tech stack combination, we can infer each component's responsibilities:
- Python: Handles backend model inference, likely using PyTorch or TensorFlow to load pre-trained LeNet-5 weights, perform forward propagation on input MNIST images, and output activation values at each layer.
- VRML: Defines the 3D scene, mapping abstract concepts like convolution kernels, feature maps, and fully connected layer neurons into cubes, planes, connecting lines, and other 3D geometric objects.
- JavaScript: Manages frontend interaction logic, implementing viewport rotation, layer switching, dynamic data updates, and other features.
- HTML: Serves as the hosting page for the entire demo, integrating all components within the browser.
This frontend-backend separation architecture, where computationally intensive model inference is handled by Python while visualization rendering is delegated to the browser, is a well-reasoned design approach.
Visualizing CNN Inference: Making the Black Box Transparent
Layer-by-Layer Transformation from Pixels to Features
Through the 3D demo, viewers can clearly see how a handwritten digit image is "understood" by the network step by step:
- Input Layer: The original 28×28 pixel image serves as the starting point;
- Convolutional Layers: Multiple convolution kernels slide across the image, extracting low-level features like edges and strokes, generating a set of feature maps;
- Pooling Layers: Downsample the feature maps, preserving key information while reducing data dimensionality;
- Fully Connected Layers: Map high-level features to 10 output nodes, corresponding to digits 0-9;
- Output: The node with the highest probability is the model's recognition result.
When all of this is presented in three-dimensional space in a rotatable, stereoscopic format, learners can truly "see" data flowing through the network, rather than relying on flat diagrams and imagination.
Educational Value Outweighs Practical Value
It should be objectively noted that projects like this have limited practical engineering application — no one uses 3D demos for inference in production environments. However, their educational and outreach value is quite significant. For students learning deep learning, or engineers who need to explain CNN principles to non-technical stakeholders, an intuitive interactive demo like this is worth a thousand words.
Conclusion: Tech Communication Needs More Creativity
This small Reddit project reminds us that excellent technology communication often comes from creative cross-domain combinations. Combining 1990s VRML with the classic LeNet-5, using 3D visualization to open the neural network "black box" — this is exactly that kind of creativity in action.
As AI increasingly permeates everyday life, finding intuitive and accessible ways to explain how these complex models work will become ever more important. Similar visualization explorations, regardless of whether the tech stack is "trendy," deserve encouragement — because they make abstract algorithms perceivable and understandable, which is in itself a valuable contribution.
Related articles

Gemini 3.7 Flash Spotted in Google Cloud Console — Launch Countdown Begins
Developers spot Gemini 3.7 Flash in Google Cloud Console, sparking discussion about its relationship to Pro and Google's model distillation strategy.

AI-Memory: Building a Cross-Tool Long-Term Memory System for Coding AIs
AI-Memory is a Rust-based open-source project providing long-term memory for Claude Code, Cursor, Aider and other Agent coding CLIs, enabling seamless handoff between vendors.

Bullet Enters the Stage: YC Newcomer Bets on a Faster Coding Agent
YC S26 startup Bullet launches a speed-focused coding Agent targeting developer latency pain points. Analysis of its differentiation, acceleration techniques, and market opportunity against Cursor and Claude Code.