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.
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).
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.
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.
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
- Connect the MindWave to
/dev/rfcomm0
- Run
main.py
in thefocus-detection
folder. - Input csv folder name
- 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)
- Auto Tuning ML model using hyperas
- Start Real time detection
- It takes almost 2 minutes to train the model.
- Uncertain if the trained model can be used for other people universally.
Thinkgear library is only available for Python2 so please replace the code with this