This paper presents a novel unsupervised approach for anomaly detection in marine diesel engines using a Transformer Neural Network based autoencoder (TAE) and residual analysis with Sequential Probability Ratio Test (SPRT) and Sum of Squares of Normalized Residuals (SSNR). This approach adeptly captures temporal dependencies within normal time-series data without the necessity for labeled failure data. To assess the performance of the proposed methodology, a dataset containing faulty data is generated under the same operational profile as the normal training data. The model undergoes training using normal data, after which the faulty data is reconstructed utilizing the trained model. Subsequently, SPRT and SSNR are used to analyze the residuals from the observed and reconstructed faulty data. Significant deviations surpassing a predefined threshold are identified as anomalous behavior. Additionally, this study explores various architectures of Transformer neural networks and other types of neural networks to conduct a comprehensive comparative analysis of the performance of the proposed approach. Insights and recommendations derived from the performance analysis are also presented, offering valuable information for potential users to leverage. The experimental results demonstrate that the proposed approach can accurately and efficiently detect anomalies in marine diesel engines. Therefore, this approach can be considered as a promising solution for early anomaly detection, leading to timely maintenance and repair, and preventing costly downtime. Also, avoid accidents with probability severe consequences.