Back to All
Project

Neuroveil: Twin Mind Interface

Neuroveil synchronizes brainwaves between participants, allowing them to converge to a shared brain state, and control that brain state to elicit certain effects. Brainwaves are measured via the OpenBCI electrode cap and Cyton receivers and sent to an ESP32 module. Frequencies are selected from the input data and outputted to photo biomodulation glasses and a cymatics generator that visualizes the synchronization state. The data from the ESP32 is also sent to a Qualcomm® RB3 Gen 2 development kit to perform inference on a user’s brain data.

Objective

Our inspiration originates with the Dream Machine from the 60s, a simple flickering light causing profound visual effects, and the plethora of research after it showing health improvements, neuron regeneration, and treatments of mental disease.

Qualcomm-image

 

Source Code 

Description

Link

Source Code: GitHubLink for project source code

 

https://github.com/MLTQ/Synchroflow

 

Build / Assembly Instructions

Windows Host PC

  1. Install Docker onto Windows host PC
  2. Clone the GitHub repo to host PC
  3. Install Python packages that are in the project directory - Synchroflow/python/ai-model-dev

Qualcomm RB3 Gen 2

  1. Connect host PC to Qualcomm RB3 Gen2 following the instructions at this link
    1. Setup SSH either over Ethernet or WiFi with PuTTY
  2. SCP the following files into the same directory on the Qualcomm RB3 Gen2:
    1. Synchroflow/qualcomm/Docker
    2. Sychroflow/python/demo/.

OpenBCI Cyton

  1. Follow OpenBCI documentation to setup connection to PC and stream real-time data: https://github.com/openbci-archive/Docs/blob/master/Tutorials/01-Cyton_Getting%20Started_Guide.md
  2. Run the command - python3 python/brainflow/brain_serve_delta.py from PC terminal while on 2.4GHz network

ESP-32 (Photobiomodulation glasses)

  1. Install Arduino IDE
  2. Upload Arduino/delta_power_wifi.ino to ESP32 on LED glasses
  3. Repeat this setup on a separate host IP and port for each LED glasses
  4. Trade glasses so each user gets each other's brain data

ESP-32 (Speaker)

  1. Upload Arduino/speaker_wifi.py to ESP32 connected to speaker

 

Project Walkthrough

Qualcomm-image

OpenBCI cap uses Cyton microcontroller to stream raw EEG readings to local web server using WiFi and web sockets

  1. ESP32s connected to LED glasses and cymatic speaker receive data via the websocket using the delta_power_wifi.ino file. which does:
    1. converts power values to frequency
    2. informs glasses to flash at the determined frequency
    3. outputs the determined frequency to the speaker
  2. New user data is saved to the host PC, and then sent to the Qualcomm RB3 Gen 2 for inference
    1. Data was collected by having each team member wear the headset for 5 minutes, and labelling each streaming session by the team member ID (integer 1-5)
    2. Since there are 5 team members, there is a label for each of the five groups respectively
    3. Transformer model was then trained on this data
    4. Test data, generated from a different user wearing the headset, will be analyzed by the transformer model and will infer which team member’s brain data the user’s brain data is most similar to.



Usage Instructions

Host PC

  1. Streamed data from OpenBCI hardware will be saved locally to Host PC
  2. Prepare raw data for model by inputting it into Sychroflow/python/ai-model-dev/preprocessdata2.py
  3. SCP processed user data to Qualcomm RB3 Gen 2 using PuTTY

Qualcomm RB3 Gen 2

  1. Navigate to directory with all of the project files
  2. Build Docker container:
    1. docker build -t docker1 .
    2. Successful output:

 

root@qcs6490-rb3gen2-vision-kit:/home# docker build -t docker1 .
Sending build context to Docker daemon  84.53MB
Step 1/9 : FROM python:3.9-slim
 ---> 4681481d939a
Step 2/9 : WORKDIR /app
 ---> Using cache
 ---> 2e16ea6ff179
Step 3/9 : RUN apt-get update && apt-get install -y --no-install-recommends gcc python3-dev && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> d4a192d8f33
Step 4/9 : COPY testmodel1.py .
 ---> Using cache
 ---> 766bafe9dc4f
Step 5/9 : COPY transformer_model.pth .
 ---> Using cache
 ---> 465c27784e66
Step 6/9 : COPY testdata1.csv .
 ---> Using cache
 ---> 26eb73918a83
Step 7/9 : RUN pip3 install --no-cache-dir torch pandas numpy scikit-learn
 ---> Using cache
 ---> 33674e583de9
Step 8/9 : RUN chmod +x testmodel1.py
 ---> Using cache
 ---> 8a37ae73ab38
Step 9/9 : CMD ["python3", "testmodel1.py"]
 ---> Using cache
 ---> 61a623845395
Successfully built 61a623845395
  1. Run Docker container:
    1. docker run -it docker1
  2. The following will then happen:
    1. Docker will install necessary python packages
    2. testmodel3.py will load in transformer_model.pth and feed it the data from labeled_data.csv
    3. The loaded model from transformer_model will run inference on the inputted data and output a string result to the command line.
    4. Successful output:
Loading the entire dataset with progress bar...
Loading data: 100%|█████████████████████████████████████████| 2/2 [00:00<00:00, 2500.00batch/s]
Dataset loaded with 10000 entries.

Scaler file 'scaler.save' not found. Fitting a new scaler.
Scaler fitted and saved to 'scaler.save'.

Scaler Parameters:
Feature-wise Min Values: [0.0000  0.3189  0.9739  0.9927  0.4227  0.5028  0.9808  0.1332]
Feature-wise Max Values: [0.0097  0.3386  1.0000  0.9994  0.4315  0.5105  1.0000  0.1378]
Feature-wise Scale Factors: [102.0408  50.0000  40.0000 160.0000 111.1111 142.8571  50.0000 500.0000]
Feature-wise Min (scaled): [-0.0005 -0.0159 -0.0243 -0.0305 -0.0469 -0.0571 -0.0196 -0.0661]

Original Data Statistics:
Feature    Min        Max        Mean       Std       
Feature 1   0.0000    0.0098    0.0031    0.0029
Feature 2   0.3189    0.3386    0.3275    0.0051
Feature 3   0.9739    1.0000    0.9865    0.0062
Feature 4   0.9927    0.9994    0.9952    0.0016
Feature 5   0.4227    0.4315    0.4262    0.0022
Feature 6   0.5028    0.5105    0.5062    0.0024
Feature 7   0.9808    1.0000    0.9894    0.0046
Feature 8   0.1332    0.1378    0.1354    0.0014

Scaled Data Statistics:
Feature    Min        Max        Mean       Std       
Feature 1   0.0000    1.0000    0.3200    0.2976
Feature 2   0.0000    1.0000    0.5198    0.2550
Feature 3   0.0000    1.0000    0.3152    0.1573
Feature 4   0.0000    1.0000    0.3125    0.1002
Feature 5   0.0000    1.0000    0.3889    0.1980
Feature 6   0.0000    1.0000    0.4786    0.1714
Feature 7   0.0000    1.0000    0.4240    0.2300
Feature 8   0.0000    1.0000    0.4400    0.1952

Total groups for inference: 10

Using device: cuda

Starting inference...
Inference Progress:   0%|          | 0/10 [00:00<?, ?batch/s]
Inference Progress:  10%|█         | 1/10 [00:00<00:00,  8.50batch/s]
Inference Progress:  20%|██        | 2/10 [00:00<00:00,  8.33batch/s]
Inference Progress:  30%|███       | 3/10 [00:00<00:00,  8.25batch/s]
Inference Progress:  40%|████      | 4/10 [00:00<00:00,  8.14batch/s]
Inference Progress:  50%|█████     | 5/10 [00:00<00:00,  8.05batch/s]
Inference Progress:  60%|██████    | 6/10 [00:00<00:00,  7.98batch/s]
Inference Progress:  70%|███████   | 7/10 [00:00<00:00,  7.91batch/s]
Inference Progress:  80%|████████  | 8/10 [00:00<00:00,  7.85batch/s]
Inference Progress:  90%|█████████ | 9/10 [00:01<00:00,  7.80batch/s]
Inference Progress: 100%|██████████| 10/10 [00:01<00:00,  7.76batch/s]

Inference completed.

EEG data signals are most similar to Rui's EEG data

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries ("Qualcomm"). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.

Project Authors
Page Patterson
Adam Sauer
Rui Ma
Max Turnquist
Brian Chung
Qualcomm relentlessly innovates to deliver intelligent computing everywhere, helping the world tackle some of its most important challenges. Our leading-edge AI, high performance, low-power computing, and unrivaled connectivity deliver proven solutions that transform major industries. At Qualcomm, we are engineering human progress.

Stay connected

Get the latest Qualcomm and industry information delivered to your inbox.

Subscribe
Manage your subscription

© Qualcomm Technologies, Inc. and/or its affiliated companies.

Snapdragon and Qualcomm branded products are products of Qualcomm Technologies, Inc. and/or its subsidiaries. Qualcomm patented technologies are licensed by Qualcomm Incorporated.

Note: Certain services and materials may require you to accept additional terms and conditions before accessing or using those items.

References to "Qualcomm" may mean Qualcomm Incorporated, or subsidiaries or business units within the Qualcomm corporate structure, as applicable.

Qualcomm Incorporated includes our licensing business, QTL, and the vast majority of our patent portfolio. Qualcomm Technologies, Inc., a subsidiary of Qualcomm Incorporated, operates, along with its subsidiaries, substantially all of our engineering, research and development functions, and substantially all of our products and services businesses, including our QCT semiconductor business.

Materials that are as of a specific date, including but not limited to press releases, presentations, blog posts and webcasts, may have been superseded by subsequent events or disclosures.

Nothing in these materials is an offer to sell or license any of the services or materials referenced herein.