A project using EEG to analyze and interpret users' emotional states through neural signal processing and machine learning.
- The collection of EEG data accredited to the authors of A Large Finer-grained Affective Computing EEG Dataset: https://rdcu.be/d1TNW
- Chen, J., Wang, X., Huang, C. et al. A Large Finer-grained Affective Computing EEG Dataset. Sci Data 10, 740 (2023). https://doi.org/10.1038/s41597-023-02650-w
- Maisha Supritee Chowdhury
- Edan Stasiuk
- Rashed Hadi
- Zihao Xie
- Daniel Kim
Project report | Figma Designs | |-----------|---------------|-------------------------|-------------------------|
repository
├── backend ## Flask backend
├── app.py ## server
├── model.pkl ## trained svm model
├── requirements.txt ## required packages for project
├── frontend ## NextJS frontend
├── README.md ## You are here
├── GRU_model ## Gated Recurrent Unit model
├── model.py ## model
├── process.py ## processing data for model
├── predict.py ## trying to predict with this model
├── KNN_model ## K Nearest Neighbors model
├── knn_model.py ## model
├── process_data.py ## processing data for model
├── process_data.py ## process data for main svm model
├── svm_model.py ## main model used for prediction
├── generate_sample.py ## generates 1 sample for each emotion to try to predict
git clone https://github.com/sfu-cmpt340/EMOTIC_g3.git
cd EMOTIC_g3
cd frontend
npm install
npm i react-icons
Then navigate back to the main directory:
cd ..
cd backend
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
To run the full-stack application locally, you need to start both the backend server and the frontend web application. Follow the steps below:
Navigate to the backend
folder and run the Flask server with your virtual environment activated:
cd backend
flask --app app run
Open a new terminal, navigate to the frontend folder, and start the Next.js development server:
cd frontend
npm run dev
Open your browser and navigate to http://localhost:3000/ to use the web application. Instructions to download data to use with the application can be found below.
python3 -m venv .venv
. .venv/bin/activate
pip install flask flask_cors pandas matplotlib seaborn scikit-learn tensorflow numpy
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1DQPpjJIigouQEzcrkb9SQbCOPtSVbP5U' -O sample_data.zip
unzip sample_data.zip
python3 svm_model.py
>> Enter the name of the sample file: filename
filename
should match any of the 9 csv files in Sample_data
Data can be found at https://drive.google.com/file/d/1DQPpjJIigouQEzcrkb9SQbCOPtSVbP5U/view?usp=sharing
- Download and unzip in the root directory of this project
- There should now exist a folder called Sample_data with 9 csv files
Running the above python command should now display the predicted emotion of the selected csv data in the terminal