# A Machine Learning Framework for Condition-Based Maintenance of Marine Diesel Engines: A Case Study
## 3 Proposed Framework
### Artificial Neural Network and Ensemble Neural Network  
An ANN is an ML algorithm that consists of different interconnected hidden layers, where neurons process the data to produce an output (Figure 2).  
The inputs to the ANN are represented by numbers, so in the current application the sensor measurements can be used as inputs to the algorithm. After that, the values are multiplied by the weights in the hidden layers, which are initialized randomly. The multiplication results are added together to produce the neuron output. Finally, once the information arrives at the final layer, the ANN outputs are produced. In the present study, the outputs are the expected sensor measurements associated with the inputs. This basic kind of information propagation is called forward propagation. During the training phase, there is also a second kind of propagation, backward propagation (not shown in Figure 2). In this case, the error is propagated backwards (from the output to the input) to update the weight values.  
The output can be a regression or a classification. More details can be found in [57]. The algorithm is described by (3)-(7):  
\[y=f\left(\sum_{i=1}^{n}w_{i}x_{i}+b\right) \tag{3}\]  
\[f(x)=\frac{2}{1+e^{-2x}}-1 \tag{4}\]  
\[h_{j}=f\left(\sum_{i=1}^{n}w_{ij}x_{i}+b_{j}\right) \tag{5}\]  
\[y_{k}=f\left(\sum_{i=1}^{m}w_{jk}h_{j}+b_{k}\right) \tag{6}\]  
\[\Delta w_{jk}=\eta\delta_{k}h_{j} \tag{7}\]  
where (3) allows us to compute the output of the neural unit, \(x_{i}\) is an input, \(w_{i}\) is a weight, \(b\) is the bias, and \(f\) is the activation function. In more detail, in (5), \(w_{ij}\) is the weight associated with the \(i\)-th neuron input \(x_{i}\) and the \(j\)-th neuron output \(h_{j}\); \(b_{j}\) is the bias of the \(j\)-th neuron.  
Figure 2: Structure of artificial neural networks.  
In (6), \(b_{k}\) is the bias of the \(k\)-th output; \(w_{jk}\) is the weight associated with the \(j\)-th hidden layer input and the \(k\)-th output. The \(tanh\) function in (4) is the activation function used in the present study and introduces nonlinearity in the system. The computations in (5) and (6) represent the feedforward operations for the hidden layer and the output layer, respectively. They describe the propagation of data to compute the output. Here, \(h_{j}\) is the neuron output of the \(j\)-th hidden layer; \(y_{k}\) is the \(k\)-th output. Equation (7) describes the backpropagation, namely, the error computation to update the weights: \(\eta\) is the learning rate and \(\delta_{k}\) the error between the network output and real data.  
An ENN represents an extension of the previous neural architecture. The ENN output is obtained by combining the outputs of several ANNs. The authors propose two different ENNs: the first one generates an output by arithmetically averaging the single neural network outputs; the second one by computing the output as the weighted mean of the single neural network outputs. The weights are assigned on the basis of the error made by each ANN. The ANN with the smallest error has the biggest weight.