AI-driven prediction of the optimal number of bowel preparation sachets for adequate preparation before colonoscopy Authors: Amir Sadeghi, Roxana Peysepar, Neda Kafash, Shabnam Shahrokh, Alireza Ahmadzadeh Published: 2025 ABSTRACT AbstractBackground:High-quality colonoscopy is critical for colorectal cancer (CRC) prevention. Suboptimal bowel preparation impairs adenoma detection and prolongs cecal intubation time (CIT). This study aimed to identify behavioral and clinical predictors of CIT and bowel preparation quality, to support development of an AI-based model for personalized purgative dosing.Method:In a prospective study of 280 outpatients undergoing screening colonoscopy, variables such as age, sex, BMI, physical activity, sleep duration, and bowel preparation quality (Boston Bowel Preparation Scale (BBPS)) were recorded. CIT, total colonoscopy time (TCT), and polyp/adenoma detection were measured. Regression models and machine learning algorithms (Random Forest, XGBoost) were applied to develop predictive models. Result:More sedentary time 6–9 hours was significantly associated with poor preparation and longer CIT and TCT (p<0.01). Daily activity Time between 9–12 hours correlated with better preparation. Chronic constipation, opioid use, and obesity independently predicted poor bowel prep (BBPS ≤6). Female sex, age ≥60, and BMI ≥30 was also associated with lower BBPS scores. The SVR model achieved a mean absolute error (MAE) of 1.3 and RMSE of 1.6 in predicting optimal powder dosage. Conclusion: Simple behavioral factors such as sleep and physical activity significantly affect colonoscopy performance. Personalized purgative dosing based on individual risk factors may enhance preparation quality and reduce procedural delays. Machine learning models can support clinical decision-making and improve colorectal cancer screening efficacy.Key Words: AI, Bowel preparation, Adequate preparation, Colonoscopy Introduction Colorectal cancer (CRC) is a major global health burden, ranking as the second leading cause of cancer-related deaths worldwide (1). Colonoscopy remains the gold standard for CRC screening and polyp detection, but its effectiveness relies heavily on bowel preparation quality and procedural efficiency (2–4). Inadequate bowel cleansing is a common obstacle that limits adenoma detection and necessitates repeat procedures (5). Current bowel preparation guidelines recommend uniform dosing of purgatives for all patients, without consideration for individual risk factors such as age, body mass index (BMI), physical activity, or sleep patterns (6). This “one-size-fits-all” approach may contribute to both under-preparation and unnecessary discomfort or side effects in well-prepared patients (7–9). Recent advances in machine learning (ML) offer opportunities to tailor bowel prep protocols using real-world data (10,11). To this end, we conducted a prospective study to identify clinical and behavioral predictors of bowel preparation quality and cecal intubation time (CIT). The goal was to support development of a predictive model for purgative dosing using supervised ML techniques. Methods Study design and participants This prospective observational study enrolled 280 adult patients (≥18 years) undergoing elective colonoscopy between January and May 2025. Exclusion criteria included prior colon resection, known or suspected bowel obstruction, recent use of laxatives, or known allergy to PEG-based solutions. All procedures were performed in the afternoon by the same experienced endoscopist to minimize inter-operator variability. Data collection Baseline demographic and clinical variables included age, sex, BMI, waist circumference, hours of daily physical activity, nighttime sleep duration, history of chronic constipation, medication use (e.g., opioids, iron, antihypertensives), and bowel preparation method. Bowel cleanliness was scored using the Boston Bowel Preparation Scale (BBPS). Procedure and outcomes Patients were instructed to follow a split-dose regimen using four sachets of Seppic PEG powder, bisacodyl, and metoclopramide. Colonoscopy metrics recorded included: Cecal Intubation Time (CIT(, Total Colonoscopy Time (TCT), Cecal scope length, Adenoma and polyp detection Statistical analysis Descriptive statistics were used to summarize baseline data. Univariate and multivariate logistic regression models were applied to identify predictors of inadequate bowel preparation (BBPS ≤6). Machine learning models (Random Forest, XGBoost, Support Vector Regression (SVR)) were trained using key input variables and validated using 5-fold cross-validation. Model performance was assessed using MAE and RMSE. Results Participant characteristics Of the 280 participants (mean age 52.4 years), 54% were male and 46% female. Chronic constipation was reported in 23% and opioid use in 9%. Most patients had a BMI between 25–30 (45%), with 18% classified as obese (BMI ≥30) The analysis identified several significant clinical and behavioral determinants influencing the quality of bowel preparation. Patients with a history of chronic constipation exhibited an 8.2-fold increase in the odds of inadequate bowel cleansing compared to those without such history (p < 0.001). Likewise, opioid consumption was associated with a 5.5-fold elevation in the risk of suboptimal bowel preparation (p < 0.001). Obesity, defined as a body mass index (BMI) ≥ 30, was correlated with a 2.5-fold greater likelihood of poor bowel preparation (p = 0.001). Furthermore, female sex and advanced age (≥ 60 years) emerged as independent predictors of lower Boston Bowel Preparation Scale (BBPS) scores. With regard to behavioral factors, sedentary duration more than 6 to 9 hours was significantly associated with reduced cecal intubation time (CIT) and impaired bowel cleanliness as assessed by BBPS (p < 0.01). Additionally, engaging in moderate activity time, quantified as 9 to 12 hours per day, corresponded with shorter CIT and superior bowel preparation outcomes. Conversely, deviations from these optimal ranges, including both excessive and insufficient sleep or physical activity, were linked to deteriorated procedural parameters. Feature selection The LIME algorithm was employed as a tool to analyze feature importance and determine which input variables had the greatest impact on predicting the optimal amount of powder needed for bowel preparation prior to colonoscopy. By applying LIME on the SVR model, the most influential features for each individual patient’s prediction were identified. This approach not only provided better insight into the model’s behavior but also helped in selecting more effective features to improve the final model. Ultimately, features such as age, sex, body mass index (BMI), waist circumference, stool type, colonoscopy time, history of chronic disease, bowel preparation quality (BBPS), physical activity levels including daily activity and walking, and number of powder sachets were selected. Some features, like colonoscopy time (all data recorded in the afternoon) and amount of hyoscine used during colonoscopy (incomplete data), were excluded from the study. Regression model selection Support Vector Regression (SVR) with an RBF kernel was chosen due to its ability to model nonlinear relationships and handle limited data effectively. SVR is a regression version of the Support Vector Machine algorithm designed specifically for regression problems. Choosing SVR for predicting the required number of powder sachets prior to colonoscopy was logical given the continuous, non-categorical nature of the target variable and the structural characteristics of the data. SVR attempts to construct a function within an epsilon-insensitive zone such that prediction errors for most data points remain inside this margin. This property gives SVR robustness against noise in the data, especially when datasets are small or include mixed numerical and categorical features, like age, BMI, stool type, and bowel preparation quality in this study. Theoretically, SVR aims to find a predictive function with low complexity and high generalizability. Unlike classical regression models, SVR can model complex nonlinear relationships between input features and output using kernel functions (such as RBF or Polynomial). This capability is particularly important in problems like estimating powder dosage where the influence of variables like BMI or colonoscopy time may be nonlinear. Overall, SVR was an appropriate choice for this project due to its capacity to model complex relationships, maintain stability against noisy data, and provide accurate results by tuning parameters such as C, epsilon, and kernel type. Parameter optimization was performed using K-Fold cross-validation with K=5. Discussion Our study confirms that behavioral and demographic factors significantly affect colonoscopy outcomes. Constipation and opioid use emerged as dominant predictors of poor bowel prep, aligning with prior studies (12–14). Notably, optimal sleep and activity patterns were associated with shorter CIT and better preparation, findings supported by Dik et al. and others (15). Unlike traditional regression models, ML approaches captured nonlinear interactions and improved prediction of optimal purgative dosage. Similar to studies by Urban et al. (16) and Wang et al. (17), our SVR and ensemble models performed robustly, demonstrating utility in clinical risk stratification. We propose a simple risk-based dosing algorithm incorporating key predictors (constipation, BMI ≥30, age ≥60, opioid use, female sex), which could guide personalized preparation protocols and reduce procedural inefficiencies. Regarding the prediction of the appropriate powder dosage for each individual undergoing colonoscopy using data from 280 participants and selected features, the model achieved a mean absolute error (MAE) of 1.3 and a root mean squared error (RMSE) of 1.6. These errors were calculated from the SVR model with RBF kernel applied on normalized data after parameter optimization (C=1, ϵ=0.1, and γ=0.01) using 5-fold cross-validation. Considering the limited diversity of the dataset, these error values appear acceptable, though collecting more diverse data is necessary to improve model accuracy. Conclusion Chronic constipation, obesity, older age, and opioid use are key predictors of poor bowel preparation. Behavioral factors such as adequate sleep and moderate activity independently enhance colonoscopy performance. AI-driven tools can integrate these variables to recommend optimal purgative dosing, potentially reducing failure rates and enhancing diagnostic yield. We plan to continue expanding the dataset used to train our AI models in order to further enhance their predictive accuracy. In the next phase, bowel preparation will be prescribed to patients based on the AI-estimated optimal purgative dose. We will then assess whether this approach achieves adequate preparation, defined as a BBPS score of ≥6, in the majority of cases. If inadequate preparation is observed, we will re-evaluate and refine the set of predictive factors to optimize the model’s performance. Conflict of interests There is no conflict of interest for authors of this article. References