Self-organizing maps (SOMs) as an AI tool for music analysis and production
2. How does a SOM work?
2.4. The u-matrix
Since we trained the map using colors, visualizing the pointer of each node is straightforward, as it is a color itself. Consequently, similarities between the nodes can be directly seen. As soon as different data is chosen, however, and the dimension of the feature vector is larger than three, no direct visualization is possible anymore.
In such cases the u-matrix may be calculated. Even though the result may look rather complicated it is computed straightforwardly. Again, Euclidean distances are calculated, however, distances between the SOM nodes and the training items are not computed. To calculate the u-matrix, the distances of a node to its neighboring nodes are observed instead. The resulting mean value is shown on the map, ranging from black for low mean values, to white for high mean values. As a result, if a node is visualized with a light color the distances to its neighboring nodes are large, while dark nodes are very similar to their neighbors.
Comparing both visualizations of the SOM reveals that regions assigned to a single color are shown in black on the u-matrix. The map becomes gray for smooth transitions between those regions, while sudden and chaotic transitions are visualized in white. Of course a lot of detail is lost on the u-matrix, as it is still known that a region is assigned to a single color, but which color remains unclear. This trade-off cannot be avoided when visualizing an entire, high-dimensional feature space with a single map.