Reference articles on history, science, culture and more
Encyclopedia

Learning vector quantization

In computer science, learning vector quantization (LVQ) is a prototype-based supervised classification algorithm. LVQ is the supervised counterpart of vector quantization systems. LVQ can be understood as a special case of an artificial neural network, more precisely, it applies a winner-take-all Hebbian learning-based approach. It is a precursor to self-organizing maps (SOM) and related to neural gas and the k-nearest neighbor algorithm (k-NN). LVQ was invented by Teuvo Kohonen.

01Definition

An LVQ system is represented by prototypes W=(w(i),...,w(n)) which are defined in the feature space of observed data. In winner-take-all training algorithms one determines, for each data point, the prototype which is closest to the input according to a given distance measure. The position of this so-called winner prototype is then adapted, i.e. the winner is moved closer if it correctly classifies the data point or moved away if it classifies the data point incorrectly.

An advantage of LVQ is that it creates prototypes that are easy to interpret for experts in the respective application domain. LVQ systems can be applied to multi-class classification problems in a natural way.

A key issue in LVQ is the choice of an appropriate measure of distance or similarity for training and classification. Recently, techniques have been developed which adapt a parameterized distance measure in the course of training the system, see e.g. (Schneider, Biehl, and Hammer, 2009) and references therein.

LVQ can be a valuable aid in classifying text documents.

Some Apollonian circles. Every blue circle intersects every red circle at a right angle. Every red circle passes through the two points C, D, and every blue circle separates the two points.
Some Apollonian circles. Every blue circle intersects every red circle at a right angle. Every red circle passes through the two points C, D, and every blue circle separates the two points.

02Algorithm

The algorithms are presented as in.

Set up:

  • Let the data be denoted by x_{i}\in \mathbb {R} ^{D}, and their corresponding labels by y_{i}\in \{1,2,\dots ,C\}.
  • The complete dataset is \{(x_{i},y_{i})\}_{i=1}^{N}.
  • The set of code vectors is w_{j}\in \mathbb {R} ^{D}.
  • The learning rate at iteration step t is denoted by \alpha _{t}.
  • The hyperparameters w and \epsilon are used by LVQ2 and LVQ3. The original paper suggests \epsilon \in [0.1,0.5] and w\in [0.2,0.3].

LVQ1

Initialize several code vectors per label. Iterate until convergence criteria is reached.

  1. Sample a datum x_{i}, and find out the code vector w_{j}, such that x_{i} falls within the Voronoi cell of w_{j}.
  2. If its label y_{i} is the same as that of w_{j}, then w_{j}\leftarrow w_{j}+\alpha _{t}(x_{i}-w_{j}), otherwise, w_{j}\leftarrow w_{j}-\alpha _{t}(x_{i}-w_{j}).

LVQ2

LVQ2 is the same as LVQ3, but with this sentence removed: "If w_{j} and w_{k} and x_{i} have the same class, then w_{j}\leftarrow w_{j}-\alpha _{t}(x_{i}-w_{j}) and w_{k}\leftarrow w_{k}+\alpha _{t}(x_{i}-w_{k}).". If w_{j} and w_{k} and x_{i} have the same class, then nothing happens.

LVQ3

Initialize several code vectors per label. Iterate until convergence criteria is reached.

  1. Sample a datum x_{i}, and find out two code vectors w_{j},w_{k} closest to it.
  2. Let d_{j}:=\|x_{i}-w_{j}\|,d_{k}:=\|x_{i}-w_{k}\|.
  3. If \min \left({\frac {d_{j}}{d_{k}}},{\frac {d_{k}}{d_{j}}}\right)>s, where s={\frac {1-w}{1+w}}, then
    • If w_{j} and x_{i} have the same class, and w_{k} and x_{i} have different classes, then w_{j}\leftarrow w_{j}+\alpha _{t}(x_{i}-w_{j}) and w_{k}\leftarrow w_{k}-\alpha _{t}(x_{i}-w_{k}).
    • If w_{k} and x_{i} have the same class, and w_{j} and x_{i} have different classes, then w_{j}\leftarrow w_{j}-\alpha _{t}(x_{i}-w_{j}) and w_{k}\leftarrow w_{k}+\alpha _{t}(x_{i}-w_{k}).
    • If w_{j} and w_{k} and x_{i} have the same class, then w_{j}\leftarrow w_{j}-\epsilon \alpha _{t}(x_{i}-w_{j}) and w_{k}\leftarrow w_{k}+\epsilon \alpha _{t}(x_{i}-w_{k}).
    • If w_{k} and x_{i} have different classes, and w_{j} and x_{i} have different classes, then the original paper simply does not explain what happens in this case, but presumably nothing happens in this case.
  4. Otherwise, skip.

Note that condition \min \left({\frac {d_{j}}{d_{k}}},{\frac {d_{k}}{d_{j}}}\right)>s, where s={\frac {1-w}{1+w}}, precisely means that the point x_{i} falls between two Apollonian spheres.

Watch videos about Learning vector quantizationExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Learning vector quantization, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.