Skip to content

This is the repository of the code that I wrote for my healthcare research with Grove City College and Highmark Healthcare. The goal of the research is to process the signals describing the gait of people and to find patterns in the data. Ultimately we would like to find detect/predict when a change is about to occur in someone's health. The app…

Notifications You must be signed in to change notification settings

allarassemjonathan/Fatigue_Detection_algorithm

Repository files navigation

Healthcare Research

Introduction

In this research we first use a mixture of gaussian models to describe the duration between the two highest peaks in the signal of one footstep. We recorded this value from the patient through time and notice that it follows the distribution dictated by a mixture of two gaussians. The signal recorded is therefore assumed to come from two gaussians (one gaussian corresponds to the fatigued state and the second to the non-fatigued state). We use the Expectation Maximization algorithm to learn the parameters of the two gaussians. This step allows us to personalized the algorithm to the patient. Even though most of the patients have mostly identical fatigued and non-fatigued models (10 for μ and 1 and .1 for σ resp for the fatigued and non-fatigued models) we thought that personalizing the algorithm to learn the parameters from the subject would make the prediction even more effective. Once we have learn the parameters from the data we can make prediction using the forward-backward algorithm. For the assignment we simply cluster by taking the class with the highest probability.

Personalization or Learning the parameters of the mixture of Gaussian

We use the Expectation Maximization to learn the parameters.
1 - Randomly initialize the parameters of the two models (μ and σ) as well as π the parameter of the latent variable. Randomly initialize the 2xn vector γ that will hold the conditional probabilities for the individual datapoints given the value of the latent Z.
2 - Compute the new value of γ with the randomly generated model.



3 - Compute the new value for the mean and deviation of the two models.
4 - Compute the new value of the parameter of the latent π.



5 - Run instruction 2- while the difference in the parameters of the models is greater than an arbitrary value ε.

Below we can see how the algorithm is run until the values of the parameters start converging breaking the condition put on the ε. In this example ε 's value is 10^-20.

Assessment or predictions of the latent state of the runner

Once the model is learned we can start making predictions. We use the forward backward algorithm for that. It can be easily derived from the bayesian network. First we have to find the joint distribution from the network:



The Markov Chain is learned from data through a Monte Carlo process, the others parameters are learned from the Personalization part. Using the Bayes rule we can derive that in fact the likelihood is proportional to the joint distribution. From that we can use the below expression to compute the likelihood of the data.



We notice that after doing the backward part of the algorithm, we find pretty much the same estimation hence for computational reasons we decided not to to a backward run and to estimate by multiplying the two.

Results

We were able to achieve 99% accuracy on test data and are waiting for the data from the patients to be able to run the entire process after a run of the athlete.

About

This is the repository of the code that I wrote for my healthcare research with Grove City College and Highmark Healthcare. The goal of the research is to process the signals describing the gait of people and to find patterns in the data. Ultimately we would like to find detect/predict when a change is about to occur in someone's health. The app…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages