# Revealing the impact of COVID-19 on mental health through machine learning

**Authors:** Salah Bouktif, Akib Mohi Ud Din Khanday, Ali Ouni

PMC · DOI: 10.1093/jamiaopen/ooag013 · JAMIA Open · 2026-01-23

## TL;DR

This study uses machine learning to show how the COVID-19 pandemic significantly affected mental health and identified key factors like delayed medical care and social isolation that contributed to increased depression.

## Contribution

The study introduces a retrained Random Forest model using pandemic-specific data and leverages XAI to reveal critical mental health factors during the pandemic.

## Key findings

- Classifiers trained on pre-COVID-19 data performed poorly on pandemic-era data.
- A retrained Random Forest model achieved 98.10% accuracy on pandemic-era data.
- XAI identified delayed medical care, family poverty, and reduced social activities as key depression drivers during the pandemic.

## Abstract

The COVID-19 pandemic caused a major health crisis worldwide significantly impacting mental well-being. In this study, our objective is to assess the resilience of pre-pandemic depression level prediction models when applied to COVID-19 era data. We leverage advanced Machine Learning (ML) and Explainable Artificial Intelligence (XAI) techniques to identify the key factors impacting the shifts in depression levels during the pandemic. We aim to align the later identification with interventions and preparedness for future pandemics.

We use, in this study, a data-driven methodology using National Health Interview Survey (NHIS) household survey data, explicitly covering the years 2019-2022. The NHIS data is used to build both the pre-pandemic (2019) and COVID-19 (2020-2022) models discussed in our comparative evaluation. Various ML techniques are supported (1) upstream, using feature selection methods to reduce both irrelevance and the high dimensionality of social-nature data, and (2) downstream, by an XAI-based approach to gain insight into the pandemic-associated phenomena that mostly impacted the mental health of individuals. In our empirical experiments, we use over 100 000 entries across the 4 yearly datasets, where we apply an 80%-20% training/testing split for models building and evaluation.

The outcomes of our empirical study show that classifiers trained solely on pre-COVID-19 data performed poorly when applied to COVID-19 era data. Conversely, models retrained on pandemic-specific data demonstrated high performance. In particular, the Random Forest (RF) classifier achieved the best performance, recording an average accuracy of 98.10% across the COVID-19 era datasets. With respect to the depression key factors’ identification, XAI techniques provided actionable insights, revealing that features such as Delayed Medical Care, Family Poverty, Participation in Social Activities, and Marital Status were the most influential factors contributing to depression challenges during the pandemic.

The significant decline in the performance of pre-pandemic models on COVID-19 data reveals the profound impact of the pandemic on mental health, highlighting the need for new predictive models tailored to crisis circumstances. The built RF model, uses appropriate pandemic data, performed accurately during the COVID-19 era with an accuracy of 98.1%. XAI techniques confirmed that factors such as delayed medical care, family poverty, job loss, and reduced social involvement were critical drivers that impacted the decline in mental health during the pandemic.

## Linked entities

- **Diseases:** depression (MONDO:0002050)

## Full-text entities

- **Diseases:** -COVID-19 (MESH:D000086382), infection (MESH:D007239), health disorder (OMIM:603663), malnutrition (MESH:D044342), Job Loss (MESH:D007589), Depression (MESH:D003866), Mental Disorders (MESH:D001523), anxiety (MESH:D001007), Loss of (MESH:D016388), trauma (MESH:D014947), emotional distress (MESH:D012128), MDD (MESH:D003865), XAI (MESH:C538243), mental health problems (MESH:D000076082), suicidal ideation (MESH:D001072), ML (MESH:D007859)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12918303/full.md

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12918303/full.md

## References

33 references — full list in the complete paper: https://tomesphere.com/paper/PMC12918303/full.md

---
Source: https://tomesphere.com/paper/PMC12918303