Predicting response to neoadjuvant chemotherapy combined with immunotherapy in gastric cancer based on habitat imaging and peritumoral radiomics: a two-center study Authors: Chenjiao Ran, Xinyu Chen, Yong Huang, Derui Kong Published: 2026 ABSTRACT AbstractBackgroundPredicting pathological response to neoadjuvant chemotherapy combined with immunotherapy (NACI) in locally advanced gastric cancer (LAGC) remains challenging. This study aimed to develop a non-invasive predictive model by integrating intratumoral habitat imaging features, peritumoral radiomics, and clinical characteristics from baseline contrast-enhanced CT (CECT).MethodsIn this retrospective, two-center study, 281 LAGC patients receiving NACI followed by surgery were enrolled. Patients were classified as responders or non-responders based on tumor regression grade (TRG). Tumors on pre-treatment CECT were segmented into distinct habitats via K-means clustering. Radiomic features were extracted from intra-tumoral, habitat subregions, and 1-mm/2-mm peritumoral areas. After feature selection, multiple models were constructed using machine learning algorithms. The optimal combined model integrated habitat features, peritumoral (1 mm) features, and clinical factors.ResultsThe combined model demonstrated superior predictive performance, achieving area under the curve (AUC) values of 0.885, 0.789, and 0.763 in the training, internal validation, and external test cohorts, respectively. It outperformed models based solely on intratumoral radiomics, habitat features, peritumoral features, or clinical data. Decision curve analysis confirmed its clinical utility.ConclusionA CT-based multiparametric model that captures intratumoral spatial heterogeneity and peritumoral microenvironmental information can effectively predict pathological response to NACI in LAGC patients preoperatively. This approach offers a promising non-invasive tool to guide personalized treatment selection and optimize therapeutic strategies.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12967-026-08342-4.Keywords: Gastric cancer, Tumor regression grade, Habitat, Immunotherapy Introduction Gastric cancer (GC) remains as a substantial global health challenge, ranking as the fifth most frequently diagnosed malignancy and the third leading cause of cancer-related deaths worldwide [1]. Currently, neoadjuvant chemotherapy (NAC) followed by surgical resection constitutes the standard of care for resectable gastric cancer [2]. Recently, the combination of immune checkpoint inhibitors—particularly PD-1/PD-L1 blockers—with conventional chemotherapy has shown encouraging efficacy in clinical trials. The landmark phase II randomized controlled NEOSUMMIT-01 trial demonstrated that adding toripalimab (a PD-1 inhibitor) to chemotherapy significantly improved pathological complete response (22.2% vs. 7.4%) and major pathological response rates (44.4% vs. 20.4%) compared with chemotherapy alone in patients with locally advanced gastric or gastroesophageal junction cancer [3]. Despite these advances, responses to combination therapies remain heterogeneous. While some patients derive minimal benefit from neoadjuvant chemotherapy or chemoimmunotherapy, they are still exposed to considerable toxicity, financial cost, and potential delays in curative resection [4]. This variability underscores the urgent need for reliable predictive biomarkers to identify optimal candidates for specific therapeutic regimens. Although several biomarkers—such as PD-L1 expression, mismatch repair status, and tumor mutational burden—have been studied, their predictive performance remains suboptimal, with inconsistent associations with treatment outcomes. Contrast-enhanced computed tomography (CECT) is fundamental for the diagnosis, staging, and response evaluation of gastric cancer [5]. Conventional CT assessment relies heavily on morphological changes, particularly tumor size reduction, which often lags behind functional and biological alterations at the cellular level. Radiomics has emerged as a promising approach to overcome this limitation by extracting high-dimensional quantitative features from medical images that reflect underlying tumor biology and the microenvironment [6]. The concept of “habitat imaging” represents a paradigm shift in radiological analysis. Moving beyond the traditional view of tumors as homogeneous masses, habitat imaging delineates distinct intratumoral subregions based on differential vascularization, cellularity, and extracellular matrix composition [7]. These habitats correspond to functionally discrete microenvironments with divergent therapeutic sensitivities. Concurrently, the peritumoral region—the tissue immediately surrounding the tumor—has garnered increasing interest due to its role in tumor progression and treatment resistance, as it often harbors critical information regarding invasive fronts and immune activity [8, 9]. While prior studies have investigated intratumoral radiomic features for predicting therapeutic response, few have comprehensively integrated both habitat-specific and peritumoral characteristics within a unified analytical framework. Such integration is particularly pertinent in the context of immunotherapy, the efficacy of which is strongly influenced by the tumor-immune microenvironment extending beyond the primary tumor boundary [10]. This study aimed to develop and validate a novel fusion model that integrates habitat and peritumoral features derived from baseline contrast-enhanced CT scans to predict treatment response to neoadjuvant chemotherapy combined with immunotherapy in locally advanced gastric cancer. By simultaneously capturing intratumoral heterogeneity and peritumoral microenvironmental properties, our approach seeks to establish a non-invasive imaging biomarker to guide personalized treatment selection, thereby reducing ineffective therapies and improving clinical outcomes. Methods Patients This retrospective study included 281 patients with gastric cancer from two tertiary medical centers between 2022 and 2025, comprising 178 from Shandong Cancer Hospital and Institute and 103 from Tianjin Medical University Cancer Institute and Hospital. All patients underwent neoadjuvant chemoimmunotherapy followed by surgical resection. The study protocol was approved by the institutional ethics committee (Approval No: SDTHEC20251102), and the requirement for informed consent was waived. A patient selection flowchart is shown in Fig. 1. The enrollment of patients in the Shandong Cancer Hospital and Institute cohort and Tianjin Medical University Cancer Institute and Hospital cohort Eligible patients met the following criteria: (1) histologically confirmed gastric adenocarcinoma; (2) completion of neoadjuvant chemotherapy combined with immunotherapy and subsequent radical surgery; (3) no history of other malignancies; and (4) achievement of R0 resection with complete clinicopathological data. Exclusion criteria were: (1) prior anticancer therapies such as radiotherapy, targeted therapy, or chemotherapy alone; (2) gastric stump cancer; and (3) lack of baseline computed tomography (CT) imaging before neoadjuvant treatment. The cohort from Shandong Cancer Hospital and Institute was randomly split into a training cohort and a validation cohort at an 8:2 ratio. The independent cohort from Tianjin Medical University Cancer Institute and Hospital served as a test cohort. The study design and workflow are illustrated in Fig. 2. The overall workflow of this study Assessment of response to neoadjuvant chemotherapy combined with immunotherapy The assessment of NACI response was conducted collaboratively by two pathology experts with more than 10 years of experience in diagnosing gastrointestinal tumors. Both were blinded to the imaging and clinical data of the patients. The response to neoadjuvant therapy was generally evaluated according to the TRG, with evaluation criteria based on the eighth edition of the American Joint Committee on Cancer (AJCC) Staging Manual [11]. Briefly, TRG 0, defined as a complete response, refers to the absence of viable cancer cells, including lymph nodes. TRG 1, defined as near-complete response, is characterized by the presence of single cells or small groups of cancer cells. TRG 2, defined as partial response, is defined as the presence of residual cancer cells, with evident tumor regression beyond single cells or small groups of cancer cells. Finally, TRG 3, defined as poor or no response, refers to the presence of extensive residual cancer with no evident tumor regression. TRG 0 and TRG 1 were defined as responders, while TRG 2 and TRG 3 were classified as non-responders. Retrieval and processing of delayed-phase CT images Patient delayed-phase thick-slice images were retrieved from the Picture Archiving and Communication System (PACS) and stored in DICOM format. The ITK-SNAP software (version 3.8.0, http://www.itksnap.org) was employed to delineate regions of interest (ROIs). Using a standardized soft-tissue window setting (window width: 40 HU; window level: 220 HU), radiologists identified lesion areas and performed slice-by-slice delineation of ROI boundaries. Image preprocessing Given the inherent heterogeneity of CT scanners and acquisition protocols across the two participating centers, all images underwent standardized preprocessing prior to segmentation and feature extraction to enhance the robustness and reproducibility of radiomic features. To mitigate the impact of anisotropic voxel resolution, spatial normalization was performed using a fixed-resolution resampling method. This approach addressed inconsistencies in voxel dimensions within ROIs, resulting in a uniform isotropic voxel spacing of 1 mm × 1 mm × 1 mm. This step ensures that radiomic features are derived from voxels of consistent size across the entire cohort, a critical requirement for reliable multi-center radiomics. Manual segmentation of ROIs were performed using ITK-SNAP software (version 3.8, http://www.itksnap.org/) by two expert radiologists with 5 and 7 years of experience. Habitat generation and peritumoral regions dilation Local characteristics, including strength and contrast metrics, were obtained through analysis of each voxel contained within the specified ROI. To compute the local features for each voxel, a 3 × 3 × 3 moving window was utilized, allowing for the extraction of 19 distinct feature vectors for every individual voxel. These features were selected to comprehensively characterize the local texture, intensity distribution, and heterogeneity of the tumor microenvironment, and included the following radiomic features (Appendix 1). The rationale for selecting these 19 features was threefold. First, they represent a diverse set of texture descriptors spanning multiple feature families, enabling a comprehensive characterization of the local tumor microenvironment [12]. Second, these features have been widely used in previous habitat imaging studies and have demonstrated sensitivity to underlying biological differences in cellular density, vascularity, and stromal composition [13]. Third, all features are compliant with the Image Biomarker Standardization Initiative (IBSI) guidelines, ensuring reproducibility and comparability across studies [12]. This combination of comprehensiveness, biological relevance, and standardization makes these 19 features well-suited for unsupervised clustering to identify functionally distinct habitat subregions. The K-means algorithm was employed for population-level voxel clustering, ensuring consistent cluster allocation across different patients. Clustering with 3–10 clusters was tested in this study, and the optimal number was selected based on Calinski-Harabasz (CH) values, which indicate tighter clustering, greater inter-cluster differences, and improved performance [14]. Habitat generation and specific features were detailed in Fig. 3. The generated habitat regions and 19 characteristics are presented. The feature map from a to s represent Entropy, MeanAbsoluteDeviation, Median, DifferenceAverage, DifferenceEntropy, DifferenceVariance, JointEnergy, JointEntropy, InverseVariance, SumEntropy, Imc1, Imc2, RunEntropy, RunVariance, LongRunEmphasis, SizeZoneNonUniformityNormalized, SmallAreaHighGrayLevelEmphasis, Contrast, Strength. The t represents clustered habitats We extended the ROI surrounding the tumor with varying margins, including 1 mm and 2 mm, in order to evaluate their impact on the predictive performance of the model. Figure 4 demonstrates the process of expanding the peritumoral area. (a) An example shows the CT image, (b) the intratumoral ROI, (c-d) expansion of peritumoral regions Feature extraction Radiomics features were extracted using software (PyRadiomics, version 3.0.1, Python package) from the intra-tumor ROI, peritumoral regions (Peri1mm, and Peri2mm), and distinct habitat subregions, following the Imaging Biomarker Standardization Initiative (IBSI) guidelines. These features were classified into three groups: geometric, intensity, and texture features including gray-level co-occcurrence matrix (GLCM), gray-level dependence matrix (GLDM), gray-level run length matrix (GLRLM), gray-level size zone matrix (GLSZM), and neighborhood gray-tone difference matrix (NGTDM) [15]. In cases where unsupervised clustering algorithms resulted in incomplete segmentation of habitat subregions, the K-Nearest Neighbor (KNN) method was used to fill in missing features for consistency across all habitats [16]. Fusion methods were applied to integrate characteristics obtained from different subregions [16]. Following population-level K-means clustering, some patients exhibited habitat subregions with no voxels, resulting in missing radiomic feature values. To address this without introducing data leakage across cohorts, the dataset was first split into the training, internal validation, and external testing cohorts. Subsequently, K-Nearest Neighbor (KNN) imputation was applied independently within each cohort. For each cohort, the imputer was fitted solely on the available data from that specific cohort and used to impute its own missing values. This procedure ensured that the imputation in the training cohort was completely uninfluenced by the validation or external testing data. During the 5-fold cross-validation on the training cohort, the dataset was already imputed, which we acknowledge may introduce a minimal degree of optimism in cross-validation metrics. However, given the very low rate of missing data (3.7% of habitat features), this effect is negligible, and the generalizability of our model is robustly supported by the strong performance on the entirely independent external test cohort. Feature selection A multi-step feature selection pipeline was implemented separately for each feature set to reduce dimensionality, eliminate redundancy, and identify the most robust and predictive features while avoiding data leakage. Reproducibility analysis A reproducibility analysis was conducted on a randomly selected subset of 30 patients to assess intra- and inter-observer agreement. The intra-class correlation coefficient (ICC) was calculated for each feature. Only features with an ICC ≥ 0.75, indicating excellent reproducibility, were retained. Normalization All remaining features were normalized using Z-score normalization. Statistical filtering Features were screened using an independent t-test or Mann-Whitney U test, as appropriate, to compare responders and non-responders in the training cohort. Features with a p-value < 0.05 were retained. Collinearity reduction The Pearson correlation coefficient was then calculated to assess feature redundancy, and only one feature was kept if the correlation coefficient between feature pairs exceeded 0.9. LASSO regression Finally, the least absolute shrinkage and selection operator (LASSO) logistic regression method was employed for identifying the most predictive features based on non-zero coefficients determined through ten-fold cross-validation and a minimum criterion-adjusted penalty parameter (λ). Model construction Three mainstream machine learning classifiers were involved in the modeling process: Multilayer Perceptron (MLP), K-Nearest Neighbors (KNN), and Light Gradient Boosting Machine (LightGBM). It is important to note that the KNN algorithm used for missing value imputation is entirely distinct from the KNN classifier evaluated in model construction; the former is unsupervised and applied prior to feature selection, while the latter is a supervised learner tuned independently during cross-validation. To determine the optimal model parameters, 5-fold cross-validation was applied on the training cohort to identify the configuration with the best median performance. Multiple prediction models were established for different regions: traditional radiomics models (INTRA), habitat imaging models (Habitat), and peritumoral models (Peri1mm and Peri2mm), habitat imaging models combined peritumoral models (HabitatPeri1, and HabitatPeri2). A comparison was made between clinical data and CT characteristics related to patients in responders and non-responders. Significant features were selected through univariate followed by multivariate logistic regression analysis to a construct clinical model (Clinic). Finally, the combined model was developed, integrating clinical factors and peritumoral features with habitat models (Combined). Model validation and interpretability The receiver operating characteristic (ROC) curve was employed to assess the predictive performance of different models, while the Delong test was utilized for comparative analysis. The calibration curve and Hosmer-Lemeshow analysis were applied to evaluate the accuracy and reliability of prediction results. Decision curve analysis (DCA) was conducted to assess the actual clinical benefits derived from the model. Statistical analysis Statistical analysis was conducted using SPSS software (version 27.0, IBM) and Python software (version 3.5.6; http://www.python.org). The independent sample t-test was performed to analyze continuous variables, expressed as mean ± standard deviation. The correlation between categorical variables was analyzed using the chi-square test or Fisher’s exact test, and the results were represented as proportions. For the identification of independent predictors of pathological response, univariate logistic regression analysis was first performed to screen candidate clinical variables. Variables with a p-value < 0.05 in univariate analysis were subsequently entered into multivariate logistic regression analysis (entry criterion: p < 0.05). Results were reported as odds ratios (OR) with corresponding 95% confidence intervals (CI). All statistical tests were two-sided, and a p-value < 0.05 was considered statistically significant. Results Clinical characteristics of patients This study enrolled a total of 281 patients, including 178 patients (133 males and 45 females) recruited from Shandong Cancer Hospital and Institute and 103 patients (85 males and 18 females) from Tianjin Medical University Cancer Institute and Hospital. The clinical characteristics were compared in Table 1. In terms of clinical stage, the percentage of stage III patients in the training cohort (75.35%) was significantly higher compared to the validation cohort (58.33%) and the testing cohort (67.96%) (p < 0.001). As for neoadjuvant therapy cycles, the proportion of patients receiving more than two cycles was significantly greater in the testing cohort (99.03%) than in the training cohort (86.62%) and the validation cohort (88.89%). No statistically significant differences were observed among the training, validation, and testing cohort in terms of age, sex, histopathology, and CEA levels. Table 1The clinical features of patients in the training, validation and testing cohortsClinical characteristicsALLTesting cohortTraining cohortValidation cohortP_value Age 60.53 ± 9.6360.76 ± 9.3260.74 ± 9.3159.06 ± 11.710.6176469 Sex 0.2223425Female63(22.42)18(17.48)34(23.94)11(30.56)Male218(77.58)85(82.52)108(76.06)25(69.44) Histopathology 0.0966882Non-adenocarcinoma47(16.73)22(21.36)17(11.97)8(22.22)Adenocarcinoma234(83.27)81(78.64)125(88.03)28(77.78) Clinical stage <0.001I1(0.36)01(0.70)0II43(15.30)28(27.18)9(6.34)6(16.67)III198(70.46)70(67.96)107(75.35)21(58.33)IV39(13.88)5(4.85)25(17.61)9(25.00) CEA 0.0623887Normal165(58.72)69(66.99)74(52.11)22(61.11)Elevated116(41.28)34(33.01)68(47.89)14(38.89) Treatment cycles 0.0023368≤224(8.54)1(0.97)19(13.38)4(11.11)>2257(91.46)102(99.03)123(86.62)32(88.89) The clinical features of patients in the training, validation and testing cohorts Univariate and multivariate analyses of baseline characteristics were performed to compare the response and non-response groups, to determine the odds ratio (OR) and corresponding p‑value for each feature (Appendix 2). Univariate analysis revealed significant differences between the two groups in terms of sex, age, pathological, clinical stage, CEA, and treatment cycles (p < 0.05). In the multivariate analysis, only clinical stage remained as independent predictors of neoadjuvant treatment efficacy (p < 0.05). Following numerical encoding of these characteristics, machine learning models were constructed. The Multilayer Perceptron (MLP) model yielded an area under the receiver operating characteristic curve (AUC) of 0.546 (95% CI: 0.476–0.617) on the training cohort, with a comparable AUC of 0.495 (95% CI: 0.301–0.687) on the validation cohort. Habitat subregion clustering, feature extraction and selection Based on the Calinski-Harabasz score, the optimal number of clusters was determined to be three (Appendix 3). Accordingly, the tumor region of interest (ROI) was segmented into three distinct habitats to facilitate subsequent feature extraction and model construction. From these three subregions, a total of 4,683 radiomic features were initially extracted. Following feature selection, 22 features were retained for building the habitat-based model (Fig. 5). Separately, 1,329, 1,561, and 1,561 features were extracted from the intratumoral region, the peritumoral 1 mm region, and the peritumoral 2 mm region, respectively. After applying the same selection process, 7, 11, and 10 features were preserved from each corresponding region (Appendix 4). (a) The coefficients for cross-validation of LASSO regression. (b) The MSE of LASSO regression. (c) Selected features weight coefficients Definition and extent of missing habitat subregions After performing population-level K-means clustering (k = 3) on all voxels from the entire cohort’s ROIs, each tumor was partitioned into three habitat subregions (Habitat 1–3). However, in some patients, a particular habitat subregion contained zero voxels-typically due to small tumor size or homogeneous internal structure. In such cases, no radiomic features could be extracted for that specific habitat subregion, leading to missing feature values. Quantitative missing data summary Among the 281 included patients, the number of missing subregions was as follows: Habitat 1 absent: 1 patient, Habitat 2 absent: 25 patients, Habitat 3 absent: 5 patients. Overall, 31/843 (3.7%) patient-habitat combinations were missing. Each missing habitat subregion resulted in the absence of 1,561 radiomic features (all features extracted from that subregion). Therefore, the total number of missing feature values was 31 × 1,561 = 48,391, representing 3.7% of all habitat-derived features. Model performance To systematically evaluate classifier performance, we compared MLP, KNN, and LightGBM across all six feature combinations (INTRA, Habitat, Peri1mm, Peri2mm, HabitatPeri1, and HabitatPeri2) in the training, validation, and test cohorts. The complete results are now presented in the Appendix 5. While no single algorithm uniformly outperformed the others across every feature set, MLP achieved the highest AUC in the majority of comparisons. Importantly, the HabitatPeri1 model—the most clinically relevant in our study—demonstrated that MLP consistently outperformed both KNN and LightGBM across all three cohorts. Table 2 summarizes the comparison of the habitat model across different machine learning algorithms (MLP, KNN, LightGBM), with the habitat model achieving optimal performance under the MLP algorithm. Table 3 and Fig. 6 presents the performance of the habitat model, the INTRA model, and the combined habitat-peritumoral model within the MLP framework across the training, validation, and testing cohorts. Table 2The comparison of the habitat model across different machine learning algorithmsModel_nameAccuracyAUC95% CISensitivitySpecificityPPVNPVMLP-train0.7680.8480.7820 - 0.91480.8750.7130.6090.918MLP-val0.7780.760.5739 - 0.94610.7270.80.6150.87MLP-test0.5530.5840.4515 - 0.71670.720.50.3160.848KNN-train0.6830.8050.7353 - 0.87380.8750.5850.5190.902KNN-val0.6110.6440.4288 - 0.85850.8180.520.4290.867KNN-test0.3880.5340.4188 - 0.64830.920.2180.2740.895LightGBM-train0.7040.6850.6027 - 0.76700.6250.7450.5560.795LightGBM-val0.6670.6070.4309 - 0.78370.4550.760.4550.76LightGBM-test0.2430.4930.3862 - 0.6005100.2430 The comparison of the habitat model across different machine learning algorithms Table 3Diagnostic performance of all modelsModelAccuracyAUC95% CISensitivitySpecificityPPVNPVINTRA-training0.6830.760.6779 - 0.84160.8330.6060.5190.877Peri1mm-training0.8240.8440.7761 - 0.91100.7080.8830.7560.856Peri2mm-training0.7890.80.7227 - 0.87700.6460.8620.7050.827Habitat-training0.7680.8480.7820 - 0.91480.8750.7130.6090.918HabitatPeri1-training0.8450.8810.8229 - 0.93820.7080.9150.810.86HabitatPeri2-training0.8240.8760.8155 - 0.93670.7710.8510.7250.879Clinic-training0.4440.5460.4759 - 0.61670.8960.2130.3680.8INTRA-validation0.6940.6980.4972 - 0.89920.8180.640.50.889Peri1mm-validation0.8060.7640.5657 - 0.96160.7270.840.6670.875Peri2mm-validation0.5280.5930.3928 - 0.79270.9090.360.3850.9Habitat-validation0.7780.760.5739 - 0.94610.7270.80.6150.87HabitatPeri1-validation0.8330.7930.6003 - 0.98520.8180.840.6920.913HabitatPeri2-validation0.8610.8040.6163 - 0.99100.6360.960.8750.857Clinic-validation0.6390.4950.3013 - 0.68780.1820.840.3330.7INTRA-testing0.6310.4840.3453 - 0.62190.360.7180.290.778Peri1mm-testing0.6410.7110.6025 - 0.81900.760.6030.380.887Peri2mm-testing0.5150.6810.5714 - 0.78960.960.3720.3290.967Habitat-testing0.5530.5840.4515 - 0.71670.720.50.3160.848HabitatPeri1-testing0.7180.7630.6647 - 0.86150.720.7180.450.889HabitatPeri2-testing0.5630.6790.5710 - 0.78700.920.4490.3480.946Clinic-testing0.2910.5280.4274 - 0.629510.0640.2551 Diagnostic performance of all models The performance of all models in the training cohort, validation cohort, and testing cohort. The AUC, and DCA of all models in the training cohort (a, d), the validation cohort (b, e), and the testing cohort (c, f). AUC, area under the receiver operating characteristic curve; DCA, decision curve analysis In the training cohort, the habitat model yielded an AUC of 0.848 (95% CI: 0.782–0.915), demonstrating superior diagnostic performance compared to the traditional intratumoral radiomics model. The peritumoral 1 mm model achieved an AUC of 0.844 (95% CI: 0.776–0.911), outperforming the peritumoral 2 mm model. The combination of the habitat model and the peritumoral 1 mm model resulted in an AUC of 0.881 (95% CI: 0.823–0.938), which represented the best diagnostic performance among all models evaluated. Figure 6 displays the AUC curves, decision curve analysis (DCA) plots, and calibration curves for the aforementioned models across the training, validation, and testing cohorts. The standard deviation across five-fold cross-validation was 0.025, demonstrating the stability of the model. For details, please refer to the attached document (Appendix 6). Finally, a combined model was developed by incorporating the clinical predictors into the HabitatPeri1 model. This comprehensive combined model achieved AUC values of 0.885, 0.789, and 0.763 in the training, validation, and testing cohorts, respectively. Figure 7 summarizes the AUC and DCA plots for this combined model. As shown in Fig. 7d–f, the net benefit curve of our combined model lies above both the “treat all” and “treat none” curves across a wide range of clinically relevant threshold probabilities in all three cohorts. This indicates that using the model to guide treatment decisions would yield greater net benefit than either default strategy for any threshold within this range. For instance, in the training cohort, the net benefit curve of our combined model remained above the “treat none” curve across a wide range of threshold probabilities (0.01–0.99), demonstrating the clinical utility of the model. Furthermore, compared with the “treat all” strategy, the combined model exhibited superior performance across most clinically relevant threshold ranges, except at very low threshold probabilities where the two curves converged. Details regarding the threshold ranges for the remaining models are provided in the Appendix 7. SHAP provided a quantitative explanation for the HabitatPeri1 model. Through SHAP summary plots (Fig. 8a), a concise visual representation was provided by displaying the range and distribution of each feature’s contribution to the model output, while also correlating feature values with their corresponding impact. Features were arranged in descending order of global importance. Each dot—representing the SHAP value of a feature for an individual patient—was distributed horizontally and stacked vertically to illustrate density. Additionally, dots were color-coded based on the original feature value, ranging from low (blue) to high (red). The force plot (Fig. 8b and c) could interpret the assessment of a single patient. It visualized the SHAP value of a feature as a force to increase or decrease the assessment, and every prediction began with the base value (0.35), which was the average SHAP value of all predictions. The arrow’s length accounted for how much (in percentage) a particular feature contributed to the SHAP value. The arrow’s color represented whether the contributions were positive (red) or negative (blue). The performance of Clinic, HabitatPeri1 and Combined models in the training cohort, validation cohort, and testing cohort. The AUC, and DCA of Clinic, HabitatPeri1 and Combined models in the training cohort (a, d), the validation cohort (b, e), and the testing cohort (c, f). AUC, area under the receiver operating characteristic curve; DCA, decision curve analysis SHAP summary plots of the HabitatPeri1 model (Fig. 8a). The plot illustrated the feature relevance and combined feature attributions to the model’s predictive performance. SHAP force plots illustrate how the model distinguishes between the treatment responses of two representative patients: patient 1 (Fig. 8b, classified as a responder) and patient 2 (Fig. 8c, classified as a non-responder). For instance, low feature value of square_firstorder_Kurtosis_h3 contributed to the increase in the assessment probability of the responding group. Patient 2 had a square_firstorder_Kurtosis_h3 value of 0.3945, while a lower square_firstorder_Kurtosis_h3 value of patient 1 (− 0.7164) contributed to assessing the responding group To rigorously evaluate the added value of clinical variables, we performed pairwise DeLong tests comparing the AUCs of the HabitatPeri1 model and the Combined model across the training, validation, and test cohorts. The DeLong test showed that the addition of the clinical model did not significantly improve the predictive performance of the combined model (Fig. 9). Delong test p-values for clinic, HabitatPeril, and combined models in the training, validation, and test cohorts Discussion Based on the HabitatPeri1 features, we developed three machine learning models—MLP, K-Nearest Neighbors (KNN), and Light Gradient Boosting Machine (LightGBM)—with their detailed performance metrics provided in the Supplementary Materials. Among the radiomics models evaluated, the HabitatPeri1 model demonstrated the best performance when constructed using the Multilayer Perceptron (MLP) classifier. In the training cohort, MLP achieved the highest AUC of 0.881, with a standard deviation of 0.025 across five-fold cross-validation, indicating excellent model stability. Calibration analysis further revealed that MLP yielded the lowest Brier score (Brier Score = 0.14), confirming the reliability of its predicted probabilities (Appendix 8). On the external validation cohort, MLP maintained an AUC of 0.763, demonstrating superior cross-center generalizability compared to the other algorithms. Collectively, MLP achieved the optimal balance among discriminative performance, stability, calibration, and generalizability, making it the most appropriate choice for final model construction. Despite the promising performance of our combined model, we acknowledge methodological concerns regarding the high dimensionality of the initial feature space relative to the sample size. We acknowledge that extracting over 6,000 features from 281 patients raises concerns about overfitting. To mitigate this risk, we implemented an aggressive multi-stage feature selection pipeline: features with low reproducibility (ICC < 0.75) were discarded, followed by univariate screening (p < 0.05), removal of highly correlated features (|r| > 0.9), and LASSO regression with 10-fold cross-validation. This reduced the feature count to fewer than 30 in the final model, substantially lowering overfitting risk. We relied on an independent external validation cohort (Tianjin, n = 103) untouched during training. The model achieved an AUC of 0.763 on this cohort, indicating that selected features capture genuine biological signals rather than center-specific noise. Additional evidence against severe overfitting includes the modest training-external testing AUC gap (Delong, p = 0.11, Appendix 9), stable repeated cross-validation (mean AUC 0.730, SD 0.025). Nonetheless, residual overfitting to center-specific features cannot be entirely excluded, and future studies should consider nested cross-validation to further enhance reproducibility. We acknowledge that inter-scanner variability between the two participating centers represents a potential confounding factor in this multi-center radiomics study. While we did not apply any feature harmonization methods, we implemented several rigorous image preprocessing steps in accordance with the Image Biomarker Standardization Initiative (IBSI) guidelines to mitigate scanner-related differences. These included isotropic voxel resampling (1 × 1 × 1 mm³), Z-score intensity normalization, and feature reproducibility filtering (retaining only features with ICC ≥ 0.75). Nonetheless, residual scanner-related effects cannot be entirely excluded, and we have added this as a limitation. Future prospective studies with standardized imaging protocols across centers or the application of feature harmonization in larger multi-center cohorts are warranted to further validate and potentially improve model generalizability. A combined model was developed by incorporating the clinical predictors into the HabitatPeri1 model. The multiparametric model demonstrated favorable and robust performance across the training, internal validation, and external validation cohorts, outperforming models based on any single dimension alone. These results validate our core hypothesis: integrating multidimensional information reflecting intratumoral spatial heterogeneity, peritumoral microenvironment status, and macroscopic disease characteristics provides a more comprehensive characterization of tumor biology, thereby enabling more accurate prediction of NACI efficacy. Given sample size considerations, we merged the original four-stage classification into two clinically meaningful subgroups: early stage (stages I and II) and advanced stage (stages III and IV). In the training cohort, the combined model achieved AUCs of 0.91 and 0.85 for early- and advanced-stage patients, respectively, with no statistically significant difference (DeLong test, p = 0.54). This finding was mirrored in the test cohort (early-stage AUC 0.70 vs. advanced-stage AUC 0.78, p = 0.52). Detailed data are provided in the Appendix 10. These findings suggest that the model’s predictive performance does not differ significantly across clinical stages, despite imbalances in cohort composition. However, we acknowledge that subgroup analysis cannot completely eliminate the potential for residual confounding. Future prospective studies with larger, more balanced cohorts and standardized treatment protocols are warranted to further validate the model’s generalizability across diverse clinical settings. The advent of the neoadjuvant therapy era, particularly with the introduction of immune checkpoint inhibitors, has brought new therapeutic hope for LAGC patients, yet it also highlights the challenge of significant interpatient heterogeneity in treatment response [17]. A considerable proportion of patients fail to benefit from intensive combination therapy while still enduring its associated toxicities [18]. Therefore, developing tools capable of accurately identifying potential responders before treatment initiation is of paramount importance. Conventional CT evaluation (e.g., RECIST 1.1 criteria) demonstrates clear limitations in assessing pathological response to neoadjuvant therapy in gastric cancer [19]. Radiomics, through high-throughput extraction of image features, offers a novel approach to quantify tumor heterogeneity. However, prior studies have predominantly focused on single regions (intratumoral or peritumoral) or single feature types (e.g., handcrafted or deep learning features), without fully exploring tumor heterogeneity. The primary innovation of this study lies in the introduction of intratumoral habitat analysis. This concept originates from the fact that tumors contain subregions with distinct biological properties [20]. Tumor spatial heterogeneity relates to the varying characteristics and distribution of cells and tissues within the tumor [21]. Tumors are heterogeneous entities composed of diverse cell types, such as tumor cells, vasculature, immune cells, and fibrous tissue [22]. This heterogeneity profoundly influences tumor therapy, as tumor cells in different regions may exhibit varying sensitivities to therapeutic agents [23]. Firstly, this study utilized imaging to analyze the internal microscopic presentation of tumors and explore the spatial manifestation of tumor heterogeneity. An unsupervised K-means clustering method was employed to partition the tumor into three subregions, which may correspond to different microenvironmental states [24]. Analysis of the spatial distribution of each cluster revealed that Habitat 1 voxels were predominantly located in the central portion of the tumor, representing hypovascular areas that exhibited resistance to therapy [25, 26]. Habitat 2 voxels constituted the main tumor mass, distributed throughout the lesion but excluding the central core and the extreme periphery, thereby constituting the solid tumor component [25]. Habitat 3 voxels were concentrated at the tumor periphery, directly adjacent to the peritumoral region, often representing the invasive edge of the tumor [9, 27]. This region is enriched with tertiary lymphoid structures and may predict response to immunotherapy [28]. Leveraging these quantified data to understand tumor heterogeneity aids in tumor diagnosis, classification, grading, and assessment of treatment response, thereby assisting clinicians in devising personalized treatment strategies [21]. Our work extends this promising analytical approach to the context of NACI in gastric cancer. Secondly, pathology studies have demonstrated that the most significant immune activity in gastric cancer occurs precisely at the tumor periphery—the invasive margin. The invasive margin is defined as extending 2.5 mm into the intratumoral region and 2.5 mm beyond the extratumoral boundary, thereby comprising a 5 mm-wide zone centered on the tumor boundary [28]. Our 1 mm peritumoral region lies entirely within this immunologically active zone. The inclusion of a 2 mm peritumoral region was primarily for comparative purposes. The key question was whether extending beyond the immediate immune-rich zone captures additional useful information or merely incorporates irrelevant stromal tissue. The findings were unequivocal: the 1 mm model consistently outperformed the 2 mm model across all evaluations (training AUC: 0.844 vs. 0.800; validation AUC: 0.764 vs. 0.593; test AUC: 0.711 vs. 0.681). This result is biologically coherent—beyond 1 mm, the region increasingly comprises fibroblasts and connective tissue, which “dilutes” the immune signal. Thirdly, the biological continuity between Habitat 3 (the intratumoral invasive edge) and the peritumoral 1 mm region (the extratumoral microenvironment) provides a compelling explanation for the synergistic performance of our combined HabitatPeri1 model. These two image-derived compartments are not independent; rather, they represent two sides of the same biological boundary. This conceptual advance moves beyond purely statistical feature fusion and grounds our multiparametric model in tumor biology. We systematically extracted and analyzed conventional radiomics features from a peritumoral 1-mm region. The peritumoral region represents the interface where tumor and host interact, harboring critical information regarding immune infiltration, angiogenesis, and connective tissue response [29]. One study indicated that peritumoral CT texture features are associated with the microsatellite instability status in gastric cancer, which is an important predictor of immunotherapy efficacy [30, 31]. In the present study, the peritumoral 1-mm radiomics model showed superior predictive value compared to a 2-mm model. The habitat model alone achieved AUCs of 0.848, 0.760, and 0.584 in the training, validation, and testing cohorts, respectively. When habitat features were combined with peritumoral 1-mm features, the AUCs improved to 0.881, 0.793, and 0.763, respectively, indicating enhanced predictive capability. This confirms that peritumoral radiomic features can provide complementary information regarding the tumor microenvironment, aiding in the assessment of response to NACI. Fourthly, we incorporated key clinical characteristics, such as clinical T stage and tumor location, into the model. These features form the basis for guiding clinical staging and therapeutic decision-making in gastric cancer. Although their individual capacity to predict NACI response is limited, the combined model demonstrates a wider range of positive net benefit in decision curve analysis than the HabitatPeri1 model and provides essential clinical context and a baseline for imaging-based models. Therefore, despite the suboptimal predictive performance of the clinical model, we incorporated it into the final model to better align with real-world clinical workflows. Fifthly, model explainability is increasingly recognized as a prerequisite for the clinical translation of machine learning-based predictive tools. Without interpretable outputs, even highly accurate models are unlikely to gain acceptance among clinicians, who must understand the rationale behind a prediction before integrating it into treatment decisions. Explainability builds trust by demonstrating that the model relies on clinically and biologically plausible features, enables verification against established pathophysiological knowledge, and directly supports personalized decision-making by revealing why a particular patient is predicted to respond or not respond to therapy. In the present study, SHAP analysis was employed to provide both global feature importance rankings and patient-level explanations, thereby moving beyond a “black box” model and facilitating clinical interpretation. Currently, tumor regression grade (TRG) assessed on postoperative pathological specimens is a reliable indicator of prognosis in gastric cancer [32]. However, TRG can only be determined postoperatively, which may delay timely adjustments to treatment plans and cannot serve as a guide for therapy. Therefore, accurately predicting pathological response to NACI before treatment is highly significant for enhancing personalized treatment and clinical decision-making in patients with advanced gastric cancer. The potential significance of our study lies in demonstrating that CT-based radiomic features are associated with pathological response to NACI. If confirmed in prospective studies, such a model could eventually provide preoperative information to inform clinical decision-making. For patients predicted as responders (high probability of TRG 0–1), the model supports confidence in completing the planned regimen to maximize therapeutic benefit. For those predicted as non-responders, the model signals a high likelihood of treatment futility, prompting early consideration of alternative strategies—such as regimen modification (e.g., changing chemotherapy backbone or combining with anti-angiogenic agents), intensified monitoring with early re-imaging, or proceeding directly to surgery to avoid unnecessary toxicity and delay of curative resection. The model outputs a continuous probability of response. Although the optimal threshold of 0.28 in this study was determined by the Youden index to balance sensitivity and specificity, this cutoff can be adjusted according to clinical priorities (Appendix 11). For example, a lower threshold may be chosen to maximize sensitivity when the goal is to avoid futile treatment, whereas a higher threshold may be preferred to identify a highly selected group of likely responders for clinical trials. However, given the retrospective nature of this analysis, these associations require prospective validation before any clinical implementation. Ultimately, whether such a model can contribute to personalized treatment strategies and potentially improve therapeutic efficacy remains to be tested in future prospective trials. Conclusion In summary, this study constructed and validated a multiparametric model integrating intratumoral habitat, peritumoral 1-mm radiomics, and clinical features for the preoperative prediction of pathological response to NACI in LAGC patients. The key innovation of this study lies in the synergistic combination of two complementary imaging dimensions: habitat analysis, which captures the spatial heterogeneity of distinct intratumoral microenvironments (central core, proliferative tumor body, and invasive margin), and peritumoral radiomics, which quantifies the tumor-host interface critical for immunotherapy response. This multidimensional approach outperformed models based on any single component alone, demonstrating that tumor biology relevant to NACI response is distributed across both intra and peritumoral compartments. If validated prospectively, the model could have potential clinical implications as a non-invasive, pre-treatment risk stratification tool. It may help identify patients whose imaging phenotype is associated with poor response to NACI, who might be considered for alternative therapeutic approaches in future clinical trials. However, we emphasize that these are associative findings from a retrospective study; the model’s ability to prospectively guide treatment decisions and improve outcomes requires rigorous evaluation in randomized controlled trials. At present, the model should be viewed as a research tool that demonstrates proof-of-concept for imaging-based prediction of NACI response. Limitations This study has an important limitation that should be acknowledged. we did not compare our imaging-based model with established molecular biomarkers such as PD-L1 expression or microsatellite instability (MSI) status. These data were not systematically available in our retrospective cohorts, as biomarker testing was not part of the routine clinical workflow during the study period. Consequently, we were unable to perform a comparison or build a combined molecular-imaging model. This limitation restricts the direct positioning of our model within existing biomarker-guided clinical decision frameworks and leaves its standalone clinical utility incompletely assessed. The intended role of our model is therefore as a complementary, non-invasive tool that may provide additional phenotypic information, especially in settings where biopsy-based markers are unavailable or provide incomplete information. Future prospective studies with comprehensive biomarker profiling are warranted to directly compare radiomics with established biomarkers and, importantly, to explore their combined predictive value. A further methodological limitation concerns the internal validation strategy. More rigorous approaches, such as nested cross-validation or repeated resampling, were not implemented. These methods provide a less biased estimate of generalization performance by fully separating model selection from model evaluation. The absence of such strategies means that some degree of optimism may remain in the reported internal validation metrics. Although the consistent performance on the external test set partially mitigates this concern, we acknowledge that future studies should incorporate nested cross-validation or repeated resampling to further substantiate model stability and generalizability. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1: Appendix 1. The 19 features employed for habitat analysis Supplementary Material 2: Appendix 2. Univariate and multivariate analyses of baseline characteristics were performed to compare the response and non-response groups Supplementary Material 3: Appendix 3. Calinski-Harabasz scores plot to determine the op timal number of clustering Supplementary Material 4: Appendix 4. (a) the intratumoral region: the coefficients for cross-validation of LASSO regression, the MSE of LASSO regression, Selected features weight coefficients. (b) the peritumoral 1 mm region: the coefficients for cross-validation of LASSO regression, the MSE of LASSO regression, Selected features weight coefficients. (c) the peritumoral 2 mm region: the coefficients for cross-validation of LASSO regression, the MSE of LASSO regression, Selected features weight coefficients Supplementary Material 5: Appendix 5. Comparative Performance of MLP, KNN, and LightGBM Classifiers Across Six Feature Combinations in the Training, Validation, and Test Cohorts Supplementary Material 6: Appendix 6. Five-fold cross-validation results Supplementary Material 7: Appendix 7. Net Benefit Analysis Across Threshold Probabilities for Models (Clinic, HabitatPeri1 and Combined) in the Training, Validation, and Test Cohorts Supplementary Material 8: Appendix 8. Model Calibration Performance (Brier Scores) Supplementary Material 9: Appendix 9. DeLong test for comparing AUCs between the training and validation cohorts Supplementary Material 10: Appendix 10. Subgroup analysis stratified by clinical stage Supplementary Material 11: Appendix 11. The optimal threshold for the combined model determined by the Youden index Acknowledgements Not applicable. Abbreviations Gastric Cancer Neoadjuvant Chemotherapy Neoadjuvant Chemotherapy combined with Immunotherapy Programmed Cell Death Protein 1 Programmed Cell Death Ligand 1 Contrast-Enhanced Computed Tomography Computed Tomography Region of Interest Intra-class Correlation Coefficient Gray-Level Co-occurrence Matrix Gray-Level Dependence Matrix Gray-Level Run Length Matrix Gray-Level Size Zone Matrix Neighborhood Gray-Tone Difference Matrix Least Absolute Shrinkage and Selection Operator Multilayer Perceptron K-Nearest Neighbors Light Gradient Boosting Machine Area Under the Curve Receiver Operating Characteristic Decision Curve Analysis Tumor Regression Grade Locally Advanced Gastric Cancer Author contributions [KDR]: Conceptualization, Methodology, Writing - Original Draft, Supervision. [RCJ]: Software, Formal analysis, Data Curation, Visualization. [HY]: Investigation, Resources, Validation. [CXY]: Investigation, Data Collection, Writing - Review & Editing. All authors have read and approved the final manuscript. Funding The authors state that this work has not received any funding. Data availability The following materials are available from the corresponding author upon reasonable request: radiomic features, preprocessing workflows, and trained models. These materials enable independent reproduction of the key analytical steps and validation of the reported results. Declarations Ethics approval and consent to participate This study was approved by our Institutional Review Board, and the requirement for informed consent was waived (Approval No: SDTHEC20251102). The study was conducted in accordance with the revised guidelines of the Declaration of Helsinki (2013). Consent for publication Not applicable. Competing interests The authors declare that they have no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Chenjiao Ran and Xinyu Chen contributed equally to this work and should be considered shared first authors. References Associated Data Supplementary Materials Supplementary Material 1: Appendix 1. The 19 features employed for habitat analysis Supplementary Material 2: Appendix 2. Univariate and multivariate analyses of baseline characteristics were performed to compare the response and non-response groups Supplementary Material 3: Appendix 3. Calinski-Harabasz scores plot to determine the op timal number of clustering Supplementary Material 4: Appendix 4. (a) the intratumoral region: the coefficients for cross-validation of LASSO regression, the MSE of LASSO regression, Selected features weight coefficients. (b) the peritumoral 1 mm region: the coefficients for cross-validation of LASSO regression, the MSE of LASSO regression, Selected features weight coefficients. (c) the peritumoral 2 mm region: the coefficients for cross-validation of LASSO regression, the MSE of LASSO regression, Selected features weight coefficients Supplementary Material 5: Appendix 5. Comparative Performance of MLP, KNN, and LightGBM Classifiers Across Six Feature Combinations in the Training, Validation, and Test Cohorts Supplementary Material 6: Appendix 6. Five-fold cross-validation results Supplementary Material 7: Appendix 7. Net Benefit Analysis Across Threshold Probabilities for Models (Clinic, HabitatPeri1 and Combined) in the Training, Validation, and Test Cohorts Supplementary Material 8: Appendix 8. Model Calibration Performance (Brier Scores) Supplementary Material 9: Appendix 9. DeLong test for comparing AUCs between the training and validation cohorts Supplementary Material 10: Appendix 10. Subgroup analysis stratified by clinical stage Supplementary Material 11: Appendix 11. The optimal threshold for the combined model determined by the Youden index Data Availability Statement The following materials are available from the corresponding author upon reasonable request: radiomic features, preprocessing workflows, and trained models. These materials enable independent reproduction of the key analytical steps and validation of the reported results.