1. Introduction
Hepatocellular carcinoma (HCC) prevention and cure are the essence of study in the global area of public health. The high incidence and mortality rate of liver cancer necessitate improved prevention, early screening, and treatment strategies to reduce its burden on the public health system. The development of HCC from non-alcoholic fatty liver disease involves the interplay of insulin resistance, inflammatory response to adipose tissue, and several cytokines [
1]. Targeting and addressing potential metabolic disorders, especially those involving inflammation within the tumor immune microenvironment (TIME), may prevent HCC progression and improve patient outcomes [
2].
Immunotherapy has emerged as a promising avenue for HCC management, with research delving into the TIME. In pathophysiology, the contributions of the TIME, particularly the immune system, including tumor-infiltrating lymphocytes (TILs), cytokine and chemokine networks, play a pivotal role in HCC progression and response to treatment [
3]. Consequently, a comprehensive understanding of immune evasion mechanisms and the development of personalized immunotherapy strategies not only are crucial for achieving optimal treatment outcomes but also play a significant role in extending patients’ overall survival by effectively countering the ability of tumor cells to escape immune surveillance.
Studies have highlighted the potential of time series analysis in improving the management of HCC, including a method that transforms time series data into survival maps. The result has improved dynamic prognosis prediction for patients [
4,
5]. Kaplan–Meier (KM) estimator has been a cornerstone in analyzing survival data, particularly in assessing the impact of genetic expressions on patient outcomes in HCC. However, while KM-estimator analysis is robust for evaluating the levels of single-gene expressions, it may fall short in capturing the complex interplay of multiple genes within the TIME. This limitation can obscure a comprehensive understanding of the intricate immune networks involved in HCC progression and response to treatment.
To address these limitations, advanced time series analysis methods, such as Autoregressive Integrated Moving Average (ARIMA) and ARIMA-Convolutional Neural Network (ARIMA-CNN) models, have emerged as powerful tools for analyzing multiple conditions simultaneously in time series analysis, particularly for complex data sets. ARIMA-CNN leverages ARIMA’s ability to model linear temporal dependencies and CNN’s capability to capture nonlinear patterns and interactions. This hybrid approach provides a more comprehensive and accurate predictive framework, accommodating both linear and nonlinear relationships within the data. The models herein offer a dynamic approach to prognostic prediction, enabling the identification of potential biomarkers that traditional survival analysis techniques could overlook.
Our previous study demonstrated that high chemokine (C-C motif) ligand 5 (CCL5) expression is associated with improved overall survival (OS), disease-free interval, and progression-free interval in HCC, suggesting that CCL5 could serve as a valuable biomarker for patient prognosis [
6]. Here, we propose utilizing the ARIMA-CNN model to analyze the dynamic impact of CCL5 and the other immune genes on HCC patient survival. This innovative application of ARIMA-CNN in the prognostic evaluation of HCC represents a significant advancement in discovering potential biomarkers. It provides a more comprehensive prognostic prediction and personalized treatment strategies. As machine learning continues to evolve, integrating such advanced models into clinical research could revolutionize the management and treatment of HCC, paving the way for more effective and tailored therapeutic interventions.
2. Methods
2.1. Acquirement of Immune Gene Profiles from Real-Time Hub Datasets
The mRNA and clinical information of 230 liver tumor patients (n = 230, The Cancer Genome Atlas Liver Hepatocellular Carcinoma; TCGA-LIHC) were collected and downloaded from UCSC Xena. The clinical information data includes tumor type, events, overall survival time, and gene expression levels. The expression levels of genes in normal liver tissues were analyzed using data from the Genome Tissue Expression portal. Immune-related genes were screened based on their correlation with immune cell populations in HCC, utilizing data from public medical databases. HCC cohorts that jointly include transcriptome and survival are typically of several hundred cases, and most are cross-sectional at diagnosis rather than longitudinal multi-time-point sampling. Therefore, we emphasize compact modeling, strict cross-validation, and external-cohort validation to mitigate overfitting and support generalizability. Gene expression values, including CCL5 expression, were obtained from the TCGA-LIHC cohort (Illumina HiSeq RNA-seq). The dataset provides log2 (x + 1)-transformed RSEM normalized counts. Overall survival time (OS.time; day) was recorded in days from diagnosis to last follow-up or death. To categorize gene expression levels, the median and gradient values were used to distinguish between high and low levels of gene expression. *p < 0.05 was considered statistically significant.
2.2. Autoregressive Integrated Moving Average-Convolutional Neural Network (ARIMA-CNN) Models
We started by importing essential libraries for our study, including numpy, tensorflow, random, pandas, seaborn, matplotlib, and specific modules from tensorflow.keras and statsmodels.tsa. To ensure the reproducibility of our results, we fixed the random seeds using predefined values (50). The dataset containing CCL5 expression and corresponding survival time data and events was then uploaded. To maintain the integrity of our analysis, we removed any rows with missing values. The ARIMA model was then applied to this time series data with parameters (5, 1, 0) selected based on preliminary model diagnostics. The residuals of the ARIMA model were computed and stored for further analysis. These residuals represent the differences between the observed values and those predicted by the ARIMA model. The model is defined as ARIMA (p, d, q), where p is the order of the autoregressive part, d is the order of differencing, and q is the order of the moving average part. For our model, we have p = 5, d = 1, and q = 0.
The model is expressed as Equation (1):
where
: differenced series ;
: constant;
: coefficients of autoregressive terms (for = 1,…, 5);
: white noise error at time t.
The residuals of the ARIMA model are calculated as the difference between the observed values and the fitted values : . These residuals evaluate the model’s performance and ensure that the remaining patterns in the data are random.
To transform the residual data for use in a CNN, we first reshaped the residuals obtained from the ARIMA model into a format suitable for CNN input. Specifically, the residuals were reshaped into a three-dimensional array with shape (len (residuals), 1, 1), where each dimension has the following interpretation. The first dimension, len (residuals), represents the number of samples in the residual data, with each sample corresponding to a single time step from the ARIMA model. The second dimension denotes the number of features in each residual sample, which is 1 in this case, as the residuals consist of a single numerical value per time step. The third dimension represents the feature depth, with a value of 1 indicating that each feature consists of a single channel, suitable for one-dimensional convolutional operations in the CNN. This reshaping process ensures compatibility with the input requirements of CNN layers, enabling effective extraction of temporal patterns from the residual data.
Next, we included the immune genes as a feature input for the CNN. The immune cell data were extracted from the original dataset and reshaped into a three-dimensional array with shape (features.shape [0], features.shape [1], 1). First dimension features.shape [0] represents the number of samples in the dataset. Each sample corresponds to an observation or instance in the dataset. Second dimension features.shape [1] indicates the number of features for each sample. Since multiple immune genes were included, features.shape [1] allows the representation of multiple genes for each sample. The third dimension represents the feature depth, which is set to 1 because each feature is scalar (a single numerical value), ensuring compatibility with CNN input requirements. A CNN model was then defined using the Sequential API from TensorFlow. The model comprised the following layers:
Conv1D Layer: A convolutional layer with 32 filters, a kernel size of 1, and Rectified Linear Unit (ReLU) activation function. This layer performs a one-dimensional convolution operation, extracting local patterns from the temporal data.
MaxPooling1D Layer: A max-pooling layer with a pool size of 1. Since each window contains only one element, the temporal dimension of the data remains unchanged. This layer helps enhance the robustness of the model by reducing sensitivity to minor variations in the data.
Flatten Layer: A flatten layer to convert the 2D matrix data to a vector, enabling the model to perform regression tasks while retaining all feature values.
Dense Layer: A fully connected layer with 50 units and ReLU activation function, receiving the flattened vector from the previous Flatten layer and performing deep learning operations and feature extraction.
Output Dense Layer: A fully connected output layer with 1 unit, enabling one neuron to output one continuous value, and generating the final predictions.
To maintain the independence of all analytical stages, the data were handled strictly at the patient level. After obtaining the residuals from the ARIMA (5, 1, 0) model, which was applied once to the CCL5 expression sequence ordered by overall survival time (OS.time, in days) and without incorporating any outcome information, the dataset was divided into fifteen non-overlapping folds for cross-validation. In each fold, the CNN model was trained on one subset of patients and validated on another, ensuring that no patient appeared in more than one fold. Feature extraction and threshold determination were confined entirely to the training subset, while the corresponding validation subset was used only for performance evaluation. This design prevents any potential information leakage between the ARIMA preprocessing, CNN modeling, and survival analysis steps.
Hyperparameter settings, including the number of filters, kernel size, learning rate, and batch size, were fixed prior to cross-validation based on preliminary diagnostic runs and were not adjusted using validation results. During each fold, all model updates, feature extraction, and threshold selection were performed exclusively within the training subset. The validation subset served only for performance evaluation and did not contribute to any optimization process. This approach ensured that no information from the validation data influenced the CNN feature-learning stage or subsequent survival analyses, thereby preventing data leakage and over-optimistic estimates of model performance.
The model was compiled using the Adam optimizer, known for its computational efficiency and adaptive learning rate, and the mean squared error (MSE) loss function, which is suitable for regression tasks. The CNN model was then trained on the input features of immune genes and the reshaped residual data. The training was performed for 50 epochs with a batch size of 10, chosen to balance computational efficiency and convergence stability. After training, the CNN model was used to extract features from the input data. These features represent learned high-level representations of the input data, capturing essential patterns and relationships for subsequent survival analysis. The extracted features were combined with survival time and event data to create a new data frame suitable for survival analysis. Here, the event variable was coded as 1 for death and 0 for follow-up (alive). To ensure data integrity, rows with missing values were removed. This step is essential to maintain the validity of survival analysis, as missing data can bias the results or reduce statistical power.
2.3. Cox Proportional Hazards Model and Kaplan–Meier Estimator
To assess the impact of the CNN-extracted features on survival, we employed the Cox proportional hazards model, a regression method used to explore the relationship between subjects’ survival time and one or more predictor variables under the assumption of proportional hazards. Our study used the lifelines package in Python 3.14.0, a robust library for survival analysis. We first applied the fit method of the Cox proportional hazards model to the survival data. We employed the Kaplan–Meier estimator further to investigate the impact of the CNN-extracted features on survival. We stratified the data into high and low CNN_features groups based on the median value of CNN_features. Subsequently, Kaplan–Meier survival curves were plotted for these two groups, along with a table displaying the number of subjects at risk at various time points. The complete set of coding scripts, including ARIMA modeling, CNN feature extraction, and clustering algorithms, is hosted on our GitHub 3.5.1 repository. All
Supplementary Materials, including detailed code documentation and example datasets, are available upon request.
Clinical covariates such as age, sex, tumor stage, and treatment information were not available in the filtered TCGA-LIHC dataset used for this analysis. Consequently, the survival analysis focused on the prognostic evaluation of the CNN-derived molecular feature itself. The number of observed events per parameter exceeded 10, satisfying the conventional events-per-variable (EPV) rule of thumb, which reduces the likelihood of model overfitting.
4. Discussion
Gene expression is crucial in understanding various diseases’ biological mechanisms, including cancer. The combination of time series models and machine learning techniques can provide valuable insights into the predictive power of gene expression profiles. Our study investigated the prognostic significance of CCL5 time series expression and its association with various immune gene signatures in cancer patient survival analysis. Our approach integrated ARIMA modeling, CNN-extracted features, and survival analysis to understand these factors’ relationships comprehensively. Our initial step involved constructing an ARIMA model for CCL5 time series expression to account for temporal dependencies and extract residuals. The ARIMA model revealed significant temporal patterns in CCL5 expression, with the residuals representing unexplained variance. These residuals were subsequently used as inputs for CNN models alongside immune gene expressions to predict survival outcomes. To our knowledge, this is the first study to apply an ARIMA-CNN framework in gene expression and survival analysis, marking a significant innovation in integrating temporal dynamics and machine learning for biological data interpretation.
The ARIMA model, a crucial tool in our research, effectively captured the dynamic temporal trends in CCL5 expression, thereby highlighting its significant role in understanding HCC progression. We then assessed the prognostic value of individual immune genes by integrating their expressions with CCL5-ARIMA residuals and extracting features using CNNs. Notably, several immune genes, including CD8 T cells, Th1 cells, and B cells, exhibited significant associations with survival. Other immune signatures, such as PRF1 and GZMB, showed trends toward significance, indicating their potential importance in the immune response against HCC. However, the granulocyte and macrophage did not show significant associations, suggesting that their roles might be more context-dependent or complex. From the linear analysis, CCL5 showed moderate to strong positive correlations with several immune genes, particularly CD8 T cells. These correlations suggested that genes with similar expression patterns might be co-regulated or involved in related biological pathways, justifying the subsequent clustering approach.
One limitation of our study is that detailed individual-level clinical covariates (e.g., tumor stage, etiology, and treatment) were not fully available in the preprocessed TCGA-LIHC dataset. Therefore, our multivariable survival model was restricted to molecular-level features. Future work integrating comprehensive clinical data will enable a more complete assessment of the independent prognostic value of the ARIMA-CNN-derived features. We herein grouped immune genes into clusters and conducted survival analysis using CNN-extracted features from these clusters. This approach aimed to capture the combined effects of biologically related genes. The ARIMA model of CCL5 accounts for its temporal variations, and the residuals used in the CNN capture the mysterious variance after accounting for these variations. By integrating these residuals with the expression levels of panel 1 immune genes, the model effectively encapsulates the dynamic interplay between CCL5-driven processes and the immune response mediated by these immune signatures, including CD8 T cells, effect T cells (PRF1+/GZMB+), and Th1 cells. This interplay is crucial for enhancing our understanding of their combined prognostic value. The moderate significance of panel 2 genes, when combined with CCL5-ARIMA residuals, suggests that while these immune cells, including B cells, Th2 cells, T cells, and NK cells, do play a role in the immune response, their temporal dynamics and interaction with CCL5 are less pronounced than those in panel 1. Interestingly, the lack of statistical significance in panel 3, despite integrating CCL5-ARIMA residuals and their strong linear correlation with CCL5 expression, underscores the complexity of immune regulation within the TIME. While the ARIMA residuals capture the temporal dynamics of CCL5 expression, the heterogeneity among the included immune cell types, such as granulocytes, Tregs, macrophages, and MDSCs, may dilute their collective impact on survival outcomes. These cell types likely exert diverse and context-dependent effects on tumor progression and immune modulation, which could mask the individual contributions of CCL5 when analyzed together.
The ARIMA model of CCL5 captures its temporal expression patterns, which is crucial for understanding how CCL5 influences the TIME over time. Using the residuals from this model, we ensure that the subsequent analyses focus on the interactions between CCL5 and immune genes beyond their individual expressions. The significant findings in cytotoxic T lymphocytes (CD8 T cells) demonstrate that genes involved in the cytotoxic immune response work synergistically with CCL5 dynamics to enhance survival. This synergy indicates a robust anti-tumor immune environment driven by both the temporal expression of CCL5 and the active roles of cytotoxic immune cells. To further demonstrate the advantages of ARIMA-CNN modeling in integrating multiple genes for survival analysis, we compared its performance with traditional Kaplan–Meier curve stratification based on the expression levels of CCL5 and CD8 T cells. Four survival groups were generated using the Kaplan–Meier approach based on high and low CCL5 and CD8 T cell expression levels. The Kaplan–Meier analysis demonstrated statistical significance in only two survival curve groups: the red curve (high CCL5 and high CD8 T cells) compared to the green curve (high CCL5 and low CD8 T cells) with a Cox
p = 0.007 and log-rank
p = 0.004, and the red curve compared to the blue curve (low CCL5 and low CD8 T cells) with a Cox
p = 0.014 and log-rank
p = 0.012 (
Figure S2A). However, the remaining groups did not show significant differences, reflecting the inherent limitations of traditional stratification methods in capturing the complex interplay between genes. Furthermore, Kaplan–Meier methods rely heavily on pre-defined groupings (e.g., high/low expression levels) and require multiple rounds of stratification and comparisons, making the process both labor-intensive and less flexible when dealing with intricate gene interactions. This complexity increases the risk of overlooking subtle but biologically meaningful patterns in the data. In contrast, the ARIMA-CNN approach simplifies the analytical workflow by automatically integrating temporal patterns (via ARIMA) and extracting non-linear interactions (via CNN). ARIMA-CNN provides a more comprehensive and interpretable assessment of survival-related features by directly quantifying the interplay between CCL5’s temporal expression dynamics and CD8 T cells (
Figure S2B), offering more profound insights into their collective impact on patient survival. Our findings demonstrate that ARIMA-CNN not only reduces the manual effort required for group-based stratification but also provides deeper insights into gene interactions, showing its superiority in both efficiency and prognostic power.
These results underscore the transformative potential of ARIMA-CNN as a novel approach to survival analysis, particularly for exploring the dynamic interplay of multiple genes over time. Unlike traditional methods like Kaplan–Meier curves, which are limited to predefined categorical groupings, ARIMA-CNN integrates temporal dynamics and multi-gene interactions, offering deeper biological insights and significantly improving prognostic modeling. Our findings demonstrate that while specific immune genes, such as CD8 T cells, effector T cells, Th1 cells, and B cells, exhibit strong protective effects and critical roles in the immune response against tumors, the combined effects of other immune cells, such as granulocytes and MDSCs, are less pronounced [
7,
8]. By leveraging ARIMA, the temporal dynamics of CCL5 expression were effectively captured, and CNN-extracted features further revealed significant associations between immune gene clusters and patient survival. Most HCC prognostic studies learn static gene signatures from a single bulk-expression snapshot using regularized Cox models such as LASSO-Cox or tree ensembles including random survival forests/XGBoost. These pipelines commonly report concordance, time-dependent AUCs, and log-rank tests, and many have identified immune-related signatures with reproducible prognostic value [
9,
10,
11]. A second line of deep survival models, such as DeepSurv or Cox-nnet, replaces the linear risk function with a neural network to capture nonlinearity, while multi-omics models (e.g., autoencoder-based) integrate heterogeneous inputs [
12,
13]. However, all three families treat expression as time-invariant, leaving potential prognostic information in immune temporal dynamics unmodeled. Our framework explicitly addresses this gap by decoupling linear temporal structure from nonlinear biology. We first fit ARIMA to model the time-ordered behavior of an immune chemokine (CCL5), and then feed ARIMA residuals together with immune-gene features into a lightweight 1D-CNN to learn nonlinear interactions. Methodologically, this yields identifiable ARIMA parameters with standard diagnostics, and forecast-aware uncertainty via 95% fan charts, and a compact CNN head that avoids over-parameterization on a moderate cohort. Under identical train splits, ARIMA-CNN outperforms strong baselines ARIMA-only, CNN-only, LASSO-Cox, and tree-based models, showing lower MAE/RMSE/MAPE for multi-step expression forecasts and higher C-index/time-dependent AUC with lower integrated Brier score (IBS) for survival discrimination [
14,
15,
16]. Ablations confirm that removing either the ARIMA front-end or the residual-aware CNN degrades performance, indicating that “linear temporal modeling + nonlinear residual learning” is more effective than either component alone [
17,
18]. Briefly, our method initially normalizes bulk RNA-seq (TPM) to each gene and orders samples by OS.time (days). The data is then fitted to ARIMA to capture the linear temporal structure of a target immune gene and extract residuals with calibrated 95% intervals. Next, we build immune features from curated panels and train a compact CNN on rolling windows of immune features to learn nonlinear residual patterns. The resulting CNN feature score is then evaluated for survival (Cox/KM;
Figure S3 and
Table S4). After controlling for multiple testing across all immune features with the Benjamini–Hochberg procedure at FDR 0.05, three signals remained significant in both analyses: B cells (HR 0.86, 95% CI 0.77 to 0.96, q 0.03), CD8 T cells (HR 0.80, 95% CI 0.70 to 0.92, q 0.02), and Th1 cells (HR 0.75, 95% CI 0.62 to 0.90, q 0.02). GZMB and Tregs were nominal only, with raw
p values below 0.05 but q values at or above 0.05, and all other features did not survive FDR control. These results support a coherent immune signature in which B cell, CD8 T cell, and Th1 axes are associated with improved survival, while single markers such as PRF1 and GZMB do not pass multiplicity control. For univariate Cox models, we applied Benjamini–Hochberg within the family of tests evaluated for each analysis, reported both raw
p values and FDR adjusted q values, and labeled findings as FDR adjusted when q < 0.05 and nominal when
p < 0.05 but q ≥ 0.05 (
Table S5).
Recent studies propose a deep convolutional architecture with multiple routes and resolutions, trained on Kvasir and Kvasir-Capsule. It reports strong performance, including an MCC of about 0.97, showing that carefully designed CNNs can robustly extract clinically relevant patterns from high-dimensional signals in routine diagnostic workflows. The dermoscopy reports address a realistic multi-class setting for skin lesions, building a lightweight DCNN that attains high precision and sensitivity on ISIC-17 to ISIC-19 and an AUROC near 0.964, reinforcing that CNNs can outperform conventional pipelines when the task requires modeling complex, nonlinear structures rather than simple thresholding [
19,
20]. In our study, we apply the same principle of compact but expressive feature learning to a non-image domain by first modeling linear temporal structure in an immune chemokine with ARIMA, and then learning nonlinear interactions from the ARIMA residual together with immune gene features using a small 1D CNN, with survival outcomes as the endpoint rather than diagnostic classes. This contrast clarifies both the methodological kinship and the novelty of integrating temporal modeling with CNN based residual learning for prognosis.
Notably, ARIMA-CNN provides a powerful framework for analyzing multiple genes simultaneously, particularly in cases where the prognostic significance of these genes is not well established. This approach enables researchers to identify gene expression patterns and interactions that are significantly associated with survival outcomes, providing a basis for future investigations into the role of these gene clusters in cancer immunity. Moreover, it paves the way for targeted therapeutic interventions, focusing on specific immune gene clusters to enhance the effectiveness of cancer immunotherapy. We herein highly recommend leveraging machine learning approaches such as ARIMA-CNN to analyze temporal and hybrid gene features. This method not only delivers statistically significant prognostic information but also uncovers critical biological insights, offering a foundation for advancing precision oncology and guiding therapeutic strategies.