# Construction of a depression risk prediction model for hepatitis B patients based on machine learning strategy

**Authors:** Siyi Wang, Haoqi Liu, Chen Liang, Chui Kong, Jingchun Li, Min Wang, Kaiqiang Dong, Qianqi Wang, Dong Zhang, Rongjuan Guo, Arne Johannssen, Arne Johannssen, Arne Johannssen, Arne Johannssen

PMC · DOI: 10.1371/journal.pone.0341236 · 2026-02-04

## TL;DR

This study builds a machine learning model to predict depression risk in hepatitis B patients, identifying key factors like liver function and socioeconomic status.

## Contribution

A novel machine learning model for depression risk prediction in hepatitis B patients, highlighting critical features for mental health management.

## Key findings

- MLPClassifier achieved the best performance with an AUC of 0.935 and high recall and F1-score.
- Liver function markers and socioeconomic factors were identified as key predictors of depression risk.
- The model offers an objective tool for depression screening and personalized mental health strategies.

## Abstract

Hepatitis B (HBV) is a chronic viral infection that can lead to cirrhosis, liver failure, and liver cancer, and has a profound impact on the patient’s mental health. However, current depression screening mainly relies on self-filled scales and clinical experience, lacking objective and efficient prediction tools. This study aims to construct a risk prediction model for depression in hepatitis B patients based on machine learning, and explore the key features that affect the occurrence of depression, so as to optimize mental health management strategies.

This study used the NHANES database to collect demographic, dietary, physical examination, laboratory test and questionnaire data. The data were standardized and SMOTE oversampling was used to solve the problem of class imbalance. Random Forest (RF) was used for feature screening to identify the top 20 most important predictive features, and five machine learning models (Gradient Boosting, Logistic Regression, AdaBoost, MLPClassifier, LDA) were used for prediction. The model performance was evaluated by AUC (area under the curve), accuracy, recall, precision and F1-score, and ROC curves, calibration curves, and decision curve analysis (DCA) were drawn to evaluate the clinical applicability of the model.

All five machine learning models performed well in the task of predicting the risk of depression in hepatitis B patients, among which MLPClassifier (multi-layer perceptron) performed best, with an AUC of 0.935, a recall of 0.980, and an F1-score of 0.917, which was better than other models. In addition, feature analysis results showed that liver function damage (serum total bilirubin, alkaline phosphatase), electrolyte imbalance (serum potassium ions), chronic inflammation (red blood cell distribution width, lymphocyte count), and socioeconomic factors (poverty-income ratio, race) were important factors affecting the risk of depression in hepatitis B patients.

This study constructed an efficient and objective machine learning model that can be used to predict the risk of depression in patients with hepatitis B, providing a new tool for accurate screening and individualized management. The study revealed the potential mechanisms of physiological, biochemical and socioeconomic factors in the occurrence of depression in patients with hepatitis B, and provided a reference for future mental health intervention strategies.

## Linked entities

- **Diseases:** Hepatitis B (MONDO:0005344), depression (MONDO:0002050)

## Full-text entities

- **Genes:** CRP (C-reactive protein) [NCBI Gene 1401] {aka PTX1}, EPO (erythropoietin) [NCBI Gene 2056] {aka DBAL, ECYT5, EP, MVCD2}, SLC17A5 (solute carrier family 17 member 5) [NCBI Gene 26503] {aka AST, ISSD, NSD, SD, SIALIN, SIASD}, KRT88P (keratin 88, pseudogene) [NCBI Gene 85348] {aka HBC, KRT122P, KRTHBP3}
- **Diseases:** psychiatric (MESH:D001523), Chronic hepatitis B (MESH:D019694), hepatic failure (MESH:D017093), Anemia (MESH:D000740), neuroinflammation (MESH:D000090862), infection (MESH:D007239), osteoarthritis (MESH:D010003), stroke (MESH:D020521), chronically infected (MESH:D000088562), loss (MESH:D016388), visceral adiposity (MESH:D007418), cirrhosis (MESH:D005355), ORCID iD (MESH:C535742), hepatocellular carcinoma (MESH:D006528), sleep apnea (MESH:D012891), fatigue (MESH:D005221), HBV infection (MESH:D006509), neurotoxic (MESH:D020258), liver damage (MESH:D056486), immune system (MESH:D007154), Cardiovascular Disease (MESH:D002318), Mortality (MESH:D003643), anhedonia (MESH:D059445), chronic liver disease (MESH:D008107), Depression (MESH:D003866), electrolyte disorders (MESH:D014883), COVID-19 (MESH:D000086382), infertility (MESH:D007246), metabolic syndrome (MESH:D024821), viral infection (MESH:D014777), Insulin Resistance (MESH:D007333), female infertility (MESH:D007247), bone marrow suppression (MESH:D001855), metabolic dysfunction (MESH:D008659), mood disorders (MESH:D019964), chronic inflammation (MESH:D007249), anxiety (MESH:D001007), chronic kidney disease (MESH:D051436)
- **Chemicals:** vitamin B12 (MESH:D014805), calcium (MESH:D002118), lipid (MESH:D008055), iron (MESH:D007501), zinc (MESH:D015032), PONE-D-25-15290R2 (-), bilirubin (MESH:D001663), volatile organic compound (MESH:D055549), potassium (MESH:D011188), folate (MESH:D005492)
- **Species:** Homo sapiens (human, species) [taxon 9606]
- **Cell lines:** U21A200276 — Mus musculus (Mouse), Hybridoma (CVCL_C5HW)

## Figures

6 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12871976/full.md

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