Feeds:
Posts
Comments

Posts Tagged ‘EEG’

Developing Deep Learning Models (DL) for the Instant Prediction of Patients with Epilepsy

Reporter: Srinivas Sriram, Research Assistant I
Research Team: Srinivas Sriram, Abhisar Anand

2021 LPBI Summer Intern in Data Science and Website Construction
This article reports on a research study conducted from January 2021 to May 2021.
This Research was completed before the 2021 LPBI Summer Internship that began on 6/15/2021.

The main criterion of this study was to utilize the dataset (shown above) to develop a DL network that could accurately predict new seizures based on incoming data. To begin the study, our research group did some exploratory data analysis on the dataset and we recognized the key defining pattern of the data that allowed for the development of the DL model. This pattern of the data can be represented in the graph above, where the lines representing seizure data had major spikes in extreme hertz values, while the lines representing normal patient data remained stable without any spikes. We utilized this pattern as a baseline for our model. 

Conclusions and Future Improvements:

Through our system, we were able to create a prototype solution that would predict when seizures happened in a potential patient using an accurate LSTM network and a reliable hardware system. This research can be implemented in hospitals with patients suffering from epilepsy in order to help them as soon as they experience a seizure to prevent damage. However, future improvements need to be made to this solution to allow it to be even more viable in the Healthcare Industry, which is listed below.

  • Needs to be implemented on a more reliable EEG headset (covers all neurons of the brain, less prone to electric disruptions shown in the prototype). 
  • Needs to be tested on live patients to deem whether the solution is viable and provides a potential solution to the problem. 
  • The network can always be fine-tuned to maximize performance. 
  • A better alert system can be implemented to provide as much help as possible. 

These improvements, when implemented, can help provide a real solution to one of the most common diseases faced in the world. 

Background Information:

Epilepsy is described as a brain disorder diagnostic category for multiple occurrences of seizures that happen within recurrent and/or a brief timespan. According to the World Health Organization, seizure disorders, including epilepsy, are among the most common neurological diseases. Those who suffer seizures have a 3 times higher risk of premature death. Epilepsy is often treatable, especially when physicians can provide necessary treatment quickly. When untreated, however, seizures can cause physical, psychological, and emotional, including isolation from others. Quick diagnosis and treatment prevent suffering and save lives. The importance of a quick diagnosis of epilepsy has led to our research team developing Deep Learning (DL) algorithms for the sole purpose of detecting epileptic seizures as soon as they occur. 

Throughout the years, one common means of detecting Epilepsy has emerged in the form of an electroencephalogram (EEG). EEGs can detect and compile “normal” and “abnormal “brain wave activity” and “indicate brain activity or inactivity that correlates with physical, emotional, and intellectual activities”. EEG waves are classified mainly by brain wave frequencies (EEG, 2020). The most commonly studied are delta, theta, alpha, sigma, and beta waves. Alpha waves, 8 to 12 hertz, are the key wave that occurs in normal awake people. They are the defining factor for the everyday function of the adult brain. Beta waves, 13 to 30 hertz, are the most common type of wave in both children and adults. They are found in the frontal and central areas of the brain and occur at a certain frequency which, if slow, is likely to cause dysfunction. Theta waves, 4 to 7 hertz, are also found in the front of the brain, but they slowly move backward as drowsiness increases and the brain enters the early stages of sleep. Theta waves are known as active during focal seizures. Delta waves, 0.5 to 4 hertz, are found in the frontal areas of the brain during deep sleep. Sigma waves, 12-16 hertz, are very slow frequency waves that occur during sleep. EEG detection of electrical brain wave frequencies can be used to detect and diagnose seizures based on their deviation from usual brain wave patterns.

In this particular research project, our research group hoped to develop a DL algorithm that when implemented on a live, portable EEG brain wave capturing device, could accurately predict when a particular patient was suffering from Epilepsy as soon as it occurred. This would be accomplished by creating a network that could detect when the brain frequencies deviated from the normal frequency ranges. 

The Study:

Line Graph representing EEG Brain Waves from a Seizure versus EEG Brain Waves from a normal individual. 

Source Dataset: https://archive.ics.uci.edu/ml/datasets/Epileptic+Seizure+Recognition

To expand more on the dataset, it is an EEG data set compiled by Qiuyi Wu and Ernest Fokoue (2021) from the work of medical researchers R.Andrzejak, M.D. et al. (2001) which had been made public domain through the UCI Machine Learning Repository We also confirmed fair use permission with UCI. The dataset had been gathered by Andrzejak during examinations of 500 patients with a chronic seizure disorder. R.G.Andrzejak, et al. (2001) recorded each entry in the EEG dataset used for this project within 23.6 seconds in a time-series data structure. Each row in the dataset represented a patient recorded. The continuous variables in the dataset were single EEG data points at that specific point in time during the measuring period. At the end of the dataset, was a y-variable that indicated whether or not the patient had a seizure during the period the data was recorded. The continuous variables, or the EEG data, for each patient, varied widely based on whether the patient was experiencing a seizure at that time. The Wu & Fokoue Dataset (2021) consists of one file of 11,500 rows, each with 178 sequential data points concatenated from the original dataset of 5 data folders, each including 100 files of EEG recordings of 23.6 seconds and containing 4097 data points. Each folder contained a single, original subset. Subset A contained EEG data gathering during epileptic seizure…. Subset B contained EEG data from brain tumor sites. Subset 3, from a healthy site where tumors had been located. Subsets 4 and 5 from non-seizure patients at rest with eyes open and closed, respectively. 

Based on the described data, our team recognized that a Recurrent Neural Network (RNN) was needed to input the sequential data and return an output of whether the sequential data was a seizure or not. However, we realized that RNN models are known to get substantially large over time, reducing computation speeds. To help provide a solution to this issue, our group decided to implement a long-short-term memory (LSTM) model. After deciding our model’s architecture, we proceeded to train our model in two different DL frameworks inside Python, TensorFlow, and PyTorch. Through various rounds of retesting and redesigning, we were able to train and develop two accurate models in each of the models that not only performed well while learning the data while training, but also could accurately predict new data in the testing set (98 percent accuracy on the unseen data). These LSTM networks could classify normal EEG data when the brain waves are normal, and then immediately predict the seizure data based on if a dramatic spike occurred in the data. 

After training our model, we had to implement our model in a real-life prototype scenario in which we utilized a Single Board Computer (SBC) in the Raspberry Pi 4 and a live capturing EEG headset in the Muse 2 Headband. The two hardware components would sync up through Bluetooth and the headband would return EEG data to the Raspberry Pi, which would process the data. Through the Muselsl API in Python, we were able to retrieve this EEG data in a format similar to the manner implemented during training. This new input data would be fed into our LSTM network (TensorFlow was chosen for the prototype due to its better performance than the PyTorch network), which would then output the result of the live captured EEG data in small intervals. This constant cycle would be able to accurately predict a seizure as soon as it occurs through batches of EEG data being fed into the LSTM network. Part of the reason why our research group chose the Muse Headband, in particular, was not only due to its compatibility with Python but also due to the fact that it was able to represent seizure data. Because none of our members had epilepsy, we had to find a reliable way of testing our model to make sure it worked on the new data. Through electrical disruptions in the wearable Muse Headband, we were able to simulate these seizures that worked with our network’s predictions. In our program, we implemented an alert system that would email the patient’s doctor as soon as a seizure was detected.

Individual wearing the Muse 2 Headband

Image Source: https://www.techguide.com.au/reviews/gadgets-reviews/muse-2-review-device-help-achieve-calm-meditation/

Sources Cited:

Wu, Q. & Fokoue, E. (2021).  Epileptic seizure recognition data set: Data folder & Data set description. UCI Machine Learning Repository: Epileptic Seizure Recognition. Jan. 30. Center for Machine Learning and Intelligent Systems, University of California Irvine.

Nayak, C. S. (2020). EEG normal waveforms.” StatPearls [Internet]. U.S. National Library of Medicine, 31 Jul. 2020, www.ncbi.nlm.nih.gov/books/NBK539805/#.

Epilepsy. (2019). World Health Organization Fact Sheet. Jun. https://www.who.int/ news-room/fact-sheet s/detail/epilepsy

Other Related Articles published in this Open Access Online Scientific Journal include the following:

Developing Deep Learning Models (DL) for Classifying Emotions through Brainwaves

Reporter: Abhisar Anand, Research Assistant I

https://pharmaceuticalintelligence.com/2021/06/22/developing-deep-learning-models-dl-for-classifying-emotions-through-brainwaves/

Machine Learning (ML) in cancer prognosis prediction helps the researcher to identify multiple known as well as candidate cancer diver genes

Curator and Reporter: Dr. Premalata Pati, Ph.D., Postdoc

https://pharmaceuticalintelligence.com/2021/05/04/machine-learning-ml-in-cancer-prognosis-prediction-helps-the-researcher-to-identify-multiple-known-as-well-as-candidate-cancer-diver-genes/

Deep Learning-Assisted Diagnosis of Cerebral Aneurysms

Reporter: Dror Nir, PhD

https://pharmaceuticalintelligence.com/2019/06/09/deep-learning-assisted-diagnosis-of-cerebral-aneurysms/

Developing Machine Learning Models for Prediction of Onset of Type-2 Diabetes

Reporter: Amandeep Kaur, B.Sc., M.Sc.

https://pharmaceuticalintelligence.com/2021/05/29/developing-machine-learning-models-for-prediction-of-onset-of-type-2-diabetes/

Deep Learning extracts Histopathological Patterns and accurately discriminates 28 Cancer and 14 Normal Tissue Types: Pan-cancer Computational Histopathology Analysis

Reporter: Aviva Lev-Ari, PhD, RN

https://pharmaceuticalintelligence.com/2019/10/28/deep-learning-extracts-histopathological-patterns-and-accurately-discriminates-28-cancer-and-14-normal-tissue-types-pan-cancer-computational-histopathology-analysis/

A new treatment for depression and epilepsy – Approval of external Trigeminal Nerve Stimulation (eTNS) in Europe

Reporter: Howard Donohue, PhD (EAW)

https://pharmaceuticalintelligence.com/2012/10/07/a-new-treatment-for-depression-and-epilepsy-approval-of-external-trigeminal-nerve-stimulation-etns-in-europe/

Mutations in a Sodium-gated Potassium Channel Subunit Gene related to a subset of severe Nocturnal Frontal Lobe Epilepsy

Reporter: Aviva Lev-Ari, PhD, RN

https://pharmaceuticalintelligence.com/2012/10/22/mutations-in-a-sodium-gated-potassium-channel-subunit-gene-to-a-subset-of-severe-nocturnal-frontal-lobe-epilepsy/

Read Full Post »

Developing Deep Learning Models (DL) for Classifying Emotions through Brainwaves

Reporter: Abhisar Anand, Research Assistant I
Research Team: Abhisar Anand, Srinivas Sriram

2021 LPBI Summer Internship in Data Science and Website construction.
This article reports on a research study conducted till December 2020.
Research completed before the 2021 LPBI Summer Internship began in 6/15/2021.

As the field of Artificial Intelligence progresses, various algorithms have been implemented by researchers to classify emotions from EEG signals. Few researchers from China and Singapore released a paper (“An Investigation of Deep Learning Models from EEG-Based Emotion Recognition”) analyzing different types of DL model architectures such as deep neural networks (DNN), convolutional neural networks (CNN), long short-term memory (LSTM), and a hybrid of CNN and LSTM (CNN-LSTM). The dataset used in this investigation was the DEAP Dataset which consisted of EEG signals of patients that watched 40 one-minute long music videos and then rated them in terms of the levels of arousal, valence, like/dislike, dominance and familiarity. The result of the investigation presented that CNN (90.12%) and CNN-LSTM (94.7%) models had the highest performance out of the batch of DL models. On the other hand, the DNN model had a very fast training speed but was not able to perform as accurately as other other models. The LSTM model was also not able to perform accurately and the training speed was much slower as it was difficult to achieve convergence.

This research in the various model architectures provides a sense of what the future of Emotion Classification with AI holds. These Deep Learning models can be implemented in a variety of different scenarios across the world, all to help with detecting emotions in scenarios where it may be difficult to do so. However, there needs to be more research implemented in the model training aspect to ensure the accuracy of the classification is top-notch. Along with that, newer and more reliable hardware can be implemented in society to provide an easy-to-access and portable EEG collection device that can be used in any different scenario across the world. Overall, although future improvements need to be implemented, the future of making sure that emotions are accurately detected in all people is starting to look a lot brighter thanks to the innovation of AI in the neuroscience field.

Emotions are a key factor in any person’s day to day life. Most of the time, we as humans can detect these emotions through physical cues such as movements, facial expressions, and tone of voice. However, in certain individuals, it can be hard to identify their emotions through their visible physical cues. Recent studies in the Machine Learning and AI field provide a particular development in the ability to detect emotions through brainwaves, more specifically EEG brainwaves. These researchers from across the world utilize the same concept of EEG implemented in AI to help predict the state an individual is in at any given moment.

Emotion classification based on brain wave: a survey (Figure 4)

Image Source: https://hcis-journal.springeropen.com/articles/10.1186/s13673-019-0201-x

EEGs can detect and compile normal and abnormal brain wave activity and indicate brain activity or inactivity that correlates with physical, emotional, and intellectual activities. EEG signals are classified mainly by brain wave frequencies. The most commonly studied are delta, theta, alpha, sigma, and beta waves. Alpha waves, 8 to 12 hertz, are the key wave that occurs in normal awake people. They are the defining factor for the everyday function of the adult brain. Beta waves, 13 to 30 hertz, are the most common type of wave in both children and adults. They are found in the frontal and central areas of the brain and occur at a certain frequency which, if slowed, is likely to cause dysfunction. Theta waves, 4 to 7 hertz, are also found in the front of the brain, but they slowly move backward as drowsiness increases and the brain enters the early stages of sleep. Theta waves are known as active during focal seizures. Delta waves, 0.5 to 4 hertz, are found in the frontal areas of the brain during deep sleep. Sigma waves, 12-16 hertz, are very slow frequency waves that occur during sleep. These EEG signals can help for the detection of emotions based on the frequencies that the signals happen in and the activity of the signals (whether they are active or relatively calm). 

Sources:

Zhang, Yaqing, et al. “An Investigation of Deep Learning Models for EEG-Based Emotion Recognition.” Frontiers in Neuroscience, vol. 14, 2020. Crossref, doi:10.3389/fnins.2020.622759.

Nayak, Anilkumar, Chetan, Arayamparambil. “EEG Normal Waveforms.” National Center for Biotechnology Information, StatPearls Publishing LLC., 4 May 2021, http://www.ncbi.nlm.nih.gov/books/NBK539805.

Other related articles published in this Open Access Online Scientific Journal include the Following:

Supporting the elderly: A caring robot with ‘emotions’ and memory
Reporter: Aviva Lev-Ari, PhD, RN
https://pharmaceuticalintelligence.com/2015/02/10/supporting-the-elderly-a-caring-robot-with-emotions-and-memory/

Developing Deep Learning Models (DL) for the Instant Prediction of Patients with Epilepsy
Reporter: Srinivas Sriram, Research Assistant I
https://pharmaceuticalintelligence.com/2021/06/22/developing-deep-learning-models-dl-for-the-instant-prediction-of-patients-with-epilepsy/

Prediction of Cardiovascular Risk by Machine Learning (ML) Algorithm: Best performing algorithm by predictive capacity had area under the ROC curve (AUC) scores: 1st, quadratic discriminant analysis; 2nd, NaiveBayes and 3rd, neural networks, far exceeding the conventional risk-scaling methods in Clinical Use
Curator: Aviva Lev-Ari, PhD, RN
https://pharmaceuticalintelligence.com/2019/07/04/prediction-of-cardiovascular-risk-by-machine-learning-ml-algorithm-best-performing-algorithm-by-predictive-capacity-had-area-under-the-roc-curve-auc-scores-1st-quadratic-discriminant-analysis/

Developing Machine Learning Models for Prediction of Onset of Type-2 Diabetes
Reporter: Amandeep Kaur, B.Sc., M.Sc.
https://pharmaceuticalintelligence.com/2021/05/29/developing-machine-learning-models-for-prediction-of-onset-of-type-2-diabetes/

Deep Learning-Assisted Diagnosis of Cerebral Aneurysms
Reporter: Dror Nir, PhD
https://pharmaceuticalintelligence.com/2019/06/09/deep-learning-assisted-diagnosis-of-cerebral-aneurysms/

Mutations in a Sodium-gated Potassium Channel Subunit Gene related to a subset of severe Nocturnal Frontal Lobe Epilepsy
Reporter: Aviva Lev-Ari, PhD, RN
https://pharmaceuticalintelligence.com/2012/10/22/mutations-in-a-sodium-gated-potassium-channel-subunit-gene-to-a-subset-of-severe-nocturnal-frontal-lobe-epilepsy/

A new treatment for depression and epilepsy – Approval of external Trigeminal Nerve Stimulation (eTNS) in Europe
Reporter: Howard Donohue, PhD (EAW)
https://pharmaceuticalintelligence.com/2012/10/07/a-new-treatment-for-depression-and-epilepsy-approval-of-external-trigeminal-nerve-stimulation-etns-in-europe/

Read Full Post »

%d bloggers like this: