Electroencephalography (EEG) is a method used to monitor the electrical activity of human brain. Electrodes placed at different positions on the scalp can measure the change in voltages during different events. It is widely used in medical diagnoses and scientific research.
This project aims to test the ability of the headbands to detect peaks in Power Spectrum Density(PSD) in the alpha band (8 to 12 Hz ) during eye closure. By using a Linear Discriminant Analysis (LDA) classifier, classification into two categories (eye closure and eye opening) is then performed on the data obtained from these devices.
The Institute for Infocomm Research (I2R), established in 2002, is a branch of the Agency for Science, Technology and Research (A*STAR). It is Singapore’s largest ICT research institute. It seeks to foster world-class Infocomm and media research and develop a deep talent pool of Infocomm professionals to power a vibrant knowledge-based Singapore.
It has thus so far focused on Artificial Intelligence, Audio; Language & Speech, Data Analytics, Communications & Networks, Cybersecurity, Heterogeneous Analytics, Healthcare, Robotics & AV, Satellite, Smart Energy & Environment and Video & Image Analytics.
The aim of the project is to test the ability of the newly developed headbands to detect eye closure and eye opening. We performed experiments on ourselves using muse headband and openBCI to obtain the training data used to build our classifier.
Our classifier is built using MATLAB and it sorts the activities into two categories: eye opening and eye closure based on the bandpower data from two selected electrodes.
The data was collected using muse headband and openBCI on three different subjects. Each device has two to four electrodes placed against the scalp. The subject had to go through 10 trials: 5 times of eye opening and 5 times of eye closure, each represented by a stim code.
Fig 1. data collection using openBCI
The data is then loaded into MATLAB, using a function that is previously written by our mentor and stored in a three-dimensional matrix. After that, time segments are extracted. We select suitable parameters such that the time segments selected are when the motion occurs.
Fig 2 . example of raw EEG data, displayed using EEG lab
Filtering is performed to obtain only the alpha band data. Instead of directly using a bandpass filter, which might lead to discontinuity in the filtered data, we used a lowpass filter followed by a highpass filter.
The bandpower of the data is then computed by calculating the variance, before it is converted, using a for loop, from a 3 dimensional matrix into a 2 dimensional matrix.
For each device, we have 2 to 4 features, each obtained from one electrode.
Fisher's ratio is a measure for linear discriminating power of some variable. By calculating the fisher ratio of each feature, we are able to choose the two features that have the best ability to distinguish the two classes. Greater value of fisher ratio indicated better discriminating power.
Fig 3. formula of fisher ratio
Data from two selected features used in the Linear Discriminant Anylasis. Leave-one-out classification is then performed, using 9 trials as training data and the remaining 1 trail as testing data. This is repeated for 10 times using a for loop.
For intersubject classification, data from 1 subjects is used for testing, while the data from the remaining subjects are used for training.
The predicted class and the actual class is compared in a confusion matrix from which accuracy is calculated.
We completed a report including a literature review and results of our intra-subject and inter-subject classification results for different headbands.
Alpha waves, also called Berger’s waves, are defined as neural oscillations ranging from 8 to 12 Hz. In Aminoff's Electrodiagnosis in Clinical Neurology (Sixth Edition 2012) by Michael J. Aminoff, it is stated that an alpha rhythm is commonly found in posterior parts of the brain (back part of the brain) when the subject is awake. A transient increase in the frequency can be observed immediately after the action of eye closing.
Neurophysiology, Vol. 49, No. 6, December, 2017 proved that the alpha rhythm (8–12 Hz) at channels P3, P4, O1, O2, T5, and T6 under eyes-closed condition boosted up to 29 kµV2 and above. The highest alpha power was observed at channel P4 under eyes-closed condition (35.62 kµV2). The global mean of the alpha-range power during the eyes-closed state was 20.0 kµV2 as compared to 5.08 kµV2 for the eyes-open state. The alpha power during the eyes-open condition was relatively low; at all channels it was below 10 kµV2. The alpha-frequency power was significantly higher within all brain regions under eyes-closed condition, as compared to eyes-open condition. It is also concluded that channels Fp1 and Fp2 demonstrated higher power values at the delta, theta, and beta frequencies during eyes-open condition. The alpha power was an exception; it increased profoundly under eyes-closed condition.
Fig 4. results from classification
Fig 5. results from classification
The most important skill I have picked up during the course of attachment in I2R is programming. This is the first time I have been exposed to programming. I could not even understand the codes given by our mentor at the start, but by the end of the attachment, I was able to write the entire script for intersubject classification using a template of intrasubject classification. Our mentor also guided us on how to go through the program step be step to find out where and what the errors were in order to debug. This skill is very useful when I was writing my own codes.
Another skill that I have learnt is to use Google for independent learning. This might rather sound simple, but its significance is often underestimated. With all the available resources online, online learning might seem common and easy. However, not everyone will take the initiative to use these resources, neither do they know how to use these resources wisely. During this attachment, I have learnt how to find out the solutions by using the available materials online as well as how to learn new knowledge.
In addition, I have also gained some more advanced math knowledge during this attachment that are related to classification and regression. I can now better understand how the mathematical knowledge that we learn in classrooms can be applied in real life.
It was fun to test out the headbands and see how our own brain signal fluctuates during different motions. The hands-on experience made the attachment experience more interactive. It was also very interesting to see how our brain signals varies from each other and how sometimes we got really weird results.
Our mentor has shared a story on how the character Gandhi in the game Civilisation, who is supposed to be peace-loving, became extremely violent because of a bug in his aggressiveness rating. This side story not only lightened the mood, but also showed us what can happen if the parameters exceeds their limits.
Our mentor shared with us his story of how he started programming as a university student and disliked it, but ended up changing his opinion and ended up choosing a related career. People's opinions are ever-changing. While interest is indeed the best teacher, we cannot be fully reliant on it and restrict our learning potential. We need to keep and open mind to new things and be willing to learn.