Abstract
Recent advancements in machine learning have increased studies predicting neurological outcomes following spinal cord injury (SCI). However, there is limited research on predictive models for bladder and bowel dysfunction outcomes postinjury. This study aims to develop predictive models for bladder and bowel dysfunction outcomes in patients with traumatic SCI and integrate the models into a web application. This study utilized data from 4181 patients with traumatic SCI, registered in the Japan Association of Rehabilitation Database between 1991 and 2015, to develop and validate predictive models. The explanatory variables were categorized into three groups: neurological findings at admission (such as American Spinal Injury Association scores and Functional Independence Measure scores), patient background (including demographics, comorbidities, and insurance status), and SCI pathology (including injury mechanism, vertebral fractures, surgical history, presence of ossification of the posterior longitudinal ligament/OLF, and time to admission). Feature selection was performed using Boruta, excluding features with more than 25% missing values. The target variables were the bladder and bowel functions at discharge, classified into a binary outcome of whether natural urination and defecation were possible. Machine learning models were implemented using PyCaret, and model performance was evaluated using the area under the curve (AUC). Shapley Additive Explanation (SHAP) values assessed the contribution of individual features. A total of 3,949 cases were analyzed, with an average age of 50.3 years. The model with the highest accuracy for predicting bladder function was the gradient boosting model, achieving an AUC of 0.9064 on the test data. For predicting bowel function, the gradient boosting model showed the highest accuracy with an AUC of 0.8714. The top three key predictive factors identified using SHAP values included L3 motor function, time from injury to admission, and the Functional Independence Measure bowel management score, which were common predictors for both bladder and bowel function. The web application of the predictive models can be found at https://takakikitamura-bladder-prediction.hf.space/ and https://takakikitamura-bowel-prediction.hf.space. In conclusion, we developed a predictive model for bladder and bowel dysfunction outcomes after traumatic SCI using machine learning, confirming its high predictive accuracy. Critical predictors included L3 motor function, time from injury to admission, and the degree of bowel dysfunction, all of which were relevant for predicting both bladder and bowel function. These models were made publicly available as a web application.
Introduction
Bladder and bowel dysfunction (BBD) are among the most severe and debilitating consequences of traumatic spinal cord injury (SCI), significantly impairing the quality of life for affected individuals.1–3 Neurogenic bladder dysfunction often leads to urinary incontinence, recurrent urinary tract infections, urethral strictures, calculus disease, hydronephrosis, and potentially renal failure. 4 Similarly, neurogenic bowel dysfunction is highly devastating, frequently causing major physical and psychological issues.5,6 These neurogenic conditions affect over 60% of the SCI population, representing significant comorbidities. 7 A comparable proportion of individuals report considerable distress caused by neurogenic bladder and bowel after SCI.
The importance of early diagnosis and intervention for these dysfunctions cannot be overstated, as timely management is crucial to prevent irreversible damage and improve patient outcomes.8,9 Outcomes after SCI are influenced by a complex interplay of biomechanical and physiological factors. The diverse nature of these injuries further complicates the prediction of long-term outcomes based on initial presentations. Additionally, the degree of recovery varies significantly between cases, and the background factors are highly diverse, resulting in a heterogeneous cohort. Therefore, prognosis prediction after SCI is inherently challenging due to the involvement of multiple factors. 10 However, recent advancements in machine learning (ML) have led to increased prediction models for neurological outcomes post-SCI.11–16
Despite these advancements, few prognostic prediction models exist for BBD after SCI.1,8,17 This scarcity may be due to the complexity and variability of the injury, which makes the early phase of SCI a particularly challenging period for accurately assessing and predicting BBD. The absence of such models restricts the ability to guide clinical decision-making and optimize the management of BBD following SCI.
The purpose of this study is to develop a prognostic model for BBD in traumatic SCI patients using ML techniques and verify its accuracy. Additionally, this study aims to investigate which backgrounds of patients, pathological conditions, and assessment items are most important for the prognostic prediction of BBD after SCI using ML. We sought to deliver an open-access web tool for health care professionals that efficiently conveys the predicted outcomes of BBD in patients with SCI, utilizing our ML model. To our knowledge, this study is the first to develop and evaluate a prognostic model for both bladder dysfunction and bowel dysfunction after SCI using ML.
Material and Methods
Data collection
This research was approved by the institutional review board at the Chiba University Graduate School of Medicine. The Japan Association of Rehabilitation Database (JARD) provided data spanning from the beginning of 1991 to the end of 2015. The JARD enrolled patients with SCIs who were either relocated to a participating postacute rehabilitation hospital after initial treatment or admitted directly to a participating SCI center for postacute rehabilitation. As a result, the study includes patients at various phases from the acute to the postacute stage. The JARD database project also obtained approval from its institutional review board. Due to the anonymized nature of the data, retracing patients is not feasible, thus waiving the requirement for informed consent.
Collected demographic information encompassed patient background data, SCI characteristics, and neurological status (Table 1). Items with over 25% missing values, including education level and history of blood transfusion, were excluded. Additionally, patients without traumatic injuries, those with an American Spinal Cord Injury Association Impairment Scale (AIS) grade of E, and those who had already established natural urination and defecation at the time of admission were excluded.
The Features Used in the Machine Learning Models for This Study
AIS, American Spinal Cord Injury Association Impairment Scale; ASIA, American Spinal Cord Injury Association; FIM, Functional Independence Measure; OLF, ossification of the Ligamentum flavum; OPLL, ossification of the posterior longitudinal ligament.
In this study, The Functional Independence Measure (FIM) was included as one of the explanatory variables. FIM is a widely used assessment tool in rehabilitation, designed to evaluate patients’ functional independence. 18 The FIM consists of 18 items, each rated on a scale from 1 (total assistance) to 7 (complete independence). This allows for a quantitative assessment of the degree of motor and cognitive functional impairment in patients. The FIM assessment items are broadly divided into two categories. The first category, comprising 13 items, evaluates motor functions necessary for daily living, such as self-mobility, toileting, bathing, dressing, eating, bladder and bowel management, walking or wheelchair operation, and stair climbing. The second category, consisting of five items, assesses cognitive functions, including communication abilities (comprehension and expression) and social cognition (social interaction, problem-solving, and memory). The FIM scores range from 18 to 126 points, with higher scores indicating a greater level of independence.
Outcome variables
The primary outcome measures were the methods of bladder and bowel management at discharge. Bladder management methods were classified into natural urination, bladder expression, self-clean intermittent catheterization (CIC), assisted CIC, indwelling bladder catheter, cystostomy, and other methods. These were recorded in the database, with independent bladder function defined as natural urination and urination by abdominal pressure. This definition of natural urination was employed because, according to the guidelines, the decision to initiate CIC following the basic assessment serves as a critical branching point in the treatment algorithm. 19 Bowel management methods were classified into natural defecation, defecation by abdominal pressure, defecation by abdominal massage, digital stimulation, enema, colonic irrigation, ostomy, and other methods. These were recorded in the database, with bowel independence defined as natural defecation, defecation by abdominal pressure, and defecation by abdominal massage. This definition of natural defecation was adopted in alignment with the therapy pyramid for neurogenic bowel dysfunction, as outlined in the guidelines. 5
ML models and model explainability
We utilized PyCaret version 2.3.10 (https://pycaret.org) to implement ML on our dataset. PyCaret is a Python library designed for the rapid and easy development, evaluation, and deployment of ML model prototypes. We implemented all ML algorithms in Python 3.8, utilizing Visual Studio Code version 1.77.3 (Microsoft Corporation, WA, USA) as the development environment. To handle missing values, we employed PyCaret’s iterative imputation, which uses LightGBM as the default estimator for both numeric and categorical variables. To assess the robustness of this approach, we conducted a sensitivity analysis comparing it with simple imputation (mean for numeric and mode for categorical data). Variable selection was performed using the Boruta algorithm to reduce the number of explanatory variables. Boruta is a Python package used for selecting important features. Following dataset preprocessing, we utilized the “compare models” function in PyCaret to evaluate different ML models. This function utilizes default hyperparameters to train all available models and then assesses their performance metrics via 10-fold cross-validation on the training data. The models focus on binary classification to predict independent bladder and bowel functions. The top-performing model from the training data was then selected, and its hyperparameters were fine-tuned with the “tune model” function in PyCaret. To improve model explainability, Shapley Additive Explanation (SHAP) values were calculated for the top-performing models. SHAP is a method based on game theory that quantitatively evaluates the contribution of each feature to the predictions of an ML model.
Web application hosting of predictive models
The predictive models for BBD outcomes were deployed in an open-access web application. Hugging Face Spaces (https://huggingface.co/spaces), a widely used platform for hosting ML models, was utilized to ensure that health care professionals can easily access the tool online.
Study cohort
Out of 4181 patients in the JARD database, 3949 met the study’s inclusion criteria (Fig. 1). The dataset was randomly divided into training and test sets in a 7:3 ratio. After the split, cases with an FIM bladder management score of 7 (indicating independent bladder management) at admission were excluded from the bladder management classification analysis. Similarly, cases with an FIM bowel management score of 7 (indicating independent bowel management) at admission were excluded from the bowel management classification analysis. Although these exclusions are usually made prior to the data split, they were performed postsplit in this study to maintain consistency in the underlying data for the comparison of final predictions between bladder and bowel management. The training set was used to develop models for binary classifications of the urination method (n = 2472) and bowel management (n = 2499). Each model underwent 10-fold cross-validation within the training set, and their performance was evaluated using the test set (n = 1077 for the bladder management and n = 1085 for the bowel management). To evaluate the performance of the binary classification models, we calculated accuracy, area under the receiver operating characteristic curve (AUC), recall, precision, and F1 scores.

Flowchart of patient selection. AIS, American Spinal Cord Injury Association Impairment Scale.
Results
Patient characteristics
Table 2 presents the characteristics of the 3949 patients at the time of admission, included in the prediction for bladder and bowel management methods following SCI. Upon admission to hospitals, the patients were categorized according to the AIS as follows: 1304 (33.0%) as AIS A, 386 (9.8%) as AIS B, 915 (23.2%) as AIS C, and 1040 (26.3%) as AIS D. Additionally, 964 patients (24.5%) were hospitalized on the day of their injury, and the average length of hospital stay was 173.2 days.
Patient Characteristics at the Time of Admission
AIS, American Spinal Cord Injury Association Impairment Scale; ASIA, The American Spinal Injury Association.
ML model performance
Table 3 displays the outputs from “compare models” in PyCaret for the binary classification model used to predict independent bladder function. For independent bladder function prediction, the gradient boosting model achieved the highest performance. In the test dataset, the tuned gradient boosting model achieved an AUC of 0.8909, an accuracy of 0.8366, a recall of 0.7096, a precision of 0.7500, and an F1 score of 0.7292. Figure 2 illustrates the receiver operating characteristic (ROC) curve, the precision–recall (PR) curve, and the confusion matrix for the independent bladder function prediction with the gradient boosting model.
Comparing the Performance of Binary Classification Models for Predicting the Achievement of Urinary Independence
AUC, area under the curve.

Evaluation of the best model predicting the independent bladder function.
Table 4 displays the outcomes of the “compare models” function in PyCaret for the binary classification model predicting bowel independence. The gradient boosting model achieved the highest performance for bowel independence prediction. In the test dataset, the tuned gradient boosting model yielded an AUC of 0.8416, an accuracy of 0.7945, a recall of 0.6156, a precision of 0.7030, and an F1 score of 0.6564. Figure 3 depicts the ROC curve, the PR curve, and the confusion matrix for the bowel independence prediction with the gradient boosting model.
Comparing the Performance of Binary Classification Models for Predicting the Achievement of Bowel Independence
AUC, area under the curve.

Evaluation of the best model predicting the independent bowel function.
Figure 4 illustrates the SHAP values for the prediction models of bladder and bowel independence. In both models, the top three features were L3 motor function, days from injury to admission, and FIM bowel management.

SHAP values for prediction models.
A sensitivity analysis was performed to assess the impact of imputation methods on model performance and feature selection. Simple imputation resulted in 10 features for bladder dysfunction and nine for bowel dysfunction, whereas iterative imputation consistently yielded five features for both outcomes. Predictive performance was comparable between the methods (AUC 0.8948 vs. 0.8909 for bladder dysfunction; 0.8530 vs. 0.8416 for bowel dysfunction). For bowel dysfunction, the top three SHAP-ranked features—L3 motor function, days from injury to admission, and FIM bowel management—were identical across both imputation methods. In contrast, for bladder dysfunction, the SHAP top features differed slightly, although L3 motor function and days from injury to admission were consistently among the most important. Detailed results are shown in Table 5.
Sensitivity Analysis of Imputation Methods on Model Performance and Feature Selection
AUC, area under the curve; FIM, Functional Independence Measure; SHAP, Shapley Additive Explanation.
Access to predictive models through web application
The final versions of the predictive models are publicly available via a web application at https://takakikitamura-bladder-prediction.hf.space/ and https://takakikitamura-bowel-prediction.hf.space/ (Fig. 5).

Web application for the independent bladder function prediction model. Left panel: feature input section; main display: shows predicted independent bladder function outcomes generated by the model.
Discussion
This study demonstrated the feasibility of using ML to predict the prognosis of BBD after SCI. The three most critical predictors for both urination and defecation methods after SCI were L3 motor function, days from injury to admission, and FIM bowel management.
Our ML models successfully predicted urinary bladder dysfunction at discharge using neurological findings at admission, patient background, and the pathology of SCI. In this study, the gradient boosting model demonstrated the best AUC. The conventional approach to predicting bladder dysfunction after SCI has been the use of logistic regression. This study moves beyond this traditional framework, exploring the potential of more contemporary ML algorithms to improve predictive accuracy. The first study used a multivariate logistic regression analysis model with 1250 patients with traumatic SCI from the European Multicenter Spinal Cord Injury dataset. This model used the lower extremity motor score (LEMS), light-touch sensation in the S3 dermatome of ISNCSI, and SCIM subscale respiration and sphincter management as predictors, reporting an ROC of 0.936, with LEMS alone achieving an ROC of 0.912. 8 The second study utilized logistic regression modeling with data from 4327 individuals, demonstrating a high prediction accuracy with an AUC of 0.919 using LEMS alone. This study also showed that the performance of LEMS decreased with an AUC of 0.724 for AIS C, an AUC of 0.644 for AIS D, and an AUC of 0.792 for AIS C or D, indicating that prediction accuracy is influenced by AIS severity. 1 In this study, patients ranging from AIS A to D were included. Lower urinary tract dysfunction due to SCI presents diverse pathology depending on the injury level, disease stage, and extent of injury.20,21 In our study, most cases were classified as suprasacral neurogenic bladder, meaning that the neurological impairment was located above the sacral micturition center. As many patients were evaluated at discharge after prolonged hospitalization, the data primarily represent chronic phase assessments conducted near the final evaluation.
To our knowledge, only one prior study has developed a prediction model for bowel dysfunction, utilizing a logistic regression model with a limited sample size. 17 Although logistic regression remains the standard approach, no large-scale investigations have applied data-driven, nonlinear methods to this outcome. In the present study, gradient boosting captured complex interactions among predictors and achieved the highest AUC, indicating superior predictive accuracy and generalizability across diverse AIS grades. Clinical symptoms of bowel dysfunction follow two distinct patterns: injuries above the conus medullaris lead to upper motor neuron (UMN) bowel syndrome, while injuries to the conus medullaris and cauda equina lead to lower motor neuron (LMN) bowel syndrome. 5 UMN bowel syndrome is characterized by increased tone in the colonic wall and anal sphincter, promoting stool retention. Since neural connections between the spinal cord and colon remain intact, reflexive coordination and stool propulsion are maintained. In these patients, rectal evacuation is achieved through reflexive activity by introducing suppositories or digital stimulation into the rectum. 22 LMN bowel syndrome is characterized by the loss of peristaltic movements mediated by the spinal cord, leading to delayed stool propulsion. LMN bowel syndrome increases the risk of constipation and incontinence due to weakened external anal sphincter and pelvic floor muscles. 22 Despite recent guidelines, research on bowel dysfunction lags that of bladder dysfunction.23,24 This study mainly included data from patients with spinal cord injuries, with a majority of cases involving cervical and thoracic level injuries, resulting in a higher prevalence of UMN bowel syndrome.
The features identified as important for predicting both bladder and bowel managements after SCI were mostly common. The nerves involved in regulating both bladder and bowel functions have many similarities, including the pelvic nerve, pudendal nerve, and hypogastric nerve. 7 The pelvic nerve, originating from the spinal roots S2–S4, promotes detrusor muscle contraction in urination and causes rectal contraction and relaxation of the internal anal sphincter in defecation. The pudendal nerve, also originating from S2 to S4, controls voluntary urination and maintains the contraction of the external anal sphincter to control defecation. Additionally, the hypogastric nerve, originating from the spinal roots T10–L2, promotes the relaxation of the detrusor muscle and contraction of the internal urethral sphincter in urination and relaxes the rectum and contracts the internal anal sphincter to inhibit bowel movements.21,25,26 Due to the common innervation and similar functions in both promoting and inhibiting actions, the same features were identified as important for predicting both BBD after SCI.
L3 motor function, days from injury to admission, and FIM bowel management were the three most critical predictors shared by both urination and bowel managements after SCI. LEMS has been incorporated into prediction in multiple studies, indicating that lower extremity muscle strength is a critical predictor of bladder dysfunction.1,8 In our study, L3 lower extremity muscle strength was identified, not because L3 motor function is uniquely important, but likely due to the ML process, which excluded other muscle strengths to mitigate multicollinearity. Additionally, shorter days from injury to admission positively influenced the acquisition of natural bladder and bowel functions. Given that this study encompasses data from both the acute and subacute phases, patients admitted shortly after injury may present with acute symptoms at the time of admission. As these patients have the potential for improvement during hospitalization, it is possible for them to attain independent bladder and bowel function as their condition evolves. Consequently, the early days following injury are likely a significant factor in the successful achievement of independent bladder and bowel function. 20 FIM bowel management was extracted as a direct parameter due to the focus on predicting bowel and bladder functions. A similar approach using early sphincter management scores from the SCIM has been shown by Pavese et al. to enhance the predictive accuracy for urinary continence, with the model achieving an AUC of 0.936. 8 Studies focusing on AIS have reported that 80% of patients with AIS-D, 38% with AIS-C, and 13% with AIS-B achieve natural urination one year after injury, suggesting that the severity of paralysis is a significant prognostic factor for bladder dysfunction. 20 However, in this study, AIS was not extracted as an important feature. This discrepancy may be attributed to differences in the dataset used, where factors such as sample size or patient demographics could have influenced the outcomes. Moreover, the application of the Boruta feature selection method, designed to identify the most relevant features by comparing them with random shadow features, may have resulted in AIS being excluded if it was deemed less important in the context of this specific dataset. Comparing the manually extracted features from previous logistic regression analyses with the features extracted by ML in this study, it was confirmed that lower extremity muscle strength, days since injury, and defecation ability at the time of admission are crucial features in both methods. These findings support the clinical validity of the Boruta-selected features. Although Boruta may exclude certain variables with known clinical relevance, such as AIS grade in our case, the remaining selected features align well with established prognostic factors reported in previous literature. This concordance suggests that the feature selection process in this study, while data-driven, retained key clinically meaningful predictors.
This study has several limitations. Due to the nature of the database study, the treatment protocols for BBD were not standardized across different facilities. Additionally, the study included a wide range of patients, from those in the acute phase transported on the day of injury to those in the subacute phase after transferring from acute care hospitals. Future research should aim to standardize the evaluation of BBD and ensure consistency in the severity of paralysis and the timing of assessments.
Conclusions
This research illustrates the effective application of ML in forecasting the prognosis of BBDs following SCI. Significant predictors for both bladder and bowel outcomes post-SCI were identified as L3 motor function, duration from injury to admission, and FIM bowel management. The predictive models for these outcomes were successfully implemented in a web application, making them accessible for health care professionals.
Transparency, Rigor, and Reproducibility Summary
The study design and analysis plan were not preregistered. A total of 4181 patients with traumatic SCI were initially extracted from the JARD, registered between January 1991 and December 2015. After excluding cases with insufficient data, 3949 were analyzed. No formal power analysis was conducted, as the study utilized an existing large-scale registry dataset. Feature selection was performed using the Boruta algorithm, and variables with more than 25% missing values were excluded. Outcomes were defined as binary indicators of natural urination and defecation at discharge. All subjects were retrospectively assigned to outcome groups based on medical records, and baseline characteristics were balanced by large sample size. Missing values were handled via imputation within the PyCaret framework (version 2.3.10 [https://pycaret.org]).
Model training and evaluation followed standard ML procedures using 70/30 train-test splits. SHAP values were used to interpret model predictions, identifying L3 motor function, time from injury to admission, and FIM bowel management score as the top contributing features for both outcomes. These variables were consistently influential across models. Correction for multiple comparisons was not applicable, as model performance metrics and feature importance were the primary focus.
The trained models and web applications are publicly accessible at bladder prediction tool (https://takakikitam-bladder-prediction.hf.space/) and bowel prediction tool (https://takakikitamura-bowel-prediction.hf.space). Code and data are not publicly available due to restrictions on the clinical registry; however, model outputs can be freely explored via application.
Footnotes
Acknowledgment
The authors acknowledge the JARD for establishing the Japan Rehabilitation Database, which served as a core resource for this study.
Authors’ Contributions
S.M. had full access to all of the data in the study and took responsibility for the integrity of the data and the accuracy of the data analysis. Concept and design: T.K. and S.M. Acquisition, analysis, or interpretation of data: All authors. Drafting of the article: T.K. Critical revision of the article for important intellectual content: All authors. Statistical analysis: T.K. Obtained funding: S.M. Administrative, technical, or material support: All authors. Supervision: S.O.
Declaration of Generative AI and AI-Assisted Technologies in the Writing Process
The author utilized ChatGPT, an AI model by OpenAI, to assist in improving the clarity, coherence, grammar, and spelling of the article. Following the use of this tool, the author thoroughly reviewed and edited the content, taking full responsibility for the final version of the publication.
Author Disclosure Statement
No competing financial interests exist.
Funding Information
This work was supported by a research grant funded by the JOA-Subsidized Science Project Research 2020-1 and JSPS KAKENHI Grant Number JP20K18052.
