Skip to main content
BMJ Neurology Open logoLink to BMJ Neurology Open
. 2026 Jun 19;8(1):e001525. doi: 10.1136/bmjno-2025-001525

AI-driven European Retrospective Database Study to predict disease onset in patients with epilepsy and depression

Alessandro Ruggieri 1, John Paul Leach 1,✉, Elena Alvarez-Baron 1, Valeria Di Franco 1, Caroline Clare Benoist 1, Alessandro Comandini 1, Giorgio Di Loreto 1, Alessandro Lovera 1, Tom Constandse 2, Martina Pili 3, Julia Gallinaro 3, Pejman Farhadi Ghalati 4, Frida Bayard 5, Abdul Sattar Raslan 3, Aisling O’Loughlin 3, Balazs Vamosi 6, Agnese Cattaneo 1
PMCID: PMC13289014  PMID: 42344856

Abstract

Background

Epilepsy and depression are prevalent, chronic conditions with a complex, bidirectional relationship that is not yet fully understood and contributes significantly to morbidity, mortality and healthcare burden. Despite advances in machine learning (ML) for analysing large real-world datasets, there is a lack of large-scale, multinational studies applying ML to explore the interplay between epilepsy and depression. This study aimed to identify predictors of depression in patients with epilepsy (PWE) and predictors of epilepsy in patients with depression (PWD), uncovering associations and shared risk factors across directions.

Methods

This retrospective, observational cohort study analysed longitudinal patient-level data from Denmark, France, Germany, Italy, Spain, Sweden and the United Kingdom. Supervised ML models were trained separately within each country. Demographics (age, gender), clinical (diagnosis and prescription history), socioeconomic status (SES, which includes employment status, education level, disposable income, long-term sick leave/financial state benefits, marital status) and healthcare utilisation features were used during training. Key predictors were identified using Shapley Additive Explanations.

Results

Approximately 2.2 million PWE and 9.7 million PWD were analysed across countries. Female gender, low SES and use of central nervous system (CNS) medications such as antipsychotics, anxiolytics and antimigraine agents were identified as predictors of depression in PWE. In PWD, epilepsy was associated with male gender, socioeconomic deprivation and use of selected CNS medications. Common predictors included demographics, socioeconomic factors and treatments for other CNS conditions, suggesting a shared higher multimorbidity burden.

Conclusions

This study demonstrates the potential of applying artificial intelligence to elucidate not only the multifactorial relationship between epilepsy and depression but also the interplay with other CNS disorders. The findings highlight the importance of demographic, clinical and social determinants in risk stratification and may assist development of screening tools for earlier intervention in high-risk patients.

Keywords: EPILEPSY, DEPRESSION


WHAT IS ALREADY KNOWN ON THIS TOPIC.

WHAT THIS STUDY ADDS

  • This large, multinational study applied artificial intelligence (AI) to real-world data from over 11 million patients to identify timing and predictors of depression in epilepsy patients and vice-versa, highlighting demographic, socioeconomic and use of certain central nervous system medication as key predictors.

HOW THIS STUDY MIGHT AFFECT RESEARCH, PRACTICE OF POLICY

  • These findings demonstrate the potential of AI-driven models for risk stratification and early screening, supporting integrated care approaches and informing preventive strategies in high-risk individuals.

Background

Epilepsy is one of the most common chronic neurological diseases affecting approximately 50 million people worldwide.1 It is associated with significant morbidity and mortality, with patients with epilepsy (PWE) having a threefold increased risk of death compared with the general population.2

Depressive disorders are also highly prevalent, affecting about 332 million people globally.3 Depression is a leading cause of disability across all aspects of life. It is further associated with increased risk of suicide, particularly among adolescents and young adults.3

The bidirectional relationship between epilepsy and depression has long been recognised.4 It is estimated that 20%–35% of PWE also suffer from major depressive disorder.5 Although depression is the most common psychiatric comorbidity in PWE, the clinical manifestations of depression in epilepsy are often atypical and under-recognised.5 Conversely, patients with depression (PWD) are at increased risk of developing epilepsy,6 although the evidence regarding the strength and causality remain limited. Shared neurobiological mechanisms, such as hypothalamic-pituitary-adrenal axis dysregulation, serotonergic and inflammatory pathways and structural brain changes, may contribute to these comorbidities, but the timing of the onset and the contribution of other central nervous system (CNS) disorders remains poorly understood.7

Advances in artificial intelligence (AI) and machine learning (ML) have enabled the analysis of large and complex healthcare datasets, uncovering patterns that may not be captured by traditional statistical approaches. In epilepsy research, ML has been applied to seizure detection8 and treatment outcome prediction.9 In depression, ML has supported prediction of remission and severity, including in comorbid epilepsy.10

Despite these developments, large-scale, multinational studies applying AI/ML to real-world data (RWD) remain uncommon. These techniques may help to explore the bidirectional relationship between epilepsy and depression and identify clinically relevant predictors. This study addresses this gap by leveraging several longitudinal patient-level data. AI/ML was used to identify predictors of depression in PWE and predictors of epilepsy in PWD as well as shared risk factors across both directions. By uncovering these associations, the study aimed to advance mechanistic understanding of epilepsy and depression. Its goal was to generate hypotheses that can guide future research and support the development of more personalised, data-driven care that more accurately addresses the complex interplay between neurological and psychiatric conditions.

Methods

Data sources

This was a retrospective, multinational, observational cohort study using longitudinal patient-level data from 18 data sources from seven European countries (table 1). In Germany, IQVIA Disease Analyser (DA) provided anonymised electronic medical record (EMR) data from over 3400 physicians. Additionally, IQVIA longitudinal prescription data (LRx), tracking up to 80% of Statutory Health Insurance prescriptions longitudinally, were employed. In France, IQVIA longitudinal patient data (LPD) were used, which collects EMR data directly from practice software, and IQVIA LRx supplied longitudinal pharmacy dispensing data. In Italy, IQVIA LPD provided data from 900 general practitioners (GPs). In Spain, IQVIA LPD data were obtained from 3000 practices, covering 3% of the population. In the United Kingdom (UK), Clinical Practice Research Datalink (CPRD) Aurum provided EMR data from primary care encompassing around 20% of England’s population. CPRD Aurum records were linked to Hospital Episode Statistics (HES), index of multiple deprivation (IMD) and mortality data from the Office for National Statistics. National registers from Denmark and Sweden provided comprehensive information covering patients in secondary care, medication dispensations, causes of death and socioeconomic status (SES). All registers are linkable, enabled by lifelong identifiers and collectively cover >99% of the total population (5.9 million inhabitants in Denmark and 10.5 million inhabitants in Sweden).

Table 1. Overview of datasets leveraged in the analysis.

Country Databases
Germany IQVIA DA and IQVIA LRx
France IQVIA LPD and IQVIA LRx
Italy IQVIA LPD
Spain IQVIA LPD
UK CPRD Aurum, HES, IMD and ONS
Denmark Danish National Patient Register (LPR/LPR_F), Danish Register of Medicinal Products Statistics (LMDB), Danish Cause of Death Register, Socioeconomic Registers
Sweden Swedish National Patient Register (NPR), Swedish Prescribed Drug Register (SPDR), Swedish Cause of Death Register, Longitudinal Integration Database for Health Insurance and Labour Market Studies (LISA)

CPRD, Clinical Practice Research Datalinkpractice research datalink; HES, Hospital Episode Statistics; IMD, index of multiple deprivation; IQVIA DA, IQVIA Disease Analyser; IQVIA DA LPD, IQVIA longitudinal patient data; IQVIA LRx, IQVIA longitudinal prescription data; ONS, Office for National Statistics.

No data pooling was performed across countries, and analyses were conducted separately for each country.

Study design

The study period started on 1 January 2010, the earliest date for which complete data were available across databases and ended at the last available date in each database at the time when data were received for the study (online supplemental table 1).

Two populations were analysed in this study:

  • Epilepsy (EP) cohort: patients with their first ever epilepsy diagnosis (defined by the WHO International Classification of Disease (ICD)−10 codes from G40.0 to G40.9) during the study period.

  • Depression (DEP) cohort: patients with their first ever depression diagnosis (defined by ICD-10-WHO codes F32, F33, F34.1, F34.8, F34.9, F38, F39 and F06.3) during the study period.

In databases lacking diagnosis information (Germany and France LRx, and the prescription registers of Sweden and Denmark), diagnosis dates were defined using treatment proxies. For epilepsy, the diagnosis date was defined as the date of first prescription of anti-seizure medication (ASM, anatomic therapeutic class (ATC) N03A, excluding gabapentin and pregabalin to avoid capturing neuropathic pain treatment). For depression, the diagnosis date was defined as the date of first prescription of antidepressant medication (ATC N06A, excluding lithium to avoid including prescriptions for bipolar disorder). This proxy-based approach is widely used in real-world studies to maximise cohort completeness in settings where diagnostic information may be partially captured (eg, lack of diagnosis codes from primary care in Sweden). However, this approach may introduce misclassification as these drug classes can be prescribed for multiple indications. Such misclassification is expected to be non-differential and may attenuate model performance.

The index date was defined as the date of first ever epilepsy (depression) diagnosis in the epilepsy (depression) cohort. Only patients with known gender and age ≥1 at index date were included in the cohort. Patients with highly severe autoimmune disorders defined by ICD-10-WHO codes D89.3 (immune reconstitution syndrome), D89.8 and D89.9 (unspecified disorders involving the immune mechanism) at any point of their history in the database were excluded from the study.

Outcomes and labelling

An assessment window (C in figures1 2) was defined as the 365 days following the index date, ending at the assessment date (red line in figures1 2). The prediction window was defined as the subsequent 365-day period following the assessment date (D in figures1 2). Modelling features were derived from variables captured within the assessment window.

Figure 1. Schematic representation of labels and data extraction windows for the model predicting depression in PWE. DEP, depression; EP, epilepsy; PWE, patients with epilepsy.

Figure 1

Figure 2. Schematic representation of labels and data extraction windows for the model predicting epilepsy in PWD. DEP, depression; EP, epilepsy; PWD, patients with depression.

Figure 2

For the model predicting depression (epilepsy) in PWE (PWD), patients were classified as DEP (EP) positive if they received a depression (epilepsy) diagnosis within the prediction window and as DEP (EP) negative otherwise (figures1 2). Patients without an event within the assessment window were considered lost to follow-up if their last record in the database occurred prior to the end of the prediction window. Patients who received a depression (epilepsy) diagnosis within the assessment window were excluded from the study. Patients who received a depression (epilepsy) diagnosis after the end of the prediction window were considered DEP (EP) negative (bottom example in figures1 2).

Variables and feature engineering

The models built in this study incorporated a comprehensive set of features spanning patient demographics, SES, clinical diagnoses, prescriptions, healthcare utilisation, pregnancy and neonatal history, and procedures. Core demographic variables such as age and gender were available across all databases. Body mass index, alcohol use and smoking status were only present in the UK, Danish and Swedish datasets. SES indicators, including employment status, type of job, disposable income, education level, long-term sick leave, financial state benefits and marriage status, were available exclusively in Nordics datasets, while IMD11 restricted to the UK. Diagnostic features were derived using ICD-9/10 codes for epilepsy, depression, other morbidities (including Charlson Comorbidity Index (CCI)).12 Diagnostic information was available in all databases except for France and Germany LRx. Prescription-related features, such as number of prescriptions (both at individual medicine and ATC4 class level) and total dosage within prediction windows, were broadly available across databases. Healthcare resource utilisation features, including visits, referrals and hospital admissions, were most comprehensively captured in the UK, Denmark and Sweden. Pregnancy and neonatal features, including normal and abnormal pregnancies, complications and neonatal history, were solely available in these countries. Procedure-related features, MRI, electroencephalogram, vagus nerve stimulation, transcranial magnetic stimulation, epilepsy neurosurgeries, psychiatric therapy and electroconvulsive treatment, were similarly limited to the UK, Denmark and Sweden. Missing data were not imputed as the level of overall data completeness across countries was high. In case of missing data (eg, SES in Sweden and Denmark), this was treated as a separate category. Online supplemental table 2 provides a complete list and definition of features engineered by country and database.

Statistical and machine learning methods

Supervised ML models, eXtreme Gradient Boosting (XGBoost)13 and Light Gradient Boosting Machine (LGBM),14 were trained to predict depression in PWE and epilepsy in PWD in each country and database. Four-fold cross-validation and hyperparameter tuning (Bayesian optimisation)15 were used to optimise model performance. Model performance was assessed by measuring accuracy, precision, recall, area under the receiver operating characteristic curve (AUROC) and area under the precision recall curve (AUPRC). To compare model performance across datasets with different levels of class imbalance, a relative AUPRC was calculated as the ratio of AUPRC and the positive class prevalence baseline. Shapley Additive Explanations (SHAP)16 were used to identify the most important predictors of each model.

Data availability

The data used in this study are not publicly available due to patient confidentiality and data governance requirements. Access to IQVIA data is available subject to a data licensing agreement and associated fees. Data from the UK, Sweden and Denmark were accessed through formal applications to CPRD, Statistics Sweden/Socialstyrelsen, Sundhedsdatastyrelsen/Statistics Denmark, respectively, under approved protocols (UK: application number 24_003747, Sweden: application number 266711801854–1/32 326/2024, Denmark: protocol number FSEID-00006940/709535).

Results

Model results

A consistent patient selection process was applied across all countries: (1) identifying all patients with a first ever diagnosis of epilepsy (depression), (2) applying demographics and clinical exclusions as described in section Outcomes and Labelling, (3) removing individuals whose depression (epilepsy) diagnosis occurred before or during the assessment window and (4) retaining only those with sufficient follow-up and records in the dataset. Detailed patient counts at each stage of cohort selection are presented in online supplemental tables 3-20.

Substantial differences were observed in the absolute number of patients per model (table 2). The largest population were captured from longitudinal prescription datasets (ie, Germany and France LRx) followed by datasets from the UK, Sweden and Denmark. The percentages of depression and epilepsy cases in the prediction window also varied for some of the data sources, due to differences in how data are captured and coded across countries. Table 3 summarises AUROC and relative AUPRC by country and database. Cross-country comparisons are shown in figure 3.

Table 2. Overview of patients included in each model by country and database.

Country and data source PWE: DEP positive/total EP cohort (%) PWD: EP positive/total DEP cohort (%)
Germany EMR 1572/55 505 (2.8%) 1453/5 31 945 (0.3%)
Germany LRx 65 272/983 796 (7.0%) 52 784/4 381 419 (1.2%)
France EMR 608/32 393 (1.9%) 680/407 450 (0.2%)
France LRx 54 867/911 414 (6%) 90 106/2 330 752 (4%)
Italy LPD 780/13 911 (5.6%) 275/139 453 (0.2%)
Spain LPD 91/4946 (1.8%) 75/35 968 (0.2%)
UK CPRD+HES+ONS 1843/90 944 (2.0%) 2211/944 697 (0.2%)
Swedish Registers 4035/74 462 (5.0%) 12333/147 185 (0.8%)
Danish Registers 1924/62 408 (3.2%) 3813/772 322 (0.5%)

CPRD, Clinical Practice Research Datalink; DEP, depression; EMR, electronic medical record; EP, epilepsy; HES, Hospital Episode Statistics; LPD, longitudinal patient data; LRx, longitudinal prescription data; ONS, Office for National Statistics; PWD, patients with depression; PWE, patients with epilepsy.

Table 3. Overview of model performance by country and database.

Country and data source Model: DEP prediction model in PWE Model: EP prediction model in PWD
AUROC Relative AUPRC AUROC Relative AUPRC
Germany EMR 0.67 2.14 0.75 10.00
Germany LRx 0.72 2.42 0.75 4.20
France EMR 0.73 2.63 0.61 2.00
France LRx 0.68 2.00 0.70 2.25
Italy LPD 0.62 3.50 0.63 2.00
Spain LPD 0.66 3.90 0.69 2.50
UK CPRD+HES+ONS 0.80 6.00 0.78 15.00
Swedish Registers 0.70 2.40 0.86 8.80
Danish Registers 0.77 4.3 0.81 12.00

AUPRC, area under the precision recall curve; AUROC, area under the receiver operating characteristic curve; CPRD, Clinical Practice Research Datalink; DEP, depression; EMR, electronic medical record; EP, epilepsy; HES, Hospital Episode Statistics; LPD, longitudinal patient data; LRx, longitudinal prescription data; ONS, Office for National Statistics; PWD, patients with depression; PWE, patients with epilepsy.

Figure 3. Cross-country comparison of model performance from depression (left) and epilepsy (right) prediction models: The x-axis reports the AUROC, the y-axis provides the relative AUPRC. The bubble size is proportionate to the number of patients analysed in each country and database. AUPRC, area under the precision recall curve; AUROC, area under the receiver operating characteristic curve; DEP, depression; EMR, electronic medical record; EP, epilepsy; LRx, longitudinal prescription data.

Figure 3

Highest performance was observed in the UK (AUROC=80% and relative AUPRC=6 in depression prediction model, AUROC=78% and relative AUPRC=15 in epilepsy prediction model), followed by Denmark and Sweden. Among the remaining countries, the best performance was observed in Germany, driven by the larger sample sizes, followed by France. Notably, good performance was also achieved in countries with limited sample sizes, that is, Italy and Spain. Country-specific SHAP values are presented in online supplemental tables 21-38. Detailed cross-country comparison is reported in online supplemental tables 39,40.

Table 4 shows the data on predictors of depression: female gender emerged as a predictor across all countries. Adult age (greater than 20 years old) was also associated with depression in six of the seven countries. Low SES was a predictor of depression in the UK, Sweden and Denmark. In the UK and Denmark, a history of alcohol use was among the most important predictors. Regarding ASMs, use of levetiracetam was positively associated with depression in Germany, Italy and Sweden but showed a negative association in other countries. Clonazepam showed a positive association in Germany, Spain, UK, Sweden and Denmark. A negative association between lamotrigine and depression was observed in Germany, France, Italy, Spain and Denmark, while the UK and Sweden showed the opposite pattern. Use of other CNS medications, anxiolytics (primarily benzodiazepines), antipsychotics (both first and second generation) and antimigraine agents (primarily triptans) showed positive associations with depression across multiple countries. Most models also identified higher healthcare use (visits, hospitalisations, prescriptions or pharmacy activity) as positively associated with depression.

Table 4. Cross-country comparison of main predictors of depression in PWE identified by the models.

Finding Observed in
Demographics Adult age positively associated with DEP in PWE DE, FR, IT, ES, UK, DK
Female gender positively associated with DEP in PWE DE, FR, IT, ES, UK, DK, SE
Low socioeconomic status positively associated with DEP in PWE UK, DK, SE (not available in DE, FR, IT, ES)
Alcohol abuse positively associated with DEP in PWE UK, DK, SE (not available in DE, FR, IT, ES)
EP treatments Levetiracetam use positively associated with DEP in PWE DE, IT, ES, UK
Clonazepam use positively associated with DEP in PWE DE, ES, UK, DK, SE
Lamotrigine use negatively associated with DEP in PWE DE, FR, IT, ES, DK
Other treatments High number of prescriptions of anxiolytics (ATC N05B) positively associated with DEP in PWE DE, FR, ES, UK, DK, SE
High number of prescriptions of antipsychotics (ATC N05A) positively associated with DEP in PWE DE, FR, DK
High number of prescriptions of antimigraine medications (ATC N02C) positively associated with DEP in PWE DE, FR, UK, SE
Healthcare resource utilisation Higher number of visits, prescriptions and all-cause hospitalisation positively associated with DEP in PWE DE, FR, UK, SE, DK

ATC, anatomic therapeutic class; DEP, depression; EP, epilepsy; PWE, patients with epilepsy.

Predictors of epilepsy in PWD

Male gender was positively associated with epilepsy in Germany, France, Spain, UK and Denmark. Low SES showed a positive association in the UK and Sweden. Alcohol abuse was an important predictor of epilepsy in the UK and Denmark. Across most countries, a higher CCI was among the strongest predictors. Exposure to certain antidepressants, including citalopram and mirtazapine, showed positive associations with epilepsy onset in several countries. Use of other CNS medications such as antipsychotics and antimigraine agents was also positively associated with epilepsy across various countries. A consistent positive association was observed for antithrombotic agents (primarily platelet aggregation inhibitors and factor Xa inhibitors) across all datasets. Models across all countries showed that greater healthcare resource utilisation (including more visits, prescriptions and pharmacy activity) was positively associated with epilepsy onset(table 5).

Table 5. Cross-country comparison of main predictors of epilepsy in PWD identified by the models.

Finding Observed in
Demographics Higher age positively associated with EP in PWD DE, ES
Male gender in PWD positively associated with EP in PWD DE, FR, ES, UK, DK
Low socioeconomic status positively associated with EP in PWD UK, SE (not available in DE, FR, IT, ES)
Alcohol abuse positively associated with EP in PWD UK, DK (not available in DE, FR, IT, ES)
Diagnoses Higher Charlson Comorbidity Index positively associated with EP in PWD DE, FR, IT, ES, DK, SE
DEP treatments Citalopram use positively associated with EP in PWD DE, DK, SE
Mirtazapine use positively associated with EP in PWD DE, UK, DK
Other treatments High number of prescriptions of antipsychotics (ATC N05A) positively associated with EP in PWD DE, FR, IT, ES, UK, DK, SE
High number of prescriptions of antimigraine medications (ATC N02C) positively associated with EP in PWD DE, FR, ES, SE
High number of prescriptions of antithrombotic agents (ATC B01A) positively associated with EP in PWD DE, FR, IT, ES, UK, DK, SE
Healthcare resource utilisation Higher number of visits and prescriptions positively associated with EP in PWD DE, FR, IT, ES, UK, DK, SE

ATC, anatomic therapeutic class; DEP, depression; EP, epilepsy; PWD, patients with depression.

Common predictors across both directions are described in the Discussion section.

Discussion

This large, multinational RWD study used explainable ML to explore predictors underlying the bidirectional relationship between epilepsy and depression. The findings consistently point to a set of shared characteristics that reflect broader vulnerability to various brain health disorders. These include sociodemographic factors, indicators of multimorbidity captured through treatment patterns and increased healthcare utilisation. Collectively, results support the view that epilepsy and depression frequently arise within complex neuropsychiatric and neurological profiles rather than as independent conditions.

Across countries and data sources, demographic characteristics and socioeconomic disadvantage emerged as important predictors in both directions. These findings are consistent with previous literature, showing a higher burden of depression among adults and women with epilepsy,17 a higher incidence of epilepsy among men,18 and a strong association between socioeconomic deprivation and adverse outcomes in both epilepsy19 and depression.20 Alcohol misuse emerged as a relevant predictor where available, aligning with evidence of its frequent co-occurrence with depressive disorders21 and its association with increased seizure risk.22 This suggests a shared and potentially modifiable risk factor both in PWE and PWD. Such associations likely reflect a combination of psychosocial stressors, differential access to care and comorbidity burden. From a clinical perspective, results reinforce the importance of considering social determinants of health into risk assessment, particularly as many of these variables are routinely available in administrative or electronic health record (EHR) data and may help identify subgroups of patients who could benefit from closer monitoring or targeted screening.

One of the most consistent findings across both modelling directions was the importance of treatments for other CNS conditions, including anxiolytics, antipsychotics and antimigraine medications. Given the heterogeneity of mechanisms of action across these drug classes, it is unlikely to reflect a direct causal effect. Instead, they are best interpreted as markers of underlying comorbid conditions that tend to cluster with both epilepsy and depression. This interpretation is supported by extensive evidence of high psychiatric and neurological comorbidity in epilepsy,23 the close relationship between depression and anxiety disorders24 and the well-described association between migraine and both depression25 and epilepsy.26 27 In addition, antipsychotics are commonly used as augmentation therapy in treatment-resistant depression,28 introducing confounding by indication in depression cohorts. While some medications (eg, certain antipsychotics) may contribute modestly to seizure risk in susceptible individuals,29 the consistency of these signals across countries suggests that comorbidity clustering, rather than medication effects alone, is the dominant explanation.

In models predicting epilepsy among PWD, indicators of higher overall comorbidity burden and use of antithrombotic agents were also identified as important predictors. These features likely reflect underlying vascular or systemic disease processes (eg, previous cerebral thrombosis and residual conditions), which are recognised contributors to acquired epilepsy, particularly in older or medically complex populations.6 30 Identification of these predictors may help highlight subgroups of patients with depression who could benefit from increased neurological vigilance or earlier investigation of seizure-like symptoms.

Higher healthcare utilisation, including increased numbers of visits, prescriptions and pharmacy interactions, was consistently associated with future comorbidity in both directions. This finding likely reflects greater clinical complexity, symptom burden and healthcare needs among patients at higher risk. In PWE, increased healthcare use has previously been interpreted as a potential marker of ASM drug resistance,31 but it may also reflect increased healthcare system utilisation and medical costs associated with under-recognised or undertreated depression.32 The present results extend this observation by suggesting that healthcare utilisation patterns may predict epilepsy onset in PWD. Given that healthcare utilisation measures are often readily available, they may represent potential indicators for identifying PWD who warrant closer follow-up or additional assessment to minimise or prevent future comorbidity.

The value of this analysis lies not only in confirming known associations at scale and in various healthcare settings, but in demonstrating how routinely collected RWD can be used to support risk stratification in clinical practice. The convergence of shared predictors across both directions and across countries suggests that patients at higher risk of comorbid epilepsy and depression often present with a recognisable clinical profile characterised by social vulnerability, multimorbidity and frequent healthcare contact.

These findings support the development of risk prediction or clinical decision support tools that leverage a common set of predictors across both conditions. The use of explainable ML methods, such as SHAP,16 enables identification of contributing factors and facilitates translation into clinical settings. In practice, such model outputs could be operationalised as risk scores or stratification tiers derived from routinely collected EHR data, allowing patients to be categorised according to their likelihood of adverse neuropsychiatric outcomes. Embedded within EHRs, these tools could prompt targeted screening for depression in people with epilepsy or earlier neurological evaluation in high-risk PWD, thereby supporting earlier intervention and more integrated care. Future work should also evaluate transferability to other healthcare systems, assess alternative assessment/prediction windows to understand time-varying predictors and clinical actionability, and stratify by epilepsy and depression subtypes.

Strengths and limitations

A key strength of this study lies in the breadth and diversity of the data sources, spanning multiple European countries and encompassing EMR, national registers and pharmacy claims-based information, with sample sizes of individual models adding up to 2.2 million PWE and 9.7 million PWD across countries. Additional data domains come from the UK and Nordic datasets, which offer rich, population-level coverage with detailed longitudinal information from both primary (UK) and secondary care (UK and Nordics) as well as pharmacy dispensations (including primary care in Nordics) and socioeconomic factors. Beyond data availability, the study’s use of AI/ML methods to analyse RWD enables the exploration of more complex, non-linear relationships beyond traditional analytic approaches. This framework enhances the understanding of patient clinical profiles and healthcare use while serving as a useful tool for hypothesis generation to guide future clinical research and support clinical decision-making. While country results are mostly concordant, variations in database settings and captured information necessitate caution when interpreting cross-country comparisons. Coverage of EMR data differs: Germany and Spain include GPs and specialists interactions, while France and Italy only cover GPs; these databases record prescriptions issued but not dispensations. In the UK, CPRD+HES links GP and hospital data, whereas Nordic registers include nationwide secondary care and dispensed prescriptions but lack primary care detail. Prescription data also vary: IQVIA LRx captures retail pharmacy dispensations in Germany and France, while Nordic registers offer full population coverage. Finally, not all variables are uniformly captured across countries (eg, SES was available only in the UK and Nordics). Such heterogeneity hindered pooling into a single model; instead, features were compared across countries with database-specific caveats. Additional limitations include incomplete patient histories (due to panel coverage in Germany, France, Italy and Spain), lack of linkage between EMR and pharmacy data (Germany and France) and differing coding systems. Most countries use ICD10 for diagnoses (eg, Germany, France, Denmark, Sweden), while Italy and Spain rely on ICD9. The UK uses the Systematised Nomenclature of Medicine Clinical Terms (SNOMED),33 which was mapped to ICD10 where possible to enable comparability. Medication coding also varies, with ATC-WHO being common across several countries, though Germany and the UK use country-specific alternatives.34 35 Smaller sample sizes in some countries (eg, Spain) may restrict generalisability to broader patient populations. In addition, exclusion of patients with incomplete follow-up may have further reduced the analysable population. Despite these challenges, associations remained consistent across countries. Future studies could model disease onset as a time-to-event outcome to reduce exclusions due to limited follow-up, thereby enabling larger cohorts to validate these findings.

Conclusion

This study highlights a complex, multifactorial interplay of clinical, therapeutic, demographic and healthcare utilisation factors underlying the bidirectional relationship between epilepsy and depression, and the interplay with other CNS disorders. Predictors common to both depression in PWE and epilepsy in PWD—including gender, low SES, high psychiatric multimorbidity burden and extensive healthcare use—highlight the need for a multidisciplinary care model that addresses these overlapping risk factors. With further validation, the insights presented here could be expanded to additional countries and inform the development of screening tools embedded in EHRs. These tools could help clinicians identify high-risk individuals and enable timely interventions aimed at enhanced prevention, improving prognosis and enhancing quality of life of patients.

Supplementary material

online supplemental file 1
bmjno-8-1-s001.pdf (3.3MB, pdf)
DOI: 10.1136/bmjno-2025-001525

Footnotes

Funding: The study was sponsored by Angelini Pharma S.p.A., which commissioned IQVIA to conduct the research. Angelini Pharma contributed to defining the study objectives, reviewed and approved the study design proposed by IQVIA, and provided scientific input into the interpretation of the results. IQVIA was responsible for data access, data collection, statistical analysis and model development. Angelini Pharma reviewed the manuscript for scientific accuracy and provided comments. However, the analyses were conducted independently by IQVIA. The funder did not influence the results or outcomes of the study and did not have access to the underlying analytical datasets, despite author affiliations with the funder. The decision to submit for publication was made jointly by the authors.

Provenance and peer review: Not commissioned; externally peer-reviewed.

Patient consent for publication: Not applicable.

Ethics approval: This retrospective study used fully anonymised, deidentified electronic medical records databases, with only Sweden requiring Ethics approval (Etikprövningsmyndigheten, application number 2023-07973-01). All other countries did not require Ethics approval. This was a retrospective study using fully anonymised secondary data. Because no identifiable information was available and no participants were contacted, informed consent was not required in accordance with institutional policy and ethics regulations.

Data availability free text: The data used in this study are not publicly available due to patient confidentiality and data governance requirements. Access to IQVIA data is available subject to a data licensing agreement and associated fees. Data from the UK, Sweden and Denmark were accessed through formal applications to CPRD, Statistics Sweden/Socialstyrelsen, Sundhedsdatastyrelsen/Statistics Denmark respectively under approved protocols (UK: application number 24_003747, Sweden: application number 266711801854-1/ 32326/2024, Denmark: protocol number FSEID-00006940/709535).

Data availability statement

Data may be obtained from a third party and are not publicly available.

References

  • 1.World Health Organization Epilepsy. [30-Sep-2025]. https://www.who.int/news-room/fact-sheets/detail/epilepsy Available. Accessed.
  • 2.Nevalainen O, Ansakorpi H, Simola M, et al. Epilepsy-related clinical characteristics and mortality: a systematic review and meta-analysis. Neurology (ECronicon) 2014;83:1968–77. doi: 10.1212/WNL.0000000000001005. [DOI] [PubMed] [Google Scholar]
  • 3.World Health Organization Depressive disorder (depression) [30-Sep-2025]. https://www.who.int/news-room/fact-sheets/detail/depression Available. Accessed.
  • 4.Hesdorffer DC, Ishihara L, Mynepalli L, et al. Epilepsy, suicidality, and psychiatric disorders: a bidirectional association. Ann Neurol. 2012;72:184–91. doi: 10.1002/ana.23601. [DOI] [PubMed] [Google Scholar]
  • 5.Kim M, Kim Y-S, Kim D-H, et al. Major depressive disorder in epilepsy clinics: A meta-analysis. Epilepsy & Behavior . 2018;84:56–69. doi: 10.1016/j.yebeh.2018.04.015. [DOI] [PubMed] [Google Scholar]
  • 6.Josephson CB, Lowerison M, Vallerand I, et al. Association of Depression and Treated Depression With Epilepsy and Seizure Outcomes: A Multicohort Analysis. JAMA Neurol. 2017;74:533–9. doi: 10.1001/jamaneurol.2016.5042. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Mazarati A, Sankar R. Common Mechanisms Underlying Epileptogenesis and the Comorbidities of Epilepsy. Cold Spring Harb Perspect Med. 2016;6:a022798. doi: 10.1101/cshperspect.a022798. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Rashed-Al-Mahfuz Md, Moni MA, Uddin S, et al. A Deep Convolutional Neural Network Method to Detect Seizures and Characteristic Frequencies Using Epileptic Electroencephalogram (EEG) Data. IEEE J Transl Eng Health Med. 2021;9:1–12. doi: 10.1109/JTEHM.2021.3050925. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Yao L, Cai M, Chen Y, et al. Prediction of antiepileptic drug treatment outcomes of patients with newly diagnosed epilepsy by machine learning. Epilepsy & Behavior . 2019;96:92–7. doi: 10.1016/j.yebeh.2019.04.006. [DOI] [PubMed] [Google Scholar]
  • 10.Camp EJ, Quon RJ, Sajatovic M, et al. Supervised machine learning to predict reduced depression severity in people with epilepsy through epilepsy self-management intervention. Epilepsy Behav. 2022;127:108548. doi: 10.1016/j.yebeh.2021.108548. [DOI] [PubMed] [Google Scholar]
  • 11.Geographic Data Service Index of Multiple Deprivation (IMD) - Geographic Data Service. [8-Oct-2025]. https://data.geods.ac.uk/dataset/index-of-multiple-deprivation-imd Available. Accessed.
  • 12.Quan H, Sundararajan V, Halfon P, et al. Coding algorithms for defining comorbidities in ICD-9-CM and ICD-10 administrative data. Med Care. 2005;43:1130–9. doi: 10.1097/01.mlr.0000182534.19832.83. [DOI] [PubMed] [Google Scholar]
  • 13.Chen T, Guestrin C. XGBoost: a scalable tree boosting system. Proc. 22nd ACM SIGKDD Int. Conf. Knowl. Discov; 2016. pp. 785–94. Available. [DOI] [Google Scholar]
  • 14.Ke G, Meng Q, Finley T, et al. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. 2017. [Google Scholar]
  • 15.Snoek J, Larochelle H, Adams RP. Practical Bayesian Optimization of Machine Learning Algorithms. Adv Neural Inf Process Syst. 2012;25 [Google Scholar]
  • 16.Lundberg S, Lee S-I. A unified approach to interpreting model predictions 2017. 2017. Available. [DOI]
  • 17.Yang Y, Yang M, Shi Q, et al. Risk factors for depression in patients with epilepsy: A meta-analysis. Epilepsy & Behavior . 2020;106:107030. doi: 10.1016/j.yebeh.2020.107030. [DOI] [PubMed] [Google Scholar]
  • 18.Kotsopoulos IAW, van Merode T, Kessels FGH, et al. Systematic review and meta-analysis of incidence studies of epilepsy and unprovoked seizures. Epilepsia. 2002;43:1402–9. doi: 10.1046/j.1528-1157.2002.t01-1-26901.x. [DOI] [PubMed] [Google Scholar]
  • 19.Bush KJ, Cullen E, Mills S, et al. Assessing the extent and determinants of socioeconomic inequalities in epilepsy in the UK: a systematic review and meta-analysis of evidence. Lancet Public Health. 2024;9:e614–28. doi: 10.1016/S2468-2667(24)00132-4. [DOI] [PubMed] [Google Scholar]
  • 20.Jespersen A, Madden RA, Whalley HC, et al. Socioeconomic status and depression-a systematic review. Epidemiol Rev. 2025;47:mxaf011. doi: 10.1093/epirev/mxaf011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.McHugh RK, Weiss RD. Alcohol Use Disorder and Depressive Disorders. ARCR . 2019;40 doi: 10.35946/arcr.v40.1.01. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Hamerle M, Ghaeni L, Kowski A, et al. Alcohol Use and Alcohol-Related Seizures in Patients With Epilepsy. Front Neurol. 2018;9:401. doi: 10.3389/fneur.2018.00401. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Keezer MR, Sisodiya SM, Sander JW. Comorbidities of epilepsy: current concepts and future perspectives. Lancet Neurol. 2016;15:106–15. doi: 10.1016/S1474-4422(15)00225-2. [DOI] [PubMed] [Google Scholar]
  • 24.Kalin NH. The Critical Relationship Between Anxiety and Depression. Am J Psychiatry. 2020;177:365–7. doi: 10.1176/appi.ajp.2020.20030305. [DOI] [PubMed] [Google Scholar]
  • 25.Dresler T, Caratozzolo S, Guldolf K, et al. Understanding the nature of psychiatric comorbidity in migraine: a systematic review focused on interactions and treatment implications. J Headache Pain. 2019;20:51. doi: 10.1186/s10194-019-0988-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Paungarttner J, Quartana M, Patti L, et al. Migraine - a borderland disease to epilepsy: near it but not of it. J Headache Pain. 2024;25:11. doi: 10.1186/s10194-024-01719-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Keezer MR, Bauer PR, Ferrari MD, et al. The comorbid relationship between migraine and epilepsy: a systematic review and meta-analysis. Eur J Neurol. 2015;22:1038–47. doi: 10.1111/ene.12612. [DOI] [PubMed] [Google Scholar]
  • 28.Nuñez NA, Joseph B, Pahwa M, et al. Augmentation strategies for treatment resistant major depression: A systematic review and network meta-analysis. J Affect Disord. 2022;302:385–400. doi: 10.1016/j.jad.2021.12.134. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Lertxundi U, Hernandez R, Medrano J, et al. Antipsychotics and seizures: higher risk with atypicals? Seizure. 2013;22:141–3. doi: 10.1016/j.seizure.2012.10.009. [DOI] [PubMed] [Google Scholar]
  • 30.Feyissa AM, Hasan TF, Meschia JF. Stroke-related epilepsy. Eur J Neurol. 2019;26:18–e3. doi: 10.1111/ene.13813. [DOI] [PubMed] [Google Scholar]
  • 31.Grabowska-Grzyb A, Jędrzejczak J, Nagańska E, et al. Risk factors for depression in patients with epilepsy. Epilepsy & Behavior . 2006;8:411–7. doi: 10.1016/j.yebeh.2005.12.005. [DOI] [PubMed] [Google Scholar]
  • 32.Cramer JA, Blum D, Fanning K, et al. The impact of comorbid depression on health resource utilization in a community sample of people with epilepsy. Epilepsy & Behavior . 2004;5:337–42. doi: 10.1016/j.yebeh.2004.01.010. [DOI] [PubMed] [Google Scholar]
  • 33.SNOMED International. [8-Oct-2025]. https://www.snomed.org Available. Accessed.
  • 34.Federal Institute for Drugs and Medical Devices BfArM - ATC. [8-Oct-2025]. https://www.bfarm.de/EN/Code-systems/Classifications/ATC/_node.html Available. Accessed.
  • 35.BNF . National Institute for Health andCare Excellence. NICE; [8-Oct-2025]. https://www.nice.org.uk/bnf-uk-only Available. Accessed. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

online supplemental file 1
bmjno-8-1-s001.pdf (3.3MB, pdf)
DOI: 10.1136/bmjno-2025-001525

Data Availability Statement

The data used in this study are not publicly available due to patient confidentiality and data governance requirements. Access to IQVIA data is available subject to a data licensing agreement and associated fees. Data from the UK, Sweden and Denmark were accessed through formal applications to CPRD, Statistics Sweden/Socialstyrelsen, Sundhedsdatastyrelsen/Statistics Denmark, respectively, under approved protocols (UK: application number 24_003747, Sweden: application number 266711801854–1/32 326/2024, Denmark: protocol number FSEID-00006940/709535).

Data may be obtained from a third party and are not publicly available.


Articles from BMJ Neurology Open are provided here courtesy of BMJ Publishing Group

RESOURCES