## 2 Theoretical Background of Applied Method
### Feed-Forward Neural Networks  
The nonlinear structure of neural networks (NNs) is suitable for predicting process variables in many industries. Recent applications of NNs to the BOS process can be found in [22; 26; 27; 28]. Neural networks consist of sensory units of so-called input neurons, which form an input layer followed by one or more hidden layers, each with a set number of neurons. Feed-forward neural networks pass a linear combination of inputs from one layer to another. As they do this, the neurons decide how to modify their inputs, utilizing a given activation function. In NN, each neuron \(v_{i}\) has activity \(x_{i}\) and threshold \(\theta_{i}\). The connections to neighboring neurons are rated by weights \(w_{ij}\). The learning of the network consists in finding the weights and thresholds that correspond to the pair of an input vector of activities \(\mathbf{x}\) and the desired output vector of activities \(\mathbf{\hat{y}}\)[66]. Depending on the type of approach to modeling the BOS process (i.e., from static or combined static and dynamic data), tensor (1) or (2) is used and subsequently decomposed into a sequence of more pairs of input and desired output vectors:  
\[(\mathbf{x_{1}}/\mathbf{\hat{y}_{1}}),(\mathbf{x_{2}}/\mathbf{\hat{y}_{2}}),...,(\mathbf{x_{N}}/\mathbf{\hat{y}_{N}}), \tag{13}\]  
The goal of learning is to minimize error \(E\) (14) in individual cycles to achieve the required accuracy. \[E=\sum_{i=1}^{N}E_{i}=\sum_{i=1}^{N}\frac{1}{2}(\mathbf{y_{i}}-\mathbf{\hat{y }_{i}})^{2}, \tag{14}\]  
where \(\mathbf{y_{i}}\) is the output vector of the NN as a response to the input vector \(\mathbf{x_{i}}\), and the desired output vector \(\mathbf{\hat{y}_{i}}\) is assigned to the input \(\mathbf{x_{i}}\). Network error minimization (14) can be calculated by the gradient method, where for multiple pairs of input-output vectors, the total gradient of the objective function is calculated as follows:  
\[\text{grad }E=\sum_{i=1}^{N}\text{grad }E_{i}, \tag{15}\]  
where the objective function \(E_{i}\) is defined for the \(i\)-th pair \(\mathbf{x}/\mathbf{\hat{y}}\) of the training set. Formally, the trained NN can be expressed as follows:  
\[(\overline{\boldsymbol{w}},\overline{\boldsymbol{\theta}})=\underset{( \boldsymbol{w},\boldsymbol{\theta})}{\text{argmin}}\ E(\boldsymbol{w}, \boldsymbol{\theta}). \tag{16}\]  
The following procedure can be used to calculate the outputs for one training sample considering a neural network with multiple inputs and multiple outputs. The output from the hidden layer can be calculated according to the following equation:  
\[L_{j}=f\left(\sum_{i=1}^{N}(w_{ij}x_{i}-\theta_{j})\right);\ \ \ \ j=1,2, \ldots M, \tag{17}\]  
where \(\theta_{j}\) is the threshold of the hidden layer neuron, \(f(. )\) is an nonlinear transfer function, \(w_{ij}\) is the input-hidden layer link weights, \(w_{jk}\) is the hidden-output layer link weights, \(N\) is the number of neurons in the input layer, and parameter \(M\) represents the number of neurons in the hidden layer. The output value of the \(k\)-th neuron in the output layer can be calculated as the following:  
\[y_{k}=\sum_{j=1}^{M}L_{j}w_{jk}-a_{k};\ \ \ \ \ k=1,2,\ldots,l, \tag{18}\]  
where \(a_{k}\) is the threshold of the output layer neuron and parameter \(l\) represents the number of neurons in output layer [22]. Figure 4 shows the general structure of NN for BOS process modeling and selected output prediction.The back-propagation algorithm for NN training was used in this study [67; 68; 69]. For the NN that was tried in this study, only one hidden layer was used. The number of neurons in the hidden layer was set to \(2N+1\), where \(N\) is the number of input neurons. This setup results from experimental trials where the best performance was searched. The maximum number of learning epochs was set to 1000 and the learning rate to 0.00000001. The gradient descent method combines adaptive learning rate with momentum training and was used to train the network.