# SOPRENE: Assessment of the Spanish Armada's Predictive Maintenance Tool for Naval Assets
## 5 Results
### Diesel Engine for Power Generation  
The second case study involves the application of the SOPRENE architecture to the diesel engine for power generation in the F-100 class frigate. Each vessel contains four generators with six cylinders and the cylinders are in charge of generating the electrical power required by the ship. Despite the fact that engines for propulsion and power generation share a basic design, they pose interesting differences in order to validate the generality of the SOPRENE architecture. For the purpose of this demonstrator, the main difference between propellant and power generation engines relies on the rotation velocity, which in the case of the power generator is, in essence, binary (stopped and online, with a brief transition state). Meanwhile, the propulsion engine has a continuous range of velocities, which requires more elaborate filtering techniques. A brief description of the main SOPRENE subsystems are as follows:  
* Prediction: Similarly to the propulsion engine, data grouping has a large impact on the amount of data available for training and validation of the diesel generator models. This happens even though the availability of a large amount of data (five ships with four engines each one) after aggregation and filtering the amount of available data for training and validation is limited. The flexibility of the SOPRENE architecture allowed the application of two types of models depending on the data aggregation: Deep LSTM networks for data grouped by days and weeks and regularized (L1, L2 and ElasticNet) lineal models for weeks and months. Linear models showed a strong tendency to underfit data grouped by days, while there were insufficient data to train LSTM networks with data grouped by months. Table 3 summarizes a comparison of the MSE measured in validation for lineal models and LSTM-based network for a 10 units prediction horizon; the best results are marked in bold. An example of prediction with a LSTM network can be observed in Figure 7 that shows three normalized variables corresponding to a certain FMECA failure mode. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **D** & **W** & **M** \\ \hline Linear Regression & - & 1.65 & 1.66 \\ L1 & - & 0.79 & **0.49** \\ L2 & - & 3.0 & 0.53 \\ Elastic Net & - & 0.79 & 0.525 \\ LSTM & **0.31** & **0.59** & - \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Mean squared errors (MSE) obtained by the algorithms by using different data grouping modes for power-generation engine: 1 data/day (D), 1 data/week (W) and 1 data/month. The prediction horizons used were 10 units. Figure 6: Normalized comparison of the vessel alarms (in blue) with the autoencoder’s joint diagnostics for all failure modes. Data comes from a BAM ship. \(y\)-axis represents the confidence given by the autoencoder. \(x\)-axis represents normalized data coming from the vessel. * Anomaly detection: Given the lack of labeled data and the need to quantify the contribution of each attribute to the overall reconstruction error, we implemented the anomaly detection subsystem based on a deep LSTM autoencoder. The autoencoder input is composed by the signals identified by FMECA for a certain failure mode and the output is the reconstruction error of each one of this attributes. Figure 8 shows an example of the real values of three attributes compared with the output given by the autoconder. In this manner, the solution gains in interpretability while the overall reconstruction error is easily computed. Figure 9 shows a confusion matrix comparing the anomalies detected automatically with vessel alarms. Despite the unsupervised nature of the anomaly detector, it is able to detect anomalies that actually correspond to vessel alarms to a great extent. Figure 10 shows a different perspective of the anomaly detector. It shows a timeline with the vessels detected by human experts (blue) with the automatic anomaly detector (red). There is an evident difference in the level of confidence given by each detection method, but it is easily adjusted by a threshold.