Introduction

Urolithiasis is the most common condition in urology, which poses a significant burden on public health globally. This disease elevate the risk of urinary tract infections that may result in septic shock, and potentially adverse renal outcomes1,2afflicting up to 10% of adults3. In the past few decades, the prevalence of urolithiasis has shown an obvious increase4. The pooled prevalence of urolithiasis is 8.1% in China5.

Stone composition analysis is a critical means of studying urinary stones. Even though around 100 distinct chemical compositions have been identified in stones currently6little progress has been made in elucidating lithogenesis mechanisms, especially for calcium-based stones that represent the majority of stone cases. Some previous studies have made an important step for obtaining the elemental composition information of urinary stones and reported that there was a diverse range of elements in stone samples7,8,9including Ca, Na, K, Mg, Sr, C, H, O, N, and P. However, most of these studies merely list the detected elements without delving into the clinical significance of elemental composition information.

In this study, laser-induced breakdown spectroscopy (LIBS) was utilized to investigate the elemental composition of 122 calcium-based stones and integrated this data with clinical information for comprehensive analysis. Then, the back propagation neural network (BPNN) algorithm was used to construct a classification model to distinguish profiles associated with recurrent calcium-based stone formation, and aid clinical physicians in identifying patients exhibiting characteristics associated with recurrence risk. We believe that establishing a connection between elemental composition information and clinical characteristics is crucial for the development of effective intervention strategies in urolithiasis.

Methods

This study has been approved by the Ethics Committee of the Second Hospital of Tianjin Medical University. The research was conducted in strict adherence to the Declaration of Helsinki and the Chinese Ministry of Health’s “Ethical Review Measures for Biomedical Research Involving Human Subjects (Trial)”.

Preparation and detection of stone samples

All the stone samples were obtained from patients who underwent stone removal surgery. A total of 122 calcium-based stones from the Second Hospital of Tianjin Medical University were selected for analysis. The infrared spectroscopy (IR) results were used as reference compositions, including 41 calcium oxalate (CaOx) stones, 11 calcium phosphate (CaP) stones, 49 CaOx/CaP mixed stones, 8 CaOx/uric acid (UA) mixed stones, and 13 CaP/struvite mixed stones. The original samples underwent a double wash with normal saline, followed by two rinses with deionized water, each lasting a minimum of 2 min. Then the cleaned stones were dried in a constant-temperature oven at 60 °C for 2 h. After drying, the stones were placed at the bottom of a cylindrical silicone mold, which was subsequently filled with photosensitive resin to fully encapsulate the stones. The resin was cured under ultraviolet light for 10 min (Fig. 1A,B).

Fig. 1
figure 1

(A) Schematic diagram of sample embedding. (B) Embedded samples. (C) Schematic diagram of the LIBS detection experimental setup. (D) Typical averaged spectra for each type of samples.

The schematic diagram of the LIBS experimental setup is shown in Fig. 1C. The laser source was a infrared pulsed Nd: YAG laser (Litron Nano SG 150 − 10) emitting at a wavelength of 1064 nm. The spectrometer (LTB ARYELLE 150) detected wavelengths ranging from 200 to 900 nm. The excitation energy was set to 100 mJ, with a delay time of 1µs. To ensure a constant distance between the lens and the sample, an oblique positioning laser beam was introduced. By using a charge coupled device (CCD) to observe the sample surface, the indicator light was aligned with the LIBS excitation site and positioned at the center of the field of view prior to formal detection. During the actual detection process, the sample stage was adjusted three-dimensionally to bring the measurement site into coincidence with the indicator light (Supplementary Fig. 1). Each sample was measured at five close positions (25 laser shots per spot), intentionally aligned with the location used for IR detection. The first 5 spectra at each position were excluded, yielding a total of 100 spectra per sample. One of the detected samples are shown in Supplementary Fig. 2.

According to the Atomic Spectral Database of the National Institute of Standards and Technology (NIST), characteristic wavelengths of the target elements were determined (Supplementary Table 1). Recent work has shown that in complex matrices, such as biological or organic materials, the most intense NIST lines may not be the most reliable in practice due to matrix effects and self-absorption10. Therefore, in order to increase the reliability of characteristic line selection, we used this LIBS device to detect standard chemicals (Supplementary Table 2). The settings for excitation energy and delay time were the same as those for detecting stone samples. Then, the characteristic spectral lines of the standard sample and the stone samples were compared (Supplementary Figs. 3 and 4). A tablet press was used to compress these standard chemicals into cylindrical samples with a diameter of 2 cm and a thickness of 1 mm. Pressing pressure of 10 MPa, pressing time of 3 min (Supplementary Figs. 5).

The selection of these specific standard chemicals was based on the primary inorganic constituents and common elemental substitutions found in calcium-based urinary stones. While these pure chemicals do not fully replicate the complex organic-inorganic composite matrix of biological stones, they provide a reliable and practical means to identify the characteristic emission lines for each element and to select those that are most robust against potential spectral interferences within our system.

According to the detection principle of LIBS, the intensity of spectral lines can partially indicate the concentrations of corresponding elements, and intensity ratios can be used to compare the differences in elemental contents semi-quantitatively11. Thus, the spectral line of Ca at 396.847 nm was selected as the reference to calculate the intensity ratios of C, H, P, Mg, Sr, Na, and K elements. The characteristic wavelengths of these elements are summarized in Supplementary Table 3.

Collection of clinical information

The baseline data, laboratory tests, and imaging results for these patients were retrospectively collected and analyzed (Table 1). These patients were classified into the first-episode group and the recurrent group. Recurrence was defined as the development of new stones following the complete removal of previous stones through surgical intervention (including extracorporeal shock wave lithotripsy) or medication treatment.

Table 1 Clinical information of patients in recurrent and first-episode groups.

Construction of a classification model for recurrence-associated profiles

Firstly, the spectral data was pre-treated using min-max normalization and principal component analysis (PCA). Then the classification model construction to distinguish recurrence-associated profiles was achieved by BPNN algorithm. The specific parameter settings included Levenberg-Marquardt algorithm with one hidden layer consisting of 50 neurons, a learning rate of 0.01, a maximum of 1000 training iterations, and a target performance of 1e-6 (i.e., mean square error). Each modeling iteration randomly split the training and testing sets in a 70%:30% ratio stratified by outcome class, repeated independently for 100 times. The clinical variables listed in Table 1 were included in the analysis. One-hot encoding was utilized to label different types of stones.

The average predictive accuracy of the model on the training and testing sets was computed to compare the performance of models constructed using the following four methods: 1.Modeling was conducted solely using clinical data. 2.Modeling was conducted using the top 100 principal components (PCs) from spectral data. 3.Modeling was conducted by merging the top 50 PCs of spectral data with clinical data. 4.The clinical data was directly merged with the spectral data, followed by normalization and PCA. Then the top 100 PCs were used for modeling. The accuracy, precision, recall, and F1 score was also used to evaluate the performance of the models. Besides, the area under the curve (AUC) of receiver operating characteristic (ROC) curve and precision–recall (P–R) curve was also calculated.

After determining the optimal model, 16 stone samples from other tertiary medical centers (Tianjin First Central Hospital, Tianjin Fifth Central Hospital, and Cangzhou Central Hospital) were tested following the same procedure as described previously, yielding a total of 1,600 spectra. These spectra were then utilized for external validation of the model. The composition of these stones and clinical information of the patients are summarized in Supplementary Tables 4 and 5.

Data processing and statistical analysis

Data analysis was carried out using MATLAB software (R2022a) and SPSS software (version 25.0). Numerical data were presented as mean ± standard deviation, while categorical data were reported as frequency and percentage. Categorical variables were compared using the Pearson’s χ2 test or Fisher’s exact test, and numerical variables were compared using either an Student’s t-test or Mann-Whitney U test. Linear regression and Spearman correlation analysis was used to assess the correlation of variables. p < 0.05 was considered statistically significant.

Results

Sample elemental analysis

A total of 12,200 spectra were obtained for all samples. By taking the arithmetic average of 100 spectra for each sample, a total of 122 averaged spectra were obtained. Elemental annotation was performed using these averaged spectra. The typical averaged spectra for each type of samples were shown in Fig. 1D.

Characteristic peaks of Ca, Na, K, C, H, O, and N were detected in all samples, whereas distinctive peaks of Cu, Ni, Fe, Mn, Pb, Cr, Cl, and S elements were not identified in any sample. Elements that were present in only a subset of samples, including P, Mg, Sr, Zn, and Al, were shown in Fig. 2. It can be seen in Supplementary Figs. 3 and 4 that the characteristic spectral lines in the stone samples correspond to those of the standard chemicals, indicating the reliability of the element annotation results in this study. Of note, almost all calcium-based samples contained Mg and Sr. Al and Zn were exclusively identified in samples that contained CaP.

Fig. 2
figure 2

Elements that were present in only a subset of samples. CaOx calcium oxalate, CaP calcium phosphate, UA uric acid.

The results of Spearman analysis were shown in Fig. 3. A significant positive correlations was observed among these ratios, with the highest correlation recorded between Sr and Mg (correlation coefficient = 0.92) and the lowest correlation between phosphorus P and C (correlation coefficient = 0.38). Furthermore, the correlation coefficients of P with other metallic elements were consistently above 0.8.

Fig. 3
figure 3

Correlations between intensity ratios. The numbers in the box represent the correlation coefficients. *p < 0.05; **p < 0.01.

The calculation results of the intensity ratios were shown in Supplementary Table 6. The linear regression results were summarized in Supplementary Table 7. Although the linear relationship between all elements was statistically significant, only some elements had high R2 values. Supplementary Fig. 6 shows the linear regression plots between elements with R2 > 0.7. The linear fitting results among P, Mg, Sr, and K were good.

Analysis of clinical characteristics and intensity ratios

The clinical data were presented in Table 1. The recurrent group exhibited a lower prevalence of hypertension (26.53% vs. 49.32%, p = 0.012) and stone average computer tomography (CT) value (804.74 ± 206.25HU vs. 878.05 ± 186.70HU, p = 0.044), while low density lipoprotein cholesterol (LDL-C) level (3.05 ± 1.57mmol/L vs. 2.71 ± 0.82mmol/L, p < 0.01), total cholesterol (TC) level (4.70 ± 0.78mmol/L vs. 4.35 ± 0.85mmol/L, p = 0.022), atherosclerosis index (AI) (3.71 ± 1.16 vs. 3.15 ± 1.31, p = 0.017) and urine pH value (6.11 ± 0.59 vs. 5.82 ± 0.50, p < 0.01) were higher.

The results of Spearman analysis between intensity ratios and continuous clinical variables were shown in Supplementary Fig. 7. The relative contents of H, P, Mg, Sr, Na, and K were significantly positively correlated with urine pH and significantly negatively correlated with the average CT value of stones. Additionally, the relative contents of P, Mg, Sr, Na, and K were significantly positively correlated with TC and LDL-C level.

As shown in Supplementary Fig. 8, for overall stone samples, the values of P/Ca, Mg/Ca, Sr/Ca, Na/Ca, K/Ca and H/Ca in the recurrent group were significantly higher. Although the intensity ratios of CaOx stones in recurrence group were slightly higher, the difference was not statistically significant (Supplementary Fig. 9).

Recurrent stone classification model

As shown in Fig. 4A,B, the Method-1 model demonstrated the lowest average accuracy on training set (76.67%) and test set (73.37%). In contrast, Method-2 significantly enhanced the accuracy for both the training (95.94%) and test (93.18%) sets. The Method-3 model attained an average accuracy of 97.82% on the training set and 94.20% on the test set. Method-4 yielded an average accuracy of 97.99% on the training set and 94.37% on the test set. There was no statistically significant difference in accuracy between the latter two models on the training and test sets. In 100 modeling repetitions, the highest classification accuracy of the four models on the test set were 79.66%, 94.62%, 95.73%, and 95.86%, respectively. At this point, other performance indicators on the test set were listed in Supplementary Table 8. The ROC curves and P-R curves for these models were also plotted (Fig. 4C and D). Overall, the Method-4 model performed the best and was confirmed as the optimal model.

Fig. 4
figure 4

(A) Comparison of classification accuracy of the models on the training set. (B) Comparison of classification accuracy of the models on the test set. (C) ROC curves of the models on the test set. (D) P–R curves of the models on the test set. ROC curve receiver operating characteristic curve, P-R curve precision-recall curve, AUC area under the curve. *p < 0.05; **p < 0.01; NS not significant.

The 1600 external spectra and corresponding clinical variables were processed according to Method 4 and input into this model for validation, with accuracy, precision, recall, and F1 values of marco-88.89%/micro-88.89%, marco-89.05%/micro-88.89%, marco-88.03%/micro-88.89%, and marco-0.8843/micro-0.8889, respectively. The AUC of ROC curve and P-R curve were 0.9523 and 0.9393, respectively (Supplementary Fig. 10).

Discussion

This study employed LIBS platform to analyze the elemental composition of 122 calcium-based stones. Subsequently, a comprehensive analysis was conducted on the elemental information and clinical data.

The detection of elements such as C, H, O, and N in the samples can be attributed not only to the main chemical components, but also to the organic substances within the samples, such as lipids and proteins. On the other hand, the results in this study solidly support the argument that both Na and K are present in urinary stones12.

Almost all calcium-based stones contained Mg and Sr. Additionally, a significant positive correlation was observed between P and other metallic elements (Mg, Sr, Na and K) in Spearman analysis (Fig. 3). P also displayed a degree of linear correlation with Mg and Sr. Earlier researches have shown that CaP crystals constitute the primary components of Randall’s plaques (RPs) and serve as the central nidus of calcium-based stones13,14where P predominantly exists in the form of apatite. Apatite is one of the major crystal found in kidney stones, often presenting as a fine powdery mass that fills the interstitial spaces among various crystal types, mainly CaOx crystals13. It is important to realize that the Ca2+ in apatite can be substituted by cations easily. Sherer et al.15 reported that there were detectable presence of O, C, Na, Ca, P, Mg and F within RPs. Elevated Zn levels have also been reported in the carbapatite of RPs16. Other analysis revealed that Zn, Mg and Sr were more abundant in CaP than in CaOx stones8,17. Blaschko et al.18 claimed that Sr co-located with Ca in all calcium-based stones, present as strontium apatite.

The evidence mentioned above, along with the strong correlation between metal cations and P observed in this study, leads us to posit that these metal ions are predominantly accumulated in the stones through the substitution of Ca2+ within apatite. As the apatite composition rises, the content of other metal elements correspondingly increases. Mg, Ca and Sr are located in the same column on the periodic table and share similar properties, hence making substitution more easily. In contrast, due to the less similarity of ions charge and size, the substitution of Zn and Al is difficult. Mg and Sr can also be detected in CaOx/UA mixed stones without P, indicating that oxalate can also bind with Mg and Sr. In fact, some researchers believe that Mg2+ competes with Ca2+ for binding to oxalate and impedes the crystallization of CaOx12,19.

A significant limitation of prior studies is the lack of integration between elemental information and clinical features. The results of this study reveled that the intensity ratios of H, P, Mg, Sr, Na, and K had significant negative correlation with average CT value and a positive correlation with urine pH value. The ratios of recurrent group were notably elevated. These results are in line with expectations, as CaP crystals show an increased tendency to develop in alkaline condition20. Higher CaP content will lower the average CT value, and lead to increased Mg and Sr accumulation in the stones. On the other hand, since CaP has been established as a favorable nucleating agent for calcium-based stones13,21,22 it is reasonable that the P, Mg and Sr content was higher in the recurrent group. Notably, there was no difference in the proportion of phosphorus in the samples indicated by IR (67.35% vs. 54.79%, p = 0.166), however, distinct differences were observed in the intensity ratios. In CaOx samples, although not statistically significant, the recurrent group still exhibited higher intensity ratios. These results suggest that employing LIBS analysis for elemental data in stone samples can offer supplementary information beyond conventional detection techniques.

Due to the high dimensionality and large volume of spectral data, conventional analysis methods can not produce satisfactory results. Machine learning (ML) algorithms, on the other hand, excel at efficiently handling large-scale multidimensional feature datasets. Therefore, many ML algorithms have been applied to the analysis and processing of LIBS data23,24. The BPNN algorithm is a widely used artificial neural network model that has been proven stable and reliable in various research fields25. BPNN were chosen in this study primarily for their ability to model complex, non-linear relationships between input features (elemental ratios, clinical variables) and the output (recurrence status), which we hypothesized might be present. Their flexibility in handling different data types and feature interactions was also considered advantageous compared to more linear models26.

To our knowledge, prior to this study, no researchers attempted to combine LIBS data of urinary stones with clinical data through ML algorithms for analysis. In this study, a classification model constructed by the BPNN to distinguish recurrence-associated profiles yielded satisfactory performance. The Method-4 model achieved an accuracy of 95.86% on the test set with AUC values of 0.982 (ROC curve) and 0.973 (P-R curve), making it recognized as the final model. The performance of models built by fusion strategy significantly outperformed models constructed solely based on clinical or spectral data. This improvement is attributed to the increased input information. The results of external validation indicate that the model has good generalization ability. By utilizing this classification model, clinicians can identify patients whose stone elemental signatures and clinical features align with the recurrence phenotype. This allows for more targeted interventions and closer monitoring schedules for these potentially higher-risk individuals.

There are some limitations to this study. It should be noted that the elemental analysis was primarily semi-quantitative, focusing on relative differences rather than absolute quantification. Future work could involve more precise measurement techniques to determine elemental concentrations. In addition, while the line selection method was validated using established reference standards, further cross-validation with other analytical techniques would help to reinforce the robustness of our findings. Finally, these patients did not undergo urine composition monitoring, making it impossible for us to directly analyze the environment in which stones formed.

Conclusions

Almost all calcium-based stones contain Mg and Sr. There is a significant correlation between P and other metallic elements. Higher relative concentrations of H, P, Mg, Sr, Na and K in stones, higher urine pH values, and lower stone averaged CT values, were characteristics of recurrent stone patients. The classification model for recurrence-associated profiles built by BPNN with fusion data as inputs has good performance. On the whole, elemental composition analysis may furnish urologists with more comprehensive insights into the urinary stones and offer innovative inspiration for the development of prevention and treatment in human urinary stones.