Computer Science Students take a step in the sleep-medicine field with Actigraphy

Simon Provost
Awake-together
Published in
7 min readJan 9, 2021

Computer Scientists usually see a purposeful and versatile vocation in computers as they allow problems to be solved efficiently and in ways that have not been possible before. Our team had great fascination in the world of medicine,so we got quickly invested in this research project. The project was born in October 2019 in Montpellier(France) as a requirement of our BSc degree in Computer Sciences at #Epitech.

Fig.1: Brainstorming board with patients & a significant number of fresh ideas. October — December 2019.

Between October and December 2019 the main mission was to find a medical field, where Computer Science could help. We built a first network of patients diagnosed with Narcolepsy and or Cataplexy. We even called some of them and tried to find how they would like to be helped. We agreed that our mission was to help patients in their day to day lives and not actually trying to find a treatment for any incurable diseases.

Fig.2: Entrance CHU Montpelleir (30/09/2019).

Nonetheless, we were curious about what an expert in the field could think about what we have thought and our ideas with a few of sleep disorder patients around the world. The 30 October 2019 we met with our first prestigious sleep expert in Montpellier(France), with whom we observed that adding a new thousandth device on the bedside table of a patient is not what they really need. After a few days, one of them came back to us and proposed us to take a deep interest in Actigraphy and why this method could helps us be one of the success-story for the next 5/10 years in Sleep Medicine.

Actigraphy is increasingly used in the assessment and treatment of various clinical condition. (McCall, 2012)

In Sleep medicine there are a significant number of things already known and studied, for example the Polysomnography which is one of the most common methods to detect sleep disorders. However, the actigraphy is a fresh new method discovered a few years ago, and especially studied and used for less than 10 years. A number of studies have been done, but more experiments should be carried out to see if the use of Actigraphy could be a great alternative to Polysomnography in regards to the patient conditions.

On 17 December 2019, the first meeting with one expert and our group in the sleep lab. at the CHU Montpellier was held. A great and rewarding meeting for our group because it was our first step with Actigraphy and Sleep Medicine around people who were being diagnosed or trying to find if they had sleep anomalies. Finally, the interesting point of this meeting was a plan given by the expert and reworked by our team:

  • First of all, trying to create a software that analyses a patient’s night, gives as much information that an expert could use. Trying to be as close as possible or better than the results of ActiLife leader in the actigraphy.
  • Secondly, either try to build an AI model to predict a disease or differentiate data between two such as narcolepsy and hypersomnia.
  • Secondly, try to make a pattern matching solution to classify two patients together and n other together.

Master’s 4th Year abroad

Fig.3: Map is pinned every current location of students of Awake in the year abroad of Epitech Master’s degree.

After a 6 month of research and our first prototype released (section: #Awake Current Stage), we then had to keep working on our project fully remotely and at a slower pace. Every student of our MSc in Computer Science had to find a university abroad, apply and study there for the year. We worked in sync from different parts of the world (Fig. 3) Léos Julien in San Diego — USA or Mathis Chaptinel in Seoul — South-Korea, Michele Leo in Paris — France, Matthieu Sauer Daegu — South-Korea , South-Korea and Simon Provost in Canterbury — United-Kingdom.

Awake current stage

Fig. 4: Awake 2020 Prototype.

Months after months, sprint after sprint, the first Windows Software of our solution had been built and can do the following:

  • Drag-and-drop data from any Actigraph Watch.
  • Read data to analyse the result of nights recorded.
  • [Result] → Profile patient.
  • [Result] → Sleep Efficiency of the total recording.
  • [Result] → Number of awakenings of the total recording.
  • And other variables that will probably change in the near future.

The raw data is also available with every night of the recording which gives more control to the experts.

The prototype was made after exploring what is currently done in the field and which algorithms are stable and robust. Moreover, we have also handled how we planned to follow the machine learning path in the next stage of our project by deeply understanding how our data works.

Awake Programming Language Stack

Fig.5: C# Used for the frontend of Awake. — Fig 6. R language used for the backend of Awake.

The Frontend Solution (WPF) (Fig. 5).

  • Gets data from the backend and use them to run a UX Awake Method and display them in a timely and secure manner.
  • Be able to show `Raw Data` to be used by the experts if required.

The backend solution (R) (Fig.6):

  • Analyse thousands of thousands of raw data.
  • Run Algorithms : (Sadeh et.al, 1994) / (Cole et.al, 1992) and others.
  • Create encrypted data and give them to the frontend solution in a structured manner.

Awake Next stage

The current stage of our project is essentially on analysing patient nights and being robust with what we output. Tomorrow we will be aiming at another type of work:

Fig 7. Cognitive Neural Network (CNN).

Our next first goal is to be able to classify every sleep stage via the help of a K-nearest neighbour, or Naive Bayes Theorem. It could help in the case where a study comparison between the current method of Awake with popular algorithms and models of learning is carried out.

Sleep Stages to detect through the CNN : `Stage N1, N2, N3, REM Sleep`(Healthwise Staff, 2019).

Tomorrow’s second goal is to be able to deploy a pattern matching solution between sets of patient data. Imagine that if we have a first patient diagnosed with narcolepsy, and another set of data shows more than 90% of similarity, an hypothesis can be made and put these both in a group. Repeating the process for each set of data would help experts and give them a better vision on where their patient’s status is, according to older diagnosis data.

Awake & EIP Xp

Fig. 8: Epitech Experience 2019+2020 cover. Competition of students on innovative project.

During the Epitech Innovative Project Experiences of Montpellier, we have twice been ranked joint winners in the category: “the first innovative and technologically advanced project of the year”

Awake Team Member

Awake Contacts

For any claims, questions and or advices, please take a look at our website: https://awaketogether.netlify.app in order to make contact through our form.

Thank you. Awake.

Fig. 9: Screenshot of Awake’s website.

Article made during an Epitech Innovative Project’s sprint by the group for the community.

Further Readings

https://actigraphcorp.com/category/research-database/pattern-recognition/

References

McCall, C., & McCall, W. V. (2012). Comparison of actigraphy with polysomnography and sleep logs in depressed insomniacs. Journal of sleep research, 21(1), 122–127. https://doi.org/10.1111/j.1365-2869.2011.00917.x

Avi Sadeh, M. Sharkey, Mary A. Carskadon, Activity-Based Sleep-Wake Identification: An Empirical Test of Methodological Issues, Sleep, Volume 17, Issue 3, May 1994, Pages 201–207, https://doi.org/10.1093/sleep/17.3.201

Roger J. Cole, Daniel F. Kripke, William Gruen, Daniel J. Mullaney, J. Christian Gillin, Automatic Sleep/Wake Identification From Wrist Activity, Sleep, Volume 15, Issue 5, September 1992, Pages 461–469, https://doi.org/10.1093/sleep/15.5.461

Healthwise Staff, Stage of Sleep, June 9, 2019, https://www.uofmhealth.org/health-library/hw48331

--

--