## 3 Results  
For the purpose of verifying the effectiveness of the proposed model, we conducted corresponding tests on the CHB-MIT dataset. In the experiment, the interictal phase was defined as the period 4 h before the seizure and 4 h after the end of the seizure. The division of epileptic EEG signals is shown in Figure 3. According to the annotation file for the database, in 24 cases some EEG recording electrodes added or deleted EEG channels during the measurement process. Therefore, we selected the EEG data from the following 18 electrodes that were considered in most cases for analysis: FP1-F7, F7-T7, T7-P7, P7-O1, FP1-F3, F3-C3, C3-P3, P3-O1, FP2-F4, F4-C4, C4-P4, P4-O2, FP2-F8, F8-T8, T8-P8, P8-O2, FZ-CZ, and CZ-PZ. The letter notations are as follows: FP, frontopolar; F, frontal; T, temporal; O, occipital; C, central; P, parietal (Figure 4). In addition, because the channels for cases 12 and 13 changed frequently during the recording process, the EEG recordings may have been polluted, and case 24 had frequent seizures, so we did not have enough interictal data for training. Therefore, in the experiment, we removed the EEG data for these three cases and applied the data for the remaining 21 patients to evaluate our model. Figure 2: The definition of seizure prediction horizon (SPH) and seizure occurrence period (SOP). The workflow of the seizure prediction system is shown in Figure 5. First, the EEG signals in the preictal and interictal segments were extracted and labeled. Second, overlapping sliding windows were used to balance the number of EEG segments in each patient's preictal and interictal segments. Third, the time-frequency domain characteristic information from the above EEG segments was extracted by STFT to obtain the three-dimensional spectrogram matrixes. The number of preictal and interictal spectrograms is summarized in Table 2. Fourth, the feature matrix was inputted to the transformer network model with a three-tower structure. The characteristics of epileptic EEG signals are learned from the step-wise, frequency-wise, and channel-wise encoders, and the classification of EEG signals is realized through the gating mechanism. Finally, the seizure prediction task is finished after post-processing. Figure 4: The electrode distribution of EEG signals. Figure 5: Workflow of the seizure prediction system. Figure 3: Division of EEG signals in the different stages of epilepsy. We divided the EEG segments from all patients into a training set and a test set at a ratio of 9:1. The model proposed in this paper was built in a Python 3.7 environment using PyTorch 1.9, and the code is available at [[https://github.com/xutianyu540/Transformer-network-with-a-three-tower-structure](https://github.com/xutianyu540/Transformer-network-with-a-three-tower-structure)]([https://github.com/xutianyu540/Transformer-network-with-a-three-tower-structure](https://github.com/xutianyu540/Transformer-network-with-a-three-tower-structure)) accessed on 11 April 2022. At the same time, the gated transformer networks (GTN) model [44] was established for comparative experiments. The classification results from the final experiments are shown in Table 3.  
In Table 3, we compare the sensitivity, specificity, and precision of our model with GTN. It can be seen that for all patients, the average sensitivity and specificity of our model were 96.01% and 96.23%, respectively, which were significantly higher than the corresponding values of 92.11% and 91.72% for the GTN model. This indicates that our model achieved satisfactory results in the classification of both preictal and interictal states. Compared with the GTN model, the average precision of our method improved from 91.12% to 95.86%. Figure 6 shows a comparison of the classification accuracy and \(F1\) score for each patient between the GTN model and our model. It can be seen that our model was greatly improved in accuracy and \(F1\) score.