Skip to content

PolyCortex/polydodo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Polydodo
Polydodo

A simple automatic sleep scoring tool that uses OpenBCI boards.

web client GitHub release (latest by date) GitHub all releases

Key FeaturesHow It WorksProject StructureLearn moreAbout us


This project aims to offer a cheaper and more accessible way to perform sleep studies from home. To achieve this, a machine learning classifier is used to automate the manual sleep scoring step. This drastically cuts the time needed to process each and every sleep sequences and it completely eliminates the learning curve associated with manual sleep scoring.

🌐 Our web application does exactly all that and is available here. Check it out!

🤖 An Android app prototype has been built to test the interface with the OpenBCI boards. Using this, we were able to record sleep data from Cyton and Ganglion boards to a mobile device (see details).

This application is not intended for medical purposes and the data it produces should not be used in such context. Its only goal is to help you study your sleep by yourself. Always seek the advice of a physician on any questions regarding a medical condition.

Key features

  • Compatible with both OpenBCI's Cyton and Ganglion boards.
  • Automatic sleep stage scoring based on the AASM's labels.
  • A comprehensive guide on how to record polysomnographic EEG data from home.
  • A nice and straightforward UI to help you upload, visualize and save your sleep.

How it works

The web client allows the user to upload a data file acquired using an OpenBCI board and then presents him a detailed and personalized analysis of his sleep. Additionally, this client will further detail the process by which we come to classify sleep in stages and offer a review of this process. OpenBCI boards must be configured via OpenBCI GUI and data must be saved on a SD card (Cyton only) or through a session file.

On the other hand, the mobile client is a prototype for a tool that could be used on a regular basis. Unlike the web application, this app could save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard.

Finally, both these clients use a local HTTP server that hosts the automatic sleep stages classification algorithm. This server is easy to install and is hosted locally so that your data is not sent over the internet. This ensure more security for sensitive data like biosignals.


General architecture of the project
Figure 1. Technology diagram with the flow of incoming and outgoing data to clients.

As the above diagram states, in the case of the mobile application, the data is received in real time, and in the case of the web application, the data is received asynchronously. In both cases, the data is classified after the end of the acquisition on the local server.

Project Structure

This project is split into different folders that represent the standalone parts of our project:

  • The ai/ folder contains all of our machine learning prototypes. It mainly consists of a set of notebooks that documents our work. It is there that we trained our sleep stage classification algorithm, validated, tested and serialized it for production. For more information, see ai/README.md; and open the notebooks as a lot of documentation can be found there;
  • The backend/ folder contains the python server that uses the serialized model from the ai/ notebooks. This is the local server that must be used with the web app and the mobile app. See server/README.md;
  • web/ contains the React web app which is the UI for our project. See web/README.md for more info;
  • mobile contains the Flutter app. It is a prototype that can interface directly with OpenBCI boards which could make it even simpler to proceed to your own sleep analysis. See mobile/README.md for more info.

Getting started

VS Code

  • Install VS Code
  • Open this project's workspace via the polydodo.code-workspace file.
  • Install all the project's recommended extensions

For more information about how to get started for each part (web, server, mobile) of the project, head to the eponym folder and look for the README.md file.

Learn more

For more information, please refer to our wiki pages. This is where you'll get all of our official documentation.

About us

PolyCortex is a student club based at Polytechnique Montreal.

The goal of PolyCortex is to develop expertise in neuroscience and engineering to solve neuroengineering problems. This field aims to create technological solutions dedicated to the search for innovative solutions to neuroscience problems.

To do this, we recommend the use of solutions revolving around the design of brain-machine interface devices, the implementation of embedded systems, the use of machine learning and signal processing techniques.