In this research, we proposed a two-stage pipeline for segmenting urinary stones. The first stage U-Net generated the map localizing the urinary organs in full abdominal x-ray images. Then, this map was used for creating partitioned images input to the second stage U-Net to reduce class imbalance and was also used in stone-embedding augmentation to increase a number of training data. The U-Net model was trained with the combination of real stone-contained images and synthesized stone-embedded images to segment urinary stones on the partitioned input images. In addition, we proposed to use an inverse weighting method in the focal Tversky loss function in order to rebalance lesion size. The U-Net model using our proposed pipeline produced a 71.28% pixel-wise F 2 score and a 69.82% region-wise F 2 score, which were higher than 2.88% and 7.63%, respectively, by a baseline method. Experimental results showed that the proposed method improved urinary stone segmentation results, especially for small stones and stones in uncommon locations.INDEX TERMS Computer-aided detection and diagnosis; urinary stone; deep learning; image segmentation; abdominal X-ray imaging.