Kohonen Self Organizing Maps for Process Applications, using Silverlight

In this blog I will discuss Kohonen self organizing maps (SOM), and how it could be applied to process engineering problems. I will also illustrate its use with a typical example, and then with a process engineering example. For this application I have used the Microsoft .NET framework, writing code in C# with the examples having Silverlight frontends. This blog will be focussed on the concept and application, rather the details on exactly how it is programmed. To follow first is short overview of what SOM’s are, a broader explanation can be found on Wikipedia.

Purpose and uses of SOM’s
SOM’s are types of artificial intelligence methods to organize and reduce high dimensionality of data to the level it can be used to visualize the it and make decisions. When configured and trained, SOM’s can have several uses to tackle challenges in specifically metallurgical and chemical processes that are not always that easy to model:

  • Model the process: The complete vector in the SOM can be found closest to the partial input vector, therefore predicting the unknown elements. In this case, the SOM has to be trained using complete vectors of historical data.
  • Categorization: The SOM will be organized into regions with distinctive element values, indicating specific operating conditions. When an input vector is feed into the SOM it will find the closest vector in the SOM and visually indicate the operating region.
  • Generate random data: A less common use of SOM is to generate data with values distributed according to the input data. For example, it is required to get a list of chemical compositions where the values of components vary between certain values, and only for certain values of other components, and some chemical compositions are available to train a SOM.
  • Fault finding: It might be possible to find a fault occurring that are related to certain conditions in other process variables which are not that obvious. Creating a SOM with all the data will arrange it and might indicate the regions where combinations of certain process conditions occured with the fault. This can also be used just find the cause of some condition in a process variable, rather than a fault.

SOM’s are usually mapped in a two-dimensional grid of nodes, where each node contains a vector of same dimension as the high-dimensional data input data. The number of nodes in the maps can be any amount, depending on the resolution and accuracy required. After training, the grid will be arranged into regions representing different conditions in the data vectors. This shows that SOM’s can therefore also be used for cause-effect type analyses through visual interpretation of the trained SOM.

To illustrate this more clearly, the following shows the typical layout of a SOM in two dimensions. Firstly the grid of the entire map (5 x 5 here) shows the row and column index of each node, then the vectors with values are shown for each node.

For training, the map is initialized with vectors of random but typical values, and then iteratively trained using one training vector at a time. In the training process, the vector closest to the training point is found and adjusted, together with the surrounding nodes, to be closer to the training value. This means that each value in the vector is manipulated, while the neighborhood radius of surrounding nodes decreases as training progresses, as well as the training rate.

After training then, the map would have been organized into region of vectors with related values. If, for example, the SOM is trained to model plant operating conditions, certain regions in the SOM would represent vectors where the values of one or more elements is significantly different and indicating specific operating conditions.

Basic example
One of the most basic examples of SOM’s is that of a grid of vectors each of length 2, representing an X and Y coordinate plotted on a chart. Each point plotted is connected with a line to the points of all 4 of its neighbours’ in the grid.  The SOM is initialized with random values and when first plotted it’s a mess with points and lines. As the SOM is trained (also with random values) the points move around, and also their neighbours get moved closer. After training a neat grid has been obtained, and all the nodes have been de-tangled.

The example is shown in the frame below, and requires of your browser to have Microsoft Silverlight installed, which can be done by following the plug-in information displayed in its place below. This application can also be installed by right clicking on it, and selecting the installation option. You can start, stop, and reset the training of the example SOM. Starting it would begin execution of 5000 steps, and resetting it would randomize the vector values. Each node is plotted as a circle on a canvas, with the coordinates of X and Y values in the vector, and the color changed from white to blue depending on the euclidean distance to the neighbor vectors (white the lowest distance).

[field name=iframe2]

Below is a static image of what the example above could look like after training.

Higher dimension example
Another typical example is that of defining vectors of length 3 and translating it to colors. For example, let’s consider a smelting process where the three points represent the mass percentages of three slag species, say SiO2, CaO and MgO.  Historical operational data is available, like that shown in the following table, representing typical slag compositions that has been obtained. Our vector might also be longer, containing values of say, metal tonnage produced, and energy consumption. If we create a SOM and train it with the historical data we would get a tool with which we can categorize new slag compositions, or model unknown values in the vector. The SOM itself would contain organized vectors and of a much higher resolution as the input data.

Because the vector is of length 3, we can translate each value to a new value between 0 and 255 to create a new vector of red, green, and blue. This means that in our example nodes depicting high SiO2 content would be more red, and more green nodes for higher CaO, etc. The SOM is initialized with random values for each node, and then iteratively trained with our historical data. While the SOM is trained, one can observe how the nodes’ values changes and grouped into regions of specific colors.

This example was again applied in a Silverlight application below, which can started, stopped, and reset. A difference of note from the previous example is that the SOM grid is now toroidal, meaning that the outer edges are connected when considering each node’s neighbours.

[field name=iframe3]

Below is a static image of what the example above could look like after training.

U-map display
A way to visualize the higher dimensional data, is by means of what is called a U-map. This in essence shows the euclidean distance between each node and its neighbors. A U-map created from the previous example is shown below. The darker blue colors shows larger distances from its neighbors, having some values in the vectors that are significantly different. The darker blue lines are therefore outlines depicting specific regions.

It is also of use to create U-maps of each variable in the the vector of each node. This is illustrated below was done for our example earlier. White indicates the lowest value of each variable, and blue the highest value. It is possible in this case to observe for the low values in CaO (white) the MgO is high (blue), and visa versa.

To conclude, it was illustrated what SOM’s are and how it could be applied to process engineering applications. However, as with any type of artificial intelligence the user of this technology should have a deep understanding of how it works and what is does. It is very risky to use any type of artificial intelligence without  this level of understanding.

Posted in Uncategorized and tagged , .