I2R001: Investigating the changes in the EEG during different mental tasks (facial expressions) and programming of data analysis
External Mentor: Dr Chin Zheng Yang
Teacher Mentor: Ms Jane Lin
Group Members: Sun Yufei, Huang Lin Wei, Fu Ziying
This website presents my one-month attachment to the Institute for Infocomm Research (I2R) in the Agency for Science, Technology and Research (A*STAR) . It provides background information on I2R and the project, namely Investigating the changes in the EEG during different mental tasks . A record of main activities done, such as learning MATLAB, data collection and analysis and results mostly in the form of graphs and tables, is also included. I have also included three content knowledge/skills I have learnt, two interesting aspects of my learning as well as one takeaway for life.
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.
Adapted from: https://www.a-star.edu.sg/i2r/ABOUT-I2R/VISION-MISSION.aspx
The overall objective of this project, Investigating the changes in the EEG during different mental tasks, is to investigate the changes in the electroencephalography (EEG) of people when they are asked to perform different types of tasks e.g. opening and closing their eyes.
By analysing the data collected and the relationship between EEG signals and cognitive workload, a classifier can be developed using MATLAB. We have developed 2 types of classifiers, namely the intra subject classifier and the inter subject classifier. Despite being at a basic level, our project provides us a starting point for future applications such as the investigation of dementia and facial recognition.
1. Learning the programming language MATLAB
MATLAB is the programming language we used to do data analysis.
We started from basic functions like simple arithmetic calculations and the use of each window in MatLab. It then gradually went into more complicated functions such as the use of for loops and eventually we needed to write our own codes to do data analysis.
We were also asked to go through online lectures on machine learning by Andrew Ng, as well as EEG analysis lectures by Mike x Cohen.
At the end of the attachment, I am able to write my codes and know how to modify the compound codes according to the needs of data analysis.
2. Experiments and data collection
We conducted 3 experiments using the muse head band, neeuro head band and OpenBCI respectively.
The subject investigated is to wear the headband which is connected to a laptop via Bluetooth and follow the instructions (such as eye open and eye close) given by the software. There are 10 trials in one experiment for the subject and the EEG data collected was first shown on the screen and later recorded into a data folder after the experiment was completed.
We learned how to connect the 2 headbands and OpenBCI device to our laptop and knew which channel each electrode on the device stands for.
Figure 1. Our team doing experiments using OpenBCI
3. EEG data analysis using MATLAB
In data analysis stage, all three experiments followed similar steps using MATLAB, which functions to load data, extract data, filter data, extract features, select features, and finally perform classification of the data.
The processed data was divided into training data and testing data for validation. Training data was used to create selected features. These features could be the mean, variance or band power of the wave. The data is then sorted into different categories according to the features by the classifier.
Lastly, the predicted data was compared to the actual grouping. The accuracy was calculated using confusion matrices.
1. Classification result
The following tables show the confusion matrices and accuracy obtained from the classification of the three experiments.
Figure 2&3. Result of confusion matrix and accuracy
2. Literature Review
Our team did online research on previous studies of similar topics. We looked through the papers to get a thorough understanding of the experiment and to have more information for knowledge.
1. I have learnt the content knowledge of MATLAB language the most in the past 1 month. Our mentor Dr Chin taught us MATLAB functions and we managed to run the functions such that we can load, process and analyse the EEG data collected.
2. Mr Chin also taught us some math and statistic concepts beyond the syllabus of JC. Examples are Bayes' theorem, the Fourier transform and the covariance etc.
3. We have developed the skill of learning independently. Since our team was not supervised by our mentor all the time, we had to keep ourselves disciplined and learn on our own. This habit will benefit me even after the WoW! programme.
1. As new learners of the MATLAB language, our team sometimes complicated the task given by our mentor. We used more complex codes to accomplish the task rather than using codes that are much more straightforward.
2. We were asked to broadcast one of our team's laptop during the meet-up with our mentor. We were all nervous when first broadcasted our screen but gradually get used to it as the project went by.
Our mentor once shared with us how bad he was when he first started on programming so as to encourage us not to be so upset when we encountered endless problems. It is always hardest to get started but things will get smoother once you keep on starting in your life.
WoW! team 2020 and our mentor Dr Chin