skip to content
Interactive demo

Self-Organizing Maps

A Kohonen self-organizing map is a 2D grid of neurons whose weight vectors live in the data space. Show it a sample, pull the closest neuron and its grid neighbors toward that sample, repeat. Over training the chaotic grid resolves into a topologically faithful map of the data: nearby cells encode nearby inputs. Below the map learns the structure of an RGB dataset live, then you can probe it with any color.

Phase 1 · Learning

Train a hex SOM on random color samples

At each step we draw a random RGB sample, find the best matching unit then pull every neuron toward the sample with influence that falls off both in grid distance from the BMU and over time: with neighborhood kernel . Both the learning rate and the neighborhood radius decay exponentially: . Toggle the view to see either the learned colors, the U-Matrix (lightness = similarity between neighbors, dark ridges = cluster boundaries), or the hit map (how often each neuron wins).

Controls
View
Total steps 3000
Initial η 0.30
Initial σ (cells) 14
Training
step 0
η(t) --
σ(t) --
q.err --
Hex grid (click to see what color a cell encodes)
Phase 2 · Inference

Probe with a color, find its best matching unit

Pick any color. We find the single hex whose weight vector is closest in Euclidean RGB distance and highlight it on the map. Hover any cell to read its weight in the panel on the left.

Pick a color Best matching unit
--
distance: --
Hovered cell
hover the map
rgb: --
Same grid, with the BMU highlighted
Sources and reading
  • Kohonen, T. Self-organized formation of topologically correct feature maps, Biological Cybernetics 43, 1982.
  • Kohonen, T. Self-Organizing Maps, Springer Series in Information Sciences (3rd ed.), 2001.
  • Ultsch, A., Siemon, H. P. Kohonen's self organizing feature maps for exploratory data analysis, INNC, 1990. (The U-Matrix visualization.)