Ann Som
Ann Som
4
Self-Organizing Maps (SOMs)
1. Input Vector Dimensionality: The input vectors represent the data that you want to classify or cluster. Each
element in the input vector represents a feature or attribute of the data point. In the context of color classification,
each input vector is typically a 3D vector representing the Red, Green, and Blue (RGB) values of a color. Hence,
the input vector dimensionality is 3.
2. Neuron Weight Vector Dimensionality: Each neuron in the SOM has a weight vector associated with it. This
weight vector also has the same dimensionality as the input vectors. In the case of color classification, each
neuron's weight vector is also a 3D vector representing an RGB color.
an example of pattern identification using a Self-Organizing Map (SOM) in a
step-by-step manner. In this example, we'll consider the task of classifying
flowers into different species based on their petal length and width. We'll use a
simple 2x2 SOM grid for illustration.
18
Terminology used
• Clustering
• Unsupervised learning
• Euclidean Distance
p (p1 , p 2 ,..., p n )
q (q1 , q 2 ,..., q n )
n
ED (p
i 1
i qi ) 2
19
Self-Organizing Maps (SOMs)
• Biologically inspired
by human brain and
nervous system
• Clustering algorithm
that maps input to
best matching unit
• Maps n-dimensional
input space onto a
two dimensional map
• Preserves
topological
relationships in the
data
08 October 2023
21
22
23
SOM algorithm – Finding winning neuron
Find neuron whose weights closest match the inputs
winner
08 October 2023
25
SOM algorithm – weight adaptation
/ 2 )
2 2
h ij exp( dij
The neighborhood function hij is typically a decreasing function of the distance between the winning neuron and
the neuron being updated.
27
A larger σ will result in a broader neighborhood, meaning that more
neurons will be influenced by the BMU during training. Conversely, a
smaller σ will result in a narrower neighborhood, where only nearby
neurons will be significantly influenced by the BMU.
28
29
In a Self-Organizing Map (SOM), each cluster is represented by a "cluster
center," which is typically the best-matching unit (BMU) or winner neuron for
that cluster. A smaller cluster size means that the SOM is organizing the input
data into finer and more distinct groupings.
Smaller Cluster Size:
•Results in more focused and specific representations of patterns or features in the
input data.
•Each neuron, as a cluster center, represents a specific and localized region of the input
space.
1.Larger Cluster Size:
1. Represents broader, more general patterns in the input data.
1. Each neuron, as a cluster center, represents a larger region of the input space.
By adjusting the SOM's parameters, such as the neighborhood size (σ), during training,
we can control the cluster size and, consequently, the specificity of the representation.
This flexibility allows you to tailor the SOM's organization to match the complexity and
detail of the input data.
30
31
Kohonen Learning Algorithm
We'll calculate the Euclidean distance between the input pattern (0.3, 0.6) and
each neuron's weight. Then, we'll use the Gaussian neighborhood function to
calculate the neighborhood weights based on the distance and a specified
neighborhood radius (σ).
•Input Pattern: (0.3, 0.6)
Calculate Distances and Neighborhood Weights
•Distance to Neuron 1: dist(X,W1)=(0.3−0.2)^2+(0.6−0.5)^2≈0.1414
New Weight5=(0.6,0.7)+0.1×exp(−dist(1,5)^2/((2×0.52)^2)
)×[(0.3,0.6)−(0.6,0.7)]
41
42
43
44
45
46