# Boiling Flow Pattern Identification Using a Self-Organizing Map
## 2 Materials and Methods
### Self-Organizing Map  
The Kohonen network [35] is an example of an unattended network. It has a special property of effectively creating a spatially organized internal representation of various input data features and providing topology-preserving mapping from a high dimensional space into what is usually a two-dimensional space. The idea of a self-organizing map (\(SOM\)) appeared in the 1950s and was proposed by Finnish computer scientist [PERSON]. In the classic Kohonen algorithm, each small element (or neuron) gets many inputs and generates only one output signal. The individual input connections have an assigned weight. When a neuron receives an input pattern, it usually calculates the weighted sum of inputs. In principle, it is useful to consider the values of different weights as components of the weight vector and individual input signals as components of the input vector. As a result of the windowed \(RQA\), 4 input points for each window of pressure drop oscillation were obtained. The input vector describes the following relationship:  
\[X=\left[DET_{n},\;\frac{1}{L_{n}},\;T_{n}^{2},\;\frac{1}{RPDE_{n}}\right]^{ \text{T}} \tag{6}\]  
where \(n\) is the row number, which corresponds to the duration of the pressure drop signal. These time series are shown in Figure 5. In Figure 5b,c, we presented graphs on a logarithmic scale to indicate a change in the dynamics of the \(T^{2}\) and \(RPDE\) coefficients. In the \(SOM\) algorithm, the weight vector is as follows [36]:  
\[W=\left[w_{j,DET},w_{j1/L},w_{j,T2},w_{j1/RPDE}\right]^{\text{T}} \tag{7}\]  
where \(j\) is the number of neurons in the network. In our analysis, \(j\) is from 1 to 36. Therefore, this algorithm is expressed in the following way [19]:  
\[Y=W\cdot X=\sum\
olimits_{i=1}^{i=n}w_{i}\cdot x_{i} \tag{8}\]  
where \(X\) is the input vector, \(W\) is the weight vector, the dimension of which is \(36\times 4\), and \(Y\) is the output vector. During the subsequent iterations, neurons compete for the privilege of learning. The best neuron is the winner of the competition. The winning neuron generates an output signal, while others generate 0. The winning neuron and its nearest neighbors are the only neurons that can learn to present the pattern or can adjust their weights [37; 38]. [PERSON]'s learning rule can be expressed as follows [19]:  
\[W_{new}=W_{old}+\lambda(X-W_{old}) \tag{9}\]  
where \(\lambda\) is the learning constant; its default value is 1. The structure of the [PERSON]'s self-organizing neural network consists of two layers. The first layer is the input layer. In our case, this is \(RQA\) vectors and the second one is the output layer-2D matrix (\(6\times 6\)), which represents neurons. Thus, each of the \(RQA\) results (180) was assigned to 1 of 36 neurons arranged in matrix (\(6\times 6\)). Such a 2D map is called the hit histogram and visualizes the density of points on the \(SOM\) by counting how many input vectors are mapped onto each \(SOM\) node. Neurons of similar weight locate themselves close to one another, while dissimilar neurons are far from each other [19; 37]. In our algorithm, the network training was performed 10 times using some \(RQA\) results. In Figure 6, the procedure of \(SOM\) combined with \(RQA\) for pressure drop oscillation is presented. The analysis using \(SOM\) was conducted in Matlab software using the Neural Network Clustering App [39]. The self-organizing process involves four basic elements: initialization, competition, cooperation, and adaptation. The procedure has been summarized in eight steps:  
1. Loading the pressure drop oscillations;
2. The division of the signal (185,000 samples) into segments of 5000 samples;
3. Conducting the windowed \(RQA\) analysis for each segment. As the results of the analysis, the matrix containing the \(RQA\) coefficients is being created (\(DET\), 1/\(L\), \(T^{2}\) and 1/\(RPDE\)). 4. \(SOM\) random initialization;
5. \(SOM\) training using 1000 iterations;
6. Comparison of each test vector with prototypes of the map (\(SOM\) classification);
7.