Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 Feb 5;16:7520. doi: 10.1038/s41598-026-38484-w

An interpretable machine learning model using routine clinical data for early recurrence prediction in hepatocellular carcinoma

Ding-Fan Guo 1,#, Qi Wen 1,#, Xiang Zhang 2,#, Jian Luo 3, Lin-Wei Fan 4, Yun-Hui Liang 1, Qi Feng 1, Ting Wang 1,✉, Kun-He Zhang 1,✉
PMCID: PMC12932649  PMID: 41644735

Abstract

Accurate prediction of early postoperative recurrence in hepatocellular carcinoma (HCC) remains challenging. We developed and validated an interpretable machine learning model to predict early recurrence after curative hepatectomy using routine clinical data. A cohort of 1,120 HCC patients from two centers (2014–2024) was split into training, hold-out test, and external validation sets. Nine predictors were selected via univariate Cox regression. The model integrated three machine learning algorithms to predict recurrence-free survival. In hold-out testing, it outperformed conventional staging in time-dependent area under the curve (0.772 vs. 0.637 at 4–24 months) and stratified patients into distinct low-, moderate-, and high-risk groups. Compared to high-risk patients, moderate-risk patients had significantly lower recurrence hazard (HR = 0.39; 95% CI: 0.24–0.64), and low-risk patients exhibited markedly reduced risk (HR = 0.10; 95% CI: 0.03–0.27). External validation confirmed robust risk stratification (log-rank test, p < 0.001). SHapley Additive exPlanations analysis identified tumor diameter as the top predictor, enabling transparent and personalized risk profiling. This model provides a non-invasive, cost-effective, and generalizable tool for predicting early HCC recurrence with enhanced interpretability.

Supplementary Information

The online version contains supplementary material available at 10.1038/s41598-026-38484-w.

Keywords: Hepatocellular carcinoma, Early recurrence, Machine learning, Prediction model, Interpretability, Multicenter study.

Subject terms: Cancer, Computational biology and bioinformatics, Oncology, Risk factors

Introduction

Hepatocellular carcinoma (HCC) is a highly heterogeneous malignancy1. Hepatectomy serves as a curative treatment for HCC; however, studies report a postoperative 5-year recurrence rate exceeding 70%2,3. Accurate recurrence prediction and timely intervention are critical for reducing mortality rates.

Established clinical staging systems are widely used for HCC prognostic evaluation1. However, these systems could provide only coarse preoperative recurrence risk predictions. Most HCC patients undergo frequent postoperative surveillance via imaging and tumor biomarker tests, entailing substantial economic, medical, and psychological burdens4. Consequently, a quantitative prognostic stratification method that is cost-effective and readily deployable across diverse healthcare settings remains clinically unmet.

Routine clinical data contain diverse parameters related to biochemical indicators, systemic inflammation, and tumor biology5,6. Models incorporating tumor size, lesion number, and blood biomarkers such as alpha-fetoprotein (AFP) can stratify HCC patients into distinct prognostic subgroups7. The ubiquitous availability of these data enhances the utility of such models. Moreover, model implementation based on routine clinical data requires minimal computational resources at marginal extra cost and facilitates validation across multicenter cohorts.

As a branch of artificial intelligence, machine learning builds predictive models by autonomously identifying patterns within biomedical data, and holds significant value in disease diagnosis, treatment optimization, and clinical decision support5,7–10. For example, random survival forest models have shown high C-indices and robust calibration in HCC prognosis9,10. Nevertheless, existing machine learning models for HCC often lack analyses of interpretability11. Their black-box nature impedes clinicians’ understanding of decision logic, thereby eroding trust in predictions, and diminishing clinical utility11. Therefore, the objective of this study is twofold: firstly, to develop and validate a machine learning prognostic model for HCC based on routine clinical data; and secondly, to conduct interpretability analysis to elucidate the contribution of routine clinical data in predicting HCC prognosis.

Method

This study focuses on the development and validation of a prediction model, adhering strictly to the transparent reporting of a multivariable prediction model for individual prognosis or diagnosis (TRIPOD) checklist (Supplementary material).

Data sources and study population

We conducted a retrospective cohort study using data from two tertiary hospitals in China. The First Affiliated Hospital of Nanchang University (FAHNU) cohort included patients who underwent surgery between December 2014 and December 2024. Using the group_by and sample_frac functions in dplyr (R package v.1.1.4) and tidyverse (R package v.2.0.0), we performed randomly stratified sampling based on the China Liver Cancer Staging (CNLC). The cohort was split into training and hold-out test sets (7:3 ratio) to avoid evaluation bias. After model development, data from The First Affiliated Hospital of Gannan Medical University (FAHGMU) between December 2017 and June 2024 were designated as the external test set.

Ethical approval for this study was obtained from the Institutional Review Board of The First Affiliated Hospital of Nanchang University, which assumed overall ethical responsibility for the study ([2024]CDYFYYLK[12–265]). Due to the retrospective nature of the study and the use of anonymized clinical data, the ethics committees of both institutions waived the requirement for informed consent. All procedures involving human participants were performed in accordance with the ethical standards of the institutional and national research committees, as well as the Declaration of Helsinki and its later amendments, or other ethical standards.

Inclusion criteria: (1) age ≥ 18 years; (2) having undergone curative resection, defined as histopathologically confirmed R0 resection without vascular invasion, lymph node metastasis, or distant metastasis; (3) completed preoperative CT/MRI assessment; (4) HCC confirmed by pathological examination of the resected specimen. Exclusion criteria: (1) radiologically confirmed recurrence ≤ 2 months postoperatively (indicating non-curative status); (2) history of other malignancies; (3) preoperative conversion therapy; (4) critical missing data (> 20% variables); (5) lost to follow-up. Preoperative conversion therapy refers to the use of locoregional treatments, such as transarterial chemoembolization or hepatic arterial infusion chemotherapy, or systemic therapies, including targeted therapy, immunotherapy, or combinations thereof, to downstage initially unresectable HCC or to improve future liver remnant volume, thereby enabling curative surgical resection. Since these treatments can alter baseline hematological parameters, patients who received preoperative conversion therapy were excluded to accurately evaluate the prognostic value of preoperative blood-based indicators. All patients received surgical planning based on imaging-assessed tumor burden characteristics, with procedures tailored to anatomical location and spatial distribution. Surgical approaches encompassed open hepatectomy, laparoscopic hepatectomy, anatomical resection, and non-anatomical resection.

Outcome

The primary endpoint was recurrence-free survival (RFS), defined as the interval from radical surgery to radiologically confirmed HCC recurrence or all-cause death. Patients underwent scheduled outpatient imaging surveillance (CT or MRI) during postoperative follow-up. Follow-up concluded in March 2025. Data for patients remaining recurrence-free and alive at the last follow-up were censored at the final assessment date.

Predictors

We incorporated objective laboratory parameters and standard clinical variables routinely accessible in practice, with selection criteria informed by established HCC recurrence prediction literature7,9,10,12,13. Predictors encompassed: demographic characteristics (age, sex); imaging features (maximum tumor diameter, tumor number); and laboratory indicators obtained within 15 days preoperatively (prioritizing values nearest to surgery), including complete blood counts, comprehensive metabolic panel, cancer biomarkers, and coagulation panel. We further calculated the following derived indices: Eosinophil-Lymphocyte Ratio (ELR), Monocyte-Lymphocyte Ratio (MLR), Neutrophil-Lymphocyte Ratio (NLR), Platelet-Lymphocyte Ratio (PLR), Albumin-Bilirubin grade (ALBI), Platelet-Albumin-Bilirubin grade (PALBI), and Aspartate aminotransferase-to-Platelet Ratio Index (APRI). All variables reflect baseline preoperative status, with detailed specifications and exclusion criteria provided in Supplementary Table 1. Operative and pathological variables were deliberately excluded, as the primary objective of this study was to develop a preoperative risk stratification model. Inclusion of intraoperative or postoperative factors would confine the model’s applicability to the postoperative setting and introduce post-exposure bias. Therefore, only variables available prior to surgery were incorporated to ensure clinical relevance and real-world usability in preoperative decision-making.

Missing data

We excluded patient records with > 20% missing predictors and removed variables missing entirely in > 10% of the cohort. Remaining missing values underwent multiple imputation using the Classification and Regression Trees via the mice package (R package v.3.10.0). Imputation was conducted independently within the training, hold-out test, and external test sets. Predictor-specific missing proportions per dataset are detailed in Supplementary Fig. S1. To mitigate bias from imputed data during performance assessment, the hold-out test set utilized complete-case analysis. Notably, all predictors of the model in the external validation set were complete without missing values.

Statistical analysis

All statistical analyses were performed using R (v.4.3.1) and Python (v.3.12).

Model development and evaluation

We identified RFS-associated predictors via Cox proportional hazards regression, excluding variables with variance inflation factor (VIF) > 5 to mitigate multicollinearity14. Models were developed using the scikit-survival package (Python module v.0.24.1) implementing three algorithms: regularized Cox regression (RCOX), fast survival support vector machine (FSSVM), and random survival forest (RSF)15–17. The outcome variable incorporated both RFS duration and event status (1: recurrence/death; 0: censored). Predictors for RCOX underwent Z-score standardization, while FSSVM/RSF used raw data. Hyperparameter optimization employed 5-fold cross-validation: we randomly split the training set into five folds, iteratively training on four folds and validating on the remaining fold. The mean C-index across folds guided hyperparameter selection via grid search over predefined spaces. Final model risk scores were linearly transformed to a 0–1 range using training-set minima/maxima. The integrated risk score was calculated as the arithmetic mean of normalized scores from all three algorithms.

Clinical stratification applied training-set-derived risk score thresholds (first quartile [Q1] and third quartile [Q3]) to categorize hold-out and external test sets into low-risk (< Q1), moderate-risk (Q1–Q3), and high-risk (≥ Q3) groups. Differences in RFS across strata were analyzed using Cox regression and log-rank tests, with statistical significance defined as two-sided P < 0.05. Survival curves, hazard ratios (HRs), and log-rank P-values were generated using survminer (R package v.0.4.9). Time-dependent receiver operating characteristic (AUC(t)) computed via timeROC (R package v.0.4) quantified model discrimination. Comparative performance against Barcelona Clinic Liver Cancer (BCLC), CNLC, and TNM staging was evaluated based on AUC(t).

Model interpretability analysis

We performed interpretability analysis using SHAP (SHapley Additive exPlanations; Python module v.0.45.0) to elucidate predictor importance and effect directions through global and local explanations11,18. For the ensemble components (RCOX, FSSVM, RSF), computationally compatible SHAP explainers were applied: TreeExplainer for RCOX/RSF and KernelExplainer for FSSVM. Global interpretation involved a two-step normalization procedure: (1) Min-max normalization scaled each predictor’s mean absolute SHAP value per algorithm to a 0–1 range using algorithm-specific minimum and maximum SHAP values from the training set. (2) Effect direction was assigned based on Spearman correlation signs between raw predictor values and SHAP values. Where significant negative correlations existed (p < 0.05), normalized values were multiplied by -1 to denote adverse effects. Global predictor importance scores were derived as arithmetic means of normalized directional SHAP values across all three algorithms.

For local interpretation of individual patient samples, SHAP values were min–max normalized using the minimum and maximum SHAP values observed in the training set, while retaining the original sign to indicate the direction of effect (negative values denote negative impact). The final patient-level SHAP explanation was calculated as the average of the normalized SHAP values derived from the three algorithms.

Results

Study cohort

We eventually included 1,120 HCC patients who underwent curative hepatectomy from two tertiary hospitals (Table 1). Patient inclusion and exclusion criteria are detailed in the “Methods” section and Fig. 1. We collected clinical data from 762 patients at FAHNU who underwent curative hepatectomy between January 2014 and December 2024. Through stratified sampling, these were divided into a training set (n = 530) and a hold-out test set (n = 232). The training set was used for developing the machine learning model, with internal validation in the hold-out test set and external validation in an independent FAHGMU cohort (n = 358). FAHGMU data were collected post-model-development following identical inclusion criteria between December 2017 and June 2024. The median follow-up durations for the training set were 29.1 months (interquartile range [IQR] 25.9–34.3), for the hold-out test set were 23.9 months (IQR 20.9–32.1), and for the external test set were 36.6 months (IQR 33.1–43.4).

Table 1.

Baseline characteristics of patients in the training, hold-out test, and external test sets.

Characteristics Training
(N = 530)
Hold-out test
(N = 232)
External test
(N = 358)
Age (years), Median (IQR) 55.0 (47.0-63.8) 54.0 (45.0-61.3) 56.0 (48.5–65.0)
Sex, n (%)
 Female 59 (11.1) 37 (15.9) 51 (14.2)
 Male 471 (88.9) 195 (84.1) 307 (85.8)
HBsAg, n (%)
 Negative 24 (4.9) 13 (6.0) 29 (8.2)
 Positive 470 (95.1) 202 (94.0) 323 (91.8)
Child-Pugh, n (%)
 A 514 (98.1) 225 (97.0) 345 (96.4)
 B 10 (1.9) 7 (3.0) 13 (3.6)

Tumor diameter (cm),

Median (IQR)

4.1 (2.6–6.4) 4.2 (2.6–6.7) 4.2 (2.6–6.2)
Tumor numbers, n (%)
 Single 507 (95.7) 222 (95.7) 343 (95.8)
 Multiple 23 (4.3) 10 (4.3) 15 (4.2)
MVI, n (%)
 0 221 (56.2) 96 (55.5) 40 (41.7)
 1 135 (34.4) 56 (32.4) 40 (41.7)
 2 37 (9.4) 21 (12.1) 16 (16.7)
Cirrhosis, n (%)
 No 112 (21.1) 56 (24.1) 67 (18.9)
 Yes 418 (78.9) 176 (75.9) 291 (81.1)
HBsAg, n (%)
 Negative 24 (4.9) 13 (6.0) 29 (8.2)
 Positive 470 (95.1) 202 (94.0) 323 (91.8)
CNLC, n (%)
 I 516 (97.4) 224 (96.6) 350 (97.8)
 II 14 (2.6) 8 (3.4) 8 (2.2)
BCLC, n (%)
 0 67.0 (12.6) 39.0 (16.8) 46.0 (12.8)
 A 449.0 (84.7) 185.0 (79.7) 305.0 (85.0)
 B 14.0 (2.6) 8.0 (3.4) 8.0 (2.2)

Follow-up duration (months),

Median (IQR)

29.1 (25.9–34.3) 23.9 (20.9–32.1) 36.6 (33.1–43.4)

IQR, interquartile range; MVI, microscopic vascular invasion; HBsAg, hepatitis B surface antigen; CNLC, China Liver Cancer Staging.

Fig. 1.

Fig. 1

Flowchart for the HCC cohorts. (a) the FAHNU cohort. (b) the FAHGMU cohort. Abbreviations: HCC, hepatocellular carcinoma; FAHNU, First Affiliated Hospital of Nanchang University; FAHGMU, First Affiliated Hospital of Gannan Medical University.

Predictor selection and model development

Laboratory test results obtained within 15 days prior to surgery were collected, including complete blood count, coagulation panel, cancer biomarkers, and comprehensive metabolic panel (Supplementary Table 1). Tumor morphological features, such as number and maximum diameter, were extracted from radiology reports, along with demographic variables including age and sex. Based on the training set, 11 predictors were initially identified as significantly associated with RFS following curative treatment for HCC (Table 2). Among these, ALBI and ALB were excluded due to strong multicollinearity, as determined by variance inflation factor analysis (Supplementary Fig. S2).

Table 2.

Univariate Cox regression analysis of predictors associated with RFS in the training set.

Predictors HR (95% CI) p value Predictors HR (95% CI) p value
Age 1.000 (0.987–1.012) 0.945 PTR 2.364 (0.714–7.832) 0.159
Sex (male/female) 1.617 (0.955–2.737) 0.073 PTA 0.998 (0.990–1.005) 0.522
Diameter 1.164 (1.114–1.216) < 0.001 INR 2.602 (0.794–8.528) 0.114
Numbers 1.707 (1.086–2.683) 0.020 APTT 1.027 (1.000-1.054) 0.047
WBC 1.013 (0.959–1.070) 0.639 Fbg 1.001 (0.991–1.010) 0.888
RBC 0.866 (0.702–1.069) 0.180 TT 0.943 (0.879–1.011) 0.097
Hb 0.997 (0.990–1.004) 0.338 ALT 1.002 (0.999–1.004) 0.156
Hct 0.503 (0.040–6.351) 0.595 AST 1.002 (1.000-1.004) 0.086
MCV 1.015 (0.994–1.036) 0.159 TBIL 0.999 (0.982–1.017) 0.950
MCH 1.032 (0.979–1.088) 0.245 DBIL 1.022 (0.993–1.051) 0.137
MCHC 1.001 (0.989–1.012) 0.911 IBIL 0.986 (0.960–1.012) 0.284
PLT 1.000 (0.998–1.002) 0.916 TP 0.986 (0.965–1.007) 0.200
MPV 0.986 (0.895–1.086) 0.768 ALB 0.960 (0.932–0.989) 0.007
Plateletcrit 1.250 (0.172–9.091) 0.826 GLO 1.012 (0.984–1.042) 0.409
PDW 1.002 (0.986–1.018) 0.775 AGR 0.605 (0.380–0.963) 0.034
Lymph 0.846 (0.678–1.055) 0.138 GGT 1.001 (1.000-1.002) 0.007
Lymph% 0.991 (0.977–1.005) 0.207 ALP 1.002 (1.000-1.004) 0.024
Mono 1.413 (0.774–2.581) 0.260 K 0.859 (0.616–1.197) 0.369
Mono% 1.016 (0.972–1.062) 0.478 Na 0.957 (0.901–1.015) 0.145
Neut 1.002 (0.996–1.007) 0.565 Cl 0.950 (0.909–0.993) 0.023
Neut% 1.006 (0.993–1.018) 0.370 Ca 0.850 (0.314–2.298) 0.748
Eos 1.058 (0.398–2.809) 0.911 ELR 1.427 (0.443–4.597) 0.552
Eos% 0.999 (0.948–1.053) 0.980 MLR 1.994 (1.141–3.485) 0.015
Baso 0.018 (0.000-34.377) 0.297 NLR 1.002 (0.997–1.007) 0.427
Baso% 0.828 (0.542–1.264) 0.381 PLR 1.002 (1.000-1.004) 0.044
PT 1.091 (0.986–1.207) 0.091 ALBI 1.551 (1.105–2.176) 0.011
AFP 1.000 (1.000–1.000) 0.751 PALBI 1.389 (0.885–2.182) 0.153
APRI 1.083 (0.942–1.245) 0.265

WBC, White blood cell; RBC, Red blood cell; Hb, Hemoglobin; Hct, Hematocrit; MCV, Mean corpuscular volume; MCH, Mean corpuscular hemoglobin; MCHC, Mean corpuscular hemoglobin concentration; PLT, Platelet count; MPV, Mean platelet volume; PDW, Platelet distribution width; Lymph, Lymphocyte count; Lymph%, Lymph to WBC ratio; Mono, Monocyte count; Mono%, Mono to WBC ratio; Neut, Neutrophil count; Neut%, Neut to WBC ratio; Eos, Eosinophil count; Eos%, Eos to WBC ratio; Baso, Basophil count; Baso%, Baso to WBC ratio; PT, Prothrombin time; PTR, Prothrombin time ratio; PTA, Percent thromboplastin activity; INR, International normalized ratio; APTT, Activated partial thromboplastin time; Fbg, Fibrinogen; TT, Thrombin time; AFP, Alpha-fetoprotein; ALT, Alanine aminotransferase; AST, Aspartate aminotransferase; TBIL, Total bilirubin; DBIL, Direct bilirubin; IBIL, Indirect bilirubin; TP, Total protein; ALB, Albumin; GLO, Globulin; AGR, Albumin to globulin ratio; GGT, Gamma-glutamyl transferase; ALP, Alkaline phosphatase; K, Potassium; Na, Sodium; Cl, Chloride; Ca, Calcium; ELR, Eosinophil to lymphocyte ratio; MLR, Monocyte to lymphocyte ratio; NLR, Neutrophil to lymphocyte ratio; PLR, Platelet to lymphocyte ratio; ALBI, Albumin-bilirubin; PALBI, Platelet-albumin-bilirubin; APRI, Aspartate aminotransferase to platelet ratio index.

Bold values indicate statistical significance (p < 0.05).

Using the remaining nine variables, hyperparameter optimization was performed for three machine learning algorithms (RCOX, FSSVM, and RSF) in the training set (Supplementary Table 2), and a risk score was computed for each patient as described in Materials and Methods. For prognostic stratification, the first quartile (0.178) and third quartile (0.398) of the risk score distribution in the training cohort were used as cutoff thresholds, classifying patients into high-risk (risk score ≥ 0.398), moderate-risk (0.17 ≤ risk score < 0.398), and low-risk (risk score < 0.178) groups (Supplementary Fig. S3).

Model performance in test sets

The model predicted RFS probabilities at 3- to 24-month intervals in the hold-out test set, yielding a median AUC(t) of 0.759 (Fig. 2a). This exceeded the discriminatory power of TNM (0.548), CNLC (0.636), and BCLC (0.554) staging systems. Significant RFS stratification was observed among low-, moderate-, and high-risk groups (log-rank p < 0.001; Fig. 2c). Compared to high-risk patients, moderate-risk patients exhibited a significantly reduced recurrence risk (HR = 0.39, 95% CI 0.24–0.64), while low-risk patients demonstrated a 90% risk reduction (HR = 0.10, 95% CI 0.03–0.27). After excluding two cases with missing AGR index values via complete-case analysis, stratification significance (p < 0.001) and model performance (AUC(t) = 0.760; Supplementary Fig. S4) were preserved.

Fig. 2.

Fig. 2

Performance of the machine learning model on test sets. Line plots show the comparison of predictive performance between the machine learning model and conventional clinical staging systems for RFS in the hold-out test set (a) and the external test set (b), based on AUC(t) values measured from 4 to 24 months. Kaplan-Meier plots illustrate the RFS of three risk groups stratified by the machine learning model in the hold-out test set (c) and the external test set (d). Tick marks represent censored observations. Two-sided P values were calculated using the log-rank test. Abbreviations: AUC(t), time-dependent area under the receiver operating characteristic curve; RFS, recurrence-free survival.

External validation in the FAHGMU cohort maintained discriminatory capacity (median AUC(t) = 0.715; Fig. 2b), surpassing TNM (0.534), CNLC (0.630), and BCLC (0.538) systems. Risk-stratified RFS differences remained significant (p < 0.001; Fig. 2d).

Subgroup analyses confirmed consistent risk stratification across clinical-pathological characteristics, including age, sex, tumor size, AFP levels, and microvascular invasion (MVI) status (Fig. 3). Diminished prognostic discrimination occurred in subgroups with multiple tumor nodules (p = 0.41), Child-Pugh B classification (p = 0.36), and CNLC stage II (p = 0.94). This may be due to limited statistical power in small cohorts (n < 30).

Fig. 3.

Fig. 3

Subgroup analysis of RFS in the test sets. Kaplan-Meier survival curves illustrate the predictive performance of the machine learning model across subgroups of patients with HCC, stratified by (a) age (< 60 vs. ≥60 years), (b) sex (female vs. male), (c) number of tumors (single vs. multiple), (d) largest tumor diameter (< 3 cm vs. ≥3 cm), (e) AFP level (< 200 ng/mL vs. ≥200 ng/mL), (f) MVI status (negative vs. positive), (g) liver function (Child-Pugh class A vs. B), and (h) CNLC (stage I vs. II). Two-sided P values were calculated using the log-rank test. Abbreviations: HCC, hepatocellular carcinoma; RFS, recurrence-free survival; AFP, alpha-fetoprotein; MVI, microvascular invasion; CNLC, China liver cancer staging.

Model interpretability analysis

We employed the SHAP framework to quantitatively assess the direction and magnitude of contributions from nine predictors toward individualized RFS predictions in the training set (Fig. 4 and Supplementary Fig. S5). The analysis revealed that maximum tumor diameter was the strongest positive predictor across all constituent algorithms of the ensemble model. In the final machine learning model, tumor diameter remained the dominant positive contributor to risk scores, while serum chloride concentration served as the primary negative predictor.

Fig. 4.

Fig. 4

Global interpretation of the machine learning model. (a) Bar plots show the mean absolute SHAP values of each predictor across different algorithms. The color indicates the Spearman correlation between the original predictor values and their corresponding SHAP values, with orange denoting a positive correlation and blue a negative correlation. (b) Dot plot shows aggregated SHAP values for each predictor in the final model. Predictors with aggregated SHAP values less than zero (blue) exhibit lower risk scores when their original values are higher, while those with aggregated SHAP values greater than zero (orange) correspond to higher risk scores as their values increase. Abbreviations: SHAP, Shapley Additive Explanations; CI, chloride; AGR, albumin to globulin ratio; MLR, monocyte to lymphocyte ratio; ALP, alkaline phosphatase; PLR, platelet to lymphocyte ratio; APTT activated partial thromboplastin time; GGT, gamma-glutamyl transferase.

Figure 5 illustrates representative patient risk scores from the hold-out test set and the external test set, along with the direction and magnitude of contribution from each predictor to the estimated recurrence risk. Local SHAP reveal that the impact of individual predictors on the model’s output varies according to their values as well as their interactions with other predictors. The result highlights the ability of the machine learning model to capture nonlinear and complex interdependencies when assessing individualized postoperative recurrence risk.

Fig. 5.

Fig. 5

Local interpretation of the machine learning model. Bar plots illustrate SHAP values for two individual patients: one from the high-risk group (a) and one from the low-risk group (b). These illustrate the impact of each predictor on the risk score of each patient (orange indicates a positive contribution and blue a negative one). Abbreviations: SHAP, Shapley Additive Explanations; CI, chloride; AGR, albumin to globulin ratio; MLR, monocyte to lymphocyte ratio; ALP, alkaline phosphatase; PLR, platelet to lymphocyte ratio; APTT, activated partial thromboplastin time; GGT, gamma-glutamyl transferase.

Discussion

HCC represents a significant global public health challenge, with postoperative recurrence emerging as the leading determinant of survival outcomes1. Here, we developed and validated a machine learning model utilizing routine clinical data to predict early post-resection recurrence within 24 months for HCC patients. The model exhibited superior discriminative performance compared to conventional staging systems. Through SHAP analysis, we performed a comprehensive interpretability assessment, quantifying the relative contribution of each predictor to risk evaluation.

In this study, early recurrence within 24 months following curative hepatectomy was defined as the primary prediction target. Early recurrence is considered a true recurrence, resulting from intrahepatic dissemination of the primary tumor through the portal venous system, whereas late recurrence is typically attributed to the emergence of de novo tumors12. Early recurrence is often associated with aggressive tumor characteristics, such as larger tumor size, greater tumor number, and the presence of microvascular invasion13. Previous studies have demonstrated that patients with early recurrence have shorter median overall survival and post-recurrence survival compared to those with late recurrence13. Therefore, we posit that distinct predictive strategies are required for early versus late recurrence of HCC and that early recurrence poses a more substantial threat to patient prognosis. Accordingly, early recurrence was designated as the prediction target of the model.

All predictors employed in this model are objective, routinely obtainable clinical parameters that are already incorporated into the standard preoperative assessment of patients with HCC, ensuring favorable clinical accessibility and standardization. Notably, tumor maximum diameter and number are widely used in clinical staging systems and thus offer strong interpretability19. Predictors such as AGR, GGT, ALP, and APTT reflect liver functional reserve, and their associations with HCC recurrence have been well documented in previous studies20–22. Similarly, PLR and MLR are systemic inflammatory markers for which prior meta-analyses have demonstrated correlations with HCC recurrence23,24. Consistent with a recent study on the prediction of immunotherapy efficacy, serum chloride concentration was also included as a predictor in our model25. Although the current literature lacks a clear clinical interpretation, basic research has identified roles for chloride channel proteins and their encoding genes in HCC progression and prognosis26,27. In addition, previous studies have suggested that hepatitis B virus (HBV)-related markers, such as HBV DNA and HBsAg status, can predict recurrence in HBV-associated HCC28. And a significant proportion of patients with HCC in our cohort were caused by the virus. However, these variables were deliberately excluded from model training to improve the model’s generalizability to HCC arising from other etiologies.

By leveraging readily accessible and information-rich clinical data, the model’s machine learning algorithm effectively captures the nonlinear and complex relationships inherent in clinical variables8. Importantly, cutoff values for risk stratification derived from the training cohort remained robust in stratifying prognosis across patient subgroups in the external test cohort.

Unlike many previous studies9,29, where model performance was limited by inconsistent definitions or measurements of predictive factors and variable cutoff selection, the model in this study was developed using objective, standardized clinical data and fixed cutoff values, resulting in improved reproducibility and greater clinical translational ability. This model can facilitate preoperative risk stratification, enabling early identification of high-risk individuals who may benefit from intensified postoperative surveillance or more aggressive adjuvant therapy. Furthermore, the model provides individualized interpretability through patient-specific outputs, which not only visualize prediction results in an intuitive manner but also highlight the key variables driving individual risk estimates. For instance, personalized reports generated via SHAP can quantify the contribution of predictors such as increased tumor diameter to poor prognostic outcomes. This level of transparency enhances clinicians’ trust in the model’s predictions and supports shared decision-making18. In the context of constrained medical resources, such an approach can assist in optimizing risk management strategies, minimizing unnecessary testing or interventions, and ultimately improving healthcare efficiency and patient outcomes.

However, this study has several limitations. First, the data were retrospectively collected, and prospective validation was not performed, which may limit the model’s generalizability to clinical practice. Second, only preoperative indicators were included, not postoperative dynamic monitoring data, which better reflect clinical settings. Thirdly, the patient group in this multicenter study was mostly from specific regions, which may have limited its representativeness. The model may also be unsuitable for certain subgroups due to insufficient sample sizes. Fourth, the model predicted early recurrence, defined as RFS, while overall survival (OS) is the most reliable endpoint for cancer therapy efficacy30. Future studies should collect OS data to assess the model’s predictive value for this critical outcome.

Despite some acknowledged limitations, the model developed in this study represents a valuable quantitative tool for prognostic assessment in patients with HCC. As data continue to accumulate, subsequent refinement of the model is expected to enhance the accuracy of RFS prediction and facilitate more robust validation. Moreover, future research should prioritize the integration of this model into electronic health record systems to enable automated risk estimation and dynamic updating of prognostic assessments, thereby providing clinicians with real-time and accurate decision support.

In summary, we developed and validated a machine learning model using routinely collected clinical data to predict early postoperative recurrence risk in HCC. The model incorporates accessible clinical variables and achieves improved interpretability via the SHAP method. Characterized by its non-invasiveness, cost-effectiveness, and generalizability, the model is well-suited for diverse healthcare settings, including resource-limited environments. Future prospective studies are warranted to further assess its clinical utility across broader practice contexts.

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary Material 1 (727.1KB, pdf)
Supplementary Material 2 (15.3KB, xlsx)

Acknowledgements

The authors would like to express their gratitude to the Key Laboratory of Digestive Diseases of Jiangxi Province (Grant No. 2024SSY06101), and the Jiangxi Clinical Research Center for Gastroenterology (Grant No. 20223BCG74011).

Author contributions

D.-F.G., K.-H.Z., and Q.W. contributed to the conception and design of the study. D.-F.G. wrote the code, conducted machine learning modeling, and drafted the manuscript. D.-F.G., Q.W., L.-W.F., X.Z., and J.L. collated the clinical and follow-up data. D.-F.G., K.-H.Z., and T.W. revised the manuscript. All authors read and approved the final manuscript.

Data availability

The datasets generated during and analyzed during the current study are available from the corresponding author on reasonable request.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Ding-Fan Guo, Qi Wen and Xiang Zhang are co-first authors.

Contributor Information

Ting Wang, Email: tingwang@ncu.edu.cn.

Kun-He Zhang, Email: khzhang@ncu.edu.cn.

References

  • 1.Llovet, J. M. et al. Hepatocellular carcinoma. Nat. Rev. Dis. Primers. 7, 6 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Pinna, A. D. et al. Liver transplantation and hepatic resection can achieve cure for hepatocellular carcinoma. Ann. Surg.268, 868–875 (2018). [DOI] [PubMed] [Google Scholar]
  • 3.Maluccio, M. & Covey, A. Recent progress in understanding, diagnosing, and treating hepatocellular carcinoma. CA Cancer J. Clin.62, 394–399 (2012). [DOI] [PubMed] [Google Scholar]
  • 4.European Association for the Study of the Liver. EASL clinical practice guidelines: management of hepatocellular carcinoma. J. Hepatol.69, 182–236 (2018). [DOI] [PubMed] [Google Scholar]
  • 5.Cohen, N. M. et al. Personalized lab test models to quantify disease potentials in healthy individuals. Nat. Med.27, 1582–1591 (2021). [DOI] [PubMed] [Google Scholar]
  • 6.Valero, C. et al. Pretreatment neutrophil-to-lymphocyte ratio and mutational burden as biomarkers of tumor response to immune checkpoint inhibitors. Nat. Commun.12, 729 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Liu, W. et al. Prognosis prediction and risk stratification of transarterial chemoembolization or intraarterial chemotherapy for unresectable hepatocellular carcinoma based on machine learning. Eur. Radiol.34, 5094–5107 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Rajkomar, A., Dean, J. & Kohane, I. Machine learning in medicine. N Engl. J. Med.380, 1347–1358 (2019). [DOI] [PubMed] [Google Scholar]
  • 9.An, C. et al. A machine learning model based on health records for predicting recurrence after microwave ablation of hepatocellular carcinoma. J. Hepatocell Carcinoma. 9, 671–684 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Zhang, J., Chen, Q., Zhang, Y. & Zhou, J. Construction of a random survival forest model based on a machine learning algorithm to predict early recurrence after hepatectomy for adult hepatocellular carcinoma. BMC Cancer. 24, 1575 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Lundberg, S. M. & Lee, S. A unified approach to interpreting model predictions. Advances Neural Inform. Process. Systems30 (2017).
  • 12.Nevola, R. et al. Predictors of early and late hepatocellular carcinoma recurrence. World J. Gastroenterol.29, 1243–1260 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Yan, W. T. et al. Predictors and long-term prognosis of early and late recurrence for patients undergoing hepatic resection of hepatocellular carcinoma: a large-scale multicenter study. Hepatobiliary Surg. Nutr.12, 155–168 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Lenth, R. V. Response-Surface methods in R, using Rsm. J Stat. Soft32, (2009).
  • 15.Polsterl, S., Navab, N. & Katouzian, A. Fast training of supportvector machines for survival analysis. Lect Notes Artif. Int 9285243–9285259 (2015).
  • 16.Verweij, P. J. M. & Van Houwelingen, H. C. Penalized likelihood in Cox regression. Stat. Med.13, 2427–2436 (1994). [DOI] [PubMed] [Google Scholar]
  • 17.Ishwaran, H., Kogalur, U. B., Blackstone, E. H. & Lauer, M. S. Random survival forests. Annals Appl. Stat.2, 841–860 (2008). [Google Scholar]
  • 18.Lundberg, S. M. et al. Explainable machine-learning predictions for the prevention of hypoxaemia during surgery. Nat. Biomed. Eng.2, 749–760 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Jung, S. M. et al. Characteristics of early recurrence after curative liver resection for solitary hepatocellular carcinoma. J. Gastrointest. Surg.23, 304–311 (2019). [DOI] [PubMed] [Google Scholar]
  • 20.Liao, Y. et al. AGLR is a novel index for the prognosis of hepatocellular carcinoma patients: a retrospective study. BMC Surg.21, 72 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Albumin-Bilirubin Score at Post-Hepatectomy Hepatocellular Carcinoma Recurrence. Impact on survival and association with Post-Hepatectomy liver failure. J. Gastrointest. Surg.27, 2414–2423 (2023). [DOI] [PubMed] [Google Scholar]
  • 22.Xu, X. S. et al. Model based on γ-glutamyltransferase and alkaline phosphatase for hepatocellular carcinoma prognosis. World J. Gastroenterol.20, 10944–10952 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Zheng, J. et al. Neutrophil to lymphocyte ratio and platelet to lymphocyte ratio as prognostic predictors for hepatocellular carcinoma patients with various treatments: a Meta-Analysis and systematic review. Cell. Physiol. Biochem.44, 967–981 (2017). [DOI] [PubMed] [Google Scholar]
  • 24.Xu, C., Wu, F., Du, L., Dong, Y. & Lin, S. Significant association between high neutrophil-lymphocyte ratio and poor prognosis in patients with hepatocellular carcinoma: a systematic review and meta-analysis. Front. Immunol.14, 1211399 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Yoo, S. K. et al. Prediction of checkpoint inhibitor immunotherapy efficacy for cancer using routine blood tests and clinical data. Nat. Med.31, 869–880 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Wang, H. et al. Chloride intracellular channels as novel biomarkers for digestive system tumors (Review). Mol. Med. Rep.24, 1–12 (2021). [DOI] [PubMed] [Google Scholar]
  • 27.Zhang, L. et al. Pathophysiological role of ion channels and transporters in hepatocellular carcinoma. Cancer Gene Ther.31, 1611–1618 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Li, Z. et al. Association of preoperative antiviral treatment with incidences of microvascular invasion and early tumor recurrence in hepatitis B Virus-Related hepatocellular carcinoma. JAMA Surg.153, e182721 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Tan, J. et al. OHCCPredictor: an online risk stratification model for predicting survival duration of older patients with hepatocellular carcinoma. Hepatol. Int.18, 550–567 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Delgado, A. & Guddati, A. K. Clinical endpoints in oncology - a primer. Am. J. Cancer Res.11, 1121–1131 (2021). [PMC free article] [PubMed] [Google Scholar]

Associated Data

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

Supplementary Materials

Supplementary Material 1 (727.1KB, pdf)
Supplementary Material 2 (15.3KB, xlsx)

Data Availability Statement

The datasets generated during and analyzed during the current study are available from the corresponding author on reasonable request.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES