A Deep-Learning based Accessible Mobile App for Activity Recognition and Freezing of Gait Detection

Team: 4

School: La Cueva High

Area of Science: Biomedical engineering/Artificial Intelligence


Interim:
Parkinson’s Disease
Parkinson's disease is a progressive neurological disorder that affects movement. It is caused by the death of cells in the brain that produce a chemical called dopamine, which helps regulate movement. Symptoms of Parkinson’s disease typically range from tremors, stiffness, difficulty with movement and balance, and changes in speech. A highly evident symptom of Parkinson’s disease is the “Freezing of gait (FOG) .” This is when an individual’s feet get “stuck” to the ground, making it difficult or impossible to take a step. This can happen when a person is walking, standing up from a sitting position, or turning around. Freezing of gait can be very distressing and significantly impact a person’s ability to move around and participate in activities. It is thought to be caused by a combination of physical and cognitive factors, such as changes in muscle control, balance and cognition resulting from Parkinson’s disease.

FOG, Dataset and Problem Definition
In support of the National Science Foundation and in collaboration with Rexa.Info, UC Irvine Machine Learning Repository released a dataset called the “Daphnet Freezing of Gait” in 2013. The dataset contains annotated readings of 3 acceleration sensors located at the hip and the leg of patients with Parkinson’s disease. These accelerometers are automated to detect gait freeze. The data set was recorded with a focus on producing numerous freeze events. Users carried out a variety of activities, including walking straight lines, making several turns while walking, and lastly, a more realistic exercise including everyday living duties, in which users entered various rooms while bringing coffee and unlocking doors. The current diagnosis treatment for detecting Parkinsons is extremely expensive and involves the patient being given a series of questionnaires that provides insight to doctors regarding whether the patient has the disease. So in most cases the certain patient struggles with the disease before necessary medication and attention is given to the patient. In summary, the problem is finding a more accessible and practicable way of identifying Parkinson's disease by detecting freezing of gait via a smartphone app and machine/deep learning. Prior research has shown that vibrations can help a patient end their FOG episode more quickly, so we plan to not only detect FOG but also send light vibrations to help a user exit a FOG state. Finally, the app should be able to detect how many FOG episodes occur per day for a Parkinson’s patient, which helps doctors evaluate if certain medications are reducing FOG occurrences.



Problem solution (overview)
To solve this problem, first we will train a machine learning or deep learning model on the Daphnet dataset, where over 200 FOG episodes were recorded over the course of the experiment for 10 Parkinsons patients. Although the initial study collected accelerometer data from the upper thigh, trunk, and ancle, we could only use data from the thigh since our secondary dataset (for activity recognition) only contained acceleration data from the thigh. The next step would be to train another model on the Activity Recognition dataset (source 8). Both models would be tuned until they reach a high accuracy in detecting FOG and activities of a user (walking, running, jogging, etc). With the advent of an accurate model, the next step is to implement these models in a fully polished app format with a functioning UI, the app will contain features like activity detection and the FOG detection. Because acceleration is recorded at the upper thigh in the training data, a user can go about their daily activities while putting their phone in their pocket and not have to worry about it. Our Activity detection model will only activate the FOG detection model when the user is walking or moving, and will be turned off if the user is sitting/resting. We propose using the accelerometers ( able to detect acceleration from 3 axes ) available in phones to collect data on people's movement, and send the data every second to our models to make a prediction after they have already been trained.


Problem solution (specifics)

To train the model, a sliding window on the dataset will be used, the sliding window takes 66 rows at a time (about 1 second of accelerometer data). If 90% of the data during these rows are annotated as 1s (part of a FOG episode), the whole window will be classified as FOG. This threshold was chosen to decrease false positives. The following values will be computed on the sliding window: mean, standard deviation, average absolute deviation, minimum value, maximum value, range, median, median absolute deviation, interquartile range, negative values count, positive values count, number of values above the mean, number of peaks, skewness, kurtosis, energy, average resultant acceleration, and signal magnitude area. Next, a fourier transform is done on the acceleration data to turn the acceleration data into frequencies in hertz, and the same values mentioned above are computed on the fourier transform. These features will be used to train a long short term memory neural network (LSTM) model to make a prediction.
LSTM is an artificial neural network that is used in fields of artificial intelligence and deep learning, the main advantage of LSTM is that it has feedback connection. To deal with sequential data and time series anomalies there are multiple approaches each with different advantages. For example, one possible network to use is DBSCAN which does not require any predefined number of clusters and is easy to tune with exceptional performance. The other possible neural networks are LSTM, ARIMA, SARIMA, GARCH, VAR or other regression or machine learning and deep learning algorithms.

Progress to Date

We have finished cleaning and filtering the Daphent dataset and have performed Exploratory Data Analysis. We also finished implementing a sliding window with a 50% overlap, that computes over 150 features based on only 3 initial features (acceleration from three axes). This is also called feature engineering. All we have to do is to prepare the features for the Activity Recognition Dataset (which is essentially just copying the code we already made but apply it to a different dataset) and to train the LSTM on both datasets. Finally, we have to create a freely-accessible app that sends the accelerometer data to a web server running our models, and displays the predictions our models make.



Expected Results :
Being able to accurately predict FOG events with over 95% accuracy, specificity, and sensitivity
Being able to accurately predict activities a user is making based on training and testing the Activity Recognition dataset
Create a fully functional app that: Displays the activity a user is doing at any given time, vibrates if a FOG is detected when a user is moving, and finally records the number of FOG events that occur per day.

A fully functioning model can prove to be a novel approach in warning and diagnosing individuals if they are likely to develop the disease in the future or not, the model can be modified and improved furthermore to detect early abnormalities and provide suggestions to individuals to prolong the expression of these symptoms. With enough time the model will be able to predict the advent of the disease and display the FOG event.

Team Members: Aditya Koushik, Abitpal Gyawali, Aiden Shoppel, Venkata Menta, Amandeep Prasankumar

Sources
Bajaj, Aayush. “Anomaly Detection in Time Series.” Neptune.ai, Neptune Labs, 7 Dec. 2022, https://neptune.ai/blog/anomaly-detection-in-time-series.
Bhattacharya, Aditya. “Effective Approaches for Time Series Anomaly Detection.” Medium, Towards Data Science, 6 Aug. 2022, https://towardsdatascience.com/effective-approaches-for-time-series-anomaly-detection-9485b40077f1.
BHATTACHARYA, Aditya. “Sales and Demand Forecast Analysis.” Aditya Bhattacharya, 20 July 2020, https://aditya-bhattacharya.net/2020/07/20/sales-and-demand-forecast-analysis/3/.
Kmkarakaya. “LSTM Output Types: Return Sequences & State.” Kaggle, Kaggle, 19 Nov. 2020, https://www.kaggle.com/code/kmkarakaya/lstm-output-types-return-sequences-state/notebook.
Kostadinov, Simeon. “How Recurrent Neural Networks Work.” Medium, Towards Data Science, 10 Nov. 2019, https://towardsdatascience.com/learn-how-recurrent-neural-networks-work-84e975feaaf7.
sentdex. “Recurrent Neural Networks (RNN) - Deep Learning w/ Python, TensorFlow & Keras P.7.” YouTube, YouTube, 7 Sept. 2018, https://www.youtube.com/watch?v=BSpXCRTOLJA&t=648s.
Marc Bächlin, Meir Plotnik, Daniel Roggen, Inbal Maidan, Jeffrey M. Hausdorff, Nir Giladi, and Gerhard Tröster, Wearable Assistant for Parkinson's Disease Patients With the Freezing of Gait Symptom. IEEE Transactions on Information Technology in Biomedicine, 14(2), March 2010, pages 436-446
Jennifer R. Kwapisz, Gary M. Weiss and Samuel A. Moore (2010). Activity Recognition using Cell Phone Accelerometers, Proceedings of the Fourth International Workshop on Knowledge Discovery from Sensor Data (at KDD-10), Washington DC.

Marc Bächlin, Meir Plotnik, Daniel Roggen, Inbal Maidan, Jeffrey M. Hausdorff, Nir Giladi, and Gerhard Tröster, Wearable Assistant for Parkinson's Disease Patients With the Freezing of Gait Symptom. IEEE Transactions on Information Technology in Biomedicine, 14(2), March 2010, pages 436-446


Team Members:

  Amandeep Prasankumar
  Aditya Koushik
  Venkata Menta
  Abitpal Gyawali
  Aiden Shoppel

Sponsoring Teacher: Jeremy Jensen

Mail the entire Team