Abstract
Preoperative diagnosis of urinary infection stones is difficult, and accurate detection of stone composition can only be performed ex vivo. To provide guidance for better perioperative management and postoperative prevention of infection stones, we developed a machine learning model for preoperative identification of infection stones in vivo. The clinical data of patients with urolithiasis who underwent surgery in our hospital from January 2011 to December 2015 and January 2017 to December 2021 were retrospectively analyzed. A total of 2565 patients were included in the study, and 1168 eligible patients with urinary calculi were randomly divided into training set (70%) and test set (30%). Five machine learning algorithms (Support Vector Machine (SVM), Multilayer Perceptron (MLP), Decision Tree (DT), Random Forest Classifier (RFC), and Adaptive Boost (AdaBoost)) and 14 preoperative variables were used to construct the prediction model. The performance measure was the area under the receiver operating characteristic curve (AUC) of the validation set. The importance of 14 features in each prediction model for predicting infection stones was analyzed. A total of 89 patients (5.34%) with infection stones were included in the validation set. All the five prediction models showed strong discrimination in the validation set (AUC: 0.689–0.772). AdaBoost model was selected as the final model (AUC: 0.772(95% confidence interval, 0.657–0.887); Sensitivity: 0.522; Specificity: 0.902), UC positivity, and urine pH value were two important predictors of infection stones. We developed a predictive model through machine learning that can quickly identify infection stones in vivo with good predictive performance. It can be used for risk assessment and decision support of infection stones, optimize the disease management of urinary calculi and improve the prognosis of patients.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
Introduction
Urolithiasis is a relatively common disease in urology, and its prevalence has been increasing worldwide over the past few decades [1, 2]. Studies have shown that about 1/17 Chinese adults have kidney stones [3], the recurrence rate was estimated to be 67% within 5 years. Infection stones account for 10%–15% of urolithiasis, and is a specific type of urolithiasis associated with urinary tract infection (UTI) caused by urease producing organisms [4]. It can rapidly grow into giant staghorn stones within 4 to 6 weeks, and struvite is generally considered to be an independent risk predictor for infectious-related complications, such as sepsis, in patients after percutaneous nephrolithotomy [5, 6]. Patients with infection stones represent one of the most challenging populations of patients with urolithiasis due to their complex structure and high recurrence rate [7, 8]. Stone composition is the basis for further diagnosis and treatment decisions, and the management of infection stones should start with early and correct identification [9, 10]. At present, there are some predictive models to distinguish infection stones from non-infection stones. However, there are few reports on preoperative prediction models that can achieve rapid, simple, and in vivo prediction based on large samples.
The development of machine learning algorithms may provide an opportunity for early preoperative prediction of infection stones by integrating large amounts of data such as demographics, diagnostics, routinely collected measurements, and interventions [11]. It can effectively deal with the nonlinear relationship and high-dimensional space in medical data, with high accuracy and good generalization in the field of urinary calculi, which outperform traditional modeling methods [12]. Machine learning has been applied in biomedical fields such as disease diagnosis, outcome prediction, medical image analysis, and therapeutics [13, 14]. Therefore, in this study, we sought to develop machine learning models that can be used to differentiate infection and non-infection stones before necessary surgery is performed on patients with urinary stones to better guide perioperative management and prevent the occurrence of infection stones after surgery.
Material and methods
Patients
The study was approved by the ethics committee of the First Affiliated Hospital of Sun Yat-sen University, and the requirement for informed consent was waived (No.: IIT-2022-437). The clinical data of 2565 patients who underwent surgery for urinary calculi in our hospital from January 2011 to December 2015 and January 2017 to December 2021 were retrospectively analyzed (the test was not performed in 2016 due to mechanical reasons). After excluding patients with incomplete clinical data, 1168 patients were used for modeling. Baseline clinical data were obtained from medical records, including age, sex, urinalysis and urine culture, a total of 24 indicators. The composition of the stones was analyzed by Fourier transform infrared spectroscopy, and the main stone components were recorded. The stone component with the highest proportion was selected as the main stone component. When magnesium ammonium phosphate hexahydrate occurs, the main ingredient is determined to be magnesium ammonium phosphate hexahydrate, regardless of the proportion. Infection stones mainly include magnesium ammonium phosphate hexahydrate and calcium carbonate stones. Others were considered to be non-infection stones.
Model
The samples were randomly divided into a training set and a validation set at a ratio of 7∶3 for the establishment and validation of the model, respectively. Five machine learning algorithms including SVM, MLP, DT, RFC, and AdaBoost were used to establish the prediction model. SVM solves the binary classification problem by fitting a maximum margin discriminator to a dataset in a kernel-induced feature space, and it has been applied in many medical diagnostics and disease classifications [15]. The MLP architecture consists of multiple interconnected hidden neurons, and the PyTorch framework is used to build and train the MLP model. We performed a semi-systematic grid search to explore the models that could be generated using multiple different combinations of the presented hyperparameters [16]. In the DT, the root node of the tree will be the feature that optimally partitions the training data. The threshold that maximizes the homogeneity of the sample subgroups is found by repeating this step [17]. RFC is a tree-based algorithm that integrates multiple decision trees by majority voting to determine the classification result [18]. Applying the boosting algorithm AdaBoost [19] provides a correction mechanism to improve the model after each prediction of the patient state [20]. Ultimately, the decision is the result of the summation of all the basic models. It is one of the most effective techniques in machine learning.
Data analysis
SPSS 26.0 software was used to analyze the data. Measurement data were expressed as mean ± standard deviation (SD), the t-test was used for normal distribution and the Mann–Whitney U test was used for non-normal distribution. The Chi-square test or Fisher exact test was used to compare the differences between the two groups. Statistical significance was defined as two-sided P < 0.05. Logistic regression was used for univariate regression analysis, and the factors with higher degrees of freedom were selected to construct the prediction model. receiver operating characteristic (ROC) and area under the curve (AUC) was used to evaluate the ability of each model to distinguish non-infectious and infectious stones. The 95% confidence interval (CI) of AUC and the difference in AUC values among different models were tested to determine the best threshold of infection stones Sensitivity, specificity, and accuracy were calculated at the optimal threshold.
Results
Patients
Table 1 presents the clinical data from the demographic, stone composition analysis based on the gender of 2565 patients. The average age of the patients was 52.14 years old, with 65.07% of males and 34.93% of females. The highest incidence of stones in males was 41–50 years old (25.04%), and that in females was 51–60 years old (33.82%). In terms of stone composition, there were 1770 cases (69.01%) of calcium oxalate stones, 482 cases (18.79%) of uric acid stones, 118 cases (4.6%) of calcium phosphate stones, and 189 cases (7.37%) of infection stones. The proportion of infection stones in men was lower than that in women (M/F = 0.64, P < 0.001). The spectrum of pathogens isolated from urine cultures is shown in Supplementary Figure S1. The most common pathogen of non-infection stones was Escherichia coli (107 strains), followed by Enterococcus faecalis (20 strains) and streptococcus agalactiae (14 strains). proteus mirabilis was the most common pathogen of infection stones (18 strains), followed by Escherichia coli (11 strains) and klebsiella pneumoniae (7 strains). Supplementary Figure S2 shows the urine pH level distribution of infection stones and non-infection stones. Among the infection stones, 44.94% of the patients had a urine pH of 6.0, 17.98% had a urine pH of 6.5, and 25.84% had a urine pH of 7.0. Among the non-infection stones, 11.39% of the patients had a urine pH of 5.0, 50.28% had a urine pH of 6.0 and 25.28% had a urine pH of 6.5. In terms of timeline, the incidence of urolithiasis increased, and the ratio of males to females decreased, but it did not reach statistical significance. The incidence of infection stones increased, and the incidence of uric acid stones decreased, indicating that the health management of uric acid stones had improved (Table 2). A total of 35 patients had at least second recurrence, of which 34.3% had inconsistent recurrence components, and the incidence of infection stones was increasing (5 cases) (Table 3).
Model
A total of 1168 patients participated in the modeling, we randomly assigned 70% of the patients to the training set and the remaining 30% to the test set, where infection stones accounted for approximately the same proportion in the training set (7.6%) and the validation set (9.7%), and no significant differences in any variables were found between the training and validation set (Table 4). In the training set, Univariate analysis showed that a total of 14 factors, such as urine culture, urine pH value, and gender, were significantly different between the patients with infection stones and non-infection stones, and the degree of freedom was 1, which was closely related to the occurrence of infection stones (Table 5). Machine learning algorithms were used to construct predictive models from these factors. The AUC, specificity, sensitivity, and accuracy of each model in the training and validation set are shown in Supplementary Table S1 and Table 6, respectively. The receiver operating characteristic curves of the different models are shown in Fig. 1A and B. The AUC values of SVM, MLP, DT, RFC, and AdaBoost in the test set were 0.754 (95% CI 0.637–0.872), 0.741 (95% CI 0.622–0.860) and 0.689 (95% CI 0.566–0.813), respectively, 0.767 (95% CI 0.651–0.883), 0.772 (95% CI 0.657–0.887). The sensitivity values of the five machine learning model scores ranged from 0.522 to 0.739, the specificity values ranged from 0.677–0.902, and the accuracy values ranged from 0.681 to 0.877. After considering other scores, especially prediction accuracy, the AdaBoost model was selected as the final prediction model.
Discussion
In this study, we explored the applicability of machine learning methods to distinguish infection stones from non-infection stones preoperatively in patients. Among the five machine learning models, the AdaBoost model had the highest AUC. Due to the complexity of infection stones, clinical models integrating conventional parameters may be more effective predictors than considering any parameter alone. One possible way to achieve this is to utilize advanced machine-learning methods that have been applied to the prevention and management of infection stones. The construction of the prediction model is derived from common clinical parameters, which are simple, easy to perform, and do not require high technical requirements. It is suitable for promotion in primary hospitals, thus expanding the application prospect of this study.
With the progress and development of minimally invasive surgical techniques and endoscopic instruments, traditional open surgery has been gradually replaced by a variety of minimally invasive surgical methods. The determination of stone types can guide the clinical selection of appropriate treatment methods, and provide a basis for the etiological analysis and the formulation of reasonable surgical plans [21]. Infection stones, which are composed of magnesium ammonium phosphate, carbonate apatite, or ammonium urate, are easily crushed, but can also cause systemic infection after lithotripsy. Therefore, surgeons should remove infection stones as much as possible to avoid residual stones during the operation. Effective antimicrobial therapy is an appropriate intervention for patients with urinary tract infections and recurrent stones [22, 23]. Patients with infection stones may have high rates of infectious complications and mortality, with or without treatment [24, 25]. The mean concentration of serum endotoxin in patients with infection stones was 35 times higher than that in patients with non-infection stones [26].
The formation of infection stones is closely related to urease-producing bacteria. In the present study, positive preoperative urine culture was a predictor of infection stones [27, 28]. As long as urease-producing bacteria appear, the possibility of infection stones should be considered first (Table S2). However, the positive rate of urease-producing bacteria culture is not high at present, it may be that the existing culture medium may not be suitable for the growth of urease-producing bacteria. In the future, renal pelvic urine culture or even stone culture may be needed to further increase the positive rate, and direct detection of urinary microbiota may be considered to be closer to reality. When the prediction model consider that the urolithiasis is infection stones, the treatment should be based on the urine culture analysis (Figure S1). Furthermore, when these urease-producing organisms infect the urinary tract, urea is broken down into ammonia and carbon dioxide in the presence of urease [7], thereby raising urine pH and increasing the concentrations of NH4+, CO32−, and PO43−. It has been shown that the crystallization of carbonate apatite begins at a pH greater than 6.8, whereas the crystallization of struvite occurs at a pH greater than 7.2, and the higher the urine pH, the higher the probability of infection stones [29]. In fact, an alkaline urine favors the crystallization of stones containing calcium and phosphate [30]. This is to some extent consistent with the results of our study (Figure S2). Interestingly, our study showed that although the urine pH of infection stones was indeed more alkaline than that of non-infection stones, about half of the patients (44.94%) still had a pH of 6.0, for which a more personalized treatment plan is needed.
Meanwhile, our study also found that for patients with recurrences more than once, the composition of recurrent stones was not completely consistent, and the incidence of infection stones increased with recurrence. It is very important to remove the stones thoroughly during the operation, antibiotics should be used in the perioperative period, and the corresponding dietary structure should be adjusted according to the composition of the stones after the operation. The treatment of infection stones, a special subset of urolithiasis formed by urinary tract infection, is particularly challenging [4, 31], which carries a high risk of postoperative infectious complications that may lead to life-threatening conditions such as severe sepsis and septic shock [32]. Although the use of antibiotics before and after surgery is essential for the adjuvant management of infection stones, the duration and mode of antibiotic therapy are not addressed in current clinical guidelines [33]. Urease inhibitors can directly interfere with the growth process of infection stones precursors and are recommended for patients with surgical contraindications or recurrent infections even after the treatment of infection stones. Urease inhibitors alter urine pH to avoid sedimentation and clearance of infected stones [34].
Our study has some limitations. First, this study was a single-institution retrospective study with a limited number of cases and some selection bias, and the lack of multicenter external validation limits the satisfactory generalizability of the model to other cohorts. At present, the prediction performance is not accurate enough, and other urine indicators, such as urine microorganisms and imaging features, need to be further added to improve the prediction performance. Further work should include optimization and external validation of the model in a larger cohort from multiple centers.
Conclusions
In conclusion, we developed a preoperative prediction model using machine learning to identify urinary infection stones in vivo. The model is easy to use for both clinicians and patients and may allow clinicians to predict stone types more precisely before surgery, to optimize the disease management of urolithiasis and improve the prognosis of patients.
Data availability
The data used to support the findings of this study are included within the article.
References
De Coninck V, Antonelli J, Chew B, Patterson JM, Skolarikos A, Bultitude M (2019) Medical expulsive therapy for urinary stones: future trends and knowledge gaps. Eur Urol 76(5):658–666. https://doi.org/10.1016/j.eururo.2019.07.053
Chewcharat A, Curhan G (2021) Trends in the prevalence of kidney stones in the United States from 2007 to 2016. Urolithiasis 49(1):27–39. https://doi.org/10.1007/s00240-020-01210-w
Zeng G, Mai Z, Xia S, Wang Z, Zhang K, Wang L et al (2017) Prevalence of kidney stones in China: an ultrasonography based cross-sectional study. BJU Int 120(1):109–116. https://doi.org/10.1111/bju.13828
Flannigan R, Choy WH, Chew B, Lange D (2014) Renal struvite stones-pathogenesis, microbiology, and management strategies. Nat Rev Urol 11(6):333–341. https://doi.org/10.1038/nrurol.2014.99
Chan JYH, Wong VKF, Wong J, Paterson RF, Lange D, Chew BH et al (2021) Predictors of urosepsis in struvite stone patients after percutaneous nephrolithotomy. Invest Clin Urol 62(2):201–209. https://doi.org/10.4111/icu.20200319
Rivera M, Viers B, Cockerill P, Agarwal D, Mehta R, Krambeck A (2016) Pre- and postoperative predictors of infection-related complications in patients undergoing percutaneous nephrolithotomy. J Endourol 30(9):982–986. https://doi.org/10.1089/end.2016.0191
Espinosa-Ortiz EJ, Eisner BH, Lange D, Gerlach R (2019) Current insights into the mechanisms and management of infection stones. Nat Rev Urol 16(1):35–53. https://doi.org/10.1038/s41585-018-0120-z
Zheng J, Yu H, Batur J, Shi Z, Tuerxun A, Abulajiang A et al (2021) A multicenter study to develop a non-invasive radiomic model to identify urinary infection stone in vivo using machine-learning. Kidney Int 100(4):870–880. https://doi.org/10.1016/j.kint.2021.05.031
Daudon M, Dore JC, Jungers P, Lacour B (2004) Changes in stone composition according to age and gender of patients: a multivariate epidemiological approach. Urol Res 32(3):241–247. https://doi.org/10.1007/s00240-004-0421-y
Stasinou T, Bourdoumis A, Masood J (2017) Forming a stone in pelviureteric junction obstruction: cause or effect? Int Braz J Urol 43(1):13–19. https://doi.org/10.1590/s1677-5538.Ibju.2015.0515
Luo X-Q, Yan P, Zhang N-Y, Luo B, Wang M, Deng Y-H et al (2021) Machine learning for early discrimination between transient and persistent acute kidney injury in critically ill patients with sepsis. Sci Rep. https://doi.org/10.1038/s41598-021-99840-6
Handelman GS, Kok HK, Chandra RV, Razavi AH, Lee MJ, Asadi H (2018) eDoctor: machine learning and the future of medicine. J Intern Med 284(6):603–619. https://doi.org/10.1111/joim.12822
Liu H, Wang X, Tang K, Peng E, Xia D, Chen Z (2021) Machine learning-assisted decision-support models to better predict patients with calculous pyonephrosis. Transl Androl Urol 10(2):710. https://doi.org/10.21037/tau-20-1208
Aminsharifi A, Irani D, Tayebi S, Kafash TJ, Shabanian T, Parsaei H (2020) Predicting the postoperative outcome of percutaneous nephrolithotomy with machine learning system: software validation and comparative analysis with guy’s stone score and the CROES nomogram. J Endourol 34(6):692–699. https://doi.org/10.1089/end.2019.0475
Blumenthal DT, Artzi M, Liberman G, Bokstein F, Aizenstein O, Ben BD (2017) Classification of high-grade glioma into tumor and nontumor components using support vector machine. Am J Neuroradiol 38(5):908–914. https://doi.org/10.3174/ajnr.A5127
Alkadri S, Ledwos N, Mirchi N, Reich A, Yilmaz R, Driscoll M et al (2021) Utilizing a multilayer perceptron artificial neural network to assess a virtual reality surgical procedure. Comput Biol Medi. https://doi.org/10.1016/j.compbiomed.2021.104770
Kalafi EY, Nor NAM, Taib NA, Ganggayah MD, Town C, Dhillon SK (2019) Machine learning and deep learning approaches in breast cancer survival prediction using clinical data. Folia Biol 65(5–6):212–220
Biau G, Scornet E (2016) A random forest guided tour. TEST 25(2):197–227. https://doi.org/10.1007/s11749-016-0481-7
Freund Y, Schapire R, Abe N (1999) A short introduction to boosting. J Japan Soc Artif Intell 14(5):771–780
Iwendi C, Bashir AK, Peshkar A, Sujatha R, Chatterjee JM, Pasupuleti S et al (2020) COVID-19 patient health prediction using boosted random forest algorithm. Front Public Health. https://doi.org/10.3389/fpubh.2020.00357
Coursey CA, Casalino DD, Remer EM, Arellano RS, Bishoff JT, Dighe M et al (2012) ACR appropriateness criteria (R) acute onset flank pain-suspicion of stone disease. Ultrasound Q 28(3):227–233. https://doi.org/10.1097/RUQ.0b013e3182625974
Tuerk C, Petrik A, Sarica K, Seitz C, Skolarikos A, Straub M et al (2016) EAU guidelines on interventional treatment for urolithiasis. Eur Urol 69(3):475–482. https://doi.org/10.1016/j.eururo.2015.07.041
Cui X, Che F, Wang N, Liu X, Zhu Y, Zhao Y et al (2019) Preoperative prediction of infection stones using radiomics features from computed tomography. Ieee Access 7:122675–122683. https://doi.org/10.1109/access.2019.2937907
Wollin DA, Preminger GM (2018) Percutaneous nephrolithotomy: complications and how to deal with them. Urolithiasis 46(1):87–97. https://doi.org/10.1007/s00240-017-1022-x
Liu M, Cui Z, Zhu Z, Gao M, Chen J, Zeng F et al (2022) Development of a nomogram predicting the infection stones in kidney for better clinical management: a retrospective study. J Endourol 36(7):947–953. https://doi.org/10.1089/end.2021.0735
McAleer IM, Kaplan GW, Bradley JS, Carroll SF, Griffith DP (2003) Endotoxin content in renal calculi. J Urol 169(5):1813–1814. https://doi.org/10.1097/01.ju.0000061965.51478.79
Iqbal MW, Shin RH, Youssef RF, Kaplan AG, Cabrera FJ, Hanna J et al (2017) Should metabolic evaluation be performed in patients with struvite stones? Urolithiasis 45(2):185–192. https://doi.org/10.1007/s00240-016-0893-6
Terry RS, Preminger GM (2020) Metabolic evaluation and medical management of staghorn calculi. Asian J Urol 7(2):122–129. https://doi.org/10.1016/j.ajur.2019.12.007
Gadalla AAH, Friberg IM, Kift-Morgan A, Zhang J, Eberl M, Topley N et al (2019) Identification of clinical and urine biomarkers for uncomplicated urinary tract infection using machine learning algorithms. Sci Rep. https://doi.org/10.1038/s41598-019-55523-x
Carpentier X, Daudon M, Traxer O, Jungers P, Mazouyes A, Matzen G et al (2009) Relationships between carbonation rate of carbapatite and morphologic characteristics of calcium phosphate stones and etiology. Urology 73(5):968–975. https://doi.org/10.1016/j.urology.2008.12.049
Bichler KH, Eipper E, Naber K, Braun V, Zimmermann R, Lahme S (2002) Urinary infection stones. Int J Antimicrob Agents 19(6):488–498. https://doi.org/10.1016/s0924-8579(02)00088-2
Koras O, Bozkurt IH, Yonguc T, Degirmenci T, Arslan B, Gunlusoy B et al (2015) Risk factors for postoperative infectious complications following percutaneous nephrolithotomy: a prospective clinical study. Urolithiasis 43(1):55–60. https://doi.org/10.1007/s00240-014-0730-8
Assimos D, Krambeck A, Miller NL, Monga M, Murad MH, Nelson CP et al (2016) Surgical management of stones: American urological association/endourological society guideline, Part I. J Urol 196(4):1153–1160. https://doi.org/10.1016/j.juro.2016.05.090
Das P, Gupta G, Velu V, Awasthi R, Dua K, Malipeddi H (2017) Formation of struvite urinary stones and approaches towards the inhibition-a review. Biomed Pharmacother 96:361–370. https://doi.org/10.1016/j.biopha.2017.10.015
Funding
None.
Author information
Authors and Affiliations
Contributions
Project development: RW, CM; data collection, data analysis, and manuscript writing: YW, YX, JZ, JG; material preparation, data collection, and analyses: SJ, CQ, QM; draft preparation of the original manuscript: YW, QM; editing the manuscript: all authors; reading and approval of the final version of the manuscript: all authors.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that there is no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
Below is the link to the electronic supplementary material.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Wu, Y., Mo, Q., Xie, Y. et al. A retrospective study using machine learning to develop predictive model to identify urinary infection stones in vivo. Urolithiasis 51, 84 (2023). https://doi.org/10.1007/s00240-023-01457-z
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s00240-023-01457-z