# thomaswengerter/eeg_driverfatigue architecture

> Architecture diagram of the GitHub repository thomaswengerter/eeg_driverfatigue, 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/thomaswengerter/eeg_driverfatigue
- Repository: https://github.com/thomaswengerter/eeg_driverfatigue

## Overview

This repository publishes MATLAB feature extraction for EEG-based driver-fatigue research, not a complete live detection system. The documented workflow preprocesses labelled EEG recordings into channel-specific epochs, extracts features, then hands those features to an external supervised-learning system. The README describes these relationships; source excerpts were not provided, so implementation details beyond that documentation are omitted.

Main entry points: [`FeatureExtraction.m`](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/FeatureExtraction.m) (Feature extraction), [`CNTpreprocess.m`](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/CNTpreprocess.m) (Epoch and filter), [`Channelinfo.xls`](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/Channelinfo.xls) (Channel reference), [`SampEn.m`](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/SampEn.m) (Sample entropy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_preprocess["EEG preprocessing"]
  node_recordings["EEG recordings"]
  node_channel_info["Channel reference<br/>[Channelinfo.xls]"]
  node_preprocessing["Epoch and filter<br/>[CNTpreprocess.m]"]
  node_channel_data[("Channel training data")]
end

subgraph group_features["Feature extraction"]
  node_feature_extraction["Feature extraction"]
  node_spectral_stats["Spectral and signal statistics"]
  node_sample_entropy["Sample entropy<br/>[SampEn.m]"]
  node_fuzzy_feature["Fuzzy feature module<br/>[Fuzzy_MI.m]"]
  node_feature_data[("Channel feature data")]
end

subgraph group_learning["Supervised learning"]
  node_learning_system["Supervised learning system"]
  node_fatigue_model["Fatigue detector"]
end

node_user(("Researcher"))

node_user -->|"runs script"| node_preprocessing
node_recordings -->|"loads and labels"| node_preprocessing
node_channel_info -->|"guides selection"| node_preprocessing
node_preprocessing -->|"saves epochs"| node_channel_data
node_user -->|"runs script"| node_feature_extraction
node_channel_data -->|"analyzes"| node_feature_extraction
node_feature_extraction -->|"extracts features"| node_spectral_stats
node_feature_extraction -->|"extracts feature"| node_sample_entropy
node_feature_extraction -.->|"extracts feature"| node_fuzzy_feature
node_feature_extraction -->|"saves features"| node_feature_data
node_feature_data -->|"feeds features"| node_learning_system
node_learning_system -->|"trains detector"| node_fatigue_model

click node_channel_info "https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/Channelinfo.xls"
click node_preprocessing "https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/CNTpreprocess.m"
click node_feature_extraction "https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/FeatureExtraction.m"
click node_spectral_stats "https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/FeatureExtraction.m"
click node_sample_entropy "https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/SampEn.m"
click node_fuzzy_feature "https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/Fuzzy_MI.m"

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_recordings,node_channel_info,node_preprocessing,node_channel_data toneBlue
class node_feature_extraction,node_spectral_stats,node_sample_entropy,node_fuzzy_feature,node_feature_data toneAmber
class node_learning_system,node_fatigue_model toneMint
class node_user toneIndigo
```

## Components

### EEG preprocessing

- **EEG recordings**
- [Channel reference](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/Channelinfo.xls): `Channelinfo.xls`
- [Epoch and filter](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/CNTpreprocess.m): `CNTpreprocess.m`
- **Channel training data**

### Feature extraction

- [Feature extraction](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/FeatureExtraction.m): `FeatureExtraction.m`
- [Spectral and signal statistics](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/FeatureExtraction.m): `FeatureExtraction.m`
- [Sample entropy](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/SampEn.m): `SampEn.m`
- [Fuzzy feature module](https://github.com/thomaswengerter/eeg_driverfatigue/blob/master/Fuzzy_MI.m): `Fuzzy_MI.m`
- **Channel feature data**

### Supervised learning

- **Supervised learning system**
- **Fatigue detector**

### Other components

- **Researcher**

## Connections

- Researcher → Epoch and filter: runs script (evidence: `README.md`)
- EEG recordings → Epoch and filter: loads and labels (evidence: `README.md`)
- Channel reference → Epoch and filter: guides selection (evidence: `README.md`)
- Epoch and filter → Channel training data: saves epochs (evidence: `README.md`)
- Researcher → Feature extraction: runs script (evidence: `README.md`)
- Channel training data → Feature extraction: analyzes (evidence: `README.md`)
- Feature extraction → Spectral and signal statistics: extracts features (evidence: `README.md`)
- Feature extraction → Sample entropy: extracts feature (evidence: `README.md`)
- Feature extraction → Fuzzy feature module: extracts feature
- Feature extraction → Channel feature data: saves features (evidence: `README.md`)
- Channel feature data → Supervised learning system: feeds features (evidence: `README.md`)
- Supervised learning system → Fatigue detector: trains detector (evidence: `README.md`)
