# Finsformer: A Novel Approach to Detecting Financial Attacks Using Transformer and Cluster-Attention
## 3 Materials and Methods
### Experiment Design
#### 3.4.2 Testbed  
In the experimental section of this article, the Finsformer model was compared with traditional deep learning models such as RNN [38], LSTM [41], Transformer [39], and BERT [46]. The selection of these models aimed to comprehensively assess the performance and innovative aspects of Finsformer in the domain of financial attack detection. Each model possesses unique architectural characteristics and application contexts, resulting in diverse performances in processing financial data. Therefore, their use as comparative objects deeply reveals the advantages and application scope of Finsformer.  
Firstly, RNN (recurrent neural network) and its variant LSTM (long short-term memory) are classical deep learning models for processing sequential data. They are capable of capturing dependencies within time series, which is crucial for financial transaction data analysis. RNN and LSTM have been extensively applied in areas such as financial time-series prediction and fraud detection. However, RNN suffers from the problem of vanishing gradients, while LSTM, although mitigating this issue to some extent, has a high computational complexity. Comparing Finsformer with these two models enables the examination of whether Finsformer can more effectively capture long-term dependencies in financial time-series data and whether it has advantages in computational efficiency. Secondly, the Transformer model is renowned for its powerful self-attention mechanism, achieving revolutionary results in the field of natural language processing (NLP). It processes the entire data sequence in parallel, effectively capturing long-distance dependencies within the sequence. Given the complexity and diversity of financial data, the Transformer model also shows significant potential in the financial domain. Comparing it with Finsformer not only demonstrates the baseline performance of Transformer in financial attack detection tasks but also highlights the innovations and optimizations of Finsformer in this area. Furthermore, BERT, as a pre-trained model based on Transformer, excels in understanding complex contextual relationships. With its pre-training on large-scale corpora, BERT captures rich semantic information. In the realm of financial attack detection, BERT can provide a deep understanding of complex financial transaction patterns. Comparing it with Finsformer verifies whether Finsformer can surpass classic NLP models in understanding the complexity and subtle differences in financial data.  
In summary, the selection of these specific models as comparison objects is not only due to their representativeness and advancement in processing time-series data and understanding complex patterns but also because of their potential in financial attack detection applications. By comparing with these models, this article not only demonstrates the superior performance of Finsformer in financial attack detection tasks but also reveals its unique advantages in processing financial data, especially in capturing complex transaction patterns and reducing false positives. Additionally, this comparison helps in understanding the application limitations of each model in the field of financial security, providing valuable insights and directions for improvement in future research.