Automated epilepsy and seizure type phenotyping with pre-trained language models
Ellie Chang1,2, Kevin Xie2,3, Daniel J Zhou2,3
1Department of Bioengineering, University of Pennsylvania, Philadelphia PA USA.
Medrxiv : the Preprint Server for Health Sciences
|February 27, 2026
Summary
Automated phenotyping using DeepSeek-R1 accurately classifies epilepsy and seizure types from clinical notes. This approach unlocks valuable insights from electronic health records for epilepsy research and patient care.
Area of Science:
- Neurology
- Artificial Intelligence
- Medical Informatics
Background:
- Epilepsy is a common neurological disorder with diverse seizure and epilepsy types impacting prognosis and treatment.
- Electronic health records (EHRs) offer rich longitudinal data but lack detailed epilepsy phenotypes in structured formats.
- Unstructured clinical notes contain crucial phenotypic information often missed by traditional data analysis.
Purpose of the Study:
- To evaluate transformer-based language models for automated epilepsy and seizure type phenotyping from clinical notes.
- To benchmark model performance against expert epileptologist agreement.
- To deploy the best-performing model for large-scale phenotyping and analysis of epilepsy patient data.
Main Methods:
- Two transformer models, fine-tuned BERT and DeepSeek-R1, were assessed for phenotyping epilepsy and seizure types.
- A subset of clinical notes was annotated by epileptologists to establish a ground truth.
- The top-performing model was applied to a large cohort of clinical notes (77,049 notes from 18,566 patients).
Main Results:
- DeepSeek-R1 demonstrated performance comparable to expert agreement in classifying epilepsy and seizure types.
- DeepSeek-R1 outperformed BERT, especially on more granular classification tasks.
- Large-scale deployment revealed clinical patterns like diagnostic stabilization and seizure type co-occurrence.
Conclusions:
- Automated phenotyping of epilepsy using language models transforms unstructured EHR data into a valuable research resource.
- This approach enables large-scale, longitudinal analysis of epilepsy trajectories and treatment outcomes.
- The findings support future clinical and translational research in epilepsy care.
Related Concept Videos
Epilepsy and Seizures: Overview
1.5K
Epilepsy is a chronic neurological disease marked by recurrent, unpredictable seizures. These seizures are caused by abnormal electrical discharges in the brain, leading to behavior, sensation, or consciousness alterations. They can also cause transient impairment of awareness, interfering with daily activities.
Various factors can trigger epilepsy, including genetic factors, brain damage, metabolic causes, and unknown etiology. Diagnosis of epilepsy involves electroencephalography (EEG), which...
Various factors can trigger epilepsy, including genetic factors, brain damage, metabolic causes, and unknown etiology. Diagnosis of epilepsy involves electroencephalography (EEG), which...
1.5K
Seizures: Classification
1.9K
Epilepsy is primarily characterized by unpredictable seizures, either provoked by an identifiable factor, such as injury or illness, or unprovoked, occurring spontaneously without apparent cause.
Seizures are typically classified into two main categories: focal and generalized seizures.
Focal Seizures
Focal seizures originate from specific regions of the brain. These seizures are further sub-classified into two types:
Seizures are typically classified into two main categories: focal and generalized seizures.
Focal Seizures
Focal seizures originate from specific regions of the brain. These seizures are further sub-classified into two types:
1.9K


