Chapter 3
Unsupervised Learning (KSOM)
Unsupervised and competitive learning, Self-Organizing Maps, and the Kohonen SOM algorithm with a worked distance and weight-update example.
From: Chapter 3_Unsupervised Learning (KSOM).pptx
Unsupervised learning (slide 3)
- Modifies weights without specifying the desired output for any input pattern (Fausett, 1990). Used for clustering, extracting principal components, curve fitting.
- Most common method: cluster analysis, for exploratory analysis of hidden patterns or groupings. Similarity is measured by Euclidean or probabilistic distance.
- Two classic examples: clustering (group similar patterns; groups not known in advance) and dimensionality reduction (reduce the number of variables; split into feature selection and feature extraction).
Competitive learning (slide 4)
- Unsupervised learning is based on competitive learning: the net adjusts its weights after the winning node is chosen.
- The activated neuron is the winner-takes-all neuron (winning neuron/unit).
- Neurons are forced to organise themselves, hence Self-Organizing Map (SOM).
Self-Organizing Map (slides 5–9)
- Goal: transform an input pattern of arbitrary dimension into a 1-D or 2-D discrete map, adaptively and in a topologically ordered way.
- Feed-forward structure with a single computational layer in rows and columns. Each neuron is fully connected to all input nodes.
- The SOM picks the neuron most similar to the input; that neuron and its neighbours adjust towards the input. Over time similar data group in nearby parts of the map.
| Component | What happens |
|---|---|
| 1. Initialization | All weights set to small random values |
| 2. Competition | Each neuron computes a discriminant function; the one with the smallest value wins |
| 3. Reward (cooperation) | The winner sets a topological neighbourhood; neighbours are updated too |
| 4. Adaptation | After some epochs, the learning rate and radius are reduced |
Kohonen SOM (slides 10–12)
- Introduced by Teuvo Kohonen in 1982 (extended in 2001 for data visualisation).
- Clusters and visualises high-dimensional data in a low-dimensional space; trained by competitive learning.
- A single-layer 2-D grid (lattice) of neurons. Nodes do not know their neighbours' values.
- Topology is preserved: neighbouring neurons respond to similar inputs.
KSOM algorithm (slide 13)
Steps
- Step 0: initialise weights wij, the neighbourhood (radius) and learning rate.
- Step 1: while the stopping condition is false, do Steps 2–8.
- Step 2: for each input vector x, do Steps 3–5.
- Step 3: for each cluster unit j, compute the distance D(j).
- Step 4: find J where D(J) is the minimum (the winner).
- Step 5: for all units j in the neighbourhood of J, update the weights.
- Step 6: update the learning rate. Then reduce the radius and test the stopping condition.
D(j) = Σᵢ (wᵢⱼ − xᵢ)²
The worked example takes the square root (Euclidean distance). Either way, the smallest wins.
wᵢⱼ(new) = wᵢⱼ(old) + α · [xᵢ − wᵢⱼ(old)]
α(t+1) = 0.5 · α(t)
Geometric decrease used in the training exercise, starting at α(0) = 0.6
h = α(t) · exp( −‖r_c − r_i‖² / 2σ² )
Gaussian neighbourhood: r_i winning node, r_c output node, σ radius (slide 16)
Small distance = similar, large distance = not similar. The winner is always the smallest D(j) (slide 15).
Training exercise (slides 17–18)
- Vectors: (1,1,0,0), (0,0,0,1), (1,0,0,0), (0,0,1,1). Clusters m = 2. α(0) = 0.6, radius 0.
- Cluster 1 weights (0.2, 0.6, 0.5, 0.9); cluster 2 weights (0.8, 0.4, 0.7, 0.3).
- Input x = (1,1,0,0): d(1) = √[(0.2−1)² + (0.6−1)² + (0.5−0)² + (0.9−0)²] = √1.86 = 1.3638.
- d(2) = √[(0.8−1)² + (0.4−1)² + (0.7−0)² + (0.3−0)²] = √0.98 = 0.9899.
- d(2) is smallest, so cluster 2 wins. Radius 0, so only cluster 2's weights change.
- w12 = 0.8 + 0.6(1 − 0.8) = 0.92; w22 = 0.4 + 0.6(1 − 0.4) = 0.76; w32 = 0.7 + 0.6(0 − 0.7) = 0.28; w42 = 0.3 + 0.6(0 − 0.3) = 0.12.
SOM quality (Chapter 1, slide 30): quantization error (QE) and topographic error (TE). Both should drop as training goes on.