1 Introduction

One of the most popular neurological diseases is epilepsy. It is widespread all over the world with about 1% of world population injured with this disease [1]. There is a need for certain precautions to deal with epilepsy patients to reduce the hazards facing them during seizure periods. That is why seizure prediction is necessary. If a seizure is predicted prior to its occurrence, alarms can be given to the patients to save them from dangerous actions [2]. Seizure prediction in itself is the process of anticipating a seizure prior to occurrence with a suitably long time. This also means the detection of the pre-ictal states from EEG signal activities if they are assumed to exist [3, 4].

Electroencephalogram (EEG) signals reflect the brain activities during human actions. For patients, epilepsy seizures occur due to some electrical discharges in groups of cells [5]. These discharges are reflected in EEG signals, which are recorded with different electrodes. Hence, EEG signals are of multi-channel nature. So, we can say that channel selection for epilepsy activity detection and prediction is a must [6,7,8]. In addition, technological improvements in implantable devices for seizure control [3, 4] have led to tremendous improvements in the accuracy and sensitivity of epileptic seizure prediction [9,10,11].

Several algorithms have been presented for EEG seizure prediction. Zandi et al. [12, 13] presented an approach for seizure prediction based on computing zero-crossing rate in sEEG with different window intervals. For each interval, the distribution of the histogram is computed. Then, the obtained distribution is compared with two reference inter-ictal and pre-ictal distributions. This approach presented an average sensitivity of 88.34%, an average prediction time of 22.5 min and a false prediction rate of 0.155/h. Hung et al. [14] presented a seizure prediction algorithm based on chaotic features in the wavelet domain. Their approach achieved an average accuracy of 87% with an average prediction time of 27 min and a false-alarm rate of 0.24/h.

Shiang et al. [15] developed a seizure prediction algorithm based on computing different attributes, namely cross-correlation, non-linear independence, difference of Lyapunov exponents and phase locking in the wavelet domain. A sensitivity of 74% was obtained. Gadhoumi et al. used wavelet features extracted from iEEG signals for seizure prediction. The features used in this approach are the entropy and wavelet energy. This approach achieved an accuracy of 85% with a false-alarm rate equal to 0.35/h [16]. In addition, the empirical mode decomposition (EMD) has also been utilized for EEG seizure prediction. The main advantage of the EMD is the ability to decompose the signal in an additive manner to a group of envelopes. Features are extracted from the intrinsic modes in the EMD domain. A hybrid feature extraction method based on three intrinsic mode functions (IMFs) and the variance of the envelope (VOE) of the approximation has been used [17]. Moreover, some sort of dimensionality reduction with principal component analysis (PCA) has been used in [18, 19].

The zero-crossing rate (ZCR) of EEG signals in the wavelet domain has been exploited for EEG seizure prediction [20]. The reason for using the ZCR is that in epileptic activities, rapid changes occur in EEG signals. These changes are estimated based on the ZCR in the wavelet domain. A support vector machine (SVM) has been used for the classification purpose. This algorithm achieved an average accuracy equal to 94%. N. Ozdemir et al. [21] adopted a seizure prediction algorithm based on Hilbert-Huang transform (HHT) and Bayesian classification. The HHT is utilized for feature extraction. After that, a correlation-based feature selection (CFS) algorithm is used to select the best features. Then, classification by means of Bayesian networks is implemented. A sensitivity of 96.55% and a false positive rate of 0.21/h were obtained.

Aarabi and He [22] presented a seizure prediction model based on the estimation of the spectra of iEEG signals. First, the EEG signal is band-pass filtered to be in the band of 0.5–100 Hz, and then notch filtered at 50 Hz. Then, the data is split into independent training and testing sets, and both are segmented into 10-s non-overlapping segments. The power spectral densities of 10-s iEEG segments are computed using the Welch spectral estimation method [23], where the signal is divided into segments overlapped by 50%, and then the Hamming window and the Fourier transform are applied. After that, the power spectra are computed. The Bayesian inference method is used to estimate the parameters of the model. This method achieved average sensitivities of 87.07 and 92.6% for maximum seizure occurrence periods of 30 and 50 min, respectively.

Alotaiby et al. [24] introduced a seizure prediction algorithm based on common spatial patterns (CSPs) as feature extractors. A linear discriminant analysis classifier is used for the classification purpose. Their algorithm achieved an average prediction time equal to 89%. The false prediction rate is 0.39/h, with an average prediction time of 68.71 min.

Myers et al. [25] presented a seizure prediction algorithm that depends on phase/amplitude lock values (PLV/ALV) by calculating the difference of phase and amplitude between electrodes that are local and remote to the epilepsy center. Their method reported an average sensitivity of 77%, and an average false prediction rate of 0.17/h. Consul et al. [26] presented a seizure prediction algorithm using phase difference in Hilbert domain. Their algorithm achieved a sensitivity of 88.2% with a prediction latency between 51 s and 188 min.

Chu et al. [27] presented a seizure prediction algorithm depending on attractor state analysis of the macroscopic dynamics of the brain. A sensitivity of 86.6%, a false prediction rate of 0.367/h and an average prediction time of 45.3 min were obtained. Sedik et al. [28] introduced a statistical framework for seizure prediction based on the utilization of digital filters. A prediction rate equal to 96.2485%, a false-alarm rate of 0.10526/h and a prediction time of 66.6 min were obtained. This framework has been applied only on 4 patients from the CHB-MIT dataset.

Daoud et al. [29] introduced a patient-specific seizure prediction algorithm using deep learning. Raw EEG signals are used as the input to the model without any pre-processing. Four deep learning models have been used to extract the most differentiating features to enhance the classification performance. Their algorithm achieved an average accuracy of 99.6% and a false-alarm rate of 0.004/h. Yang et al. [30] presented an approach for seizure prediction depending on permutation entropy as a main feature. An SVM has been used for the classification purpose. This approach achieved an average sensitivity of 94% and a false prediction rate of 0.111/h

Fig. 1
figure 1

Instantaneous amplitude in the Hilbert domain of normal and pre-ictal EEG segments

This paper introduces a patient-specific algorithm for EEG channel selection and seizure prediction from sEEG. Signal attributes in the Hilbert domain including amplitude, derivative, local mean, local variance, and median are analyzed statistically to perform the channel selection and seizure prediction tasks. Pre-defined prediction and false-alarm probabilities are set to select the channels, the attributes, and bins of PDFs that can be useful for seizure prediction. In the training phase, EEG signal segments of length 10 s are analyzed into non-overlapping segments and filtered using a band-pass finite impulse response (FIR) filter (3–100 Hz) to remove undesired artifacts. Then, the Hilbert transform is estimated for each segment to compute the instantaneous amplitude. Figure 1 shows the instantaneous amplitudes for normal and pre-ictal segments. The selected signal attributes are treated statistically to yield PDFs. Seizure prediction is tested in this paper over three horizons of 30, 60, and 90 min, which are within the ranges used by other authors [13, 25, 27].

Contributions of the proposed approach are the utilization of the Hilbert transform to calculate the instantaneous amplitude of the analytic signals without the need for domain change, in addition to the simplicity of hardware implementation. Moreover, we introduce an adaptive channel selection algorithm, which specifies the effective channels for prediction. Moreover, we use a threshold-based classifier to decrease the computational complexity. The results obtained using the proposed approach are compared to those of previously published methods.

The rest of the paper is organized as follows. Section 2 provides materials and methods. Section 3 includes results and discussion. Finally, the conclusions are given in Sect. 4.

2 Materials and Methods

2.1 Dataset

Experiments are carried out on long-term continuous multi-channel scalp EEG recordings for 24 patients from the publicly available CHB-MIT dataset [31]. This dataset has been collected for 23 cases. One of them was recorded again after 1.5 years. All signals were measured with a sampling frequency of 256 Hz. The dataset for every patient has 23 channels, except for patients 12, 13, 14, 16, 17, 20, 21 and 22, who have 28 channels and patient 15, who has 31 channels. The dataset includes 686 sEEG hours. Table 1 introduces the seizure information for each case.

Table 1 Seizure information for each case

2.2 Hilbert Transform

Hilbert transform is a convolution between the Hilbert transformer \(1/(\pi t)\) and the signal. It does not involve a change of domain, unlike many other transforms. The Hilbert transform of a signal X(t) is calculated as follows [32]:

$$\begin{aligned} Y(t)=\frac{1}{\pi }P\int _{-\infty }^{\infty }\frac{X(\tau )}{t-\tau } d\tau \end{aligned}$$
(1)

where P represents the Cauchy principal value of the integral. An analytic complex-time signal Z(t) is constructed from a real-valued input signal X(t) and the imaginary part Y(t). The imaginary part represents the Hilbert transform of the real part. A(t) is the instantaneous amplitude of the complex signal, and \(\theta (t)\) is the phase of that signal.

$$\begin{aligned} Z(t)= & {} X(t)+jY(t)=A(t)e^{j(\theta (t)} \end{aligned}$$
(2)
$$\begin{aligned} A(t)= & {} \left| Z(t) \right| \end{aligned}$$
(3)

2.3 Statistical Analysis

Features extracted from the signals can be utilized to distinguish between normal and pre-ictal EEG states. The five statistical parameters representing the features used in the proposal are presented.

2.3.1 Signal Amplitude

The instantaneous amplitude after Hilbert transform is considered.

2.3.2 Signal Derivative

It is important to use a differentiator as a digital filter to acquire any abrupt changes in the signal. A suitable digital filter for this task is given by [33]:

$$\begin{aligned} H(z)=1-z^{-1} \end{aligned}$$
(4)

2.3.3 Local Mean

Local mean is a measure of the signal trend. It can be estimated with a moving average filter of window \((2 k+1)\) as follows [34]:

$$\begin{aligned} \hat{X}(n)=\frac{1}{2k+1}\sum _{m=n-k}^{n+k} X(m) \end{aligned}$$
(5)

2.3.4 Local Variance

Local variance reflects how the signal is spread around the local mean. A moving average filter can be used for this task as follows [34]:

$$\begin{aligned} \hat{\sigma }^{2}_{x}(n)=\frac{1}{2k+1}\sum _{m=n-k}^{n+k}(X(m)-\hat{X}(n))^2 \end{aligned}$$
(6)

where \(\hat{X}(n)\) represents the local mean of X(n), which can be calculated using Eq. (5).

2.3.5 Instantaneous Median

Median filter is a type of order statistics filters. It depends on the selection of the median value of a certain signal segment as a tool to eliminate extrema of the signal. It can be implemented in a recursive or non-recursive manner. The non-recursive median filter output is given as [35]:

$$\begin{aligned} Y(n)=MED[X(n-k),\ldots ,X(n),\ldots ,X(n+k)] \end{aligned}$$
(7)

where X(n) and Y(n) are the nth samples of the input and output sequences, respectively.

2.4 Statistical Analysis for EEG Signal Classification

The strategy adopted in the proposed approach is a thresholding strategy applied on certain bins extracted from certain PDFs. These bins must satisfy the distinguishability criteria between pre-ictal and normal states. The selection of bins and thresholds depends on setting pre-defined prediction and false-alarm probabilities. In our work in this paper, we set a prediction probability threshold of 70% and a false-alarm threshold of 30%. Firstly, known normal and pre-ictal signal segments of length 10 s are analyzed in Hilbert domain. The selected signal attributes are treated statistically to yield PDFs for each attribute with 9 bins. Each bin is treated across signal segments as a random variable and the PDFs of these random variables are estimated to select the bins that satisfy the 70% for prediction probability and 30% for false-alarm probability for discrimination between normal and pre-ictal states. The intersection points between the PDFs of selected bins are estimated to determine the thresholds. Multiple decisions are taken for each incoming signal segment to decide whether it belongs to a normal or a pre-ictal activity. These decisions are merged together to yield a final decision about each segment. The training and testing phases are illustrated in Figs. 2 and 3, respectively.

Fig. 2
figure 2

Block diagram of the training phase of the proposed Hilbert-transform-based approach

Fig. 3
figure 3

Block diagram of the testing phase of the proposed Hilbert-transform-based approach

2.4.1 Performance Metrics

Different evaluation metrics have been considered for the EEG seizure prediction process [8]:

The prediction rate (\({R_p}\)) is calculated as:

$$\begin{aligned} R_p=\frac{N_p}{N_t} \end{aligned}$$
(8)

The false-alarm rate (\({R_{fa}}\)) is calculated as:

$$\begin{aligned} R_{fa}=\frac{N_{fa}}{H_t} \end{aligned}$$
(9)

The average prediction time (\({T_{avg}}\)) is calculated as:

$$\begin{aligned} T_{avg}=\frac{T_p}{N_p} \end{aligned}$$
(10)

where \({N_p}\) represents the number of predicted seizures, \({N_t}\) is the total number of seizures, \({N_{fa}}\) represents the number of false alarms, \({H_t}\) is the total number of hours and \({T_p}\) represents the prediction time.

3 Experimental Results and Discussion

For each segment of the EGG signal, five PDFs are estimated for each channel. These include amplitude, derivative, local mean, local variance, and median PDFs. Bin selection process for discrimination is performed on all bins from all PDFs from all channels. The prediction matrix in (11) reveals the bin selection and thresholding processes for patient 20. The first column determines the type of the attribute used for discrimination. (1) refers to amplitude, (2) refers to derivative, (3) refers to local mean, (4) refers to local variance and (5) refers to median. The second column determines the index of the selected channel. The third column determines the index of the bin selected for discrimination between normal and pre-ictal states.

We adopted 9 bins in each PDF. Prior to the prediction process, we set pre-defined prediction and false-alarm probability thresholds of 70% and 30%, respectively. Hence, the bins that satisfy the 70% predict probability with a false-alarm probability below 30% are selected. Hence, all values of column 4 are larger than 70%, and all values of column 5 are below 30%. Each selected bin is treated as a random number across segments. Hence, the PDF of the selected bin itself differs between pre-ictal and normal states. Two different distributions for both states intersect with a certain threshold chosen for discrimination as shown in Fig. 4. The threshold differs for each selected bin. Hence, different values of the thresholds lie in column 6. To discriminate between two scenarios, we put 1 or 0 for each state of the normal distribution on the right or on the left as shown in column 7.

A group of decisions is obtained for each segment. Some of them are positive, meaning a pre-ictal state, and some are negative meaning a normal state. If we represent the positive decisions with 1 and the negative decisions with 0, an averaging or majority voting process gives a certain indicator from the state. The obtained signal needs some smoothing with a non-recursive averaging filter. A filter of such type with length 60 is used to get a discrete time sequence representing the segment diagnosis state. In this paper, we adopt the name of discrimination count for this sequence. The level-crossing strategy is applied on this count for seizure prediction. Figures 567 and 8 show the majority voting results for patients 1, 8, 14 and 20, respectively. The horizontal axis represents the selected segment index and the vertical axis represents the bins that are selected for classification.

Different prediction horizons of 30, 60 and 90 min have been considered in our simulation experiments. The prediction horizon represents the period within which a seizure is anticipated. A long prediction horizon is preferred due to the ability to predict seizures as early as possible, which allows an alert to be sent to the patient or the care-giver very early to take an action to save the patient’s life. A 15-min post-seizure horizon is taken into consideration. In this horizon, all prediction alerts are ignored. The prediction time (\(T_P\)) in our simulations is the time between the prediction alert and the start of the ictal state.

$$\begin{aligned} P = \begin{pmatrix} 2 &{} 2 &{} 2 &{} 0.95000 &{} 0.079167 &{} 0.072266 &{} 1 \\ 5 &{} 12 &{} 2 &{} 0.7083 &{} 0.2806 &{}0.1599&{}1\\ 2 &{} 3 &{} 2 &{} 0.95000 &{} 0.084722 &{} 0.073398 &{} 1 \\ 3&{}12&{}9&{}0.7000 &{}0.2667 &{}0.1587 &{}1\\ \vdots &{}\vdots &{}\vdots &{}\vdots &{}\vdots &{}\vdots &{}\vdots \\ 1&{}20&{}4&{}0.7083 &{}0.2792 &{}0.1606 &{}0\\ 4 &{} 4 &{} 5 &{} 1.0000 &{} 0.075 &{} 0.204102 &{} 1 \\ 2 &{} 20 &{} 6 &{} 0.941667 &{} 0.1875 &{} 0.023281 &{} 1 \\ 4 &{} 3 &{} 7 &{} 0.916667 &{} 0.118056 &{} 0.011953 &{} 0 \\ \end{pmatrix} \end{aligned}$$
(11)
Fig. 4
figure 4

PDFs for amplitude and derivative attributes

Fig. 5
figure 5

Majority voting results for patient 1

Fig. 6
figure 6

Majority voting results for patient 8

Fig. 7
figure 7

Majority voting results for patient 14

Fig. 8
figure 8

Majority voting results for patient 20

Table 2 presents the evaluation parameters, where the first and second columns show the prediction probability constraint and false-alarm probability constraint, respectively. The third, fourth, fifth and sixth columns represent the decision threshold (\(D_{th}\)) for each patient from the dataset for time domain, fast Fourier transform (FFT), wavelet transform (WT) and the proposed approach using the Hilbert transform (HT), respectively.

Table 2 Evaluation parameters

In order to study the impact of the transform on the performance of the proposed approach, a comparison between the time-domain, frequency-domain, wavelet-domain and the proposed HT-based approach for 30, 60 and 90 min horizons is presented.

3.1 Results for 30-min Horizon

The results for 30-min horizon are presented in Table 3. It is clear that the proposed approach outperforms the time-domain, frequency-domain and wavelet-domain approaches in terms of prediction time \(T_P\), number of false alarms \(N_{FA}\) and number of predicted seizures \(N_P\).

For example, for patient 1, although the proposed approach has the same prediction rate as those of both the time-domain and the wavelet-domain approaches, it has better performance in terms of false-alarm rate and prediction time compared to these approaches. Moreover, the frequency-domain approach achieves a longer prediction time compared to the proposed approach by about 4 min. In addition, the proposed approach reduces the false-alarm rate by about 66.67% of that of the frequency-domain approach. Furthermore, the proposed approach increases the number of predicted seizures by about 50% of that of the frequency-domain approach.

In addition, let us concentrate on the results of patient 15, where the proposed approach provides a 100% prediction rate. Furthermore, it provides a prediction time, which is longer than those of the time-domain, frequency-domain and wavelet-domain approaches by values that are about 5.61, 3, and 3 min, respectively. Moreover, the proposed approach reduces the false-alarm rate by about 80, 66.67, and 75% compared to those of the time-domain, frequency-domain and wavelet-domain approaches, respectively.

The prediction rate is estimated based on the number of predicted seizures. The prediction of a seizure depends on the detection of a single alert prior to the seizure within the prediction horizon. The proposed approach provides an average prediction rate of 89.9% for all patients.I improves the average prediction rate for all patients by values that reach 37, 7.3, and 6.6% compared to those of the time-domain, frequency-domain and wavelet-domain approaches, respectively. Moreover, the proposed approach reduces the false-alarm rate for all patients by about 58.4, 56.9, and 58.84% compared to those of the time-domain, frequency-domain and wavelet-domain approaches, respectively.

3.2 Results for 60-min Horizon

The obtained results for 60-min horizon are given in Table 4. It is clear from the results that the proposed approach improves the prediction rate by values that reach 9.76, 3.45, and 4.65% compared to those of the time-domain, frequency-domain and wavelet-domain approaches, respectively. It is noteworthy that the proposed approach produces a 100% prediction rate for patients 3, 4, 7, 8, 11, 15, 18, and 20. Moreover, the proposed approach reduces the false-alarm rate for all patients by about 61.1, 67.7, and 62.5% compared to those of the time-domain, frequency-domain and wavelet-domain approaches, respectively. It should be noted that the proposed approach produces zero false alarms for patients 3, 11, and 24.

Furthermore, the proposed approach provides an average prediction time for all patients, which is longer than those of the time-domain, frequency-domain and wavelet-domain approaches by values that are about 13.6, 8.83, and 17.1 min, respectively. This means that the proposed approach can predict the seizures earlier than rival approaches, and hence it allows the patients to take the necessary precautions earlier before the occurrence of the seizure. For example, for patient 9, the proposed approach provides a prediction time that reaches 56.78 min, which is longer than those of the time-domain, frequency-domain and wavelet-domain approaches by values that are about 21.19, 23.92, and 23.34 min, respectively.

Considering another patient, specifically patient 19, it is clear that the proposed approach provides a prediction time that reaches 56.85 min, which is longer than those of the time-domain, frequency-domain and wavelet-domain approaches by values that are about 13, 7.6, and 17.16 min, respectively.

3.3 Results for 90-min Horizon

A summary of the results for the 90-min horizon is presented in Table 5. The proposed approach provides a 96.46% average prediction rate for all patients, which is higher than those of the time-domain, frequency-domain and wavelet-domain approaches by 14.4, 9.8, and 10.4%, respectively. Specifically, the proposed approach achieves a 100% prediction rate for patients 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 15, 18, and 20. In addition, the proposed approach produces an average prediction time for all patients, which reaches 60.15958 min. It is longer than those of the time-domain, frequency-domain and wavelet-domain approaches by values that are about 22.2, 13.1, and 17.5 min, respectively.

Moreover, the proposed approach has a better performance in terms of false-alarm rate. I reduces the false-alarm rate for all patients by about 71.3, 76.1, and 70.3% of those of the time-domain, frequency-domain and wavelet-domain approaches, respectively. Specifically, the proposed approach provides zero false alarms for patients 3, 4, 11, 12, 16, 20, and 24.

Table 3 Performance comparison between all approaches for the 30-min horizon
Table 4 Performance comparison between all approaches for the 60-min horizon
Table 5 Performance comparison between all approaches for 90-min horizon

3.4 Comparison with Existing Seizure Prediction Approaches

The comparison of the proposed prediction approach with other published approaches is shown in Table 6. Improvements in performance in terms of prediction rate, false-alarm rate and prediction time are obtained with less computational complexity. In addition, an adaptive algorithm for channel selection and a simple thresholding-based classifier are used. The proposed approach provides prediction rates that are 45.88, 8.42, 8.56, 20.17, 10.15, and 9.8% higher than those of the approaches presented in [13, 15, 25,26,27] and [24], respectively. In addition, it reduces the false-alarm rate \(R_{fa}\) by 81.9, 83.5, 92.4, 93, 74, and 72% compared to those of [13, 25, 27, 24, 30] and [28], respectively. Moreover, it provides prediction times that are 62.62 and 14.23% higher than those of [13] and [24].

Table 6 Comparison between the proposed approach and other published approaches

4 Conclusions

This paper presented an efficient seizure prediction approach that depends on statistical analysis of EEG signals in the Hilbert domain. The PDFs are estimated for signal attributes, and their bins are traced to select the most appropriate ones for seizure prediction under certain constraints. Seizure prediction has been tested in this paper over three horizons. Simulation results proved that the 90-min horizon is the best for efficient seizure prediction. In addition, the comparison with the published approaches for EEG seizure prediction ensures superiority of the proposed approach from the prediction time, prediction rate, and false-alarm rate perspectives.