Back to Portfolio
Healthcare AI

EEG2Text — Clinical EEG Annotation & Auto-Report Platform

A browser-based platform that turns routine clinical EEG review into AI-ready feature–text datasets and editable draft reports.

ET
Eric Tran · Project lead
EEG2Text — Clinical EEG Annotation & Auto-Report Platform

Key Features

  • Multi-format EEG ingestion (EDF/BDF/GDF, EEGLAB, MNE-FIF, BrainVision, Neuroscan CNT, MATLAB) with automatic 10–20 channel standardisation
  • Interactive multi-channel viewer with drag-based time-range and channel selection over full-length recordings
  • Multimodal annotation layer combining typed text with voice notes transcribed by a locally hosted Whisper model
  • Feature engine computing spectral, temporal, entropy, Hjorth, connectivity and spike descriptors — 1,322 features per segment
  • Portable JSON schema storing aligned feature–text pairs ready to supervise multimodal EEG–language models
  • Auto-report module pairing a convolutional ensemble with a large language model to draft editable clinical narratives
  • All signal processing runs server-side, keeping raw EEG under institutional control

Overview

Clinical electroencephalography (EEG) reporting is still largely manual and time-consuming, and the existing software ecosystem was never designed to produce the structured EEG–text supervision that modern language models need. Most toolboxes stop at visualisation, preprocessing or event marking. EEG2Text closes that gap: it is a browser-based annotation and feature–text framework that links routine EEG review with the construction of AI-ready datasets, so that every minute a clinician spends reviewing a recording also produces training data.

The Problem

Existing report-automation systems assume access to proprietary, highly curated SCORE-style databases and are tightly coupled to specific commercial EEG platforms. That locks out smaller centres, research labs and resource-constrained hospitals working with heterogeneous file formats and legacy systems. Meanwhile the widely used open-source toolboxes are built for signal processing and research analysis — not for clinician-centred generation of aligned feature–text training data.

System Architecture

The application runs as a single-page React/TypeScript frontend talking over a REST API to a Python FastAPI backend organised as a modular monolith. The interactive viewer uses Plotly.js for hardware-accelerated multi-channel rendering; EEG processing relies on MNE-Python, quantitative features are computed with NumPy/SciPy, and speech-to-text is served by a locally hosted Whisper model. Because all signal processing stays server-side, raw EEG never leaves institutional control, and the tool runs on any modern operating system without local installation.

EEG2Text system architecture: React/TypeScript frontend, FastAPI backend, annotation module and auto-report module

Module 1 — Annotation and dataset construction

A recording is ingested and channel-standardised, preprocessed, and reviewed in the interactive viewer. The clinician drag-selects a time segment and the relevant channels, annotates them with typed text or voice, and the system computes per-segment quantitative features. Each annotated segment is stored as an aligned feature–text pair in the exported JSON.

Dataset-creation pipeline from EEG ingestion through annotation to exported feature–text JSON

Module 2 — Auto-report

As a working report generator, the framework estimates quantitative descriptors from each recording with a convolutional ensemble and prompts a large language model to draft a clinical narrative. The output is an editable draft — posterior dominant frequencies, slow-wave and beta ratios, and a clinical impression — exported as a PDF or Word report for neurologist review rather than a final signed document.

First page of a generated clinical EEG report PDF with study metadata, quantitative descriptors and clinical impression

Feature–Text Schema

Every saved annotation becomes a segment object in the JSON dataset holding segment timing, the channel list, the quantitative feature block and the free-text clinical description, with case-level doctor's notes stored separately. For each segment and channel the engine computes band powers across delta, theta, alpha, beta and gamma; basic statistics; Hjorth mobility and complexity; Shannon and approximate entropy; z-score-based spike counts; and pairwise channel coherence. On a typical 36-channel montage this yields a 1,322-dimensional feature vector per segment.

The schema also supports multi-expert annotation: recordings annotated independently by two or more clinicians are stored as separate annotation objects that can later be consolidated, providing a foundation for studying inter-rater variability and for training models that account for annotation uncertainty.

Portable JSON schema capturing segment timing, channel context, quantitative features and clinical text

Pilot Results

The framework was exercised on the publicly available Siena Scalp EEG Database — de-identified clinical recordings acquired with a standard 10–20 referential montage at 512 Hz. Guided by expert seizure onset/offset markers, the tool was used to build a pilot corpus spanning ictal, peri-ictal and interictal windows.

  • 36 recordings annotated across 12 patients
  • 112 segment-level annotations, median duration 20 s
  • 1,322 features per segment on a 36-channel montage
  • Narrative descriptions of 9–17 tokens, with a vocabulary dominated by EEG-specific terminology
  • Auto-report drafts rated for clinical plausibility by 3 expert readers
Annotation timeline across patients showing ictal and interictal segment selection

Outcome

EEG2Text streamlines the annotation workflow and produces editable draft reports for neurologist review, while turning that same clinical effort into a reusable feature–text corpus. It gives centres a practical path to grow local EEG–text datasets incrementally as part of routine work — the foundation required for future automated EEG reporting systems. Training a dedicated feature-to-text model on the exported corpus is the natural next step.

Gallery

Figures and interface screenshots from the project.

EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 1
EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 2
EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 3
EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 4
EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 5
EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 6
EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 7
EEG2Text — Clinical EEG Annotation & Auto-Report Platform - Image 8