AI and Machine Learning Visualizations in Three.js

Machine learning is easier to understand when you can watch it work. These demos visualise algorithms in 3D as they run, including a neural network training with backpropagation, k-means and DBSCAN clustering, decision tree splits, and Q-learning and SARSA agents learning a gridworld.

You will also find pathfinding with A*, Dijkstra and BFS, boids flocking, genetic programming, word embeddings with attention, object detection overlays and a recommendation engine. Every algorithm runs live in the browser, and each page explains what is happening at each step.

Most viewed in ai & machine learning

All ai & machine learning demos

10 Demos
Three.js Neural Network Training Visualization (Backprop in 3D) preview
Explore Demo →

Three.js Neural Network Training Visualization (Backprop in 3D)

Watch a small neural network learn in real time in Three.js, as a 2-8-8-1 multilayer perceptron trains with backpropagation on spiral, XOR, circle or moons data, with a live 3D decision surface and neurons and weights coloured by activation and sign.

ai
Three.js Pathfinding Visualizer (A*, Dijkstra, Greedy, BFS) preview
Explore Demo →

Three.js Pathfinding Visualizer (A*, Dijkstra, Greedy, BFS)

Compare A*, Dijkstra, greedy best-first and breadth-first search on a 3D grid in Three.js, animating the open set, explored cells coloured by cost and the final path over random walls, recursive mazes or weighted terrain, with click-to-edit walls.

ai
Three.js Boids Flocking Simulation (Separation, Alignment, Cohesion) preview
Explore Demo →

Three.js Boids Flocking Simulation (Separation, Alignment, Cohesion)

Reynolds boids in Three.js, with thousands of instanced birds steering by separation, alignment and cohesion using a spatial hash, avoiding obstacles and scattering from a hunting predator.

ai
Three.js Decision Tree Classifier (CART Visualization) preview
Explore Demo →

Three.js Decision Tree Classifier (CART Visualization)

Grow a CART decision tree in Three.js on rings, blobs or checkerboard data, watching the axis-aligned decision regions refine as depth increases next to a live diagram of the learned splits, leaf classes and training accuracy.

ai
Three.js Clustering Algorithms (K-means vs DBSCAN in 3D) preview
Explore Demo →

Three.js Clustering Algorithms (K-means vs DBSCAN in 3D)

Animated unsupervised clustering in Three.js, comparing K-means with k-means++ seeding (assign and update steps converging) against density-based DBSCAN growing clusters and flagging noise on 3D blobs, rings and moons.

ai
Three.js Genetic Programming (Symbolic Regression) preview
Explore Demo →

Three.js Genetic Programming (Symbolic Regression)

Evolve mathematical programs in Three.js, where a population of expression trees uses tournament selection, subtree crossover and mutation to rediscover a target function from data, shown with the best program's curve and a live tree diagram.

ai
Three.js Reinforcement Learning (Q-Learning vs SARSA Gridworld) preview
Explore Demo →

Three.js Reinforcement Learning (Q-Learning vs SARSA Gridworld)

Tabular reinforcement learning in Three.js, where an agent learns to reach the goal in cliff-walk, four-rooms and maze gridworlds with Q-learning or SARSA, shown as live value heights, greedy-policy arrows and the latest episode path.

ai
Three.js Computer Vision Object Detection Overlay preview
Explore Demo →

Three.js Computer Vision Object Detection Overlay

A real-time detection pipeline on a Three.js scene, where frames from an offscreen render-target "sensor" are read back, colour-segmented in HSV and grouped with union-find connected components into labelled bounding boxes drawn as an overlay.

ai
Three.js Word Embeddings & Attention (NLP Visualization) preview
Explore Demo →

Three.js Word Embeddings & Attention (NLP Visualization)

Explore a 21-dimensional word-embedding space in Three.js, projected to 3D with PCA, solving analogies such as king − man + woman ≈ queen with arrows, and showing scaled dot-product self-attention between the words of a sentence.

ai
Three.js Recommendation Engine (Collaborative Filtering) preview
Explore Demo →

Three.js Recommendation Engine (Collaborative Filtering)

Collaborative filtering with matrix factorisation in Three.js, as SGD learns user and item vectors from a sparse ratings matrix, plotted live in a 3D latent space with predicted ratings filling the matrix and top-5 recommendations for each user.

ai