# manthandixit089/we-msdt-former_model architecture

> Architecture diagram of the GitHub repository manthandixit089/we-msdt-former_model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manthandixit089/we-msdt-former_model
- Repository: https://github.com/manthandixit089/we-msdt-former_model

## Overview

This repository is a research notebook for training and evaluating an MSDT-Former P300 speller model, including a class-balanced ensemble and target-prior calibration. The documented workflow runs through EEG data loading and preprocessing, training or loading saved checkpoints, then evaluating classification and speller performance. The README identifies the notebook and saved artifacts, but no notebook source was available to verify internal call details; the workflow links below reflect documented behavior only.

Main entry points: [`nayaModel.ipynb`](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb) (Experiment notebook), [`model_0.pt`](https://github.com/manthandixit089/we-msdt-former_model/blob/main/model_0.pt) (Model checkpoints), [`ensemble_weights.npy`](https://github.com/manthandixit089/we-msdt-former_model/blob/main/ensemble_weights.npy) (Ensemble weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["EEG preparation"]
  node_notebook["Experiment notebook<br/>[nayaModel.ipynb]"]
  node_preprocess["Preprocessing<br/>[nayaModel.ipynb]"]
end

subgraph group_model["Modeling"]
  node_baseline["Baseline training<br/>[nayaModel.ipynb]"]
  node_ensemble["Ensemble training<br/>[nayaModel.ipynb]"]
  node_focal["Balanced focal loss<br/>[nayaModel.ipynb]"]
  node_checkpoints["Model checkpoints<br/>[model_0.pt]"]
  node_weights["Ensemble weights"]
end

subgraph group_results["Speller evaluation"]
  node_calibration["Target-prior calibration<br/>[nayaModel.ipynb]"]
  node_speller["Character recognition<br/>[nayaModel.ipynb]"]
  node_metrics["Performance metrics<br/>[nayaModel.ipynb]"]
end

node_user(("Researcher"))
node_dataset[("Albany dataset")]

node_user -->|"runs"| node_notebook
node_notebook -->|"loads data"| node_dataset
node_notebook -->|"prepares epochs"| node_preprocess
node_preprocess -->|"provides epochs"| node_baseline
node_preprocess -->|"provides epochs"| node_ensemble
node_ensemble -->|"uses loss"| node_focal
node_notebook -->|"loads checkpoints"| node_checkpoints
node_notebook -->|"loads weights"| node_weights
node_ensemble -->|"saves models"| node_checkpoints
node_ensemble -->|"saves weights"| node_weights
node_notebook -->|"applies scaling"| node_calibration
node_calibration -->|"supports decoding"| node_speller
node_notebook -->|"evaluates results"| node_metrics
node_speller -->|"reports accuracy"| node_metrics

click node_notebook "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb"
click node_preprocess "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb"
click node_baseline "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb"
click node_ensemble "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb"
click node_focal "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb"
click node_checkpoints "https://github.com/manthandixit089/we-msdt-former_model/blob/main/model_0.pt"
click node_weights "https://github.com/manthandixit089/we-msdt-former_model/blob/main/ensemble_weights.npy"
click node_calibration "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb"
click node_speller "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb"
click node_metrics "https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.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_notebook,node_preprocess toneBlue
class node_baseline,node_ensemble,node_focal,node_checkpoints,node_weights,node_dataset toneAmber
class node_calibration,node_speller,node_metrics toneMint
class node_user toneIndigo
```

## Components

### EEG preparation

- [Experiment notebook](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`
- [Preprocessing](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`

### Modeling

- [Baseline training](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`
- [Ensemble training](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`
- [Balanced focal loss](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`
- [Model checkpoints](https://github.com/manthandixit089/we-msdt-former_model/blob/main/model_0.pt): `model_0.pt`
- [Ensemble weights](https://github.com/manthandixit089/we-msdt-former_model/blob/main/ensemble_weights.npy): `ensemble_weights.npy`

### Speller evaluation

- [Target-prior calibration](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`
- [Character recognition](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`
- [Performance metrics](https://github.com/manthandixit089/we-msdt-former_model/blob/main/nayaModel.ipynb): `nayaModel.ipynb`

### Other components

- **Researcher**
- **Albany dataset**

## Connections

- Researcher → Experiment notebook: runs
- Experiment notebook → Albany dataset: loads data
- Experiment notebook → Preprocessing: prepares epochs
- Preprocessing → Baseline training: provides epochs
- Preprocessing → Ensemble training: provides epochs
- Ensemble training → Balanced focal loss: uses loss
- Experiment notebook → Model checkpoints: loads checkpoints
- Experiment notebook → Ensemble weights: loads weights
- Ensemble training → Model checkpoints: saves models
- Ensemble training → Ensemble weights: saves weights
- Experiment notebook → Target-prior calibration: applies scaling
- Target-prior calibration → Character recognition: supports decoding
- Experiment notebook → Performance metrics: evaluates results
- Character recognition → Performance metrics: reports accuracy
