Skip to content

Add EEG task definitions and expand GCNN evaluation metrics#2

Merged
jburhan merged 2 commits intoeeg-gcnn-contributionfrom
claude/distracted-williamson
Apr 8, 2026
Merged

Add EEG task definitions and expand GCNN evaluation metrics#2
jburhan merged 2 commits intoeeg-gcnn-contributionfrom
claude/distracted-williamson

Conversation

@jburhan
Copy link
Copy Markdown
Owner

@jburhan jburhan commented Apr 8, 2026

Summary

This PR adds EEG task definitions and significantly expands the evaluation pipeline for the EEG GCNN model:

New Features

  1. EEG Task Definitions

    • pyhealth/tasks/EEG_abnormal.py: Binary classification task for abnormal EEG detection on TUAB dataset
    • pyhealth/tasks/EEG_events.py: Multiclass classification task for EEG event annotation on TUEV dataset
  2. Extended Evaluation Metrics

    • Added Precision, Recall, F1, and Balanced Accuracy to complement AUC
    • Implements Youden's J statistic for automatic optimal threshold selection
    • Matches evaluation protocol from Wagh & Varatharajah (2020)
  3. Comprehensive Test Coverage

    • Tests for functional adjacency computation (coherence and wPLI methods)
    • Tests for combined adjacency mode (mean of spatial + functional)
    • All adjacency tests validated for shape, symmetry, and diagonal properties

Changes

  • examples/eeg_gcnn_nd_detection_gcn.py: Enhanced metrics reporting, improved logging format (mirrors Table 2 of paper)
  • tests/test_eeg_gcnn.py: Added 121 lines of functional and combined adjacency tests with mocked mne_connectivity dependency

Jimmy Burhan and others added 2 commits April 6, 2026 16:33
Rename task schema keys (psd_features→node_features, adjacency→adj_matrix)
to match the EEGGraphConvNet model interface. Add self-contained combined
pipeline script that runs both GCN and GAT models with demo mode, requiring
only torch + torch_geometric (no PyHealth install needed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation

- Restore accidentally dropped EEG_abnormal.py and EEG_events.py task
  files that were causing an ImportError on test collection.
- Add TestFunctionalAdjacency (10 tests) covering _build_functional_adjacency
  and combined adjacency mode; mne_connectivity is mocked via sys.modules
  so tests run in milliseconds with no real EEG dependency.
- Extend evaluate() in the ablation script to report Precision, Recall,
  F1, and Balanced Accuracy in addition to AUC, using Youden's J statistic
  for threshold selection — matching the evaluation protocol in Table 2 of
  Wagh & Varatharajah (2020).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jburhan jburhan merged commit f918d71 into eeg-gcnn-contribution Apr 8, 2026
@jburhan jburhan deleted the claude/distracted-williamson branch April 8, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant