Skip to content

max-hill-4/uni-dissertation

Repository files navigation

Final Dissertation

Contributors MIT License LinkedIn


Logo

Final Dissertation

EEG Based Biomarker prediction using Deep Learning
Explore the docs »

YouTube
View Demo · Report Bug

About The Project

This study aims to predict sleep-related hormone levels utilizing electroencephalogram (EEG) data. This could be an effective alternative, as it would provide a less invasive means of capturing vital biomarkers than blood sampling methods. Deep learning has proven to be very useful in means of EEG analysis, specifically by utilizing Convolutional Neural Networks (CNNs) we could correlate key hormones such as cortisol and testosterone. This approach eliminates the need for frequent blood draws as model prediction could be done in real-time, allowing for continuous hormonal sampling. Significant findings could have a meaningful effect for endocrine research. Hormone Regression in Sleep The first iteration of the model included all four sleep stages in its traning set, and a single output layer to predict regression values for all 12 hormones (TAC mmol/L, ADA U/L, ADA2 U/L, %ADA2, GLU mg/Dl, PHOS mg/Dl, CA mg/Dl, CHOL mg/Dl, TRI mg/Dl, HDL mg/dL, LDL-C mg/Dl, CPK U/L) at once. This was very challenging, as the model struggled to converge on all 12 labels at the same time. The model’s input being a 19x19 square matrix, originally it seemed that the model could not successfully optimise all of the hormones hormones due to the diverse scale of the hormone levels. This was resolved by normalising the values to 0-1. This change improved the models convergence during training, but still could not generalise well to the unseen data, with the best performance a mere: 0.175 r2. Due to the challenges in the regression task, the modelling approach was adapted to suit a classification approach, where hormone levels were categorised into three discrete groups to enhance generalisation. Sleep stages were also separated during training to remove possibility of frequency sensitive hormonal fluctuations. These changes are further demonstrated using the regression performance as outlined below.

Hormone Classification in N1 Sleep The N1 sleep stage is characterised by light sleep, only lasting for around 5 minutes; there is not much data available, so training is completed on the entire dataset. This is particularly noticeable in comparison to the other sleep stages, demonstrating a much larger amount of variance between feature extraction methodology. This does not seem to prevent results in N1 however, as notable findings include 0.8816 for ADA2 U/L (alpha) and 0.7829 for TAC mmol/L (alpha), it is to be expected that the delta wavelength appears to perform the worse, as the N1 sleep stage has very little delta wave activity. Low performing hormones such as CHOL, TRI and LDL-C may indicate limitations for EEG-based correlations in lipid biomarkers. Topographic visualisations reveal critical electrode channels Fp3 and Fp4 driving N1’s high performance. These frontal channels reveal coherence patterns relevant to early sleep. Future work that have access to larger computation and datasets could expand on this key pairing with further frequency analysis, to improve performance.

(back to top)

https://pytorch.org/

Built With

Major frameworks/libraries

  • Python
  • Javascript
  • Flask
  • Torch

(back to top)

Getting Started

Docker compose is as located inside of /frontend/docker_compose.yaml. Deployment based upon mounted Caddyfile.

(back to top)

Usage

Infrence models are deployed on eeg.maxh.work, where .MAT files are currently supported.

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Max - 26584263

Project Link: Here

(back to top)

Image 1 Image 2 Image 3 Image 4 Image 5 Image 6 Image 7 Image 8 Image 9 Image 10 Image 11 Image 12 Image 13 Image 14 Image 15 Image 16 Image 17 Image 18 Image 19 Image 20 Image 21 Image 22 Image 23 Image 24 Image 25 Image 26 Image 27 Image 28 Image 29 Image 30 Image 31 Image 32 Image 33 Image 34 Image 35 Image 36 Image 37 Image 38

About

Hormonal prediction from sleep EEG using PyTorch, Docker and MNE.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published