## 1 Introduction
Traditional machine learning algorithms and deep learning models have been successfully applied to the classification of time-series signals, especially EEG signals. In early research, the seizure detection task for EEG signals mainly used traditional machine learning algorithms such as decision tree classifier [19; 20], support vector machine [21; 22], k-nearest neighbor [23] (KNN), and random forest [24]. Recently, deep learning algorithms have also achieved remarkable results for EEG seizure detection. Because EEG signals are variable and long, recurrent neural networks (RNN), which are appropriate for time series information, have also been gradually applied to EEG signal processing. However, due to the short-term memory problem of RNN, the long short-term memory network (LSTM) [25; 26], which combines short-term and long-term memory through a gated structure, has been more widely used in epileptic seizure tasks. In addition, the convolutional neural network (CNN) [27] has the ability of automatic feature learning, which not only simplifies the process of artificially constructing features but also significantly improves the performance of seizure detection. Now, the frontier research on epilepsy EEG has gradually shifted from epilepsy detection to seizure prediction. Since seizure activity is unpredictable and drug-resistant epilepsy patients lack reliable treatment, there is an urgent need to develop an accurate and reliable seizure prediction model. [PERSON] et al. [12] proposed a generalized retrospective and patient-specific seizure prediction method based on STFT and CNN. After that, [PERSON] et al. [28] added the generative adversarial network as a feature extractor to train in an unsupervised way and connect an external classifier for classification to solve the difficulty of manual marking of seizure data and make better use of key data. [PERSON] et al. [29] introduced the LSTM network into EEG signal prediction of seizures, which significantly improved its performance. [PERSON] et al. [30] proposed a patient-specific EEG channel selection optimization method based on permutation entropy, which combined the genetic algorithm and KNN to predict seizures. [PERSON] et al. [2] designed a seizure prediction framework based on statistical analysis and digital band-limiting filters, which can make robust decisions on signal activities and is suitable for long prediction horizons. [PERSON] et al. [31]studied the advantages of multivariate multi-scale modified distribution entropy by using artificial neural networks and proposed an epilepsy prediction system. However, these deep learning models can only achieve very limited performance in long sequences, and the attention mechanism can process the signal as a whole without being limited by the sequence length. Therefore, we consider applying it to our long-term monitoring of EEG signals. In recent years, the transformer model based on the attention mechanism proposed by [PERSON] et al. [32] has achieved great success in the field of natural language processing, and it has been gradually applied to the tasks of computer vision and time series prediction and regression. [PERSON] et al. [33] used the transformer to classify EEG data for brain vision and motor imagination to decode EEG signals from human brain activities. In this paper, scalp EEG is used to predict the onset of epilepsy to provide enough treatment time for doctors and patients and prevent the occurrence of seizure events. The proposed seizure prediction model in this paper is based on transformer networks for extracting and fusing the three-dimensional features of EEG signals and has achieved remarkable results in seizure prediction. The main contributions of this paper are as follows:  
1. Based on the transformer's self-attention coding layer and gating mechanism, a transformer network with a three-tower structure is established to extract and fuse the features of epileptic EEG signals from different dimensions, which improves the learning ability of the time, spectrum, and spatial information. 2.