Epileptic seizures are unusual levels of excitatory activity in the human brain. While epileptic seizures are easily identifiable on an encephalogram, we want to forecast seizures before they actually happen. To do this is not easy, and requires difficult analysis of multiple lines of data in real-time. Since we cannot ask trained humans to constantly monitor a patient’s EEG readings, we need computer algorithms to do it. We accomplished this task by training a feedforward neural network on EEG data. EEG data was composed of 10 minute segments labeled as base, pre-ictal, ictal and post-ictal, and sampled at a rate of 400 Hz for 16 separate electrodes attached to the patient. We needed our model to produce a probability estimate (from 1 to 0) based on whether or not each segment was post-ictal. We achieved a 67% success rate on validation data. An example of the difficulty of distinguishing pre-ictal EEG readings from

Inspiration

Epileptic seizures are unusual levels of excitatory in the human brain. While epileptic seizures are easily identifiable on an encephalogram, we want to forecast seizures before they actually happen. To do this is not easy, and requires subtle analysis of multiple lines of data in real-time. Since we cannot ask trained humans to constantly monitor a patient’s EEG readings, we need computer algorithms to do it.

What it does

We accomplished this task by training a feedforward neural network on EEG data. EEG data was composed of 10 minute segments labeled as base, pre-ictal, ictal and post-ictal, and sampled at a rate of 400 Hz for 16 separate electrodes attached to the patient. Each segment was given a probability estimate (scalar from 0 to 1) based on whether or not it was post-ictal. We achieved a 67% successful classification rate on validation data with 32 inputs for the mean and midrange of all the time series values for each of the 16 electrodes. By eliminating the midrange, we reduced our network input to 16 variables and got a classification rate of 70%.

How I built it

We used scikit-learner, a fast and lightweight machine learning library that quickly builds and trains neural network models. Despite the large size of our dataset, we were able to break it down into smaller, fundamental components and analyze them using FFTs (Fast Fourier Transforms).

Challenges I ran into

Many different predictive models are available and there are no immediate clues as to which one is best. Our dataset had nearly 50 gigabytes of information. We had to compress this information and perform signal processing what was left. At one point, we had difficulties writing to file. Kaggle's validation data is different than the labeled data we were given, and the neural basis of each epileptic seizure may be different for each patient.

Accomplishments that I'm proud of

We're getting better and better at predicting things with machine learning. We also learned how to prepare data so that it could be processed by a feedforward neural network.

What I learned

We got better with machine learning libraries. We learned that building a good predictive model only solves half of the problem; in order to make accurate predictions, you must accurately preprocess the data so your models can understand it without difficulty. There are a lot of setbacks; neural networks take time to train and are not likely to work the first time.

What's next for EEG Seizure Forecasting

Patients who have electrodes implanted in their brain can benefit from this technology. Data streamed to a computer or microprocessor in real-time can warn a patient of an impending seizure, which allows them to prepare for proper medical assistance.

Built With

Share this project:
×

Updates