Skip to content

The Simple ML program uses brain waves(EEG) and GSR to analyze user activity.

License

Notifications You must be signed in to change notification settings

kei5uke/focus-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

focus-detection

This is a re-creation of the project I worked on before graduating from college in 2019.
The main goal of this project is to capture characteristic features from the data measured by the sensors and detect if the user is focusing on activities such as reading, watching videos, playing sudoku, or any other stimulus that engages the human nervous system.

Sensors

GSR


To achieve this goal, I used GSR sensor from Grove for measuring the stress level and put it on Raspberry Pi.
GSR stands for galvanic skin responce, which is a way of measuring the electrical conductance of the skin. Research shows that the value of GSR goes down when emotional arousal changes, on the other hand, it goes up when emotionally stable(relaxed).

EEG


I also used EEG sensor from NeuroSky. This tool can measure various brain waves such as alpha, beta, etc. It can be connected via bluetooth on any devices.
Each brain wave has its own characteristics and will be able to capture changes in arousal, relaxation, and emotions.

Neural Network

After measuring the data, system start training neural network model.
Since the data is time-series, I used LSTM as a main part of the architecture.
I used hyperas for auto-tuning.

Required Python libraries

hyperopt==0.2.5
tensorflow==2.4.0
Keras==2.4.3
pandas==1.2.0
hyperas==0.4.1
scipy==1.1.0
numpy==1.19.2
grove.py==0.6
grove==0.0.13
thinkgear==0.2

Usage

  1. Connect the MindWave to /dev/rfcomm0
  2. Run main.py in the focus-detection folder.
  3. Input csv folder name
  4. Start measuring GSR values
  • 1st session - calibration
  • 2nd session - focus (Training data)
  • 3rd session - relaxed (Training data)
  • 4th session - focus (Test data)
  • 5th session - relaxed (Test data)
  1. Auto Tuning ML model using hyperas
  2. Start Real time detection

Things to improve

  • It takes almost 2 minutes to train the model.
  • Uncertain if the trained model can be used for other people universally.

Note

Thinkgear library is only available for Python2 so please replace the code with this

About

The Simple ML program uses brain waves(EEG) and GSR to analyze user activity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published