## 2 Materials and Methods  
Seizure prediction typically involves recording the patient's EEG signals in four states: interictal, preictal, ictal, and postictal [10; 35] (Figure 1). The interictal period represents the normal brain state, far from seizure activity. Prior to a seizure, the patient's EEG signals exhibit abnormal fluctuations, known as the preictal phase. The preictal phase transitions from a normal state to a seizure state. The ictal period corresponds to the actual occurrence of a seizure. The postictal phase refers to the transitional period when the brain returns to its normal state after a seizure. Seizure detection based on EEG signals aims to distinguish between the interictal and ictal periods, while seizure prediction focuses on analyzing the preictal state of the EEG signals, specifically performing classification tasks between the preictal and interictal periods.  
The algorithmic process of this study is shown in Figure 2, which mainly includes: (1) Training of the unsupervised feature learning model (WGAN-GP): The unlabeled EEG signals are transformed into two-dimensional time-frequency feature maps using a short-time Fourier transform. Combined with the patient data in the database, the WGAN-GP model is trained to generate a high-performance feature extractor. (2) Training of the classifier model: The trained WGAN-GP discriminator is used as the feature extractor, combined with Bi-LSTM to construct a classification network. A small amount of labeled EEG signals with STFT time-frequency maps is used to train the classifier model and complete the classification task.  
Figure 1: Illustration of the status of epileptic seizures.  
There are three commonly used techniques for analyzing brain signals: time domain analysis, frequency domain analysis, and time-frequency domain analysis [10]. Time domain analysis examines the voltage amplitude of the signal over time, while frequency domain analysis examines the spectral distribution and energy changes of the signal in the frequency domain. Both time and frequency domain analysis methods are typically effective for analyzing stationary signals and can only reflect single signal characteristics, which are not suitable for extracting nonlinear features of brain signals. Time-frequency analysis combines time and frequency domain calculations to describe the frequency information of a signal over a period of time, making it a common method for processing EEG signals.  
The \(STFT\) is a commonly used tool in signal processing. It involves dividing a longer time signal into shorter segments of equal length and then calculating the Fourier transform, or Fourier spectrum, of each segment to obtain the frequency changes over time. The mathematical formula for a single-channel EEG signal \(x(t)\) can be represented as follows:  
\[STFT(f,t)=\int_{-\infty}^{+\infty}{[x(t)g(t-\tau)]e^{-\gamma 2 tf\tau}d\tau}, \tag{1}\]  
In (1), \(t\) represents the time point, \(f\) is the frequency component in the signal, and \(j\) represents the imaginary unit. \(x(t)\) represents the time series of the EEG signal, \(g(t)\) represents the window function, and \(\tau\) represents the index of different time windows.