Best Matching Unit
The neuron whose weight vector is closest to the current input is called the BMU.
A Self Organizing Map, or SOM, is a neural network that learns to arrange high-dimensional data onto a low-dimensional grid. Similar inputs activate nearby neurons, creating a visual map of hidden structure in the data.
A SOM is trained without labels. Every neuron owns a weight vector. For each input, the closest neuron wins. Then the winner and its neighbors move closer to that input. Over many iterations, the grid becomes an organized map of the input space.
The neuron whose weight vector is closest to the current input is called the BMU.
Nearby neurons also update, which keeps the map smooth and topologically ordered.
The learning rate controls how strongly neurons move toward each training sample.
Complex input patterns become easier to inspect on a 2D neuron grid.
The core idea is simple: find the winning neuron, then pull it and its neighbors toward the input.
In this example, each input is an RGB vector: [red, green, blue]. The SOM learns to arrange colors so that similar colors appear near each other.
The grid starts with random colors. During training, random colors are sampled from a curated palette. The closest neuron becomes the winner, and surrounding neurons shift toward the sampled color.
After training, nearby cells tend to form smooth color regions: blues near cyans, reds near pinks, yellows near greens, and so on.
In this example, each input is a 2D point: [x, y]. The SOM learns to bend its grid over the shape of the data distribution.
The data contains three visible clusters. The SOM starts as a loose grid of random neurons. During training, the neurons are pulled toward dense areas of data while preserving neighborhood structure.
The result is a flexible 2D map that approximates the topology of the dataset. This is useful for exploratory clustering, anomaly detection, customer segmentation, and visualization.
This example uses 9 editable samples. Each sample has 3 dimensions: [x₁, x₂, x₃]. A 3 × 3 SOM also has 9 neurons with random 3D weight vectors. The 2D plot shows dimensions x₁ and x₂, while x₃ is represented by color intensity.
Change any sample value between 0 and 1. Select an active sample, then train one step to see the exact SOM math update.
| Sample | x₁ | x₂ | x₃ |
|---|
Projection: horizontal axis = x₁, vertical axis = x₂. Color intensity represents x₃.
For each neuron, we calculate the Euclidean distance between the active input vector and the neuron's current 3D weight vector.
| Neuron | Weight [w₁,w₂,w₃] | Grid | Distance |
|---|
This panel shows the latest training step. The BMU gets the strongest update. Neighbors get smaller updates based on grid distance.