# Research on Fault Diagnosis of Marine Diesel Engines Based on CNN-TCN-ATTENTION
## 3 Experiment
### Ablation Experiment
#### 3.3.2 Ablation Experiment of Network Structure  
The purpose of this experiment is to validate the contribution of each network unit in the proposed model to the overall performance, thereby proving its reliability. For the network structure ablation study, the model details and hyperparameter settings are as introduced at the beginning of this section. Under unchanged conditions, ablation experiments are performed on the CNN, TCN, ATTENTION, and combined models. Each model undergoes multiple trials to obtain the evaluation results for the test set. The final experimental results are presented in Table 8.  
As shown in Table 8, when a CNN or TCN is used individually, although the structure is simple and the computational complexity is low, the diagnostic accuracy is relatively low. This is because each model focuses only on features that match its respective extraction characteristics and is not sensitive to other types of features, leading to poor performance  
Figure 13: Training and validation accuracy and loss rates for different numbers of convolution layers.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Diagnostic Model** & **Test Accuracy/\%** & **Precision/\%** & **Recall/\%** & **F1 Score/\%** & **Running Time/s** \\ \hline CNN & 90.62 & 92.92 & 89.66 & 89.14 & 15 \\ TCN & 89.38 & 89.98 & 89.89 & 89.91 & 20 \\ CNN-TCN & 91.87 & 95 & 91.03 & 91.37 & 21 \\ CNN-TCN-ATTENTION & 100 & 100 & 100 & 100 & 29 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Diagnostic accuracy of different diagnosis models.  
when used alone. When the CNN and TCN are combined, the model complexity becomes moderate, and the feature extraction is more comprehensive. However, compared to the individual CNN or TCN models, the diagnostic accuracy does not improve significantly. This is because the features extracted by the CNN and TCN are heterogeneous, making feature fusion difficult, and there is a lack of focus on key information, which results in no significant improvement in the model's diagnostic performance. To address the feature fusion problem, the attention mechanism is introduced to integrate the features extracted by both the CNN and TCN, rationally allocate feature weights, and thus optimize the model. As a result, the model achieves optimal accuracy, reaching 100% in the test set. The confusion matrices for the different models are shown in Figure 14. In Figure 14, the dark blue blocks represent correctly diagnosed fault samples in the test set, while the light blue blocks represent misdiagnosed fault samples. From the confusion matrix, it can be seen that the combined model accurately classifies each fault category, achieving 100% accuracy, outperforming the other ablation models. It is worth noting that the confusion matrix for the CNN clearly shows that its recognition of Category 3 is significantly weaker compared to the other three models. This is because the time-series features of Fault 3 are relatively stable, and the CNN's sensitivity to such features is insufficient. In contrast, the other three models, after introducing the TCN, show improved classification accuracy for Category 3, which highlights the role of the