# sharan-yan04/eeg_classifier architecture

> Architecture diagram of the GitHub repository sharan-yan04/eeg_classifier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharan-yan04/eeg_classifier
- Repository: https://github.com/sharan-yan04/eeg_classifier

## Overview

This repository presents a notebook-driven EEG motor-imagery classification workflow: obtain PhysioNetMI trials, extract filter-bank CSP features, select features with QGA, and classify with an SVM. The README also describes evaluation statistics and a Gradio demo supporting staged examples and manual EEG input. The tree identifies one main notebook, but its contents were not sampled; component paths and relationships below therefore follow the README’s documented architecture, not inspected notebook calls.

Main entry points: [`notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb) (Gradio demo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["EEG data"]
  node_physionet[("PhysioNetMI")]
  node_trials["EEG trials"]
end

subgraph group_features["Feature pipeline"]
  node_filterbank["Three-band filterbank"]
  node_fbcsp["FBCSP features"]
  node_scaler["Train-only scaling"]
end

subgraph group_model["Selection and classification"]
  node_qga["QGA selection"]
  node_svm["RBF SVM"]
end

subgraph group_evaluation["Evaluation and demo"]
  node_predictions["Class predictions"]
  node_statistics["Statistical evaluation"]
  node_demo["Gradio demo"]
  node_staged["Staged samples"]
  node_manual["Manual EEG input"]
end

node_researcher(("User"))

node_physionet -->|"provides trials"| node_trials
node_trials -->|"filters into bands"| node_filterbank
node_filterbank -->|"extracts features"| node_fbcsp
node_fbcsp -->|"scales features"| node_scaler
node_scaler -->|"selects subset"| node_qga
node_qga -->|"feeds classifier"| node_svm
node_svm -->|"predicts classes"| node_predictions
node_predictions -->|"evaluates results"| node_statistics
node_predictions -->|"presents predictions"| node_demo
node_researcher -->|"uses interface"| node_demo
node_staged -->|"supplies examples"| node_demo
node_manual -->|"accepts trial"| node_demo

click node_trials "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_filterbank "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_fbcsp "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_scaler "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_qga "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_svm "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_predictions "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_statistics "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_demo "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_staged "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"
click node_manual "https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_physionet,node_trials,node_researcher toneBlue
class node_filterbank,node_fbcsp,node_scaler toneAmber
class node_qga,node_svm toneMint
class node_predictions,node_statistics,node_demo,node_staged,node_manual toneRose
```

## Components

### EEG data

- **PhysioNetMI**
- [EEG trials](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`

### Feature pipeline

- [Three-band filterbank](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`
- [FBCSP features](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`
- [Train-only scaling](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`

### Selection and classification

- [QGA selection](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`
- [RBF SVM](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`

### Evaluation and demo

- [Class predictions](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`
- [Statistical evaluation](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`
- [Gradio demo](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`
- [Staged samples](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`
- [Manual EEG input](https://github.com/sharan-yan04/eeg_classifier/blob/main/notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb): `notebooks/QGA_for_FBCSP_feature_selection_(Final).ipynb`

### Other components

- **User**

## Connections

- PhysioNetMI → EEG trials: provides trials (evidence: `README.md`)
- EEG trials → Three-band filterbank: filters into bands (evidence: `README.md`)
- Three-band filterbank → FBCSP features: extracts features (evidence: `README.md`)
- FBCSP features → Train-only scaling: scales features (evidence: `README.md`)
- Train-only scaling → QGA selection: selects subset (evidence: `README.md`)
- QGA selection → RBF SVM: feeds classifier (evidence: `README.md`)
- RBF SVM → Class predictions: predicts classes (evidence: `README.md`)
- Class predictions → Statistical evaluation: evaluates results (evidence: `README.md`)
- Class predictions → Gradio demo: presents predictions (evidence: `README.md`)
- User → Gradio demo: uses interface (evidence: `README.md`)
- Staged samples → Gradio demo: supplies examples (evidence: `README.md`)
- Manual EEG input → Gradio demo: accepts trial (evidence: `README.md`)
