Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.24 KB

README.md

File metadata and controls

30 lines (20 loc) · 1.24 KB

2024BELAB_Final - EEG-Based Alarm System to prevent internet addiction

Data Preprocessor

This tool processes EEG (Electroencephalogram) data by filtering and visualizing alpha, beta, and theta brain waves. The code is in data_preprocessor.py. The data preprocessor performs the following operations:

  • Reads raw EEG data from CSV files
  • Applies bandpass filtering to isolate specific frequency bands
  • Generates visualizations of both raw and filtered data
  • Processes data into averaged time segments
  • Saves visualizations as PNG files
  • Reform the data to the format that the model needs

Configuration (config.json)

The config.json file controls the preprocessing parameters, modify once there is a new dataset to be processed.

Model Training

The model training part is in the file train_w_lstm.py.

Data Generation

The test data is generated by the file gen_testData.py.

Overall Testing

The overall testing part is in the file alarm.py. The structure can be devided into two parts:

  • Hardware Setup: Setup LED, Buzzer, and HC05.
  • Model Predicting: Using test data as input, predict the result and compare with the expected result.

This part of code is run on the Raspberry Pi to achieve the function of the alarm system.