Background

Colorectal cancer (CRC) significantly impacts both survival and quality of life worldwide. According to the International Agency for Research on Cancer (IARC), CRC ranks third among all cancers in terms of incidence, with approximately 1.8 million new cases annually, and is the second leading cause of cancer-related deaths [1, 2]. About 60% of CRC patients undergo permanent colostomy (PC) surgery [3]. Parastomal hernia (PSH) is a common complication where intra-abdominal tissue protrudes around the stoma site, occurring in about 30% of cases within 1 year post-surgery. This incidence increases to approximately 42% three years after operation [4]. PSH can lead to various issues such as abdominal pain and distension, fecal water leakage, and skin ulceration. These symptoms not only reduce social engagement but also increase economic burdens and cause significant physical and mental pains. Moreover, around 15% of patients with PSH may develop serious complications like incarceration, intestinal obstruction, or intestinal perforation [5]. Surgical repair of PSH remains challenging with current methods like Keyhole, Sugarbaker, and Sandwich, which still see recurrence rates exceeding 30% [6].

Colostomy maintenance is predominantly overseen by nurses, emphasizing preventive nursing practices over reactionary treatments or surgical interventions, which aligns with the high-quality nursing principles [7]. Early identification of high-risk patients is crucial for implementing effective preventive care strategies, thereby enhancing stoma care quality. At present, there is a deficiency in effective prediction tools or scoring sheets for guiding nursing practice in managing PSH. The pathogenic mechanism of PSH is complex, involving factors such as disease status, stoma, and operation conditions. It involves multiple pathophysiological mechanisms and the predictive efficacy by a single index is insufficient. Therefore, constructing a prediction model using multi-dimensional indicators is more aligned with the needs of stoma care. Lopez-Cano M et al. conducted a meta-analysis to evaluate the effectiveness of prophylactic mesh in preventing post-colostomy PSH, highlighting both its potential benefits and risks [8]. They employed a rigorous statistical method to aggregate data from multiple studies, finding that while prophylactic meshes significantly reduced the incidence of PSH, there was also an increased risk of mesh-related complications. Donahue TF et al. investigated risk factors for parastomal hernias following radical cystectomy to help physicians better manage this complication [9]. Using a retrospective cohort study design, they identified several key risk factors such as age, BMI, and stomal location, which could inform targeted preventive strategies. Funahashi K et al. analyzed risk factors for PSH in Japanese patients undergoing permanent colostomy, focusing on identifying effective preventive measures [10]. Their case-control study revealed that patient-specific factors like abdominal adiposity and ostomy-related factors such as the size of the fascial opening were critical in determining PSH risk. Liu H et al. developed a nomogram model for predicting PSH risk, offering clinicians a valuable assessment tool [11]. This model, based on machine learning techniques, demonstrated superior predictive accuracy compared to traditional risk assessment methods and has the potential to be further enhanced with more extensive data.

Despite these advancements, there remains a compelling case for the continued application of machine learning (ML) approaches in predicting and managing PSH. The existing literature has shown promising results with ML models, particularly in enhancing predictive accuracy and personalizing patient care. However, limitations such as dataset size and model generalizability suggest that further exploration with more extensive and diverse datasets could lead to even more accurate and robust predictions. Moreover, the incorporation of recent ML innovations might unlock new pathways for preventing and managing PSH, underlining the potential value of continued research in this domain. ML is an advanced artificial intelligence technique designed for data processing. Unlike traditional statistical methods, ML excels in handling complex datasets associated with intricate disease mechanisms, incorporating numerous candidate parameters. These datasets often exhibit challenges like multicollinearity, interaction effects, nonlinear parameter relationships and outcome events, and intermediary effects with outcome events [12]. Methodologically, ML aligns with the characteristics of PSH and possesses a certain level of sophistication. At present, the application of ML algorithms remains relatively limited in nursing research, especially as a primary method for studying risk prediction of PSH after permanent colostomy surgery, with scarce existing literature indicating potential for major innovations.

Therefore, this study aims to utilize perioperative clinical indicators as a basis, employ ML algorithms for data screening, and establish an effective multidimensional model for predicting PSH risk. This endeavor seeks to enhance the quality and efficiency of ostomy care, provide early identification of high-risk patients, and support the development of preventive care strategies for timely intervention.

Materials and methods

General information

This retrospective case-control analysis included 495 patients with permanent colostomies who underwent surgical treatment at the Second Affiliated Hospital of Anhui Medical University from June 2017 to June 2023, with a one-year follow-up period. The latest patient surgery inclusion was in May 2022. All participants had complete one-year follow-up records at the colostomy outpatient clinic (Fig. 1). This study received approval from the Ethics Committee of the Second Affiliated Hospital of Anhui Medical University (YX2023-003).

Fig. 1
figure 1

Flowchart of case data collection

Inclusion and exclusion criteria

Inclusion criteria: ①Patients who were diagnosed with colorectal cancer for the first time and underwent permanent colostomy surgery; ②Patients with no prior history of colostomy surgery; ③Age ≥ 18 years.

Exclusion criteria: ①Incomplete baseline data; ②Lack of complete one-year follow-up data post-surgery; ③Subsequent ileostomy or colostomy revision surgery unrelated to specified reasons; ④Presence of severe infection, septic shock, severe postoperative bleeding or hemorrhagic shock, severe postoperative heart failure or cardiogenic shock, active phases of hematological and rheumatic autoimmune diseases during the postoperative period.

Sample size estimation

In this study, we aimed to construct a nomogram using the top 10 ranked variables in the model. According to literature on PSH incidence [4], a minimum of 334 patients must be included to adhere to the Events Per Variable (EPV) principle for predictive model studies [13]. Ultimately, our study included a total of 495 cases, meeting the required sample size criteria.

Diagnostic methods

The diagnosis of CRC diagnosis was based on the 2021 guidelines from the Chinese Society of Clinical Oncology (CSCO) for the diagnosis and treatment of CRC. tumor node metastasis (TNM) staging was assessed according to the eighth edition of the American Joint Committee on Cancer (AJCC) staging system. PSH was diagnosed by a full-time Enterostomal Therapist (ET) following the 2017 European Society of Hernia guidelines, using physical examination (Valsalva maneuver) combined with abdominal computed tomography (CT).

Included variables

In this study, data collection took place around the perioperative period, and a total of 48 clinical indicators were gathered from patients through literature review, expert guidance, and other sources. These include: ①Demographic and medical history data: gender, age, body mass index (BMI), smoking history, drinking history, hypertension history, diabetes history, chronic obstructive pulmonary disease (COPD) history, heart failure (HF) history, abdominal surgery history, and constipation history; ②Clinical data: cause of disease, subcutaneous fat thickness (SFT), thickness of rectus abdominis muscle (TRAM), long-term hormone use, postoperative blood transfusion, American Society of Anesthesiologists physical status classification (ASA), nutritional risk screening 2002 (NRS2002), Barthel Index (BI), neoadjuvant chemotherapy (NACT), tumor node metastasis (TNM) staging, and postoperative incision infection; ③Operation and stoma characteristics: timing of operation, operation method, operation type, operation duration, preoperative stoma localization (PSL), stoma route, stoma site, stoma diameter, and stoma venting time; ④Auxiliary examination data (before surgery): C-reactive protein (CRP), hemoglobin (HB), alanine transaminase (ALT), aspartate aminotransferase (AST), total bilirubin (TBIL), creatinine (Cr), blood urea nitrogen (BUN), prealbumin (PAB), albumin (ALB), glycosylated hemoglobin (HBA1c), creatine kinase (CK), total cholesterol (TC), triglyceride (TG), uric acid (UA), low-density lipoprotein cholesterol (LDL-C), carcinoembryonic antigen (CEA), and carbohydrate antigen 199 (CA-199).

Data processing

(1) Since no variable had more than 25% missing values after inclusion andexclusion, all 48 variables were retained. The remaining missing values (limited to continuous variables) were imputed using multiple imputation (MI). (2) Based on follow-up records, the included cases were categorized into the PSH group and the Non-PSH group depending on whether PSH occurred within 1 year after the operation. (3) Ordinal variables were ranked in order, while binary and multivariate variables were assigned based on the current situation [14, 15] (Tables 1 and 2). (4) The dataset was split into a training set and a test set using a 70:30 ratio, with the training set utilized for constructing different ML algorithm models. (5) The training set variables underwent initial screening to exclude collinearity using a 10-fold cross-validation with the Least Absolute Selection and Shrinkage Operator (LASSO). (6) Utilizing the training dataset, predictive models for PSH were developed employing four machine learning algorithms: Logistic Regression (LR), Support Vector Classification (SVC), K-Nearest Neighbors (KNN), Random Forest (RF), Light Gradient Boosting Machine (LGBM), and Extreme Gradient Boosting (XgBoost). Hyperparameter optimization of the models was conducted using 5-fold cross-validation. (7) The test set was utilized for model validation, and the optimal algorithm model was selected to evaluate the predictive efficacy using metrics such as Area Under Curve (AUC), specificity (SPE), sensitivity (SEN), accuracy (ACC), positive predictive value (PPV), negative predictive value (NPV) and F1-score. Clinical applicability was evaluated using decision curve analysis (DCA). (8) Shapley additive explanation (SHAP) was used for explanatory analysis of model variables and attribution analysis of individual-level effects. (9) Using the training set, a nomogram was constructed featuring the top 10 predictor variables from the model as evaluation metrics. This nomogram served as a tool for quantitatively visualize the risk of PSH.

Table 1 Assignment table of dichotomous and multivariate variables
Table 2 Assignment of ordinal variables

Statistical analysis

Descriptive statistics were performed using SPSS 25.0. Continuous variables, which were not normally distributed, are presented as median (quartile). The Mann-Whitney U test was utilized for their comparison. Categorical variables are represented as counts (percentages %) and were compared using the chi-square test. A two-tailed P-value of less than 0.05 was considered statistically significant. Multiple data imputation was performed using SPSS 25.0, followed by LASSO regression analysis using the Glmnet package in the R. ML model establishment, ROC curve plotting, and DCA curve plotting were carried out using Python 3.10, and the Scikit-learn package (https://scikit-learn.org). Variable importance and ranking in the predictive model were quantified using SHAP. The direction of impact of variables on the outcome event was determined based on SHAP values, and individual-level visual explanations were generated. A nomogram was created using the RMS package in R.

Results

Screening of variables

495 patients were ultimately included in the study, with a total of 48 variables, and no variables were excluded, leaving 48 variables in total. Among them, 144 (29.1%) developed PSH within one year after the operation. The training dataset underwent preliminary variable selection using LASSO regression with 10-fold cross-validation. When λ equaled 0.0171, 23 optimal predictive variables were identified. These variables are BMI, TNM staging, ASA classification, history of diabetes, history and status of COPD, history of constipation, NRS2002, operation duration, stoma route, stoma site, stoma diameter, stoma venting time, timing of operation, TBIL, CRP, TC, TG, HBA1c, LDL-C, SFT, TRAM, ALB, and PAB (Fig. 2A and B).

Fig. 2
figure 2

A) LASSO regression coefficient plot. B) LASSO regression subset selection plot

Model performance comparison

The RF prediction model demonstrated superior performance across various metrics in the study, achieving an AUC of 0.888 (95% CI: 0.881–0.935), SEN of 0.851, SPE of 0.804, ACC of 0.819, PPV of 0.921, NPV of 0.667, and F1-score of 0.813. In a comprehensive analysis, it could be concluded that the RF model exhibited the best predictive performance (Fig. 3; Table 3). DCA further supported the RF model’s efficacy by demonstrating the highest net benefit across different risk probability thresholds. Specifically, the RF model demonstrated the highest net benefit within the threshold probability range of 0.30 to 0.95 (Fig. 4). Therefore, RF was selected as the optimal algorithm for constructing the PSH prediction model.

Fig. 3
figure 3

ROC curves for LR, KNN, RF, SVC, LGBM, and XgBoost models

Table 3 Performance parameters of different machine learning algorithms for constructing predictive models
Fig. 4
figure 4

DCA curves for LR, KNN, RF, SVC, LGBM, and XgBoost models

Random forest algorithm setup

A total of 100 decision trees were employed to construct the Random Forest (RF) classifier model. Information entropy was utilized as the criterion for splitting, and to prevent overfitting, a maximum tree depth of 7 was imposed. Ensuring a balance between model complexity and performance, each tree required a minimum of 2 samples per node to undergo splitting.

Interpretation of prediction model

①The SHAP bar plot, based on mean SHAP mean values, displayed the average impact magnitude of variables on the model output, ranked in descending order (Fig. 5). The top 10 variables influencing the prediction of PSH included BMI, operation duration, history and status of COPD, PAB, TNM staging, stoma site, TRAM, CRP, ASA classification, and stoma diameter. ②The SHAP waterfall plot, in conjunction with assignment situations, further illustrated the positive or negative associations of variables with the occurrence of PSH. It indicated that BMI, history and status of COPD, TNM staging, CRP level, and ASA classification are positively correlated with PSH. Conversely, operation duration ≤ 4 h, PAB, stoma site (through rectus abdominis muscle), TRAM measurements, and stoma diameter ≤ 30 mm are negatively correlated with PSH (Fig. 6). ③The SHAP Explanatory plot, employing two patient cases, provided detailed insights into how the RF prediction model analyzed individual-level predictive factors for occurrences and non-occurrences of PSH (Fig. 7A and B). In patients who experienced PSH, significant contributing factors included ALB levels at 27.28 g/L, BMI indicating overweight, CRP levels at 6.92 mg/L, TRAM measurements at 1.35 cm, PAB levels at 248.7 mg/L, and TNM stage II. Protective factors were the absence of COPD history and operation duration ≤ 4 h. In patients who did not experience PSH, protective factors included operation duration ≤ 4 h, no history of COPD, TRAM measurements at 1.01 cm, PAB levels at 231.3 mg/L, CRP levels at 5.4 mg/L, stoma site through the rectus abdominis muscle, and a healthy ASA classification. Factors promoting PSH included not being overweight in terms of BMI, stoma diameter > 30 mm, transperitoneal stoma route, and TNM stage II.

Fig. 5
figure 5

SHAP bar plot for variable ranking in the random forest model

Fig. 6
figure 6

SHAP waterfall plot for variables in the random forest model

Fig. 7
figure 7

(A) PSH patients - single-sample SHAP explanatory plot. (B) Non-PSH patients - single-sample SHAP explanatory plot

Predictive model presentation

The top 10 variables were assessed, and the predictive model was quantified using a nomagram to evaluate the risk of PSH in colostomy patients (Fig. 8). Its interpretation is as follows: For a given patient, a vertical line was drawn upwards from the horizontal axis corresponding to each variable, indicating a specific score on the horizontal axis. These scores from all variables were then summed to derive a total score. Subsequently, a vertical line was drawn downwards from this total score to the horizontal axis labeled “Risk Probability,” representing the predicted risk for PSH for that patient.

Fig. 8
figure 8

The nomogram of the PSH risk prediction model

The nomogram included the following variables: BMI, operation duration, COPD history and status, PAB, TNM staging, stoma site, TRAM, CRP, ASA classification, and stoma diameter. Firstly, you can get a specific value for each variable. BMI: 2. Operation duration: 0.5 h. History of COPD. PAB: 300. TNM stage: 2. Stoma position: 0. TRAM: (1) CRP: 5. ASA score: (2) Stoma diameter: 1. Secondly, according to the value of each variable, the integral is found on the corresponding axis. BMI = 2 corresponds to about 25 points. Operation time = 0.5 h corresponds to about 8 points. Have no history of COPD = 0 points. PAB = 300 corresponds to about 15 points. TNM stage = 2 corresponds to about 20 points. Stoma site = 0 is 20 points. TRAM = 1 corresponds to about 15 points. CRP = 5 corresponds to about 24 points. ASA classification = 2 corresponds to about 15 points. stoma diameter = 1 corresponds to 0 points. Then, you add up all the integrals and you get a total of 100. Based on a total score of 142, you find it on the “total score” axis, then corresponding down to the risk probability axis. For example, it might correspond to 0.6, indicating a 60% risk probability.

Discussion

In this study, we analyzed perioperative clinical data from 495 patients with permanent colostomy. Among them, 144 patients developed PSH within 1 year after the operation, resulting in an incidence of 29.1%, which was consistent with previous literature reports. Subsequently, LASSO regression and six machine learning algorithms were employed to analyze the variables. Ultimately, it was determined that the RF-based PSH prediction model exhibited the best performance in terms of predictive efficiency and clinical applicability. This model could effectively identify high-risk PSH patients early, providing significant clinical benefits. SHAP is used as a post-hoc explanation and analysis method for black-box models. It provides an intuitive way to assess the contribution and direction of the impact of variables on outcome events [16]. According to SHAP, the top 10 most important variables influencing PSH included history of COPD, SFT, ALB, BMI, PAB, CRP, stoma diameter, stoma route, TRAM, and operation duration. SHAP waterfall plots demonstrated the positive or negative relationship between these variables and the occurrence of PSH. From a disease perspective, these indicators are theoretically linked to PSH and align with the underlying pathophysiological mechanisms. They are not merely results of statistical analysis but encompass multiple dimensions, including stoma characteristics, nutritional status, medical history, and surgical factors. Together, they significantly enhance predictive accuracy. Moreover, these indicators are easily obtainable in routine nursing practices and do not require special methods or tools, thereby ensuring the clinical applicability of the model. Importantly, some of these indicators can be modified through nursing interventions, enabling the guidance of clinical preventive care plans.

From a methodological perspective, although Logistic Regression remains prominent in predictive modeling research as a traditional method for multifactor analysis, it faces limitations such as suboptimal accuracy, susceptibility to underfitting, and the requirement for linear relationships in data, along with limited capability to handle collinear data [17]. In contrast, machine learning, as a representative technology of artificial intelligence, excels at managing large datasets with complex relationships like collinearity, interactions, and mediation effects. It can effectively screen significant variables from numerous variables to construct more robust and efficient predictive models [18]. Among them, RF stands out as a supervised machine learning algorithm that integrates decision trees with ensemble learning techniques. It achieves higher accuracy by combining predictions from multiple decision trees, each trained on randomly sampled data and variables. This approach effectively mitigates overfitting and enhances classification performance [19, 20]. This study employed machine learning algorithms for data analysis, which is methodologically more advanced compared to traditional statistical methods. Osborne et al. developed a PSH risk assessment scale, which collected data through questionnaire surveys. However, it is essential to acknowledge potential limitations in data authenticity and objectivity [21]. In this study, all included variables were clinical objective indicators, to some extent, mitigating model underfitting due to information bias.

From the analysis of the pathogenic mechanism of PSH, its primary causes include the extent of abdominal wall defect and the intensity of intra-abdominal pressure. In this study, SHAP plots were utilized to rank and display the variables of the RF model based on their contribution levels. Additionally, the relationship between each variable and the outcome event was clarified. Regarding physical and medical history, BMI serves as an indicator used to measure the degree of obesity. Obese patients often exhibit weakened abdominal wall muscles and fascial tissues, resulting in insufficient abdominal wall strength. Subcutaneous fat will increase the longitudinal tension of the abdominal wall, which may result in suture ischemia, liquefaction, and delayed healing. Furthermore, excessive visceral fat deposition can elevate intra-abdominal pressure. Obese patients are prone to fat liquefaction, edema, necrosis secondary infection, and other adverse conditions in the surgical incision. Several studies have demonstrated a corresponding increased risk of postoperative PSH in patients with BMI > 25 kg/m2 [22, 23]. COPD is a respiratory condition characterized by recurrent coughing and wheezing. Frequent coughing and vigorous expectoration can significantly elevate intra-abdominal pressure. Furthermore, COPD, being a catabolic disease often accompanied by malnutrition, resulting in weakened abdominal wall muscles and fascial tissues, which makes surgical incisions less likely to heal. Liu et al. have confirmed that COPD independently increases the risk of PSH [24]. TRAM is directly correlated with PSH occurrence. Thicker rectus abdominis muscles can effectively resist tension around the incision site, thus reducing the extent of abdominal wall defect, buffering intra-abdominal pressure, and preventing herniation of abdominal contents [25].

In terms of disease status, TNM staging of CRC serves as a criterion for evaluating the degree of tumor infiltration and metastasis. Higher TNM stages indicate greater tumor invasion of the intestinal wall and surrounding lymph nodes. Patients with high TNM stage often suffer from severe malnutrition and weakened rectus abdominis due to factors such as intestinal absorption dysfunction, insufficient intake, and cancer cell consumption [26, 27]. Additionally, these patients frequently require more extensive surgical resections and prolonged postoperative chemotherapy. Consequently, patients with high TNM staging of stoma are more susceptible to PSH complications. ASA classification is an indicator used to evaluate the physical condition of CRC patients from the perspective of anesthesia safety. A higher ASA classification denotes poorer nutritional status, reduced activity ability, and other compromised general conditions, as well as an increased likelihood of combined organ dysfunction. Patients with high ASA classifications have diminished tissue repair capabilities, higher rates of stoma infection, poor healing of abdominal wall incisions, and decreased abdominal wall strength, all of which can increase the incidence of PSH [28, 29].

In terms of surgery and stoma conditions, the duration of the operation can reflect the complexity of the procedure, including factors such as intraoperative adhesions, complex tumor structures, and challenges in hemostasis. These complexities can lead to postoperative complications like wound infections and deteriorating postoperative conditions. Prolonged laparoscopic insufflation can damage the abdominal wall, causing aseptic inflammation. Additionally, since stoma creation typically occurs at the end of surgery, extended operation duration can lead to surgeon fatigue, potentially affecting the quality of the stoma. A prospective cohort study by Pennings et al. indicated a significant increase in PSH occurrence within 1 year after surgery for patients whose operation duration exceeded 395 min [5]. The abdominal wall stoma site is usually chosen beside or through the rectus abdominis muscle. Due to the thickness of the rectus abdominis muscle and its easy fixation with the intestinal tract, it can increase the strength of the abdominal wall adjacent to the stoma. Shiraishi et al. demonstrated that the incidence of PSH through rectus abdominis muscle stoma is lower than that beside rectus abdominis muscle stoma [30]. The stoma diameter not only represents the size of the abdominal wall defect, but its enlargement also indicates that the elastic retraction force of the tissue or scar around the stoma is compromised, preventing the maintenance of normal abdominal wall tension. Studies have shown that increased stoma diameter is positively associated with the incidence of PSH [15, 31, 32]. Current guidelines or consensus do not specify an optimal diameter due to the need for patient individualization [4]. However, excessively small stomas can easily lead to postoperative intestinal obstruction and intestinal ischemic necrosis.

In terms of blood test indicators, PAB reflects a patient’s nutritional status. Malnutrition can lead to periwound edema and poor healing, thereby increasing the risk of PSH [9]. Additionally, malnutrition may impair incision granulation tissue formation and weaken muscle fibers around the incision by reducing collagen production [33]. CRP, as an inflammatory marker, indicates elevated levels that may correlate with conditions such as perioperative infections and organ dysfunction. Increased inflammation not only hinders wound recovery but also exacerbates risks associated with colorectal tumor-related intestinal infections and intestinal obstructions, which elevate intra-abdominal pressure and complicate wound healing. Meta-analysis results by Niu et al. highlighted that persistent postoperative inflammation is a risk factor for PSH occurrence [34].

From a preventive nursing perspective, developing scientifically sound and effective nursing measures is crucial in mitigating PSH risks. In this study, SHAP plots were utilized with the RF model to analyze variables and provide individualized presentations. This approach facilitates the development of personalized care plans. Among the top 10 variables with significant impact, BMI, PAB, history and status of COPD, CRP, and TRAM were modifiable through nursing interventions. Additionally, their overall impact surpassed that of the remaining factors. Strengthening preoperative respiratory exercises, advising smoking cessation, enhancing postoperative airway care, performing back patting during position changes, and providing appropriate oxygen therapy can effectively decrease cough frequency, alleviate severity, and enhance expectoration in COPD patients. Implementing scientifically designed exercise plans during the perioperative period and after discharge, alongside appropriate dietary interventions, promotes reduction in body fat, optimal weight management, enhanced nutritional status, and increased rectus abdominis muscle strength. Enhancing preoperative psychological care can reduce patient anxiety and tension, thereby potentially reducing inflammatory responses in the body.

Conclusion

This study developed a predictive model for PSH using machine learning algorithms, elucidating the relevant promoting or protective factors of PSH and their respective impact levels. This approach facilitates early identification of high-risk patients and guides the formulation of preventive care strategies for PSH. However, this study is retrospective and sourced from a single center, thus limiting the strength of its findings and necessitating further prospective validation. Currently, the application of machine learning algorithms in PSH risk prediction models and other nursing research remains exploratory. Nevertheless, within the context of advancing nursing information technology and strengthening interdisciplinary collaboration between nursing and engineering, machine learning presents new opportunities for nursing research in the era of big data, warranting further investigation.