# An Efficient Hybrid Model for Patient-Independent Seizure Prediction Using Deep Learning
## 2 Materials and Methods  
The dataset used in this research was assembled from the CHB-MIT [26], which is a benchmark dataset and is freely accessible for research.  
Each case (chb1, chb2, etc.) contained between 9 and 42 continuous '.edf' files from a single patient. To protect the patients' privacy, all protected health information (PHI) in the original files was replaced with surrogate information in the provided files. Surrogate dates replaced the dates in the original files, but the time relationships between the individual files belonging to each case were preserved. The files, in most cases, contained exactly one hour of digitized EEG signals, though those in case chb10 were two hours long, and those in cases chb04, chb06, chb07, chb09, and chb23 were four hours long; files in which seizures were recorded were occasionally shorter. For these recordings, the International 10-20 system of EEG electrode positions and nomenclature was used.  
Files labeled 'RECORDS' contained a list of all 664 files in the collection, while files labeled 'RECORDS-WITH-SELZURES' contained a list of the 129 files that contained one or more seizures. These records contained 198 seizures in total, with the beginning and the end of each seizure annotated.  
This dataset included continual EEG signals recordings for 24 patients, composed of 5 males and 17 females patients. The records for patient 1 and 21 were gathered from the same female with 1.5-year difference. While records for patient 24 were added to the dataset later in December 2010. Female patients' ages were from 1.5 to 19 years, while male patients' ages varied from 3 to 22 years. The data were reported and collected by positioning 23 electrodes on the scalps of patients, which meant that all EEG signals were scalp EEG (sEEG). This dataset has a frequency of 256 HZ per second with a 16-bit resolution.  
Figure 1 shows a sample of the dataset used. The signal depicted represents patient one's ictal phase, which is the phase in which he had seizures that typically last a few seconds. The figure shows that, for each patient, there were several parallel channels, which could differ from one patient to the next. Every patient's record file contained information about the exact location and duration of the ictal state. The pre-ictal state is the state that occurs immediately before the onset of the ictal phase, whereas the inter-ictal state was the state in which the patient was normal. To achieve standardization, the following 18 channels were chosen from the 23 electrodes to be the 18 common channels between all 24 patients: [FP2-F4', 'F3-C3', 'P7-O1', 'P8-O2', 'T8-P8', 'FP1-F7', 'F8-T8', 'T7-P7', 'F4-C4', 'FP2-F8', 'CZ-PZ', 'C3-P3', 'F7-T7', 'C4-P4', 'FP1-F3', 'FZ-CZ', 'P3-O1', 'P4-O2'].  
Seizure prediction methods are divided into patient-specific and patient-independent. EEG signal patterns are unique for each epilepsy patient. Moreover, seizure prediction is a challenging task because of the presence of noise during EEG recording due to eye blinking, eyelids movement, swallowing, and breathing. In addition, EEG signal patterns vary from one individual to another.  
The proposed system for epileptic prediction system, as shown in Figure 2, is composed of 3 main modules: EEG signal pre-processing, EEG signal segmentation, and the 1-D CNN based model used to predict whether the signal is pre-ictal or inter-ictal.  
As shown in Figure 2, the signal channels are first pre-processed and noise is removed from every channel using DWT techniques. After channel cleaning, the pre-ictal and inter-ictal segments are extracted from the signals. Each channel is then passed to the 1-D CNN model for the prediction process.