Abstract
Epilepsy is a chronic neurological disease that profoundly impacts patients' daily lives. Electroencephalography (EEG) serves as a crucial tool for the clinical diagnosis of epilepsy and other brain disorders. Current research methods primarily concentrate on the time domain of EEG signals, often preprocessing frequency domain information without thorough exploration or effective integration with the time domain. To overcome the limitations of traditional models in extracting comprehensive frequency domain information and fusing time and frequency data, this paper proposes a Time-Frequency Cross-Attention Network (TFCANet) based on the residual attention mechanism. This network converts time-domain features into frequency-domain features using a Fast Fourier Transform. Subsequently, four SE Residual modules are employed to extract features for the frequency domain branch, while a Residual Window Multi-head Self-Attention (ResWMSA) mechanism is utilized for the time domain branch. Finally, cross-attention is applied to achieve inter-modal feature fusion. The proposed model is experimentally evaluated on the HMS-Harmful Brain Activity Classification dataset from Kaggle's 2024 competition and a dataset from the University of Bonn, Germany. Our model achieved 96.15% accuracy on a five-category task using the HMS dataset and 93.63% accuracy on a five-category task using the University of Bonn dataset. These results demonstrate that our model fully integrates features from both time and frequency domains, highlighting the superiority of time-frequency feature fusion over single-modality approaches for epilepsy detection.