From 70533ccc164e3b6edde673c97a1085e66630a981 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Fri, 20 Nov 2020 22:14:48 -0500 Subject: [PATCH 01/33] Add readme header --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index 58e3d79c..91c1bd42 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,53 @@ +

+
+ Polydodo +
+ Polydodo +
+

+ +

A simple automatic sleep scoring tool that uses OpenBCI boards.

+ +

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

+ +

+ Key Features • + How To Use • + Download • + Credits • + Related • + License +

+ # Polydodo: Automatic Sleep Analysis Tool +This project aims to offer a solution to record + This projects aims to offer a comprehensive guide to **record polysomnographic EEG data from home** with an OpenBCI, a website to **upload sleep data** to our classifier and an **interactive visualisation** tool to observe the classified night of sleep. +## Key features + + +## How to use + +## How it works + +## Credits + +## Support + +## License + ## Dev requirements ### Web From 93c43d8044674c2d27b5cc2b11ad0712b1e122f6 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sat, 21 Nov 2020 15:26:44 -0500 Subject: [PATCH 02/33] update readme --- README.md | 81 ++++++++++++++++---------------- ai/README.md | 46 +++++++++++------- backend/{readme.md => README.md} | 18 ++++++- mobile/README.md | 26 ++++++---- web/README.md | 14 ++++++ 5 files changed, 116 insertions(+), 69 deletions(-) rename backend/{readme.md => README.md} (58%) create mode 100644 web/README.md diff --git a/README.md b/README.md index 91c1bd42..143b94eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@


- Polydodo + Polydodo
Polydodo
@@ -22,73 +22,72 @@

Key Features • - How To Use • - Download • - Credits • - Related • - License + How It Works • + Project Structure • + Learn more • + About us

-# Polydodo: Automatic Sleep Analysis Tool +___ -This project aims to offer a solution to record +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. -This projects aims to offer a comprehensive guide to **record polysomnographic EEG data from home** with an OpenBCI, a website to **upload sleep data** to our classifier and an **interactive visualisation** tool to observe the classified night of sleep. +🌐 Our web application does exactly all that and is available at [this link](https://polycortex.github.io/polydodo/). Check it out! -## Key features +🤖 Our Android app is underway. Give us a star to stay tuned for upcoming news about its release! + +**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 -## How to use +- 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 -## Credits +Polydodo is composed of two client apps, a web one and a mobile one, through which the user can interact. These clients are not complementary but are alternatives to one another. Each of these clients uses the same local server which hosts the automatic sleep stages classification algorithm. -## Support +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. -## License +On the other hand, the mobile client offers a tool that can be used on a regular basis. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of his acquisition. -## Dev requirements +Finally, both these clients use a local http server that is easy to installed. This server is local so that your data is not sent over the internet. Biosignals data are sensitive and this is our way to promise you security. -### Web +![General architecture of the project](https://github.com/PolyCortex/polydodo/wiki/img/general_architecture.png) -- Install Yarn package manager +*Figure 1. Technology diagram with the flow of incoming and outgoing data to clients.* -### Python +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. -- Install Python 3 and pip -- Consider using `venv` to create a virtual environment +## Project Structure -### Flutter +This project is split into four different folders that represents the four different standalone parts of our project: -- Install the latest stable version of flutter +- 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`](https://github.com/PolyCortex/polydodo/tree/master/ai); and open the notebooks as a lot of documentation is 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`](https://github.com/PolyCortex/polydodo/tree/master/backend); +- `web/` contains the React web app which is the UI for our project. See [`web/README.md`](https://github.com/PolyCortex/polydodo/tree/master/web) for more info; +- `mobile` contains the Flutter app. This app is an alternative to our web app. It can interface itself directly to the OpenBCI boards which makes it even simpler to proceed to your own sleep analysis. See [`mobile/README.md`](https://github.com/PolyCortex/polydodo/tree/master/mobile) for more info. + +## Getting started ### VS Code - Install VS Code -- Install the project's recommended extensions - -## Dev workflow - -### Web +- Open this project's workspace via the `polydodo.code-workspace` file. +- Install all the project's recommended extensions -- Open workspace `polydodo.code-workspace` -- Install Python packages by running `pip install --user -r backend/requirements.txt` -- Install node modules by running `yarn install --cwd web` -- Fetch Flutter dependencies through the `Flutter` extension -- Start dev server by running `python backend/app.py` +For more information about how to get started for each part of the project, see their respective `README.md` file. -### Building the server as a single executable +## Learn more -Run `python -m PyInstaller --onefile app.py` +For more information, please refer to our [wiki pages](https://github.com/PolyCortex/polydodo/wiki). This is where you'll get all of our official documentation. -### Running the server locally +## About us -- [Login](https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-with-a-personal-access-token) to Github Docker registry -- `docker pull docker.pkg.github.com/polycortex/polydodo/backend:latest` -- `docker run -p 8080:8080 docker.pkg.github.com/polycortex/polydodo/backend:latest` +[PolyCortex](http://polycortex.polymtl.ca/) is a student club based at [Polytechnique Montreal](https://www.polymtl.ca/). -### Mobile +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. -Prior to build execute build-runner to generate the app's routes. -`flutter packages pub run build_runner watch --delete-conflicting-outputs` +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. diff --git a/ai/README.md b/ai/README.md index 3c11d40f..dea3f22b 100644 --- a/ai/README.md +++ b/ai/README.md @@ -1,17 +1,18 @@ # Sleep Stage Classification -This project aims to classify a full night of sleep based on two-channels of raw EEG signal. The sleep stage annotations should follow those of the *American Academy of Sleep Medicine (AASM) scoring manual* [[1]](https://aasm.org/clinical-resources/scoring-manual/). +This project aims to classify a full night of sleep based on two-channels of raw EEG signal. The sleep stage annotations should follow those of the _American Academy of Sleep Medicine (AASM) scoring manual_ [[1]](https://aasm.org/clinical-resources/scoring-manual/). A particularity of this project is that the data on which we will later apply our classifier will be different from the data from which we've trained on. Indeed, since there's no large public dataset of sleep stage classification based on the hardware we use and recommend (because of its affordability), we need to train on a dataset that used different recording equipment. Thus, our pipeline should also be able to classify sleep based on EEG acquired by different types of hardware (i.e. OpenBCI). ## Project Summary Once the right dataset was chosen, the following steps were taken in order to successfully classify sleep stages: -1) Dataset exploration -2) Feature extraction -3) Model exploration -4) Testing on Open BCI data -5) Feature and annotation formatting to csv + +1. Dataset exploration +2. Feature extraction +3. Model exploration +4. Testing on Open BCI data +5. Feature and annotation formatting to csv ## How to Recreate Results @@ -21,10 +22,11 @@ You must first install package dependencies by running the following: Afterwards, the order in which the notebooks should be run is the following: -1) `exploration/subject_exploration.ipynb`: This notebook will generate the recording's info file, namely `recordings-info.csv`, which holds the extrapolated offset time at which the user closed the lights. It also holds the total night duration. Those information will be used to crop the recordings to only keep epochs of the subject's night. -2) `feature_extraction.ipynb`: This notebook takes the recordings file and extract the different features. It will save two files, one that holds the features (`x_features.npy`) and the other which holds the sleep stage labels (`y_observations.npy`). If you also want to test the OpenBCI performance, it extracts the feature from the OpenBCI recordings into the `X_openbci_HP.npy` and scored labels into `y_openbci_HP.npy`. -3) `models/{RF_HMM, KNN, NB, SVC, voting_clf}.ipynb`: These notebooks train the corresponding classifier with the previously extracted features. Each notebook also saves the trained classifier into the `trained_models` folder. Also, in order to have the hidden markov model matrices for the postprecessing step, you must run the final steps of `models/RF_HMM.ipynb`. -4) `prediction_{openbci, anonymous}.ipynb`: These notebooks allows you to check the accuracy of a trained classifier on a single night recording. It takes in input the features, that have to be extracted beforehand, and outputs the epoch's labels. +1. `exploration/subject_exploration.ipynb`: This notebook will generate the recording's info file, namely `recordings-info.csv`, which holds the extrapolated offset time at which the user closed the lights. It also holds the total night duration. Those information will be used to crop the recordings to only keep epochs of the subject's night. +2. `feature_extraction.ipynb`: This notebook takes the recordings file and extract the different features. It will save two files, one that holds the features (`x_features.npy`) and the other which holds the sleep stage labels (`y_observations.npy`). If you also want to test the OpenBCI performance, it extracts the feature from the OpenBCI recordings into the `X_openbci_HP.npy` and scored labels into `y_openbci_HP.npy`. +3. `models/{RF_HMM, KNN, NB, SVC, voting_clf}.ipynb`: These notebooks train the corresponding classifier with the previously extracted features. Each notebook also saves the trained classifier into the `trained_models` folder. Also, in order to have the hidden markov model matrices for the postprecessing step, you must run the final steps of `models/RF_HMM.ipynb`. +4. `prediction_{openbci, anonymous}.ipynb`: These notebooks allows you to check the accuracy of a trained classifier on a single night recording. It takes in input the features, that have to be extracted beforehand, and outputs the epoch's labels. + ## Dataset & Exploration We will cover the choices that led us to Sleep-EDF as our main dataset, a brief overview and exploration results. @@ -42,17 +44,18 @@ On the other hand, for the next iterations of improving our classifier, the use Sleep-EDF extended is a dataset that is separated in two sections: sleep cassette (SC) and sleep telemetry (ST). They were compiled for two different research; the further was intended to study the impact of age and sex over sleep, and the latter was intended to study the effect of Temazepan on sleep. We only used the SC part of the dataset, because we initially only wanted to train on subjects that didn't have sleep pathologies. As stated on the Physionet website, resource group managed by the National Institutes of Health (NIH), the SC part of the dataset can be described as: -> The 153 SC* files (SC = Sleep Cassette) were obtained in a 1987-1991 study of age effects on sleep in healthy Caucasians aged 25-101, without any sleep-related medication [2]. Two PSGs of about 20 hours each were recorded during two subsequent day-night periods at the subjects homes. Subjects continued their normal activities but wore a modified Walkman-like cassette-tape recorder described in chapter VI.4 (page 92) of Bob’s 1987 thesis [7]. [...] + +> The 153 SC\* files (SC = Sleep Cassette) were obtained in a 1987-1991 study of age effects on sleep in healthy Caucasians aged 25-101, without any sleep-related medication [2]. Two PSGs of about 20 hours each were recorded during two subsequent day-night periods at the subjects homes. Subjects continued their normal activities but wore a modified Walkman-like cassette-tape recorder described in chapter VI.4 (page 92) of Bob’s 1987 thesis [7]. [...] Overall, there are 82 subjects whom participated in this research. The following signals have been recorded: -| Label | Sample Frequency | Physical Range | Unit | Digital Range | High Pass | Low Pass | +| Label | Sample Frequency | Physical Range | Unit | Digital Range | High Pass | Low Pass | |----------------|------------------|----------------|------|---------------|---------------------|----------| -| EEG Fpz-Cz | 100 Hz | [-192,+192] | uV | [-2048,+2047] | 0.5 Hz | - | -| EEG Pz-Oz | 100 Hz | [-197,+196] | uV | [-2048,+2047] | 0.5 Hz | - | -| EOG Horizontal | 100 Hz | [-1009,+1009] | uV | [-2048,+2047] | 0.5 Hz | - | -| Resp oro-nasal | 1 Hz | [-2048,+2047] | - | [-2048,+2047] | 0.03 Hz | 0.9 Hz | -| EMG Sumbental | 1 Hz | [-5,+5] | uV | [-2500,+2500] | 16 Hz Rectification | 0.7 Hz | -| Temp Rectal | 1 Hz | [+34,+40] | °C | [-2849,+2731] | - | - | +| EEG Fpz-Cz | 100 Hz | [-192,+192] | uV | [-2048,+2047] | 0.5 Hz | - | +| EEG Pz-Oz | 100 Hz | [-197,+196] | uV | [-2048,+2047] | 0.5 Hz | - | +| EOG Horizontal | 100 Hz | [-1009,+1009] | uV | [-2048,+2047] | 0.5 Hz | - | +| Resp oro-nasal | 1 Hz | [-2048,+2047] | - | [-2048,+2047] | 0.03 Hz | 0.9 Hz | +| EMG Sumbental | 1 Hz | [-5,+5] | uV | [-2500,+2500] | 16 Hz Rectification | 0.7 Hz | +| Temp Rectal | 1 Hz | [+34,+40] | °C | [-2849,+2731] | - | - | > The EOG and EEG signals were each sampled at 100 Hz. The submental-EMG signal was electronically highpass filtered, rectified and low-pass filtered after which the resulting EMG envelope expressed in uV rms (root-mean-square) was sampled at 1Hz. Oro-nasal airflow, rectal body temperature and the event marker were also sampled at 1Hz. @@ -98,3 +101,10 @@ CNN, sur l’´epoque ayant le meilleur score de justesse. Finalement, l’algorithme de Viterbi est appliqu´e afin de trouv´e la s´equence d’´etats cach´es la plus probable ´etant donn´e nos ´emissions sur notre ensemble de test. --> + +## Model export + +The ONNX library from Facebook and Microsoft is used to serialize the model and export it to production. This allows to improve the interoperability of the models developed by allowing to serialize, thanks to Protobuf, pipelines sklearn, pytorch and others to onnxruntime. Onnxruntime then makes it possible to run these pipelines on platforms other than Python. + +Check out `export_to_onnx.ipynb` to see how we serialized our trained model for it to be used in production. +Refer to `backend/` to see how we are then using it in a production environment. diff --git a/backend/readme.md b/backend/README.md similarity index 58% rename from backend/readme.md rename to backend/README.md index 90cc17b1..74a3361c 100644 --- a/backend/readme.md +++ b/backend/README.md @@ -1,4 +1,6 @@ -# Backend +# Polydodo server + +This server is responsible for the automatic sleep stage scoring of recorded EEG data. For more info about the deployed model, see [our wiki page](https://github.com/PolyCortex/polydodo/wiki/model). ## Setup @@ -29,6 +31,10 @@ brew install libomp # on macos ## Run it locally +- Install Python 3 and pip + +- Consider using `venv` to create a virtual environment + Activate your virtual environment. ```bash @@ -56,3 +62,13 @@ pytest - Send the request to the server - Open the profiler result contained in `profiles` folder with `snakeviz` + +## Building the server as a single executable + +Run `python -m PyInstaller --onefile app.py` + +## Running the server locally + +- [Login](https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-with-a-personal-access-token) to Github Docker registry +- `docker pull docker.pkg.github.com/polycortex/polydodo/backend:latest` +- `docker run -p 8080:8080 docker.pkg.github.com/polycortex/polydodo/backend:latest` diff --git a/mobile/README.md b/mobile/README.md index b3c68635..adabbd9a 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -1,16 +1,24 @@ -# Polydodo +# Polydodo mobile client -A new Flutter project. +This mobile app receives, scores, saves and aggregates sleep sequences. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of his acquisition. It does not require the use of OpenBCI GUI as it directly interface itself with the OpenBCI board. + +In the case of the Cyton, this is done using the serial protocol via an OTG cable that is plugged into the phone and with the Cyton Dongle plugged in. In the case of the Ganglion, the connection is made by bluetooth. + +## Development Framework + +We are using Flutter which is a high-level framework for mobile development. The speed of development and the possibility to develop a cross-platform product (Android and iOS) from a single code repository without sacrificing performances has been the determining factor in the use of this technology. Flutter uses the Dart language which is typed and compiled. + +## Targeted Platform + +We target Android as our only platform. While development frameworks like Flutter allow these two platforms to be targeted using a single source code, there are some small tasks and extra attention that should be paid in this regard. If it became worth it, we will also target iOS in the future. ## Getting Started -This project is a starting point for a Flutter application. +- Install the latest stable version of flutter -A few resources to get you started if this is your first Flutter project: +Prior to build execute build-runner to generate the app's routes. +`flutter packages pub run build_runner watch --delete-conflicting-outputs` -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) +## Learn more -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +Refer to the [wiki pages](https://github.com/PolyCortex/polydodo/wiki) to learn more about our mobile app project. diff --git a/web/README.md b/web/README.md new file mode 100644 index 00000000..b50ef3a9 --- /dev/null +++ b/web/README.md @@ -0,0 +1,14 @@ +# Polydodo web client + +This web app aims to offer a comprehensive guide on **how to record polysomnographic EEG data from home** with an OpenBCI, a form to **upload sleep data** to our classifier and an **interactive scrolly-telling visualization** to observe the night of sleep. Finally, it is possible to export the classifier results for further use. + +This app was designed on top of React.js and the data visualizations were created using D3.js. + +## Getting started + +- Install Yarn package manager +- Open workspace `polydodo.code-workspace` +- Install Python packages by running `pip install --user -r backend/requirements.txt` +- Install node modules by running `yarn install --cwd web` +- Fetch Flutter dependencies through the `Flutter` extension +- Start dev server by running `python backend/app.py` From dd9a3ecc84af6bb344a4a814dbf736d6da44a7e9 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sat, 21 Nov 2020 16:59:09 -0500 Subject: [PATCH 03/33] Update web/README.md Co-authored-by: Anes Belfodil --- web/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/README.md b/web/README.md index b50ef3a9..bc42dda9 100644 --- a/web/README.md +++ b/web/README.md @@ -7,7 +7,7 @@ This app was designed on top of React.js and the data visualizations were create ## Getting started - Install Yarn package manager -- Open workspace `polydodo.code-workspace` +- Open VS Code workspace `polydodo.code-workspace` - Install Python packages by running `pip install --user -r backend/requirements.txt` - Install node modules by running `yarn install --cwd web` - Fetch Flutter dependencies through the `Flutter` extension From 4c9ccbb62cf7cf80f4cf658dea4bc51c4be0e47c Mon Sep 17 00:00:00 2001 From: MouradLachhab Date: Sat, 21 Nov 2020 21:54:25 -0500 Subject: [PATCH 04/33] Added more setup to mobile and web readme --- mobile/README.md | 14 +++++++++++++- web/README.md | 20 ++++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/mobile/README.md b/mobile/README.md index adabbd9a..51c6879d 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -14,11 +14,23 @@ We target Android as our only platform. While development frameworks like Flutte ## Getting Started -- Install the latest stable version of flutter +### Prerequisites: +- Install the latest stable version of [flutter](https://flutter.dev/docs/get-started/install/). +- Install the latest stable version of [Android Studio](https://developer.android.com/studio/index.html). + - Android Studio is a great tool as it installs the required Android SDK, but also provides an Android Virtual Device manager which allows you to emulate an android device. + +### Setup: +First, download the required dependencies using: +`flutter pub get` Prior to build execute build-runner to generate the app's routes. `flutter packages pub run build_runner watch --delete-conflicting-outputs` +You now have the option to run the app on an emulator or on a live device. If you wish to run the app on a live device, you will need to use [Android Debug Brige](https://developer.android.com/studio/command-line/adb). + +Once you have an emulator setup or a connection to your live device, you can now run the app using: +`flutter run` + ## Learn more Refer to the [wiki pages](https://github.com/PolyCortex/polydodo/wiki) to learn more about our mobile app project. diff --git a/web/README.md b/web/README.md index bc42dda9..adb141f2 100644 --- a/web/README.md +++ b/web/README.md @@ -6,9 +6,17 @@ This app was designed on top of React.js and the data visualizations were create ## Getting started -- Install Yarn package manager -- Open VS Code workspace `polydodo.code-workspace` -- Install Python packages by running `pip install --user -r backend/requirements.txt` -- Install node modules by running `yarn install --cwd web` -- Fetch Flutter dependencies through the `Flutter` extension -- Start dev server by running `python backend/app.py` +### Prerequisites: +- Install the latest stable version of [Yarn package manager](https://classic.yarnpkg.com/lang/en/). +- Install the latest LTS version of [Node.js](https://nodejs.org/en/download/). +- We will also be needing [Python](https://www.python.org/downloads/). + - We recommend installing Python 3 as it is the version required for the backend. + +### Setup +Open VS Code workspace and then open a new terminal for the web directory. + +Install the required node modules using: +`yarn install` + +Aftwards, it is possible to run the web client using: +`yarn run start` From 0d96a4d9b77bda3b95c640ffc0ea7db8bdd2b1e5 Mon Sep 17 00:00:00 2001 From: MouradLachhab Date: Sat, 21 Nov 2020 21:56:29 -0500 Subject: [PATCH 05/33] Changed formatting for commands --- mobile/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mobile/README.md b/mobile/README.md index 51c6879d..cf52f5bc 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -21,15 +21,21 @@ We target Android as our only platform. While development frameworks like Flutte ### Setup: First, download the required dependencies using: -`flutter pub get` +```` +flutter pub get +``` Prior to build execute build-runner to generate the app's routes. -`flutter packages pub run build_runner watch --delete-conflicting-outputs` +``` +flutter packages pub run build_runner watch --delete-conflicting-outputs +``` You now have the option to run the app on an emulator or on a live device. If you wish to run the app on a live device, you will need to use [Android Debug Brige](https://developer.android.com/studio/command-line/adb). Once you have an emulator setup or a connection to your live device, you can now run the app using: -`flutter run` +``` +flutter run +``` ## Learn more From 42518182c2280f1d2c2079414f581977d93b9504 Mon Sep 17 00:00:00 2001 From: MouradLachhab Date: Sat, 21 Nov 2020 21:57:44 -0500 Subject: [PATCH 06/33] Removed extra character --- mobile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/README.md b/mobile/README.md index cf52f5bc..1bae7d86 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -21,7 +21,7 @@ We target Android as our only platform. While development frameworks like Flutte ### Setup: First, download the required dependencies using: -```` +``` flutter pub get ``` From 5499c577cfa614136b2f2b1d67d77531c30ebd31 Mon Sep 17 00:00:00 2001 From: MouradLachhab Date: Sat, 21 Nov 2020 21:58:35 -0500 Subject: [PATCH 07/33] Added missing web readme --- web/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/README.md b/web/README.md index adb141f2..92ba9c77 100644 --- a/web/README.md +++ b/web/README.md @@ -16,7 +16,12 @@ This app was designed on top of React.js and the data visualizations were create Open VS Code workspace and then open a new terminal for the web directory. Install the required node modules using: -`yarn install` +``` +yarn install +``` Aftwards, it is possible to run the web client using: -`yarn run start` +``` +yarn run start +``` + From 860bbd441b3c71917894b2ad965310bd7ee20a23 Mon Sep 17 00:00:00 2001 From: MouradLachhab Date: Sat, 21 Nov 2020 22:01:39 -0500 Subject: [PATCH 08/33] Removed python from web prerequesites --- web/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/README.md b/web/README.md index 92ba9c77..f64640e2 100644 --- a/web/README.md +++ b/web/README.md @@ -9,13 +9,11 @@ This app was designed on top of React.js and the data visualizations were create ### Prerequisites: - Install the latest stable version of [Yarn package manager](https://classic.yarnpkg.com/lang/en/). - Install the latest LTS version of [Node.js](https://nodejs.org/en/download/). -- We will also be needing [Python](https://www.python.org/downloads/). - - We recommend installing Python 3 as it is the version required for the backend. ### Setup -Open VS Code workspace and then open a new terminal for the web directory. +Once you have installed the required frameworks, you can now go into the mobile folder using a terminal. -Install the required node modules using: +From there, you can install the required node modules using: ``` yarn install ``` From 3ca76569ef9f81bc586d39ac938dfa62aa05ab55 Mon Sep 17 00:00:00 2001 From: MouradLachhab Date: Sat, 21 Nov 2020 22:34:33 -0500 Subject: [PATCH 09/33] Tweaked backend readme --- backend/README.md | 33 ++++++++++++++++++--------------- mobile/README.md | 4 ++-- web/README.md | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/backend/README.md b/backend/README.md index 74a3361c..131f2519 100644 --- a/backend/README.md +++ b/backend/README.md @@ -2,22 +2,35 @@ This server is responsible for the automatic sleep stage scoring of recorded EEG data. For more info about the deployed model, see [our wiki page](https://github.com/PolyCortex/polydodo/wiki/model). -## Setup -Create a new virtual environment to isolate Python packages. +## Prerequesites +- Install [Python 3.7](https://www.python.org/downloads/). + - Make sure that the "Python37\Scripts" folder is added to your environnment path varible on Windows in order to use pip and hupper without any issue. +## Setup - Linux + +Create a new virtual environment to isolate Python packages. This step will need to be done everytime you re-open your terminal. + +Linux: ```bash virtualenv -p /usr/local/bin/python3.7 venv ``` +Windows: +``` +python -m venv .venv +``` Activate your virtual environment. - +Linux: ```bash source venv/bin/activate ``` +Windows: +``` +.\.venv\Scripts\activate.bat +``` Install the required dependencies. - ```bash pip install -r requirements.txt -r requirements-dev.txt ``` @@ -31,19 +44,9 @@ brew install libomp # on macos ## Run it locally -- Install Python 3 and pip - -- Consider using `venv` to create a virtual environment - -Activate your virtual environment. - -```bash -source venv/bin/activate -``` - If you want to run the backend with hot reload enabled (you must have installed the development requirements), run the following command. -```bash +``` hupper -m app ``` diff --git a/mobile/README.md b/mobile/README.md index 1bae7d86..7c5ef7a1 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -14,12 +14,12 @@ We target Android as our only platform. While development frameworks like Flutte ## Getting Started -### Prerequisites: +### Prerequisites - Install the latest stable version of [flutter](https://flutter.dev/docs/get-started/install/). - Install the latest stable version of [Android Studio](https://developer.android.com/studio/index.html). - Android Studio is a great tool as it installs the required Android SDK, but also provides an Android Virtual Device manager which allows you to emulate an android device. -### Setup: +### Setup First, download the required dependencies using: ``` flutter pub get diff --git a/web/README.md b/web/README.md index f64640e2..c1e7deec 100644 --- a/web/README.md +++ b/web/README.md @@ -6,7 +6,7 @@ This app was designed on top of React.js and the data visualizations were create ## Getting started -### Prerequisites: +### Prerequisites - Install the latest stable version of [Yarn package manager](https://classic.yarnpkg.com/lang/en/). - Install the latest LTS version of [Node.js](https://nodejs.org/en/download/). From 20c416a18f09604bb8e5c556d7558c5655e2b0ec Mon Sep 17 00:00:00 2001 From: MouradLachhab Date: Sat, 21 Nov 2020 22:37:38 -0500 Subject: [PATCH 10/33] Made Linux vs Windows commands popup more using list dash --- backend/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/README.md b/backend/README.md index 131f2519..02255bee 100644 --- a/backend/README.md +++ b/backend/README.md @@ -11,21 +11,21 @@ This server is responsible for the automatic sleep stage scoring of recorded EEG Create a new virtual environment to isolate Python packages. This step will need to be done everytime you re-open your terminal. -Linux: +- Linux: ```bash virtualenv -p /usr/local/bin/python3.7 venv ``` -Windows: +- Windows: ``` python -m venv .venv ``` Activate your virtual environment. -Linux: +- Linux: ```bash source venv/bin/activate ``` -Windows: +- Windows: ``` .\.venv\Scripts\activate.bat ``` From 09e10eaf1ac5b50ed33f745da8978e10e55ba7ce Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sat, 21 Nov 2020 23:05:08 -0500 Subject: [PATCH 11/33] Update README.md --- backend/README.md | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/backend/README.md b/backend/README.md index 02255bee..07195faa 100644 --- a/backend/README.md +++ b/backend/README.md @@ -2,28 +2,22 @@ This server is responsible for the automatic sleep stage scoring of recorded EEG data. For more info about the deployed model, see [our wiki page](https://github.com/PolyCortex/polydodo/wiki/model). +## Getting started +### Prerequesites +- Install [Python 3.8](https://www.python.org/downloads/). + - Make sure that the "Python38\Scripts" folder is added to your environnment path varible on Windows in order to use pip and hupper without any issue. -## Prerequesites -- Install [Python 3.7](https://www.python.org/downloads/). - - Make sure that the "Python37\Scripts" folder is added to your environnment path varible on Windows in order to use pip and hupper without any issue. +### Setup -## Setup - Linux - -Create a new virtual environment to isolate Python packages. This step will need to be done everytime you re-open your terminal. - -- Linux: -```bash -virtualenv -p /usr/local/bin/python3.7 venv -``` -- Windows: +Create a new virtual environment to isolate Python packages. ``` python -m venv .venv ``` -Activate your virtual environment. -- Linux: +Activate your virtual environment. This step will need to be done everytime you re-open your terminal. +- Linux/macOS: ```bash -source venv/bin/activate +source .venv/bin/activate ``` - Windows: ``` @@ -42,7 +36,7 @@ apt-get install libgomp1 # on linux brew install libomp # on macos ``` -## Run it locally +## Run the server If you want to run the backend with hot reload enabled (you must have installed the development requirements), run the following command. @@ -59,6 +53,7 @@ pytest ``` ## Profile application +*A profile is a set of statistics that describes how often and for how long various parts of the program executed.* -[Python Software Foundation](https://docs.python.org/3/library/profile.html) - Run `python profiler.py` @@ -69,9 +64,3 @@ pytest ## Building the server as a single executable Run `python -m PyInstaller --onefile app.py` - -## Running the server locally - -- [Login](https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-with-a-personal-access-token) to Github Docker registry -- `docker pull docker.pkg.github.com/polycortex/polydodo/backend:latest` -- `docker run -p 8080:8080 docker.pkg.github.com/polycortex/polydodo/backend:latest` From 6d78508be55e64b6927c87b341490eb1d2860e74 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sat, 21 Nov 2020 23:05:36 -0500 Subject: [PATCH 12/33] Update README.md --- backend/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/README.md b/backend/README.md index 07195faa..629eeba8 100644 --- a/backend/README.md +++ b/backend/README.md @@ -36,7 +36,7 @@ apt-get install libgomp1 # on linux brew install libomp # on macos ``` -## Run the server +### Run the server If you want to run the backend with hot reload enabled (you must have installed the development requirements), run the following command. @@ -44,7 +44,7 @@ If you want to run the backend with hot reload enabled (you must have installed hupper -m app ``` -## Run the tests +### Run the tests You can run our unit tests with the following command, after installing the development requirements: @@ -52,7 +52,7 @@ You can run our unit tests with the following command, after installing the deve pytest ``` -## Profile application +### Profile application *A profile is a set of statistics that describes how often and for how long various parts of the program executed.* -[Python Software Foundation](https://docs.python.org/3/library/profile.html) - Run `python profiler.py` @@ -61,6 +61,6 @@ pytest - Open the profiler result contained in `profiles` folder with `snakeviz` -## Building the server as a single executable +### Building the server as a single executable Run `python -m PyInstaller --onefile app.py` From 97956e1a3f48392f73c61a91fee817bbc585a774 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sat, 21 Nov 2020 23:07:08 -0500 Subject: [PATCH 13/33] Update README.md --- mobile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/README.md b/mobile/README.md index 7c5ef7a1..14e48a7e 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -30,7 +30,7 @@ Prior to build execute build-runner to generate the app's routes. flutter packages pub run build_runner watch --delete-conflicting-outputs ``` -You now have the option to run the app on an emulator or on a live device. If you wish to run the app on a live device, you will need to use [Android Debug Brige](https://developer.android.com/studio/command-line/adb). +You now have the option to run the app on an emulator or on a live device. If you wish to run the app on a live device, you will need to use [Android Debug Bridge](https://developer.android.com/studio/command-line/adb). Once you have an emulator setup or a connection to your live device, you can now run the app using: ``` From 3f8369c357dc1ecc68a69050dd6eaf6e6addf5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 13:48:11 -0500 Subject: [PATCH 14/33] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 143b94eb..ab7ddfbd 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,15 @@

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

From be5230d894b0196e6e2c5123e87698e45bba558a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 13:56:19 -0500 Subject: [PATCH 15/33] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab7ddfbd..7df4b765 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ GitHub all releases - +

From 2ccde238089b9e142f5973cdeed004ffe2bd455f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 15:26:55 -0500 Subject: [PATCH 16/33] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7df4b765..59b9df4a 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ On the other hand, the mobile client offers a tool that can be used on a regular Finally, both these clients use a local http server that is easy to installed. This server is local so that your data is not sent over the internet. Biosignals data are sensitive and this is our way to promise you security. -![General architecture of the project](https://github.com/PolyCortex/polydodo/wiki/img/general_architecture.png) +![General architecture of the project](https://github.com/PolyCortex/polydodo/wiki/img/general_architecture_small.png) *Figure 1. Technology diagram with the flow of incoming and outgoing data to clients.* From 2dd35dd765dbae6c8aa6d1f18470f93d980d86de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 15:36:50 -0500 Subject: [PATCH 17/33] Centered and reduce the size of gen. arch. img --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59b9df4a..14d0ad1e 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,12 @@ The web client allows the user to upload a data file acquired using an OpenBCI b On the other hand, the mobile client offers a tool that can be used on a regular basis. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of his acquisition. Finally, both these clients use a local http server that is easy to installed. This server is local so that your data is not sent over the internet. Biosignals data are sensitive and this is our way to promise you security. - -![General architecture of the project](https://github.com/PolyCortex/polydodo/wiki/img/general_architecture_small.png) - +

+
+ 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. From 724b5f62eef983a394f2571857ec4b273d97fc11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 15:38:02 -0500 Subject: [PATCH 18/33] html italic for figure description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14d0ad1e..a18797f6 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Finally, both these clients use a local http server that is easy to installed. T
General architecture of the project
-*Figure 1. Technology diagram with the flow of incoming and outgoing data to clients.* +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. From 071e7c1a3f75b6b6170025ee66802d0bf208983c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 15:39:46 -0500 Subject: [PATCH 19/33] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a18797f6..d76a9614 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ This project is split into four different folders that represents the four diffe - 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 of the project, see their respective `README.md` file. +For more information about how to get started for each part (web, server, mobile) of the project, see their respective `README.md` file located in the eponym folder name. ## Learn more From 3ee4743aeb013b8114cc9fcbe94da1617a7beea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 15:49:28 -0500 Subject: [PATCH 20/33] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d76a9614..f45b70cf 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ This project is split into four different folders that represents the four diffe - 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, see their respective `README.md` file located in the eponym folder name. +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 From e4d83457ede3e4aefddf53a39d2d66cf433fc3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 16:00:36 -0500 Subject: [PATCH 21/33] Update README.md --- mobile/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/README.md b/mobile/README.md index 14e48a7e..a14843a2 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -20,7 +20,7 @@ We target Android as our only platform. While development frameworks like Flutte - Android Studio is a great tool as it installs the required Android SDK, but also provides an Android Virtual Device manager which allows you to emulate an android device. ### Setup -First, download the required dependencies using: +First, at the root of the mobile/ folder, download the required dependencies using: ``` flutter pub get ``` @@ -36,6 +36,7 @@ Once you have an emulator setup or a connection to your live device, you can now ``` flutter run ``` +If you are using Microsoft's Visual Studio Code IDE, build & Launch configurations are already setted for you. Head to the **Run** tab and run the **Mobile debug** option. ## Learn more From 88b5bcfdb0f079215c6924741a3e285446d0db69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 16:30:17 -0500 Subject: [PATCH 22/33] Update README.md --- mobile/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mobile/README.md b/mobile/README.md index a14843a2..6367ddd3 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -1,3 +1,24 @@ +

+ + web client + + + web client + + + web client + + + web client + +

+ + + # Polydodo mobile client This mobile app receives, scores, saves and aggregates sleep sequences. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of his acquisition. It does not require the use of OpenBCI GUI as it directly interface itself with the OpenBCI board. From 5f24f37ae913913fbda385f3789db3b48ebcf429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 16:30:58 -0500 Subject: [PATCH 23/33] Update README.md --- mobile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/README.md b/mobile/README.md index 6367ddd3..4379158d 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -4,7 +4,7 @@ alt="web client"> - web client From 7f4141d1d8f47bc3c719d18a428da450a7361c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 16:54:16 -0500 Subject: [PATCH 24/33] Badges for web readme --- web/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/web/README.md b/web/README.md index c1e7deec..ce36da40 100644 --- a/web/README.md +++ b/web/README.md @@ -1,5 +1,20 @@ # Polydodo web client +

+ + web client + + web client + + + web client + +

+ + This web app aims to offer a comprehensive guide on **how to record polysomnographic EEG data from home** with an OpenBCI, a form to **upload sleep data** to our classifier and an **interactive scrolly-telling visualization** to observe the night of sleep. Finally, it is possible to export the classifier results for further use. This app was designed on top of React.js and the data visualizations were created using D3.js. From 8f0442062514b29c64427ba316b6acfd542552e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 17:18:20 -0500 Subject: [PATCH 25/33] Added badges to backend readme --- backend/README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index 629eeba8..22be85f9 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,4 +1,19 @@ -# Polydodo server +# Classification backend (local server) + +

+ + + + + + + + + + + +

+ This server is responsible for the automatic sleep stage scoring of recorded EEG data. For more info about the deployed model, see [our wiki page](https://github.com/PolyCortex/polydodo/wiki/model). From a41addc751ef4249ba226cb5b7d0747507cb3f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 17:22:09 -0500 Subject: [PATCH 26/33] Removed unnecessary html --- backend/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/README.md b/backend/README.md index 22be85f9..a575ebf5 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,15 +1,15 @@ # Classification backend (local server)

- + - + - + - +

From 31c06e0fbdcc27f43a673ebb250d0c7a3e5165c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 17:23:29 -0500 Subject: [PATCH 27/33] added links to badges in web readme --- web/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/README.md b/web/README.md index ce36da40..3e9807c1 100644 --- a/web/README.md +++ b/web/README.md @@ -1,14 +1,14 @@ # Polydodo web client

- + web client - + web client - + web client From 45df4b7033daa830d9fb14723b0ce4dbc53b317a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 17:25:58 -0500 Subject: [PATCH 28/33] Update README.md --- mobile/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mobile/README.md b/mobile/README.md index 4379158d..0b78ee07 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -1,17 +1,17 @@

- - + web client - + web client - + web client - + web client From 3c36f9ed557c65da4de2decd4afe7ef8332c1bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 17:27:44 -0500 Subject: [PATCH 29/33] Update README.md --- mobile/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mobile/README.md b/mobile/README.md index 0b78ee07..f8ac16c1 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -1,3 +1,5 @@ +# Polydodo mobile client +

web client

- - - -# Polydodo mobile client This mobile app receives, scores, saves and aggregates sleep sequences. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of his acquisition. It does not require the use of OpenBCI GUI as it directly interface itself with the OpenBCI board. From 01ab9b4bfa3252c9903335f5ade8bf9591abb8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9langer?= Date: Sun, 22 Nov 2020 17:28:30 -0500 Subject: [PATCH 30/33] Update README.md --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index a575ebf5..14cb6310 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,4 +1,4 @@ -# Classification backend (local server) +# Polydodo classification backend (local server)

From e7a3c1c58b86dd806d17fac21942e30b5377f481 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sun, 22 Nov 2020 18:55:14 -0500 Subject: [PATCH 31/33] Update README.md Co-authored-by: Anes Belfodil --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f45b70cf..791276d7 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ ___ 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 at [this link](https://polycortex.github.io/polydodo/). Check it out! +🌐 Our web application does exactly all that and is available [here](https://polycortex.github.io/polydodo/). Check it out! 🤖 Our Android app is underway. Give us a star to stay tuned for upcoming news about its release! From 4a4b1af0aa70851a0b0066ccd16178f782684389 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sun, 22 Nov 2020 18:56:33 -0500 Subject: [PATCH 32/33] Apply suggestions from code review Co-authored-by: Anes Belfodil --- README.md | 10 +++++----- ai/README.md | 2 +- mobile/README.md | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 791276d7..f5c6d9bd 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ Polydodo is composed of two client apps, a web one and a mobile one, through whi 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 offers a tool that can be used on a regular basis. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of his acquisition. +On the other hand, the mobile client offers a tool that can be used on a regular basis. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes to the end of his data acquisition. -Finally, both these clients use a local http server that is easy to installed. This server is local so that your data is not sent over the internet. Biosignals data are sensitive and this is our way to promise you security. +Finally, both these clients use a local HTTP server that is easy to install. This server is hosted locally so that your data is not sent over the internet. Biosignal data are sensitive and this is our way to promise you security.


General architecture of the project @@ -67,12 +67,12 @@ As the above diagram states, in the case of the mobile application, the data is ## Project Structure -This project is split into four different folders that represents the four different standalone parts of our project: +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`](https://github.com/PolyCortex/polydodo/tree/master/ai); and open the notebooks as a lot of documentation is found there; +- 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`](https://github.com/PolyCortex/polydodo/tree/master/ai); 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`](https://github.com/PolyCortex/polydodo/tree/master/backend); - `web/` contains the React web app which is the UI for our project. See [`web/README.md`](https://github.com/PolyCortex/polydodo/tree/master/web) for more info; -- `mobile` contains the Flutter app. This app is an alternative to our web app. It can interface itself directly to the OpenBCI boards which makes it even simpler to proceed to your own sleep analysis. See [`mobile/README.md`](https://github.com/PolyCortex/polydodo/tree/master/mobile) for more info. +- `mobile` contains the Flutter app. This app is an alternative to our web app. It can interface directly with OpenBCI boards which makes it even simpler to proceed to your own sleep analysis. See [`mobile/README.md`](https://github.com/PolyCortex/polydodo/tree/master/mobile) for more info. ## Getting started diff --git a/ai/README.md b/ai/README.md index dea3f22b..ded79e78 100644 --- a/ai/README.md +++ b/ai/README.md @@ -104,7 +104,7 @@ la s´equence d’´etats cach´es la plus probable ´etant donn´e nos ## Model export -The ONNX library from Facebook and Microsoft is used to serialize the model and export it to production. This allows to improve the interoperability of the models developed by allowing to serialize, thanks to Protobuf, pipelines sklearn, pytorch and others to onnxruntime. Onnxruntime then makes it possible to run these pipelines on platforms other than Python. +The ONNX library from Facebook and Microsoft is used to serialize the model and export it to production. This allows to improve the interoperability of the models developed by allowing to serialize sklearn pipelines, pytorch and others to onnxruntime thanks to protobuf,. onnxruntime then makes it possible to run these pipelines on platforms other than Python. Check out `export_to_onnx.ipynb` to see how we serialized our trained model for it to be used in production. Refer to `backend/` to see how we are then using it in a production environment. diff --git a/mobile/README.md b/mobile/README.md index f8ac16c1..3c4c61c9 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -25,11 +25,11 @@ In the case of the Cyton, this is done using the serial protocol via an OTG cabl ## Development Framework -We are using Flutter which is a high-level framework for mobile development. The speed of development and the possibility to develop a cross-platform product (Android and iOS) from a single code repository without sacrificing performances has been the determining factor in the use of this technology. Flutter uses the Dart language which is typed and compiled. +We are using Flutter which is a high-level framework for mobile development. The speed of development and the possibility to develop a cross-platform product (Android and iOS) from a single code repository without sacrificing performance has been the determining factor in the use of this technology. Flutter uses the Dart language which is typed and compiled. ## Targeted Platform -We target Android as our only platform. While development frameworks like Flutter allow these two platforms to be targeted using a single source code, there are some small tasks and extra attention that should be paid in this regard. If it became worth it, we will also target iOS in the future. +We target Android as our only platform. While development frameworks like Flutter allow these two platforms to be targeted using a single source code, there are some small tasks and extra attention that should be paid in this regard. If it becomes worth it, we will also target iOS in the future. ## Getting Started From 66183f936662390d254a79d1c44bf0d43c00ca40 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Sun, 22 Nov 2020 18:56:46 -0500 Subject: [PATCH 33/33] Update mobile/README.md Co-authored-by: Anes Belfodil --- mobile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/README.md b/mobile/README.md index 3c4c61c9..a73273f6 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -19,7 +19,7 @@

-This mobile app receives, scores, saves and aggregates sleep sequences. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of his acquisition. It does not require the use of OpenBCI GUI as it directly interface itself with the OpenBCI board. +This mobile app receives, scores, saves and aggregates sleep sequences. Unlike the web application, this app can save sleep sequences for later consultation and display the aggregated results of several nights of sleep on a dashboard. Also, it will guide the user from the installation of the electrodes, until the end of their data acquisition. It does not require the use of OpenBCI GUI since it directly interfaces with the OpenBCI board. In the case of the Cyton, this is done using the serial protocol via an OTG cable that is plugged into the phone and with the Cyton Dongle plugged in. In the case of the Ganglion, the connection is made by bluetooth.