NeuroBrowse (1): an EEG-browsing web application

This year, during my engineering formation, I participated in a great project: the development of a web application for EEG analysis. We worked with an innovative start-up specialized in neurofeedback, Mensia Technologies, who asked us to create the first prototype of the NeuroBrowse project.


[projectinfo languages=”python,html/css,javascript” team=”5″ duration=”6 months”]

EEGs, neuroscience…: quésaco?

‘Neurosciences’ are the scientific study of the brain and they refer to a huge number of domains that are, quite frankly, very complex: some consider the brain’s anatomy, other the diseases that can affect its activity, or its links with emotions… it’s not easy to get your head around the entire thing! Neurofeedback focuses on the real-time study of brain activity to help scientists have a better understanding of the process at work, but also to help patients regulate their activity directly. In particular, Mensia’s team is interested in non-invasive ADHD treatment and has already developed several products and technologies that are approved and used by physicians.

EEGs (or electroencephalograms) are recordings of the brain activity thanks to electrodes set on the patient’s head. This raw data is dense and requires numerous processing steps before a scientist can actually analyze it. So far, Mensia has created many tools to take care of that, but they are not always adapted and, most importantly, they are not connected to their database. Thus the need for NeuroBrowse: an easy-to-use web application to automatize EEG file imports, pre-processing and visualization.

NeuroBrowse to the rescue!

Our mission was to make a first prototype of the NeuroBrowse app.

The idea of this project was both to teach us fundamental concepts in the fields of signal processing and web development, and to create a viable proof-of-concept to give Mensia’s researchers a sense of what NeuroBrowse could be. Plus, we convinced our tutor to add a machine learning part to the whole thing, because we were eager to train on a concrete case to test the theories we had seen in our Data Analysis course! If you want to read more about this part of the project, I have written a more comprehensive article about it.

For 6 months, my 4 partners F. Bentires Alj, A. Khizar, B. Merhane and A. Zounias-Sirabella and I learnt a lot about EEGs, data visualization, web development and project management. It was a rather complete experience I am happy I got to be a part of, since it really gave me a first experience of what a long-term industrial project can be. We had a good dynamic with Mensia’s collaborators and we ended up with – at least from our point of view – a nice result!

NeuroBrowse logo offered to Mensia (M. Pêcheux)

The app’s main features

As explained by the client, the core goal of NeuroBrowse is to facilitate database usage and EEG files handling. That is why they were really pleased we managed to connect the app directly to their storage point and enable an immediate access to the database. With the prototype, you simply input the unique identifier of the EEG session you want to analyze and it automatically loads the file from Mensia’s Cloud.

At the beginning of the project, the client defined with us a list of ‘use cases’ to incorporate to our product, i.e. the 3 visualizations most of Mensia’s scientists use to analyze an EEG: the temporal representation of the EEG, its spectrum and its covariance matrix.

EEG temporal visualization

EEG Spectrum

EEG Covariance matrix

These 3 visualizations are generated upon file loading and first displayed to the user as a grid of thumbnails – just for a quick overview of the EEG. Then, you can navigate through the website to get more details on each visualization and perform a deeper analysis.

NeuroBrowse homepage (when logged in) displays an overview of the 3 visualizations

Each visualization has its own detailed page to get more info

Early on, we – the students – also had an idea that ended up being added to the prototype’s features list: a user-based layout for each visualization specific page. Simply put, to improve the website’s accessibility, we thought it better to let the users themselves choose how to organize their workspace; so we implemented a ‘main plot-secondary plots’ combo that allows each user to put up to two secondary plots side by side with the main plot they are watching (for example, in the photo above, the main EEG plot is shown with the matching covariance matrix on its right). This way, Mensia’s researchers can easily see multiple visualizations of the same data at the same time, which is often very useful. Moreover, their preference is stored so that everytime they sign in, the app remembers what visualizations they like to study together.

In addition to these essential features, we also implemented a basic login/logout system to protect the website and only allow Mensia’s users to access it.

One researcher from Mensia stated that, thanks to this application:

‘What was tedious to do will become pleasant’ (Q. Barthélémy)

Tools & technologies

After discussing it with our tutor, we decided to use the Django framework to build the app. We chose it because it is simple and user-friendly, it is written in Python and the start-up already had some notions of how it works. Thanks to Django, we quickly produced a first draft of NeuroBrowse: that allowed us to gradually build on it with the clients and include new features on-the-go very easily.

To generate the graphs and plots Mensia’s team usually works on when studying an EEG session, we looked at the BokehJS open-source Javascript library designed for dynamic and interactive visualizations in the browser.

References

Leave a Reply

Your email address will not be published. Required fields are marked *