Transfer Learning for Effective Urolithiasis Detection

Article information

Int Neurourol J. 2023;27(Suppl 1):S21-26
Publication date (electronic) : 2023 May 31
doi :
1Department of Computer Science, Gachon University, Seongnam, Korea
2Health IT Research center, Gachon University Gil Medical Center, Incheon, Korea
3Department of Urology, Chungnam National University Sejong Hospital, Chugnam National University College of Medicine, Sejong, Korea
Corresponding author: Taeg-Keun Whangbo Department of Computer Science, Gachon University, 1342 Seongnam-daero, Sujeong-gu, Seongnam 13120, Korea Email:
Co-corresponding author: Khae Hawn Kim Department of Urology, Chungnam National University Sejong Hospital, Chungnam National University College of Medicine, 20 Bodeum 7-ro, Sejong 30099, Korea Email:
*Hyoung-Sun Choi and Jae-Seoung Kim contributed equally to this study as cofirst authors.
Received 2023 May 03; Accepted 2023 May 18.



Urolithiasis is a common disease that can cause acute pain and complications. The objective of this study was to develop a deep learning model utilizing transfer learning for the rapid and accurate detection of urinary tract stones. By employing this method, we aim to improve the efficiency of medical staff and contribute to the progress of deep learning-based medical image diagnostic technology.


The ResNet50 model was employed to develop feature extractors for detecting urinary tract stones. Transfer learning was applied by utilizing the weights of pretrained models as initial values, and the models were fine-tuned with the provided data. The model’s performance was evaluated using accuracy, precision-recall, and receiver operating characteristic curve metrics.


The ResNet-50-based deep learning model demonstrated high accuracy and sensitivity, outperforming traditional methods. Specifically, it enabled a rapid diagnosis of the presence or absence of urinary tract stones, thereby assisting doctors in their decision-making process.


This research makes a meaningful contribution by accelerating the clinical implementation of urinary tract stone detection technology utilizing ResNet-50. The deep learning model can swiftly identify the presence or absence of urinary tract stones, thereby enhancing the efficiency of medical staff. We expect that this study will contribute to the advancement of medical imaging diagnostic technology based on deep learning.


Urinary stones are a prevalent urinary disease that affects numerous individuals worldwide, leading to intense pain as the stones pass through the urinary system [1,2]. The development of urinary tract stones arises from various factors that increase the risk of complications and recurrence. Research on diverse surgical approaches has been conducted to address this issue [3,4]. Accurate diagnosis is crucial for enhancing treatment and prognosis, as the treatment strategy and outcomes depend on the size and location of the stone [5,6].

The medical field is currently undergoing numerous changes due to recent advances in artificial intelligence (AI) technology. In particular, deep learning-based image diagnosis technology demonstrates exceptional performance, which is anticipated to enhance efficiency for medical staff. A prime example of a deep learning algorithm is the convolutional neural network (CNN) [7], which exhibits outstanding performance in image recognition. The objective of this study was to develop a model capable of determining the presence or absence of urinary tract stones using the ResNet model [8], a prominent technique in deep learning.

ResNet is a high-performing deep CNN known for its effectiveness in image recognition. It is capable of learning specialized feature extractors for urinary tract stones through the finetuning of its model. Transfer learning [9] is a technique that utilizes the weights of pretrained models as initial values, finetunes them to suit a specific dataset, and applies them to new tasks. Through this process, it is anticipated that a deep learning model with high accuracy in determining the presence or absence of urinary tract stones will be developed.

In this study, we first collected medical imaging datasets and enhanced data quality through preprocessing. We then utilized the ResNet model to develop specialized feature extractors for urinary tract stones by fine-tuning the model with transfer learning applied to the collected data. During this process, we maximized the model’s performance by employing tuned hyperparameters and data augmentation techniques [10]. Additionally, cross-validation was implemented to assess the model’s generalization performance. Accuracy and the confusion matrix were employed to evaluate the performance of the ResNetbased urinary tract stone detection model developed in this study, which demonstrated superior performance compared to existing methods.

In conclusion, this study is significant as it accelerates the clinical implementation of AI in urinary tract stone detection technology utilizing ResNet. The developed model can swiftly determine the presence or absence of urinary tract stones, thereby enhancing the efficiency of medical staff. This is anticipated to contribute to the advancement of deep learning-based medical image diagnostic technology.


Data Collection and Preprocessing

The study involved a total of 150 cases, including 100 cases of urinary stones and 50 cases without urinary stones. These cases were reviewed by a specialist from patients who visited Sejong Chungnam National University Hospital between July 2020 and October 2022. All personal information was removed from the collected data to protect privacy, and each case was assigned a research target number. The data were then stored separately in the DICOM format on individual storage devices. Fig. 1 is sample from the dataset.

Fig. 1.

Sample images from the dataset: (A) normal, (B) stone, and (C) ureter stone.

For the data preprocessing stage, the image was standardized to enhance data quality, and its size was adjusted to 224×224 to align with the input dimensions of ResNet. Subsequently, the histogram smoothing technique [11] was employed to improve the image contrast. This method involves adjusting the distribution of pixel intensity to achieve uniformity throughout the image, utilizing histograms that display the frequency of each pixel intensity level.

The procedure for histogram smoothing was as follows. Initially, the histogram function (1) was computed, which determined the number of pixels in the input image, and then normalization (2) was performed. Subsequently, the cumulative distribution function (CDF) (3) for each intensity value was calculated. The CDF (g) represented the number of pixels below the intensity g, while p(i) denoted the probability for intensity I. Finally, the CDF was used to map each pixel value of the original image to a new value. The new pixel value, dst (x, y), was calculated by multiplying the entire intensity range by the CDF. This process aided in extracting more detailed information from images that had low contrast or poor lighting. Ultimately, this significantly contributed to enhancing the accuracy of determining the presence or absence of urinary tract stones.

(1) hg=Ng
(2) pg=hgw×h
(3) cdfg=0igpi
(4) dstx,y=roundcdfsrcx,y×Lmax

Data Augmentation and Transfer Learning

The data utilized in this study comprised urinary tract stones, which were expanded through various data augmentation techniques [12]. These methods have been employed to enhance the model’s performance in processing diverse urinary images in real-world settings. Data augmentation techniques were implemented using arbitrary angle rotation, horizontal/vertical movement, proportion adjustment, image reversal, and Cycle-GAN [13] data augmentation algorithms. CycleGAN is a type of generative adversarial network (GAN) that transforms images into different styles. The crux of this model lies in maintaining consistency when converting a transformed image back into its original form, effectively transferring data from one domain to another. It has applications in various fields, such as art style transformation, photo colorization, and landscape transformation. These methods enable models to be trained with a larger number of images and extract the necessary information for feature detection. Fig. 2 displays the results of data augmentation using CycleGAN.

Fig. 2.

Results of data augmentation with CycleGAN.

In the design and learning process of this model, transfer learning was employed. Transfer learning is a technique commonly used in various fields, such as image classification, natural language processing, and speech recognition. In machine learning and deep learning, it involves using the weights of a pretrained model as the initial values for a new model, which can shorten learning time and improve performance. This approach is particularly beneficial when there is a scarcity of data. Consequently, this study developed a urinary tract detection model based on the ResNet50 model, which was pretrained with the ImageNet dataset. The ResNet50 model is a deep neural network with a depth of 50 layers and a structure that incorporates residual connections to overcome learning difficulties that may arise in neural networks. Compared to other transfer learning models, ResNet50 performs exceptionally well in image classification tasks. Fig. 3 illustrates the model structure proposed in this research. The output portion of the model utilized a sigmoid activation function for the binary classification problem, which determines the presence or absence of urinary tract stones. Binary cross-entropy was employed as the loss function, and the Adam optimization algorithm was used.

Fig. 3.

Proposed model architecture. CONV, convolution; FC, fully connected.

Hyperparameter Tuning

We enhanced the performance of the Resnet50 model through hyperparameter tuning. Key hyperparameters include the learning rate, batch size, number of epochs, weight loss, and so forth. Both grid search and random search were employed to determine the optimal values for these hyperparameters. During this process, the learning rate was initially set at 0.001 and gradually decreased as learning progressed. The batch size was established at 16, while the number of epochs was determined based on the model’s performance convergence. To avert overfitting, L2 normalization was applied to the model.

Model Evaluation

In this study, k-fold cross-validation was employed to assess the performance of the developed models. Cross-validation involves partitioning a dataset into multiple subsets, utilizing each subset as validation data while concurrently using the remaining subsets as training data. This procedure is repeated until each subset has been used as validation data once.

Ten-fold cross-validation is a technique that involves dividing the data into 10 subsets, training the model on the remaining 9 subsets, and using each subset as validation data. This approach ensures that all data is used equally for training and validation, allowing for a more accurate estimation of the model’s generalization performance. During this process, the model’s performance is measured on each fold, and the average value of these results serves as the final performance indicator. In this study, accuracy, sensitivity, specificity, and the F1-score were used as performance evaluation indicators for the model. Accuracy represents the proportion of correct predictions among all predictions, sensitivity indicates the proportion of true positives predicted, and specificity denotes the proportion of true negatives predicted in relation to the actual speech. Furthermore, the F1 score is an indicator of the harmonic mean of precision and recall, which is commonly used to evaluate model performance in unbalanced datasets. By employing these measures, this study objectively assessed the performance of the urinary tract stone diagnosis model.


In this study, we developed an AI model to determine the presence or absence of urinary tract stones based on ResNet50. To evaluate the model’s performance, we used accuracy, precision, and recall as indicators. Furthermore, we assessed the model’s generalization performance by employing k-fold cross-validation, in which each subset was sequentially used as a validation set. The evaluation dataset comprised 100 urinary tract stones and 20 normal cases, divided into 9 learning sets and one test set with 10-fold cross-validation. The cross-validation results are presented in Table 1.

Performance evaluation using cross-validation

The model demonstrated an accuracy of 0.93 in detecting urinary tract stones. Additionally, the precision and recall were 0.949 and 0.936, respectively, surpassing the target threshold of 0.8. Fig. 4 presents the area under the receiver operating characteristic curve.

Fig. 4.

Area under the receiver operating characteristic (ROC) curve.


AI is increasingly utilized across various domains, with particularly notable advancements in healthcare and medicine. A significant portion of medical AI research focuses on enhancing patient care and diagnosis, spurred by improvements in computing hardware and the growth of big data. In this study, a ResNet50-based transfer learning approach was employed to create an AI model for detecting the presence of urinary tract stones.

During the model development process, histogram smoothing was conducted as part of the preprocessing stage, and data augmentation techniques were applied to enhance the model’s generalization performance. The resulting model demonstrated high performance in terms of accuracy, precision, and recall. This outcome indicates that the AI-based urinary tract stone detection model allows for a more accurate and efficient diagnosis of urinary tract stones compared to traditional methods. Furthermore, the data preprocessing and augmentation techniques employed in this study can be applied to the development of other AI models. These methods can contribute to the creation of highly generalizable and efficient AI models.

This study utilized computed tomography image data supplied by Sejong Chungnam National University Hospital to validate the performance of our model in a real-world medical setting. However, due to the limited size of the dataset used in this research, further studies incorporating larger datasets are essential. By continuously collecting data and conducting research, we will enhance the generalizability of our models and develop versions that can accommodate diverse population characteristics.

As a result, AI-based models for detecting urinary tract stones are anticipated to aid medical professionals in rapidly and accurately diagnosing these conditions. This will allow them to effectively serve as assistants in diagnostic decision-making, while maintaining clinically acceptable safety standards and enhancing the patient’s treatment process. Furthermore, these models are expected to elevate the quality of healthcare by reducing medical expenses and time, while still delivering precise diagnoses.


Grant/Fund Support

This work was supported by the GRRC program of Gyeonggi Province [GRRC-Gachon2020(B03), Development of AIbased Healthcare Devices].

Research Ethics

This research was approved by the Institutional Review Board of Chungnam National University Hospital (approval number: CNUSH2022-10-015).

Conflict of Interest

KHK, an editor-in-chief of the Editorial Board of International Neurourology Journal, is the co-corresponding author of this article. However, he played no role whatsoever in the editorial evaluation of this article or the decision to publish it. Except for that, no potential conflict of interest relevant to this article was reported.


· Conceptualization: TKW, KHK

· Data curation: KHK

· Formal analysis: JSK

· Methodology: JSK

· Project administration: TKW

· Visualization: JSK

· Writing - original draft: HSC

· Writing - review & editing: HSC


1. López M, Hoppe B. History, epidemiology and regional diversities of urolithiasis. Pediatr Nephrol 2010;25:49–59.
2. Liu Y, Chen Y, Liao B, Luo D, Wang K, Li H, et al. Epidemiology of urolithiasis in Asia. Asian J Urol 2018;5:205–14.
3. Kwon WA, Lee SY, Jeong TY, Moon HS. Lower urinary tract symptoms in prostate cancer patients treated with radiation therapy: past and present. Int Neurourol J 2021;25:119–27.
4. Yu J, Jeong BC, Jeon SS, Lee SW, Lee KS. Comparison of efficacy of different surgical techniques for benign prostatic obstruction. Int Neurourol J 2021;25:252–62.
5. Türk C, Petřík A, Sarica K, Seitz C, Skolarikos A, Straub M, et al. EAU guidelines on interventional treatment for urolithiasis. Eur Urol 2016;69:475–82.
6. Pak CY. Etiology and treatment of urolithiasis. Am J Kidney Dis 1991;18:624–37.
7. Alzubaidi L, Zhang J, Humaidi AJ, Al-Dujaili A, Duan Y, Al-Shamma O, et al. Review of deep learning: concepts, CNN architectures, challenges, applications, future directions. J Big Data 2021;8:53.
8. He K, Zhang X, Ren S, Sun J. Deep Residual Learning for Image Recognition. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR); Las Vegas, NV, USA; 2016. p. 770-8, doi: 10.1109/CVPR.2016.90.
9. Zhuang FZ, Zhiuan Q, Keyu D, Dongbo X, Yongchun Z, Hengshu Z, et al. A comprehensive survey on transfer learning. Proc IEEE 2021;109:43–76.
10. Yogatama D, Mann G. Efficient transfer learning method for automatic hyperparameter tuning. Proc Mach Learn Res 2014;33:1077–85.
11. Ayesha AS, Ghous BN, Mashal T, Adnan H. Investigation of historgram equalization filter for CT scan image enhancement. Biomed Eng Appl Basis Commun 2019;31:1950038.
12. Goceri E. Medical image data augmentation: techniques, comparisons and interpretations. Artif Intell Rev 2023;
13. Zhu JY, Park TS, Isola P, Efros AA. Unpaired image-to-image translation using cycle-consistent adversarial networks. In: 2017 IEEE International Conference on Computer Vision (ICCV); Venice, Italy; 2017. p. 2242-51. doi: 10.1109/ICCV.2017.244.

Article information Continued

Fig. 1.

Sample images from the dataset: (A) normal, (B) stone, and (C) ureter stone.

Fig. 2.

Results of data augmentation with CycleGAN.

Fig. 3.

Proposed model architecture. CONV, convolution; FC, fully connected.

Fig. 4.

Area under the receiver operating characteristic (ROC) curve.

Table 1.

Performance evaluation using cross-validation

Cross-validation Accuracy Confusion matrix
Precision Recall
1 0.94 0.967 0.953
2 0.93 0.943 0.945
3 0.95 0.966 0.971
4 0.91 0.927 0.921
5 0.92 0.935 0.929
6 0.94 0.954 0.936
7 0.95 0.968 0.961
8 0.96 0.963 0.957
9 0.89 0.916 0.901
10 0.91 0.951 0.911
Average score 0.93 0.949 0.936