Skip to content

whuang20226450/Brain-node-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brain-node-classification

Modified from https://github.com/Charliefff/Brain-node-classification/tree/main

Modified Parts

1. load_data.pyload_data_v2.py

  • Use full 0–499 timesteps per trial (previously 0–374).
  • Added wavelet transform for feature extraction.
  • Changed data split from train / val / test to train / val only — planning to use n-fold cross-validation.
  • Apply z-score normalization on validation data using training set mean and std for a more realistic evaluation setting.

2. model.py

  • Added flatConv_waveletEEGNet architecture.
  • Currently only tested EEGNet, waveletEEGNet, and flatConv_waveletEEGNet.
  • flatConv_waveletEEGNet_v2 (which performs convolution over both band and time dimensions) is commented out for now —
    its current input shape (batch, 1, channel, 1) is incompatible with EEGNet’s temporal convolution structure.
    (Left for reference and possible future modification.)

3. main.py

  • Replaced TensorBoard with standard logging.
  • Introduced a workspace directory to store log files and model checkpoints.
  • Removed test phase, since only train / val are used at this stage.

4. run_batch.py

  • Added this script to automate running main.py across multiple parameter configurations.

Usage

1. Set Up the Environment

pip install -r requirements.txt

2. Modify Configuration

Before training, update config.yaml with appropriate hyperparameters.

3. Train the Model

(1) Train the CNN Model

cd conv_based
python main.py --config config.yaml

4. See Training Result

  • Training results are saved under the directory:
    {log_dir}/{exp_name}_{time}
  • Both log_dir and exp_name can be configured in config.yaml.
  • Each run creates a unique timestamped subfolder to store:
    • Training logs
    • Model checkpoints
    • config file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages