Abstract
Detecting seizures automatically is crucial for diagnosing and treating epilepsy, substantially benefiting affected patients. Various deep learning models and methods have been developed to automatically extract features from electroencephalogram (EEG) data for detecting seizures, but may often fail to adequately capture the significant periodic and semi-periodic dynamics in EEG signals, thus incompletely representing the extracted features. To address this challenge, we here introduced a novel EEG feature learning framework named ContrLF. This framework combines a contrastive learning framework and the Floss method to improve EEG feature learning for epileptic seizure detection. In our methodology, initially, both strong and weak augmentation are applied to transform the original EEG data into two distinct yet correlated views. Then, Floss is employed to automatically detect and learn the primary periodic dynamics within the augmented EEG data, capturing meaningful periodic representations that are essential for understanding seizure patterns in EEG signals. In parallel, the augmented EEG data were sequentially processed through temporal and contextual contrasting modules, which are designed to learn robust feature representations of the EEG signals. Finally, a Support Vector Machine (SVM) classifier was used to evaluate the effectiveness of the EEG features extracted using our proposed framework. Experimental results generated using both scalp and intracranial electroencephalogram (iEEG) datasets revealed that the proposed framework achieves over 90% accuracy, sensitivity, and specificity in detecting seizures. The framework outperforms other state-of-the-art methods, demonstrating its superiority in both cross-patient and specific-patient seizure detection.