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

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.
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.
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.
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.
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.
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.
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.
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.
Figures and interface screenshots from the project.







