Published online Jul 16, 2025. doi: 10.4253/wjge.v17.i7.108307
Revised: May 7, 2025
Accepted: May 30, 2025
Published online: July 16, 2025
Processing time: 90 Days and 4.9 Hours
Difficulty of colonoscopy insertion (DCI) significantly affects colonoscopy effectiveness and serves as a key quality indicator. Predicting and evaluating DCI risk preoperatively is crucial for optimizing intraoperative strategies.
To evaluate the predictive performance of machine learning (ML) algorithms for DCI by comparing three modeling approaches, identify factors influencing DCI, and develop a preoperative prediction model using ML algorithms to enhance colonoscopy quality and efficiency.
This cross-sectional study enrolled 712 patients who underwent colonoscopy at a tertiary hospital between June 2020 and May 2021. Demographic data, past medical history, medication use, and psychological status were collected. The endoscopist assessed DCI using the visual analogue scale. After univariate screening, predictive models were developed using multivariable logistic regression, least absolute shrinkage and selection operator (LASSO) regression, and random forest (RF) algorithms. Model performance was evaluated based on discrimination, calibration, and decision curve analysis (DCA), and results were visualized using nomograms.
A total of 712 patients (53.8% male; mean age 54.5 years ± 12.9 years) were included. Logistic regression analysis identified constipation [odds ratio (OR) = 2.254, 95% confidence interval (CI): 1.289-3.931], abdominal circumference (AC) (77.5–91.9 cm, OR = 1.895, 95%CI: 1.065-3.350; AC ≥ 92 cm, OR = 1.271, 95%CI: 0.730-2.188), and anxiety (OR = 1.071, 95%CI: 1.044-1.100) as predictive factors for DCI, validated by LASSO and RF methods. Model performance revealed training/validation sensitivities of 0.826/0.925, 0.924/0.868, and 1.000/0.981; specificities of 0.602/0.511, 0.510/0.562, and 0.977/0.526; and corresponding area under the receiver operating characteristic curves (AUCs) of 0.780 (0.737-0.823)/0.726 (0.654-0.799), 0.754 (0.710-0.798)/0.723 (0.656-0.791), and 1.000 (1.000-1.000)/0.754 (0.688-0.820), respectively. DCA indicated optimal net benefit within probability thresholds of 0-0.9 and 0.05-0.37. The RF model demonstrated superior diagnostic accuracy, reflected by perfect training sensitivity (1.000) and highest validation AUC (0.754), outperforming other methods in clinical applicability.
The RF-based model exhibited superior predictive accuracy for DCI compared to multivariable logistic and LASSO regression models. This approach supports individualized preoperative optimization, enhancing colonoscopy quality through targeted risk stratification.
Core Tip: This study developed machine learning models to predict the difficulty of colonoscopy insertion using abdominal circumference, constipation, anxiety, and clinical history. Among the 712 patients, the random forest model achieved optimal performance, demonstrating high sensitivity and clinical utility. It uniquely integrates anatomical, psychological, and medical factors, offering a novel preoperative risk-stratification tool to enhance procedural success and patient comfort. This approach supports tailored interventions, improving colonoscopy quality through personalized risk assessment.
- Citation: Gao RX, Wang XL, Tian MJ, Li XM, Zhang JJ, Wang JJ, Gao J, Zhang C, Li ZT. Construction and validation of a machine learning algorithm-based predictive model for difficult colonoscopy insertion. World J Gastrointest Endosc 2025; 17(7): 108307
- URL: https://www.wjgnet.com/1948-5190/full/v17/i7/108307.htm
- DOI: https://dx.doi.org/10.4253/wjge.v17.i7.108307
Colonoscopy is regarded as the gold standard for detecting lower gastrointestinal disorders[1]. Current guidelines recommend routine colonoscopy screening for adults aged 50 years and older, with some suggesting initiation at 45 years. Successful insertion of the colonoscope into the ileocecal region is essential and serves as a critical indicator of colonoscopy quality[2]. Reducing insertion difficulty is a primary priority for endoscopists, ensuring that the colonoscope is introduced swiftly, safely, and efficiently. Multiple variables may impede the colonoscopy insertion process (difficulty of colonoscopy insertion [DCI]), including intestine tortuosity, patient discomfort, and inappropriate selection of colonoscope stiffness or length. These issues may lead to procedural failure, jeopardizing diagnostic and therapeutic outcomes[3]. Moreover, DCI is frequently associated with excessive gas insufflation and bowel traction, increasing the risk of adverse events such as abdominal pain, distension, and gastrointestinal bleeding[4,5]. Thus, identifying specific risk factors preoperatively, predicting insertion difficulties, and developing personalized diagnostic and management strategies might enhance the efficiency, safety, and comfort of colonoscopy procedures.
Previous research[6-8] has identified advanced age, female sex, reduced body mass index (BMI), smaller abdominal circumference (AC), and inadequate bowel preparation as independent risk factors for DCI. However, considerable variability exists regarding factors identified in different studies, and current research has yet to provide a comprehensive and systematic classification. Furthermore, numerous studies[9] have neglected factors such as patients’ past medical history, medication use, and psychological status at the time of the procedure. Most existing studies are based on non-Chinese populations, resulting in inadequate understanding of DCI-related characteristics specific to Chinese popu
Currently, studies evaluating DCI are scarce. Despite DCI being an important metric of colonoscopy quality, a standardized definition or assessment criterion remains unavailable. Existing research[10-13] frequently employs criteria such as cecal intubation success rates, intensity of bowel spasms, insertion duration, and operator-assigned difficulty scores to evaluate procedural challenges. Nevertheless, these assessments are typically performed after the procedure and lack consensus regarding measurement standards. Furthermore, these methods possess several limitations: (1) They provide only post-procedural evaluations with limited predictive utility; (2) They assess a single aspect of DCI without offering a comprehensive evaluation; and (3) They inadequately account for individual patient variables objectively. Thus, developing a simple and effective risk prediction model to anticipate insertion difficulties before colonoscopy and enhance procedure success rates is of considerable clinical significance.
In recent years, machine learning (ML) algorithms, which can progressively identify patterns and learn from data, have been widely applied in social sciences and medicine[14,15]. Compared to conventional statistical methods, ML algorithms effectively handle issues such as multicollinearity and variable interactions, making them reliable and efficient modeling tools. In this study, DCI prediction models were developed and validated using multivariable logistic regression, least absolute shrinkage and selection operator (LASSO) regression, and random forest (RF) methods. These proposed models improve DCI risk assessment and provide an intuitive interface linking event probabilities to specific patients, thereby enhancing clinical decision-making. The objective of this study is to establish a robust predictive model for DCI, facilitating individualized guidance for colonoscopy procedures and ultimately improving clinical practice.
This study enrolled participants who underwent colonoscopy at the Digestive Endoscopy Center, Affiliated Hospital of North China University of Science and Technology, and Tangshan Union Hospital (Hebei, China), from June 2020 to May 2021. The study was registered in the Chinese Clinical Trial Registry (No. CHiCTR2000040109) and approved by the Medical Ethics Committees of both institutions (No. 20210130017).
Inclusion criteria: (1) Age ≥ 18 years; and (2) Signed informed consent form.
Exclusion criteria: (1) Patients undergoing painless colonoscopy; (2) Patients with a history of coloproctectomy; and (3) Patients with incomplete, missing, or inaccurate survey data.
On the day of colonoscopy, trained nurses or researchers collected participants' demographic information, medical history, current medications, and psychological health status using a questionnaire developed by the research team. Demographic information included sex, age, education level, ethnicity, marital status, occupation, and annual household income. Medical history included constipation, previous colonoscopy, irritable bowel syndrome (IBS), colonic diverticulosis, history of colorectal polyps (HOCRP), family history of intestinal polyps, history of pelvic and abdominal surgery (HOPAS), radiation therapy, hypertension, and diabetes. Current medication history focused primarily on nonsteroidal anti-inflammatory drugs and anticholinesterase agents. Additional data were collected on smoking history, alcohol consumption, AC, BMI, healthcare access, occupation type, and health insurance coverage.
Anxiety status was assessed using the Zung Self-Rating Anxiety Scale (SAS)[16], which consists of 20 items. The total raw score of these items was multiplied by 1.25, and the integer portion was used as the standard score. According to Chinese normative data, an SAS standard score of 50 served as the cutoff, with scores < 50 defined as normal and scores ≥ 50 indicating anxiety.
Colonoscopy insertion difficulty was rated by the endoscopist using a visual analogue scale (VAS)[17]. This scale consists of a 10 cm line, with “0 cm” representing “no difficulty” and “10 cm” indicating “extremely difficult”. The endoscopist marked the difficulty level encountered during colonoscope insertion. A mark > 5 cm from 0 cm indicated “difficult insertion”, whereas a mark ≤ 5 cm indicated “easy insertion”. If cecal intubation was unsuccessful, the case was categorized as “difficult insertion” and recorded as 10 cm. All data were collected by nurses and researchers who did not participate in statistical analyses.
Participants were instructed to consume a normal lunch and only liquid food for dinner on the day preceding examination. For bowel preparation, subjects orally ingested 137.15 g polyethylene glycol electrolyte powder (PEG-ELP) (Wanhe Pharmaceutical Co., Ltd., Shenzhen, China), containing 2.93 g sodium chloride, 11.37 g anhydrous sodium sulfate, 1.48 g potassium chloride, 3.37 g sodium bicarbonate, and 118 g polyethylene glycol. Participants dissolved one packet of PEG-ELP in 2 L water at 12-14 hours and again at 6 hours before examination, consuming each solution at a constant rate of 250 mL every 15 minutes over 2 hours.
All colonoscopies were performed between 09:00 and 14:00 using an Olympus colonoscopy system (CV-260 endoscope, Tokyo, Japan). The four endoscopists who performed these procedures each independently completed over 3000 colonoscopies previously.
Data were compiled into an Excel database. Normally distributed quantitative data were expressed as mean ± SD and compared using t-tests. Non-normally distributed quantitative data are presented as the median (interquartile range) (M [Q1, Q3]) and analyzed using Mann-Whitney U tests. Qualitative data are reported as percentages and compared using χ² tests. Following univariate analysis for variable screening, predictive models were constructed using multivariable logistic regression, LASSO regression, and RF algorithms. Model predictive performance was assessed and compared through sensitivity, specificity, receiver operating characteristic (ROC) curves, and decision curve analysis (DCA). All statistical analyses were performed using R software (version 3.6.2), utilizing the rms, glmnet, and randomForest packages. All significance tests were two-sided, with P < 0.05 considered statistically significant.
Data were collected from 815 individuals who underwent colonoscopy. Among these, 44 participants did not complete the questionnaire, 47 provided incomplete data, and 12 submitted erroneous information. Consequently, 712 participants were included in the final analysis.
Of these 712 patients, 383 (53.8%) were male and 329 (46.2%) were female, with a mean age of 54.5 years ± 12.9 years. DCI was diagnosed in 185 participants (26.0%), whereas 527 participants (74.0%) experienced no insertion difficulty. Participants were randomly assigned to training (n = 481) and validation (n = 231) sets at a 2:1 ratio. Comparison of baseline characteristics between these two groups (Table 1) showed no statistically significant differences except for sex distribution (P = 0.002). Although a statistically significant sex difference existed, the absolute discrepancy (0.1%) was minimal; thus, separate modeling and validation by sex subgroups were not pursued. To manage class imbalance between the DCI (26.0%) and non-DCI (74.0%) groups during model training, the following strategies were adopted: Evaluation prioritized metrics unaffected by class distribution, including sensitivity, specificity, F1-score, and area under the ROC curve (AUC) values. Because the current imbalance reflects typical clinical conditions and maintains ecological validity, oversampling methods such as synthetic minority oversampling technique were deliberately avoided. This approach aimed to prevent artificial shifts in data distribution due to synthetic samples, preserving the model’s clinical applicability.
Variable | Level | Overall (n = 712) | Training set (n = 481) | Validation set (n = 231) | P value |
Sex | Female | 329 (46.2) | 222 (46.2) | 107 (46.3) | 0.002 |
Male | 383 (53.8) | 259 (53.8) | 124 (53.7) | ||
Age (years) | / | 54.5 ± 12.9 | 54.3 ± 12.8 | 55.0 ± 13.1 | 0.461 |
Body mass index (kg/m2) | < 18.5 | 15 (2.1) | 10 (2.1) | 5 (2.2) | 0.978 |
18.5-23.9 | 293 (41.2) | 200 (41.6) | 93 (40.2) | ||
24.0-28.3 | 297 (41.7) | 198 (41.2) | 99 (42.9) | ||
≥ 28.4 | 107 (15.0) | 73 (15.1) | 34 (14.7) | ||
Abdominal circumference (cm) | < 77.5 | 401 (56.3) | 271 (56.3) | 130 (56.3) | 0.185 |
77.5-91.9 | 143 (20.1) | 89 (18.5) | 54 (23.4) | ||
≥ 92.0 | 168 (23.6) | 121 (25.2) | 47 (20.3) | ||
Smoking | No | 560 (78.7) | 383 (79.6) | 177 (76.6) | 0.360 |
Yes | 152 (21.3) | 98 (20.4) | 54 (23.4) | ||
Drinking | No | 567 (79.6) | 382 (79.4) | 185 (80.1) | 0.216 |
Yes | 145 (20.4) | 99 (20.6) | 46 (19.9) | ||
Constipation | No | 588 (82.6) | 397 (82.5) | 191 (82.7) | 0.961 |
Yes | 124 (17.4) | 84 (17.5) | 40 (17.3) | ||
History of colonoscopy | No | 457 (64.2) | 313 (65.1) | 144 (62.3) | 0.476 |
Yes | 255 (35.8) | 168 (34.9) | 87 (37.7) | ||
Irritable bowel syndrome | No | 587 (82.4) | 400 (83.2) | 187 (80.9) | 0.469 |
Yes | 125 (17.6) | 81 (16.8) | 44 (19.1) | ||
Diverticulum | No | 699 (98.2) | 474 (98.5) | 225 (97.4) | 0.443 |
Yes | 13 (1.8) | 7 (1.6) | 6 (2.6) | ||
Polyps | No | 559 (78.5) | 380 (79.0) | 179 (77.5) | 0.645 |
Yes | 153 (21.5) | 101 (21.0) | 52 (22.5) | ||
Family history of colon polyps | No | 655 (92.0) | 443 (92.1) | 212 (91.8) | 0.881 |
Yes | 57 (8.0) | 38 (7.9) | 19 (8.2) | ||
History of pelvic and abdominal surgery | No | 533 (74.9) | 361 (75.1) | 172 (74.5) | 0.864 |
Yes | 179 (25.1) | 120 (24.9) | 59 (25.5) | ||
History of Radiotherapy | No | 703 (98.7) | 475 (98.7) | 228 (98.7) | 1.000 |
Yes | 9 (1.3) | 6 (1.3) | 3 (1.3) | ||
Hypertension | No | 558 (78.4) | 380 (79.0) | 178 (77.1) | 0.555 |
Yes | 154 (21.6) | 101 (21.0) | 53 (22.9) | ||
Diabetes | No | 623 (87.5) | 420 (87.3) | 203 (87.9) | 0.832 |
Yes | 89 (12.5) | 61 (12.7) | 28 (12.1) | ||
Taking painkillers | No | 698 (98.0) | 471 (97.9) | 227 (98.3) | 0.981 |
Yes | 14 (2.0) | 10 (2.1) | 4 (1.7) | ||
Anxiety (scores) | 32.9 ± 8.7 | 32.7 ± 8.6 | 33.4 ± 8.9 | 0.277 |
Of the 712 participants undergoing colonoscopy, 185 (26.0%) experienced DCI, whereas 527 (74.0%) did not encounter insertion difficulty. Univariate analysis showed that female sex, constipation, IBS, HOCRP, family history of colon polyps, HOPAS, and anxiety were significantly associated with increased risk of DCI (P < 0.05) (Table 2).
Variable | Level | Overall (n = 712) | Easy insertion (n = 527) | Difficult insertion (n = 185) | P value |
Sex | Female | 329 (46.2) | 227 (43.1) | 102 (55.1) | 0.006 |
Male | 383 (53.8) | 300 (56.9) | 83 (44.9) | ||
Age (years) | / | 54.5 ± 12.9 | 54.2 ± 13.2 | 55.4 ± 11.9 | 0.278 |
Body mass index (kg/m2) | / | 24.8 ± 3.6 | 24.8 ± 3.5 | 24.5 ± 3.9 | 0.334 |
Abdominal circumference (cm) | / | 85.7 ± 10.3 | 86.0 ± 9.2 | 84.6 ± 13.0 | 0.104 |
Smoking | No | 560 (78.7) | 419 (79.5) | 141 (76.2) | 0.404 |
Yes | 152 (21.3) | 108 (20.5) | 44 (23.8) | ||
Drinking | No | 567 (79.6) | 426 (80.8) | 141 (76.2) | 0.216 |
Yes | 145 (20.4) | 101 (19.2) | 44 (23.8) | ||
Constipation | No | 588 (82.6) | 468 (88.8) | 120 (64.9) | < 0.001 |
Yes | 124 (17.4) | 59 (11.2) | 65 (35.1) | ||
History of colonoscopy | No | 457 (64.2) | 349 (66.2) | 108 (58.4) | 0.068 |
Yes | 255 (35.8) | 178 (33.8) | 77 (41.6) | ||
Irritable bowel syndrome | No | 587 (82.4) | 449 (85.2) | 138 (74.6) | 0.002 |
Yes | 125 (17.6) | 78 (14.8) | 47 (25.4) | ||
Diverticulum | No | 699 (98.2) | 520 (98.7) | 179 (96.8) | 0.176 |
Yes | 13 (1.8) | 7 (1.3) | 6 (3.2) | ||
History of colorectal polyps | No | 559 (78.5) | 430 (81.6) | 129 (69.7) | 0.001 |
Yes | 153 (21.5) | 97 (18.4) | 56 (30.3) | ||
Family history of colon polyps | No | 655 (92.0) | 498 (94.5) | 157 (84.9) | < 0.001 |
Yes | 57 (8.0) | 29 (5.5) | 28 (15.1) | ||
History of pelvic and abdominal surgery | No | 533 (74.9) | 413 (78.4) | 120 (64.9) | < 0.001 |
Yes | 179 (25.1) | 114 (21.6) | 65 (35.1) | ||
History of Radiotherapy | No | 703 (98.7) | 520 (98.7) | 183 (98.9) | 1.000 |
Yes | 9 (1.3) | 7 (1.3) | 2 (1.1) | ||
Hypertension | No | 558 (78.4) | 412 (78.2) | 146 (78.9) | 0.915 |
Yes | 154 (21.6) | 115 (21.8) | 39 (21.1) | ||
Diabetes | No | 623 (87.5) | 469 (89.0) | 154 (83.2) | 0.057 |
Yes | 89 (12.5) | 58 (11.0) | 31 (16.8) | ||
Taking painkillers | No | 698 (98.0) | 519 (98.5) | 179 (96.8) | 0.252 |
Yes | 14 (2.0) | 8 (1.5) | 6 (3.2) | ||
Anxiety (scores) | 32.9 ± 8.7 | 31.4 ± 8.2 | 37.5 ± 8.6 | < 0.001 |
Variables significant in the univariate analysis and AC were included in model development. Although AC was not statistically significant (P = 0.104), it was retained based on clinical judgment, as previous evidence suggests a potential nonlinear relationship with insertion difficulty. Multivariable logistic regression analysis identified AC, constipation, history of colonic polyps, diabetes, and anxiety score as independent predictors of DCI (P < 0.05) (Table 3)[17].
Characteristics | B | SE | χ² value | P value | Odds ratio | Lower | Upper |
Intercept | -3.945 | 0.473 | -8.338 | < 0.001 | 0.019 | 0.007 | 0.048 |
Abdominal circumference (cm) | |||||||
< 77.5 | |||||||
77.5-91.9 | 0.639 | 0.292 | 2.191 | 0.028 | 1.895 | 1.065 | 3.350 |
≥ 92.0 | 0.240 | 0.279 | 0.859 | 0.390 | 1.271 | 0.730 | 2.188 |
Constipation | 0.813 | 0.284 | 2.865 | 0.004 | 2.254 | 1.289 | 3.931 |
History of colorectal polyps | 0.690 | 0.266 | 2.599 | 0.009 | 1.994 | 1.181 | 3.353 |
History of pelvic and abdominal surgery | 0.396 | 0.250 | 1.580 | 0.114 | 1.485 | 0.904 | 2.418 |
Hypertension | -0.551 | 0.317 | -1.736 | 0.083 | 0.576 | 0.303 | 1.055 |
Diabetes | 0.740 | 0.341 | 2.170 | 0.030 | 2.096 | 1.066 | 4.081 |
Self-rating anxiety scale (scores) | 0.069 | 0.013 | 5.218 | < 0.001 | 1.071 | 1.044 | 1.100 |
LASSO regression with cross-validation identified an optimal λ value of 0.0183, selecting eight predictors: (1) AC (cm); (2) Constipation; (3) History of polyps; (4) Family history of colon polyps; (5) HOPAS; (6) Hypertension; (7) Diabetes; and (8) Anxiety scale (Figure 1). The prediction model formula for DCI is: Colonoscopy difficulty = -3.478 - 0.378 × AC (cm) + 0.549 × constipation + 0.455 × history of polyps + 0.204 × family history of colon polyps + 0.250 × HOPAS - 0.119 × hypertension + 0.321 × diabetes + 0.062 × anxiety scale.
Based on variables selected from univariate analysis and AC, a RF prediction model was constructed. The error convergence curve demonstrated that as the number of trees (ntree) increased, the out-of-bag error rapidly declined and stabilized at approximately 300–400 trees, indicating a performance plateau at ntree = 500. The model reached stability, and further increases in tree number risked overfitting. Thus, the optimal parameter configuration (ntree = 500, mtry = 8) was selected to balance model complexity and predictive performance. Feature importance was ranked using mean decrease Gini (MDG) and mean decrease accuracy, with larger values indicating greater importance. Figure 2 illustrates MDG values for each variable. The SAS score, age, BMI, AC (cm), and IBS showed relatively high MDG values, highlighting their significance in predicting DCI. The SAS score emerged as the most critical predictor, with an MDG value substantially exceeding other variables, indicating the decisive role of psychological status in predicting DCI.
Calibration evaluation: Calibration of the models was assessed using the Bootstrap method with 1000 resamples in the training and validation datasets. Goodness-of-fit tests (Hosmer-Lemeshow method) were performed for each model. Results were as follows: (1) χ² = 2.016, P = 1.000 for multivariable logistic regression; (2) χ² = 1.870, P = 1.000 for LASSO regression; and (3) χ² = 0.009, P = 0.999 for RF. All P values exceeded 0.05, indicating excellent fit for each model. Calibration performance was quantitatively evaluated using the Brier Score (BS), with lower values (0–1) indicating superior calibration. BS values in the training set were 0.165 (logistic regression), 0.024 (RF), and 0.190 (LASSO regression). In the validation set, BS values were 0.168 (logistic regression), 0.160 (RF), and 0.174 (LASSO regression). All BS values fell below the optimal threshold of 0.20, confirming reliable calibration performance. The RF model showed the best calibration performance in the training set, exhibiting close agreement between predicted and actual incidence of DCI.
Evaluation of discrimination: Discriminative performance of the models was evaluated using sensitivity, specificity, accuracy, Youden's index, F1 score, and BS for both training and validation datasets, along with corresponding ROC curves (Figures 3 and 4, Table 4). Delong’s test assessed differences among the three models, indicating that the RF model exhibited the best predictive performance overall (Table 5). The RF model achieved an AUC of 1.000 (95% confidence interval [CI]: 1.000-1.000) in the training set and 0.754 (95%CI: 0.688-0.820) in the validation set. Despite performance variations between training and validation sets, particularly regarding sensitivity and specificity, rigorous optimization strategies were applied: Hyperparameter tuning through 10-fold cross-validation and feature selection via LASSO regularization. The observed overfitting in the RF model may arise from the limited sample size, a limitation explicitly noted in the discussion section. Future multicenter, large-sample studies are planned to address this issue. Notably, the RF model demonstrated a lower BS (0.160) in the validation set compared to logistic regression (0.168) and LASSO (0.174) models, indicating superior calibration performance.
Evaluation indicator | Logistic | Least absolute shrinkage and selection operator | Random forest | |||
Training set | Validation set | Training set | Validation set | Training set | Validation set | |
Cut-off value | 0.199 | 0.191 | 0.257 | 0.261 | 0.401 | 0.156 |
Sensitivity | 0.826 | 0.925 | 0.924 | 0.868 | 1.000 | 0.981 |
Specificity | 0.602 | 0.511 | 0.510 | 0.562 | 0.977 | 0.526 |
Accuracy | 0.663 | 0.606 | 0.624 | 0.632 | 0.998 | 0.628 |
Youden index | 0.428 | 0.436 | 0.434 | 0.430 | 0.977 | 0.507 |
F1 score | 0.574 | 0.519 | 0.574 | 0.520 | 0.996 | 0.547 |
Area under the receiver operating characteristic curve | 0.780 (0.737-0.823) | 0.726 (0.654-0.799) | 0.754 (0.710-0.798) | 0.723 (0.656-0.791) | 1.000 (1.000-1.000) | 0.754 (0.688-0.820) |
Brier score | 0.165 | 0.168 | 0.190 | 0.174 | 0.024 | 0.160 |
Model A-model B | Model A-model C | Model B-model C | |
Z value | 1.527 | -10.036 | -10.884 |
P value | 0.127 | < 0.001 | < 0.001 |
Assessment of applicability: DCA was conducted in both training and validation cohorts to evaluate clinical utility. Results indicated that, in the training set, the RF model’s decision curve exceeded the "none" and "all" curves across threshold probabilities from 0% to 90%. In the validation set, the curve similarly outperformed the reference curves within threshold ranges of 5% to 37%. Thus, the model exhibited strong clinical applicability within these thresholds (Figure 5).
Based on odds ratio and MDG values, significant predictors of DCI were identified across the three models. The RF model identified SAS, age, BMI, AC, IBS, and constipation as important predictors. LASSO regression highlighted AC (cm), constipation, HOCRP, family history of colon polyps, HOPAS, hypertension, diabetes, and anxiety level as significant factors. Multivariable logistic regression indicated AC, constipation, HOCRP, history of abdominal surgery, HOPAS, hypertension, diabetes, and SAS as predictors.
In conclusion, our findings suggest that the identified characteristics serve as reliable predictors of DCI. A nomogram was constructed based on the multivariable logistic regression model (Figure 6) to assess individual risk and estimate the probability of DCI.
Colonoscopy is essential for screening, diagnosing, and treating colorectal conditions. Safe and successful insertion of the colonoscope into the cecum is critical for high-quality colonoscopy practice. Precisely assessing the likelihood of DCI preoperatively assists in selecting a skilled operator, appropriate colonoscope type, and effective intraoperative techniques, such as abdominal pressure assistance. Current studies on colonoscopy insertion difficulties generally rely on retrospective evaluations by operators or patients after the procedure. Other studies use success in reaching the cecum or insertion duration as indicators of difficulty. These methods lack objectivity and cannot effectively predict insertion challenges beforehand. Furthermore, few studies have developed models based solely on preoperative variables or utilized sophisticated ML methods.
This study employed ML algorithms to construct a predictive prediction model for DCI. Model hyperparameters were rigorously optimized using three-times repeated 10-fold cross-validation combined with grid search optimization. The dataset was randomly divided into training and validation sets at a 2:1 ratio. Comprehensive hyperparameter tuning was conducted on the training set, and the model’s performance was evaluated using an independent validation set to ensure robustness and generalizability. A dual-path variable selection approach was implemented: (1) Statistically significant variables (P < 0.05) were prioritized; and (2) Clinically meaningful predictors (e.g., AC) were retained based on clinical expertise. This hybrid method effectively preserved potentially important predictors, particularly in scenarios with limited samples[18]. The inclusion of AC and improved model performance demonstrate the value of integrating clinical expertise with data-driven methods.
This study is the first to quantify insertion difficulty using the VAS score based on participants’ demographic data, past medical and medication history, and psychological health. Logistic regression and ML algorithms, including LASSO regression and RF, were utilized to construct preoperative prediction models for DCI. The models demonstrated strong performance regarding AUC, sensitivity, and specificity, effectively assisting endoscopists in predicting individual DCI risk. Notably, the RF model showed superior sensitivity and specificity. In contrast, Khan et al[19] used cecal intubation success or insertion time exceeding 10 minutes as outcome variables and relied solely on logistic regression, achieving an AUC of only 0.66. Compared with that study, our models, developed using optimal ML methods, showed improved accuracy and practicality in predicting difficult colonoscopy outcomes.
The current study identified AC, constipation, HOCRP, HOPAS, hypertension, diabetes, and anxiety as independent risk factors for DCI. These findings both align with and differ from previous research by Nagata et al[20], which identified associations between DCI and female sex, advanced age, low BMI, HOPAS, and constipation. These discrepancies might result from variations in study demographics, sample sizes, statistical methods, and definitions of outcomes.
Constipation was identified as an independent risk factor for DCI, aligning with prior studies. Nagata et al[20] reported that increased constipation severity was associated with prolonged insertion times and increased difficulty (P < 0.01)[21]. Factors such as increased intestinal length, impaired peristalsis due to abnormal colonic motility, and intestinal tortuosity may decrease colonic wall compliance, thus complicating colonoscope insertion[22,23].
Additionally, this study confirmed AC as an independent risk factor for DCI. AC, similar to BMI, serves as an indicator of abdominal morphology and fat distribution[24]. Early et al[25] demonstrated significantly increased insertion difficulty when BMI was below 18.5. Previous studies often overlooked the “bipolar” effects of abdominal fat distribution—both obesity and low BMI can exacerbate insertion difficulty. Our study evaluated the bipolar characteristics of AC by categorizing participants into three groups based on AC distribution. Findings confirmed that both obesity and low BMI correlate with increased insertion difficulty. Patients with larger waist circumferences typically exhibit abdominal obesity, characterized by significant mesenteric fat deposition. This causes substantial angulation of the colonoscope, particularly in the sigmoid and transverse colon, making corrections through external abdominal pressure challenging[26]. Conversely, slender individuals with minimal abdominal fat often present pronounced tortuosity and acute intestinal angles, further complicating insertion[27]. Therefore, AC effectively identifies atypical body types (both excessively high and low) associated with increased risk of DCI.
This study is the first to incorporate diverse medical histories, including HOCRP, HOPAS, hypertension, and diabetes, as independent variables in a DCI prediction model. Prior research by Drewes et al[28] mainly highlighted HOPAS or diabetes as risk factors for DCI. Our study included a history of colon polyps because polyps can mechanically obstruct the colon during insertion, complicating the procedure. Hypertension can cause abdominal arterial atherosclerosis, leading to mesenteric sclerosis and intestinal ischemia. These factors reduce colonic compliance and increase insertion difficulty[29]. Consequently, elderly patients who frequently suffer from these conditions face a higher risk of DCI, though the exact mechanisms require further investigation.
Our analysis identified anxiety as an independent risk factor for DCI, supporting findings from Shen et al[30]. Due to the invasive nature of colonoscopy and associated risks, patients often experience negative emotions such as fear, resistance, and embarrassment, contributing to anxiety[31]. Anxiety may disrupt normal intestinal motility via the brain-gut axis, complicating insertion and increasing the likelihood of procedure failure[32]. Therefore, this study fully considered psychological factors when evaluating colonoscopy insertion difficulty. Based on the biological-social-psychological model, future research should include psychosocial dimensions, quantification of preoperative anxiety, pain tolerance, stress response patterns, quality of doctor-patient communication, iatrogenic anxiety, expectation management, and identification of molecular biomarkers through epigenetics. By developing such a multi-dimensional predictive model, we can enhance both DCI risk assessment accuracy and our understanding of its complex determinants. This approach would provide a solid theoretical basis and empirical support for individualized intervention strategies.
This research offers several strengths. First, it enables predictive assessment of individual DCI risk preoperatively by evaluating multiple factors, helping healthcare providers optimize intervention strategies, improve procedural quality, and enhance patient experiences. Second, by integrating conventional statistical methods with ML algorithms (LASSO regression and RF), the study provides a more accurate and robust model, supported by comprehensive validation and performance comparisons. Third, the model demonstrates clinical translational potential through three implementation pathways: (1) Embedded clinical workflow integration: Serving as a module in electronic medical record systems, automatically generating risk scores during patient scheduling to guide triage decisions (e.g., assigning high-risk patients to experienced endoscopists); (2) Mobile decision-support development: A companion app enabling real-time input of patient characteristics and visual risk stratification to support point-of-care decisions; and (3) Quality assurance system interoperability: Integration with hospital quality control systems to dynamically monitor DCI rates, facilitating data-driven benchmarking of endoscopic performance.
This study had several limitations. First, although overfitting was controlled through cross-validation and parameter optimization, the constrained sample size still led to inadequate model generalization. Future improvements necessitate either increasing sample size or simplifying model architecture. The observed discrepancy in performance between training and validation sets for the RF model suggests limited generalizability. Specifically, the RF model achieved an AUC of 1.000 (95%CI: 1.000-1.000) in the training set, compared to 0.754 (95%CI: 0.688-0.820) in the validation set. Sensitivity and specificity were 1.000 and 0.977, respectively, in the training set, but decreased to 0.981 and 0.526 in the validation set. This divergence may result from unmeasured confounding variables. Second, our models' AUC values indicated moderate predictive capability, falling short of the established threshold for strong predictive performance (AUC ≥ 0.8). Key limitations encompass the single-center study design and constrained sample size. Due to sample-size limitations, model optimization relied primarily on hyperparameter tuning rather than data augmentation. Future studies should employ transfer learning or hybrid algorithms (e.g., XGBoost) on multicenter, large-scale datasets to enhance model robustness. Third, although the selection of ntree = 500 was empirically justified, systematic evaluation of larger parameter values (e.g., ntree > 1000) was not performed. Future work could leverage parallel computing techniques to investigate potential marginal performance gains at higher tree counts. Finally, the absence of external validation represents a key limitation of our study. We are presently planning a multicenter investigation to include data from hospitals of varying tiers across different geographical regions.
This study developed preoperative prediction models for DCI using multivariate logistic regression, LASSO regression, and RF methods, based on independent risk factors such as constipation, AC, and anxiety. The models demonstrated strong predictive performance concerning sensitivity, specificity, and other evaluation metrics, with the RF model achieving the highest performance. This research provides clinicians with valuable support for developing personalized, proactive colonoscopy strategies informed by preoperative risk assessments.
1. | Mankaney G, Sutton RA, Burke CA. Colorectal cancer screening: Choosing the right test. Cleve Clin J Med. 2019;86:385-392. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 2] [Cited by in RCA: 6] [Article Influence: 1.0] [Reference Citation Analysis (0)] |
2. | American Cancer Society updates its colorectal cancer screening guideline: New recommendation is to start screening at age 45 years. Cancer. 2018;124:3631-3632. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 9] [Cited by in RCA: 15] [Article Influence: 2.1] [Reference Citation Analysis (0)] |
3. | May FP, Shaukat A. State of the Science on Quality Indicators for Colonoscopy and How to Achieve Them. Am J Gastroenterol. 2020;115:1183-1190. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 26] [Cited by in RCA: 42] [Article Influence: 8.4] [Reference Citation Analysis (0)] |
4. | Laanani M, Weill A, Carbonnel F, Pouchot J, Coste J. Incidence of and Risk Factors for Systemic Adverse Events After Screening or Primary Diagnostic Colonoscopy: A Nationwide Cohort Study. Am J Gastroenterol. 2020;115:537-547. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 3] [Cited by in RCA: 4] [Article Influence: 0.8] [Reference Citation Analysis (0)] |
5. | Xiang L, Zhan Q, Wang XF, Zhao XH, Zhou YB, An SL, Han ZL, Wang YD, Xu YZ, Li AM, Zhang YL, Liu SD. Risk factors associated with the detection and missed diagnosis of colorectal flat adenoma: a Chinese multicenter observational study. Scand J Gastroenterol. 2018;53:1519-1525. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 5] [Cited by in RCA: 7] [Article Influence: 1.0] [Reference Citation Analysis (0)] |
6. | Robertson AR, Koulaouzidis A, Yung DE, Fraser C, Nemeth A, Trimble K, Toth E, Plevris JN, Wurm Johansson G. Balloon-Assisted Colonoscopy after Incomplete Conventional Colonoscopy-Experience from Two European Centres with A Comprehensive Review of the Literature. J Clin Med. 2020;9:2981. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in Crossref: 3] [Cited by in RCA: 4] [Article Influence: 0.8] [Reference Citation Analysis (0)] |
7. | Ito S, Hotta K, Imai K, Kishida Y, Takizawa K, Kakushima N, Kawata N, Yoshida M, Yabuuchi Y, Ishiwatari H, Matsubayashi H, Shiomi A, Ono H. Ultrathin colonoscopy can improve complete preoperative colonoscopy for stenotic colorectal cancer: Prospective observational study. Dig Endosc. 2021;33:621-628. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 2] [Cited by in RCA: 5] [Article Influence: 1.3] [Reference Citation Analysis (0)] |
8. | Jaruvongvanich V, Sempokuya T, Laoveeravat P, Ungprasert P. Risk factors associated with longer cecal intubation time: a systematic review and meta-analysis. Int J Colorectal Dis. 2018;33:359-365. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 17] [Cited by in RCA: 27] [Article Influence: 3.9] [Reference Citation Analysis (0)] |
9. | Waye JD. Difficult colonoscopy. Gastroenterol Hepatol (N Y). 2013;9:676-678. [PubMed] |
10. | Wu J, Zhao SB, Wang SL, Fang J, Xia T, Su XJ, Xu C, Li ZS, Bai Y. Comparison of efficacy of colonoscopy between the morning and afternoon: A systematic review and meta-analysis. Dig Liver Dis. 2018;50:661-667. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 15] [Cited by in RCA: 23] [Article Influence: 3.3] [Reference Citation Analysis (0)] |
11. | Chen H, Gao C, Li H, Li C, Wang C, Bai Z, Wu Y, Yao H, Li Y, Gao F, Shao XD, Qi X. Factors of easy and difficult cecal intubation during unsedated colonoscopy. Rev Esp Enferm Dig. 2023;115:546-552. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 1] [Cited by in RCA: 2] [Article Influence: 1.0] [Reference Citation Analysis (0)] |
12. | Ortiz O, Sendino O, Rivadulla S, Garrido A, Neira LM, Sanahuja J, Sesé P, Guardiola M, Fernández-Esparrach G. New Concept of Colonoscopy Assisted by a Microwave-Based Accessory Device: First Clinical Experience. Cancers (Basel). 2025;17:1073. [RCA] [PubMed] [DOI] [Full Text] [Cited by in RCA: 1] [Reference Citation Analysis (0)] |
13. | Yamada A, Watabe H, Takano N, Togo G, Yamaji Y, Yoshida H, Kawabe T, Omata M, Koike K. Utility of single and double balloon endoscopy in patients with difficult colonoscopy: a randomized controlled trial. World J Gastroenterol. 2013;19:4732-4736. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in CrossRef: 24] [Cited by in RCA: 27] [Article Influence: 2.3] [Reference Citation Analysis (0)] |
14. | Wahl B, Cossy-Gantner A, Germann S, Schwalbe NR. Artificial intelligence (AI) and global health: how can AI contribute to health in resource-poor settings? BMJ Glob Health. 2018;3:e000798. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in Crossref: 170] [Cited by in RCA: 229] [Article Influence: 32.7] [Reference Citation Analysis (0)] |
15. | Bini SA. Artificial Intelligence, Machine Learning, Deep Learning, and Cognitive Computing: What Do These Terms Mean and How Will They Impact Health Care? J Arthroplasty. 2018;33:2358-2361. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 247] [Cited by in RCA: 253] [Article Influence: 36.1] [Reference Citation Analysis (0)] |
16. | Dunstan DA, Scott N. Norms for Zung's Self-rating Anxiety Scale. BMC Psychiatry. 2020;20:90. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in Crossref: 123] [Cited by in RCA: 298] [Article Influence: 59.6] [Reference Citation Analysis (0)] |
17. | Jia H, Wang L, Luo H, Yao S, Wang X, Zhang L, Huang R, Liu Z, Kang X, Pan Y, Guo X. Difficult colonoscopy score identifies the difficult patients undergoing unsedated colonoscopy. BMC Gastroenterol. 2015;15:46. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in Crossref: 14] [Cited by in RCA: 19] [Article Influence: 1.9] [Reference Citation Analysis (0)] |
18. | Moons KG, Altman DG, Reitsma JB, Ioannidis JP, Macaskill P, Steyerberg EW, Vickers AJ, Ransohoff DF, Collins GS. Transparent Reporting of a multivariable prediction model for Individual Prognosis or Diagnosis (TRIPOD): explanation and elaboration. Ann Intern Med. 2015;162:W1-73. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 2833] [Cited by in RCA: 3262] [Article Influence: 326.2] [Reference Citation Analysis (0)] |
19. | Khan F, Hur C, Lebwohl B, Krigel A. Unsedated Colonoscopy: Impact on Quality Indicators. Dig Dis Sci. 2020;65:3116-3122. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 8] [Cited by in RCA: 16] [Article Influence: 3.2] [Reference Citation Analysis (0)] |
20. | Nagata N, Sakamoto K, Arai T, Niikura R, Shimbo T, Shinozaki M, Noda M, Uemura N. Predictors for cecal insertion time: the impact of abdominal visceral fat measured by computed tomography. Dis Colon Rectum. 2014;57:1213-1219. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 15] [Cited by in RCA: 21] [Article Influence: 1.9] [Reference Citation Analysis (0)] |
21. | Staller K, Cash BD. Myths and Misconceptions About Constipation: A New View for the 2020s. Am J Gastroenterol. 2020;115:1741-1745. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 4] [Cited by in RCA: 6] [Article Influence: 1.2] [Reference Citation Analysis (0)] |
22. | Di Leo M, Iannone A, Arena M, Losurdo G, Palamara MA, Iabichino G, Consolo P, Rendina M, Luigiano C, Di Leo A. Novel frontiers of agents for bowel cleansing for colonoscopy. World J Gastroenterol. 2021;27:7748-7770. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in CrossRef: 18] [Cited by in RCA: 19] [Article Influence: 4.8] [Reference Citation Analysis (1)] |
23. | Dinçer B, Ömeroğlu S, Güven O, Akgün İE, Celayir MF, Gürbulak EK, Yazıcı P, Köksal HM, Demir U. Factors predict prolonged colonoscopy before the procedure: prospective registry study. Surg Endosc. 2024;38:5704-5711. [RCA] [PubMed] [DOI] [Full Text] [Cited by in RCA: 1] [Reference Citation Analysis (0)] |
24. | Passi M, Rahman F, Koh C, Kumar S. Efficacy and tolerability of colonoscopies in overweight and obese patients: Results from a national database on gastrointestinal endoscopic outcomes. Endosc Int Open. 2022;10:E311-E320. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in Crossref: 4] [Cited by in RCA: 9] [Article Influence: 3.0] [Reference Citation Analysis (0)] |
25. | Early D, Larue S, Weinstock L, Kushnir V, Gyawali P, Sullivan S, Thyssen E, Hollander T, Elsner J, Vyhmeister R, Bhat T, Gaddam S. Impact of Tilt-Down Positioning Compared With Left Lateral Positioning on Ease of Colonoscope Insertion During Colonoscopy. J Clin Gastroenterol. 2020;54:558-560. [RCA] [PubMed] [DOI] [Full Text] [Cited by in Crossref: 1] [Cited by in RCA: 6] [Article Influence: 1.2] [Reference Citation Analysis (0)] |
26. | Spada C, Koulaouzidis A, Hassan C, Amaro P, Agrawal A, Brink L, Fischbach W, Hünger M, Jover R, Kinnunen U, Ono A, Patai Á, Pecere S, Petruzziello L, Riemann JF, Staines H, Stringer AL, Toth E, Antonelli G, Fuccio L; On Behalf Of The Ecqi Group. Factors Associated with Polyp Detection Rate in European Colonoscopy Practice: Findings of The European Colonoscopy Quality Investigation (ECQI) Group. Int J Environ Res Public Health. 2022;19:3388. [RCA] [PubMed] [DOI] [Full Text] [Full Text (PDF)] [Cited by in Crossref: 5] [Cited by in RCA: 5] [Article Influence: 1.7] [Reference Citation Analysis (0)] |
27. | Chen XJ, Yang C, Zhu XL, Wei BN, Ji L, Xie ZJ, Qu F, Zhang LY, Zhan Q. [Analysis of patient-related factors influencing the difficulty of colonoscopy]. Weichengbingxue. 2023;455-461. [DOI] [Full Text] |
28. | Drewes JL, Rifkin SB, McMann M, Glass S, Spence E, Wensel CR, Geis AL, Stevens C, Gills JJ, Wang H, Hylind LM, Mullin G, Kafonek D, Cromwell D, La Luna L, Giardiello FM, Sears CL; Biofilm Study Consortium; Biofilm Study Consortium consists of the primary authors above as well as the following:. Epidemiology of bacterial biofilms on polyps and normal tissues in a screening colonoscopy cohort. Gut Microbes. 2025;17:2452233. [RCA] [PubMed] [DOI] [Full Text] [Cited by in RCA: 2] [Reference Citation Analysis (0)] |
29. | Qu QX, Wang T, Li YY, Wang YM, Zhang HT, Chu YZ, Liu HX. [The Impact of Coronary Heart Disease Risk Factors on the Severity of Abdominal Atherosclerosis]. Zhongxiyi Jiehe Xinnaoxueguanbing Zazhi. 2023;878-881. [DOI] [Full Text] |
30. | Shen SJ, Zheng B, Lin LM, Xia XP, Xue ZX. [Study on Anxiety and Influencing Factors in Patients Undergoing Gastroscopy and Colonoscopy Examinations]. Zhongguo Neijing Zazhi. 2019;40-44. [DOI] [Full Text] |
31. | Cheng Y, Zhong C, Wu W, Xi X, Luo M, Chen Y, Zhang B. Association between anxiety, depression, and bowel air bubbles at colonoscopy: a prospective observational study. Ann Palliat Med. 2021;10:3247-3257. [RCA] [PubMed] [DOI] [Full Text] [Cited by in RCA: 4] [Reference Citation Analysis (0)] |
32. | Zhang ML, Wang J, Chen P, Cong CL, Fu Q, Tian LN, Yang Q, Hou YT. [Research Progress on the Correlation between Anxiety-Depression Status and Intestinal Microbiota in Patients with Irritable Bowel Syndrome]. Guoji Xiaohuabing Zazhi. 2024;80-83. [DOI] [Full Text] |