This folder is made available as part of the following research paper published in MDPI Sensors.

Title: Multimodal Approach for Pilot Mental State Detection Based on EEG
Authors: Ibrahim Alreshidi, Irene Moulitsas, and Karl W Jenkins

Citation: Alreshidi, I.; Moulitsas, I.; Jenkins, K.W. Multimodal Approach for Pilot Mental State Detection Based on EEG. Sensors 2023, 23, 7350. https://doi.org/10.3390/s23177350

Abtract:
The safety of flight operations depends on the cognitive abilities of pilots. In recent years, there has been growing concern about potential accidents caused by the declining mental states of pilots. We have developed a novel multimodal approach for mental state detection in pilots using electroencephalography (EEG) signals. Our approach includes an advanced automated preprocessing pipeline to remove artefacts from the EEG data, a feature extraction method based on Riemannian geometry analysis of the cleaned EEG data, and a hybrid ensemble learning technique that combines the results of several machine learning classifiers. The proposed approach provides improved accuracy compared to existing methods, achieving an accuracy of 86\% when tested on cleaned EEG data. The EEG dataset was collected from 18 pilots who participated in flight experiments and publicly released at NASA’s open portal. This study presents a reliable and efficient solution for detecting mental states in pilots and highlights the potential of EEG signals and ensemble learning algorithms in developing cognitive cockpit systems. The use of an automated preprocessing pipeline, feature extraction method based on Riemannian geometry analysis, and hybrid ensemble learning technique set this work apart from previous efforts in the field and demonstrates the innovative nature of the proposed approach.


We have performed our experiments on an Intel(R) Core(TM) i7-10700 2.90 GHz CPU with 32 GBytes RAM PC. We have developed our algorithms using Python within Jupyter Notebook and we have utilised the MNE, Scikit-Learn, and pyriemann libraries.


## Contents of this repository
Data: 
This folder contains:
- A dataset called Crews_equalized_dataset_epo.fif which was used to obtain the results presented in the journal paper. It is the preprocessed EEG dataset used to predict four mental states, Channelised Attention, Diverted Attention, Startle/Surprise, and Baseline.
- A dataset called Example_raw.fif which was used to obtain Figure 6 of the journal paper.


Source code:
This folder contains a jupyter notebook called python_code.ipynb which implements the proposed EEG preprocessing pipeline and all the algorithms presented and validated in the journal paper.


Output:
This folder contains:
- A figure called Confusion Matrices.jpg which shows results from the Random Forest classifier in (A), Extremely Randomized Trees in (B), Gradient Tree Boosting in (C), AdaBoost in (D),
and Voting in (E).
- Figures called Figure 6A.jpg and Figure 6B.jpg which show the EEG signals before applying the preprocessing pipeline, and after applying the preprocessing pipeline, respectively.
- A text file called ML models evaluation.txt which contains the results produced by all algorithms presented and validated in the journal paper.
- A figure called The preprocessed EEG signals.jpg which shows the EEG signals, upon completion of our preprocessing pipeline, fed into the machine learning models for training and testing purposes.
