# purohith08/bci-iv-year-project architecture

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

- Interactive diagram: https://gitdiagram.com/purohith08/bci-iv-year-project
- Repository: https://github.com/purohith08/bci-iv-year-project

## Overview

This repository combines motor-imagery EEG collection, offline classifier training, and a real-time maze-game demo. The collection app presents trials and records subject sessions; separate training scripts process BCI Competition GDF data and build distinct classifiers; the game simulates EEG, classifies movement, and applies predictions to maze navigation while recording performance. The excerpts establish the game’s simulation and buffer, and training stages, but do not show the collection save path or a connection from trained artifacts to the game. Those links are therefore omitted. There is no substantive README overview.

Main entry points: [`Game-Test/bci_maze_game.py`](https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py) (Maze navigation), [`DATA`](https://github.com/purohith08/bci-iv-year-project/tree/main/DATA) (BCI GDF dataset), [`Data-collection/mi_eeg_system.py`](https://github.com/purohith08/bci-iv-year-project/blob/main/Data-collection/mi_eeg_system.py) (Trial collection app), [`Signal processing/FBCSP+MLP.py`](https://github.com/purohith08/bci-iv-year-project/blob/main/Signal%20processing/FBCSP%2BMLP.py) (FBCSP + MLP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["EEG Collection"]
  node_collector["Trial collection app<br/>[mi_eeg_system.py]"]
end

subgraph group_training["Offline Training"]
  node_fbcsp_mlp["FBCSP + MLP<br/>[FBCSP+MLP.py]"]
  node_fbcsp_svm["FBCSP + EEGNet + SVM"]
  node_hybrid_train["Hybrid MLP + XGBoost<br/>[train.py]"]
end

subgraph group_game["Maze Game"]
  node_eeg_sim["EEG simulation and buffer<br/>[bci_maze_game.py]"]
  node_game_classifier["Signal processing and prediction<br/>[bci_maze_game.py]"]
  node_maze["Maze navigation<br/>[bci_maze_game.py]"]
  node_score["Trial metrics<br/>[bci_maze_game.py]"]
end

subgraph group_data["EEG Data &amp; Results"]
  node_recordings[("Session recordings")]
  node_competition_data[("BCI GDF dataset")]
  node_trained_models[("Saved model artifacts")]
  node_game_results[("Game session logs")]
end

node_subject(("Study participant"))
node_game_user(("Game participant"))

node_subject -->|"completes trials"| node_collector
node_collector -.->|"records sessions"| node_recordings
node_fbcsp_mlp -->|"loads GDF epochs"| node_competition_data
node_fbcsp_svm -->|"loads GDF epochs"| node_competition_data
node_hybrid_train -->|"loads GDF epochs"| node_competition_data
node_game_user -->|"starts session"| node_maze
node_eeg_sim -->|"supplies samples"| node_game_classifier
node_game_classifier -->|"applies predictions"| node_maze
node_maze -->|"records outcomes"| node_score
node_score -.->|"writes session logs"| node_game_results

click node_collector "https://github.com/purohith08/bci-iv-year-project/blob/main/Data-collection/mi_eeg_system.py"
click node_recordings "https://github.com/purohith08/bci-iv-year-project/tree/main/Data-collection/EEG_Dataset"
click node_competition_data "https://github.com/purohith08/bci-iv-year-project/tree/main/DATA"
click node_fbcsp_mlp "https://github.com/purohith08/bci-iv-year-project/blob/main/Signal%20processing/FBCSP%2BMLP.py"
click node_fbcsp_svm "https://github.com/purohith08/bci-iv-year-project/blob/main/Signal%20processing/FBCSP%2BEEGNET%26SVM.py"
click node_hybrid_train "https://github.com/purohith08/bci-iv-year-project/blob/main/Signal%20processing/train.py"
click node_trained_models "https://github.com/purohith08/bci-iv-year-project/tree/main/models"
click node_eeg_sim "https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py"
click node_game_classifier "https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py"
click node_maze "https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py"
click node_score "https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py"
click node_game_results "https://github.com/purohith08/bci-iv-year-project/tree/main/Game-Test/bci_results"

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_collector toneBlue
class node_fbcsp_mlp,node_fbcsp_svm,node_hybrid_train toneAmber
class node_eeg_sim,node_game_classifier,node_maze,node_score toneMint
class node_recordings,node_competition_data,node_trained_models,node_game_results toneRose
class node_subject,node_game_user toneIndigo
```

## Components

### EEG Collection

- [Trial collection app](https://github.com/purohith08/bci-iv-year-project/blob/main/Data-collection/mi_eeg_system.py): `Data-collection/mi_eeg_system.py`

### Offline Training

- [FBCSP + MLP](https://github.com/purohith08/bci-iv-year-project/blob/main/Signal%20processing/FBCSP%2BMLP.py): `Signal processing/FBCSP+MLP.py`
- [FBCSP + EEGNet + SVM](https://github.com/purohith08/bci-iv-year-project/blob/main/Signal%20processing/FBCSP%2BEEGNET%26SVM.py): `Signal processing/FBCSP+EEGNET&SVM.py`
- [Hybrid MLP + XGBoost](https://github.com/purohith08/bci-iv-year-project/blob/main/Signal%20processing/train.py): `Signal processing/train.py`

### Maze Game

- [EEG simulation and buffer](https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py): `Game-Test/bci_maze_game.py`
- [Signal processing and prediction](https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py): `Game-Test/bci_maze_game.py`
- [Maze navigation](https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py): `Game-Test/bci_maze_game.py`
- [Trial metrics](https://github.com/purohith08/bci-iv-year-project/blob/main/Game-Test/bci_maze_game.py): `Game-Test/bci_maze_game.py`

### EEG Data & Results

- [Session recordings](https://github.com/purohith08/bci-iv-year-project/tree/main/Data-collection/EEG_Dataset): `Data-collection/EEG_Dataset`
- [BCI GDF dataset](https://github.com/purohith08/bci-iv-year-project/tree/main/DATA): `DATA`
- [Saved model artifacts](https://github.com/purohith08/bci-iv-year-project/tree/main/models): `models`
- [Game session logs](https://github.com/purohith08/bci-iv-year-project/tree/main/Game-Test/bci_results): `Game-Test/bci_results`

### Other components

- **Study participant**
- **Game participant**

## Connections

- Study participant → Trial collection app: completes trials (evidence: `Data-collection/mi_eeg_system.py`)
- Trial collection app → Session recordings: records sessions
- FBCSP + MLP → BCI GDF dataset: loads GDF epochs (evidence: `Signal processing/FBCSP+MLP.py`)
- FBCSP + EEGNet + SVM → BCI GDF dataset: loads GDF epochs (evidence: `Signal processing/FBCSP+EEGNET&SVM.py`)
- Hybrid MLP + XGBoost → BCI GDF dataset: loads GDF epochs (evidence: `Signal processing/train.py`)
- Game participant → Maze navigation: starts session (evidence: `Game-Test/bci_maze_game.py`)
- EEG simulation and buffer → Signal processing and prediction: supplies samples (evidence: `Game-Test/bci_maze_game.py`)
- Signal processing and prediction → Maze navigation: applies predictions (evidence: `Game-Test/bci_maze_game.py`)
- Maze navigation → Trial metrics: records outcomes (evidence: `Game-Test/bci_maze_game.py`)
- Trial metrics → Game session logs: writes session logs
