A Machine Learning-Based Mortality Prediction Model for Patients with Chronic Hepatitis C Infection: An Exploratory Study

Background: Chronic hepatitis C (HCV) infection presents global health challenges with significant morbidity and mortality implications. Successfully treating patients with cirrhosis may lead to mortality rates comparable to the general population. This study aims to utilize machine learning techniques to create predictive mortality models for individuals with chronic HCV infections. Methods: Data from chronic HCV patients at Sultan Qaboos University Hospital (2009–2017) underwent analysis. Data pre-processing handled missing values and scaled features using Python via Anaconda. Model training involved SelectKBest feature selection and algorithms such as logistic regression, random forest, gradient boosting, and SVM. The evaluation included diverse metrics, with 5-fold cross-validation, ensuring consistent performance assessment. Results: A cohort of 702 patients meeting the eligibility criteria, predominantly male, with a median age of 47, was analyzed across a follow-up period of 97.4 months. Survival probabilities at 12, 36, and 120 months were 90.0%, 84.0%, and 73.0%, respectively. Ten key features selected for mortality prediction included hemoglobin levels, alanine aminotransferase, comorbidities, HCV genotype, coinfections, follow-up duration, and treatment response. Machine learning models, including the logistic regression, random forest, gradient boosting, and support vector machine models, showed high discriminatory power, with logistic regression consistently achieving an AUC value of 0.929. Factors associated with increased mortality risk included cardiovascular diseases, coinfections, and failure to achieve a SVR, while lower ALT levels and specific HCV genotypes were linked to better survival outcomes. Conclusions: This study presents the use of machine learning models to predict mortality in chronic HCV patients, providing crucial insights for risk assessment and tailored treatments. Further validation and refinement of these models are essential to enhance their clinical utility, optimize patient care, and improve outcomes for individuals with chronic HCV infections.


Introduction
Hepatitis C virus (HCV) infection is a significant global health concern, affecting over 70 million people worldwide, and contributes to global morbidity and mortality, leading to cirrhosis, hepatocellular carcinoma (HCC), liver transplantation, and liverrelated deaths [1].The 2030 Agenda for Sustainable Development highlights the need to address HCV infections, with world leaders committing to combat this global health issue by 2030.In response, the World Health Organization (WHO) developed the Global Viral Hepatitis Strategy, aiming to reduce deaths by two-thirds and increase treatment rates to 80% [2].The introduction of direct-acting antiviral (DAA) therapy has transformed HCV clinical care and prompted efforts toward eliminating HCV infections [3,4].Unfortunately, around 700,000 individuals die annually as a result of HCV-related complications, with many diagnosed only after manifesting symptoms related to either cirrhosis or HCC [5].Observational studies have primarily focused on determining the advantages of curing HCV, which include a reduced risk of mortality when compared to untreated individuals with chronic HCV infection or those for whom treatment has not succeeded [6,7].However, the long-term prognosis for successfully treated individuals is still debatable, especially in the era of interferon-free DAA regimens.Multiple studies propose that individuals with cirrhosis who have been effectively treated for HCV show low mortality rates, similar to the general population when adjusted for age, sex, and calendar year [8,9].
Other studies have identified specific factors associated with poor survival among HCV patients, including failure to achieve sustained virological response (SVR), HCC, human immunodeficiency virus (HIV) coinfection, hepatitis B virus (HBV) coinfection, substance abuse, decompensated liver cirrhosis, old age, HCV genotype, diabetes mellitus, and smoking [10][11][12][13][14].However, the presence of multiple factors, including comorbidities, HIV and HBV coinfection, HCV genotype, and the presence of chronic liver disease, represents unpredictable interactions, leading to various reported HCV survival outcomes [15,16].Therefore, exploring nonlinear and intricate relationships among different patients and viral characteristics becomes valuable in understanding these complex interactions.
Employing sophisticated statistical tools and machine learning techniques can improve the accuracy of our predictions, such as survival, compared to traditional statistical methods.This improvement is achieved by considering the higher-dimensional and potentially nonlinear influences of different variables, resulting in a broader range of viral and hostrelated variables included in the analysis [17].Artificial intelligence (AI) is a rapidly growing field in computer science, finding applications in diverse sectors like e-commerce, media, and finance.While the integration of AI, particularly machine learning (ML), has been relatively slow in the health sciences, it is now garnering interest [18,19].ML is a subset of AI that emphasizes the learning of algorithms from data.Unlike traditional programing, ML algorithms derive patterns and relationships from subsets of data.There are four main learning methods: supervised (using labeled data), unsupervised (using unlabeled data), semi-supervised (combining labeled and unlabeled data), and reinforcement learning.These methods are useful for different tasks and enable systems to make predictions, solve problems, and make informed decisions [20].
Deep learning, a subset of machine learning, utilizes deep neural networks (DNNs) to process data.DNNs mimic the structure of the cerebral cortex by using multiple layers of interconnected artificial neurons.It consists of nodes that communicate through connections, similar to how cell bodies communicate through axons and dendrites.In biological and artificial networks, synapses between neurons become stronger when their outputs are correlated, shaping the network's behavior [20,21].Previous prediction models using AI/ML have primarily focused on predicting the development of HCC, treatment response, and cirrhosis rather than mortality prediction [22][23][24].
The aim of the present study is to use different ML techniques, along with traditional logistic regression, to create and validate models for mortality prediction among chronic HCV-infected patients.

Study Setting and Population
This study used data gathered from a database of patients seen at the adult hepatology clinic at Sultan Qaboos University Hospital (SQUH), a 500-bed tertiary referral hospital specializing in various medical services and featuring specific, specialized medical facilities [25].All data of patients with chronic HCV referred to the adult hepatology clinic from January 2009 to December 2017, aged 13 years and older, were included.Patients who experienced spontaneous clearance of HCV, patients with missing survival outcomes, and patients who were followed up in alternative healthcare facilities were excluded from this study.

Definitions
The resolution of acute HCV infection was considered when the HCV viral load became undetectable within six months of diagnosis using highly sensitive real-time polymerase chain reaction (PCR) with lower detection limits of 15 IU/mL.Chronic HCV infection was defined as cases with a detectable HCV viral load after six months of infection, confirmed by two positive readings spaced six months apart.Diagnoses of HCC and cirrhosis were made following the guidelines of the European Association for the Study of the Liver (EASL) [26,27].

Features
Relevant data for this study were gathered from patients' electronic medical records, which included baseline information like demographic data, comorbidities, and relevant laboratory results, including a detailed hematological profile, hepatic and renal function, HCV genotype, and HCV viral load, as well as HBV and HIV coinfection status.Additionally, detailed data related to HCV treatment and outcomes were included.All patients were followed up from their initial encounter at the adult hepatology clinic until death or the follow-up endpoint (April 2022), whichever occurred first.

Outcome
The primary outcome of interest was all-cause mortality during the follow-up period.Additionally, patients with end-stage liver disease or other terminal diagnoses who had been lost to follow-up for three years were considered deceased.

Data Pre-Processing
Before creating the model, the dataset was pre-processed to manage missing values and scale continuous features.For binary features with missing values, these were filled using the mode.Continuous features with missing values were replaced by the median, accommodating their skewed distribution.To ensure consistency and standardize scales for continuous features, we applied the StandardScaler, which standardizes features by subtracting the mean and dividing by the standard deviation.This standardization ensures that the features have zero mean and unit variance [28].

Primary Data Analysis
All data analyses and model development relied on the Anaconda distribution, incorporating the Python programing language along with diverse libraries [29].
The Shapiro-Wilk test from the Scipy Library was utilized to assess the normality of each continuous variable in the dataset.Normally distributed variables were reported as means and standard deviations (SDs), and abnormally distributed variables were reported as medians and interquartile ranges (IQRs).Binary variables were reported as numbers and frequencies.The survival analysis was conducted using the KaplanMeierFitter module from the lifelines library using the Kaplan-Meier method.The median survival time and survival probabilities at specific time points (12,24,36,60, and 120 months) were calculated.

Feature Selection and Model Training
The data were split into training data (80%) and testing data (20%).Feature selection and model training were performed using the sci-kit-learn library in Python.The SelectKBest algorithm was employed to identify relevant features associated with mortality.A SelectKBest object was created with the ANOVA F-value as the score function, and a value of k = 10 was set to select the top 10 features.The SelectKBest object was then fitted to the training data.The get support method was used to retrieve the selected feature.The final models for logistic regression, random forest, gradient boosting, and support vector machine (SVM) were initialized and trained using the selected features, and feature coefficients, importance, and contributions were reported for each feature in the final models.

Model Evaluations
The performance metrics for each model were calculated, including the area under the curve (AUC), accuracy, precision, recall, and F1 score.This allows for a comprehensive evaluation of the performance of each model in terms of its predictive ability.The model's performance was also evaluated at different time points using a filtered dataset, with time points of interest (12,24,36,60, and 120 months) used to filter the data.The filtered dataset was then split into training and testing sets, and the models were trained on the training set.The probabilities of the positive class were predicted on the testing set, and the AUC was calculated.

Model Cross-Validation
Cross-validations were performed using 5-fold cross-validation for each of the trained models: logistic regression, random forest, gradient boosting, and support vector machine (SVM), with an array of 5 scores for each fold.The cross-validation scores for each model were reported using the area under the receiver operating characteristic curve (ROC AUC), providing an overview of the model's performance across the 5 folds.

Results
A total of 702 patients met the inclusion criteria.There were 477 (67.9%) men, and the average age was 47 (IQR: 33-59) years old.The median follow-up duration was 97.4 months (61.0-131.2).Detailed baseline characteristics and relevant clinical laboratory findings are presented in Table 1.
The survival time for patients diagnosed with chronic HCV infections from the index encounter at the adult hepatology clinic until death or the final follow-up date (April 2022) is shown in Figure 1.The survival probabilities were 90.0%, 84.0%, and 73.0% at 12, 36, and 120 months, respectively.The survival time for patients diagnosed with chronic HCV infections from the index encounter at the adult hepatology clinic until death or the final follow-up date (April 2022) is shown in Figure 1.The survival probabilities were 90.0%, 84.0%, and 73.0% at 12, 36, and 120 months, respectively.The SelectKBest function from the scikit-learn library was used to select the top 10 features based on the ANOVA F-value.These features, namely hemoglobin level (Hb), alanine aminotransferase (ALT), alpha-fetoprotein, hypertension, cardiovascular system diseases, HCV genotype 1, HCV genotype 3, coinfection with HBV virus, followup duration, and SVR, were used for model training and evaluation.Higher hemoglobin levels, the presence of cardiovascular system diseases, virus coinfection, longer followup duration, and failure to achieve a SVR were associated with an increased likelihood of mortality in patients with chronic HCV infections.On the other hand, lower levels of alanine aminotransferase, the absence of hypertension, and HCV genotype 3 were associated with improved survival outcomes.
The performance of the different machine learning models in predicting the mortality outcome was evaluated using several performance metrics, as presented in Table 2.The logistic regression, random forest, gradient boosting, and support vector machine models achieved AUC values of 0.926, 0.897, 0.919, and 0.907, respectively.Cross-validation using five folds resulted in AUC scores ranging from approximately 0.972 to 1.000 for logistic regression models.The random forest model demonstrated variations in performance across different folds, with the cross-validation AUC scores ranging from approximately 0.633 to 1.000.Similarly, the gradient boosting model showed variations in performance across different folds, with the cross-validation AUC scores ranging from approximately 0.270 to 1.000.In contrast, the support vector machine model demonstrated consistent performance across the different folds, with the cross-validation AUC scores ranging from approximately 0.915 to 0.996, as shown in Table 3.The predictive ability of machine learning models for mortality outcomes over time was assessed at different time points (12, 24, 36, 60, and 120 months).The logistic regression model consistently achieved an AUC of 0.929 at each time point, indicating its stable performance over time, as shown in Table 4.
The random forest model demonstrated varying performance across the different time points, with its AUC values ranging from approximately 0.908 to 0.915.Similarly, the gradient boosting model showed consistent performance, with its AUC values ranging from approximately 0.918 to 0.919 across the time points.

Discussion
This study presents a novel mortality prediction model using machine learning for patients with chronic HCV infections.The median follow-up duration was approximately 97.4 months, allowing for a significant observation period to analyze mortality outcomes.The prediction models achieved high accuracy levels in predicting mortality at different time points.
The survival probabilities at specific time points, calculated using the Kaplan-Meier method, indicate the long-term prognosis of patients with chronic HCV infections.At 12, 36, and 120 months, the survival probabilities were 90.0%, 84.0%, and 73.0%, respectively.Survival rates can vary in chronic HCV patients, depending on the study population.For instance, a study from the USA reported a 5-year survival rate of 82%, which is consistent with our findings [30].Another study from South Korea observed high overall survival rates in HCV patients without cirrhosis, reaching 99.7% at 3 years and 96% at 5 years, similar to the general population [30,31].
In a large meta-analysis of 31 studies, including 33,360 patients, it was found that achieving a SVR after HCV treatment significantly reduces the risk of death compared to unsuccessful therapy across different populations.The risk of all-cause mortality decreases by approximately 50% in the general population, 74% in cirrhotic patients, and 79% in coinfected patients [32].This demonstrates a significant survival benefit, even in patients with cirrhosis and HIV coinfection.These findings highlight the relatively high survival rate among patients treated for CHC.However, it is important to note that various factors, such as treatment advances, adherence to therapy, and patient characteristics, may influence these survival probabilities [32].
The SelectKBest algorithm was utilized to identify the top 10 features associated with mortality.Raised alpha-fetoprotein, failure to achieve a SVR, and coinfection with the HBV were associated with high mortality, consistent with the findings of previous studies [32,33].In addition, lower levels of ALT, the absence of hypertension, and the presence of HCV genotype 3 were associated with improved survival outcomes in patients with chronic HCV infections.However, factors such as age, HCC, liver cirrhosis, other non-hepatic malignancies, and liver transplants were not among the top 10 features that impacted patient survival.This highlights the comprehensive nature of machine learning models in predicting outcomes by considering the complex interactions of different patients and viral factors beyond those specifically related to liver diseases [34].
The performance of different machine learning models in predicting mortality outcomes was evaluated using various performance metrics, including the AUC, accuracy, precision, recall, and F1 score.The logistic regression model displayed the highest AUC value of 0.926, indicating its excellent discriminatory ability in distinguishing between survivors and non-survivors.Logistic regression models have been widely used in medical research and are known for their simplicity and interpretability [35].In this study, the logistic regression model showed promising performance in predicting mortality outcomes, suggesting its potential utility as a predictive tool for clinicians.
The random forest, gradient boosting, and support vector machine (SVM) models also showed good predictive performances, with AUC values of 0.897, 0.919, and 0.907, respectively.These models utilize complex algorithms that capture nonlinear relationships and interactions between different variables, improving prediction accuracy [36,37].The consistent performance of these models across multiple performance metrics suggests their robustness in predicting mortality outcomes in patients with chronic HCV infections.
Cross-validation was performed to assess the generalizability of these models.The logistic regression model showed high cross-validation AUC scores, ranging from approximately 0.972 to 1.000.This demonstrates the model's stability and reliability across different folds.The random forest and gradient boosting models showed variations in their performance across different folds, indicating potential sensitivity to changes in the training dataset.In contrast, the support vector machine model demonstrated consistent performance across different folds, boosting confidence in its predictive ability.Employing cross-validation is an important step to ensure that the machine learning models can be moderated against excessive optimism and potential biases arising from hyperparameter tuning and algorithm selection [38].
Additionally, the predictive performance of these models was evaluated at different time points to assess their ability to predict mortality outcomes over time.The logistic regression model consistently achieved an AUC of 0.929, indicating its stable performance.The random forest model showed varying performance across different time points, with its AUC values ranging from approximately 0.908 to 0.915.The gradient boosting model demonstrated consistent performance, with its AUC values ranging from approximately 0.918 to 0.919.Similarly, the support vector machine model consistently achieved an AUC of approximately 0.925 across all time points.These findings suggest that these models have the potential to predict mortality outcomes with reasonable accuracy at different stages of the disease.
It is important to note that the predictive performance of these models should be interpreted cautiously.Although the models showed good discrimination and predictive abilities, they are not without limitations.The models were developed using data from a single center and a specific patient population, which may limit their generalizability to other populations.Furthermore, the models were trained on retrospective data, and the retrospective nature of the study may introduce biases and limit causal inference.Prospective validation studies are needed to confirm the predictive accuracy of these models in diverse patient populations.
In addition, the models may not capture all relevant factors contributing to mortality outcomes in patients with chronic HCV infections.There may be other unmeasured variables that influence long-term prognoses, such as lifestyle factors, socioeconomic status, and access to healthcare.Including these factors in future studies may improve the predictive accuracy of these models.
Despite these limitations, the findings of this study provide valuable insights into the prediction of mortality outcomes in patients with chronic HCV infections.The use of machine learning algorithms and feature selection techniques offers a promising approach to identifying high-risk patients who may benefit from early interventions and targeted treatment strategies.The models can assist clinicians in risk stratification and personalized management, ultimately leading to improved patient outcomes.
Future research should focus on the external validation of these models in independent cohorts to assess their generalizability and applicability in different healthcare settings.Additionally, efforts should be made to incorporate additional variables and risk factors that may contribute to mortality outcomes.Long-term prospective studies are warranted to further refine and optimize predictive models for mortality in patients with chronic HCV infections.

Figure 1 .
Figure 1.Kaplan-Meier survival curve for patients with chronic HCV infections.

Table 1 .
Demographic, clinical, and laboratory characteristics of the study population.

Table 2 .
Metrics highlighting the performance of each model in terms of its discriminative ability (AUC), overall accuracy, precision (ability to identify positive cases correctly), recall (ability to capture all true positives), and F1 score (a harmonic mean of precision and recall).

Table 3 .
Cross-validation ROC AUC scores for machine learning models.