Integrated Urine Crystal Detection and Classification Using Sensor Data and YOLOv8 Imaging

International Journal of Electrical and Electronics Engineering |
© 2025 by SSRG - IJEEE Journal |
Volume 12 Issue 8 |
Year of Publication : 2025 |
Authors : Joshua V. Nogalo, Jovito Miguel R. Regalado, Kim P. Ravida, Jazel A. Rivera, Rosanna C. Ucat |
How to Cite?
Joshua V. Nogalo, Jovito Miguel R. Regalado, Kim P. Ravida, Jazel A. Rivera, Rosanna C. Ucat, "Integrated Urine Crystal Detection and Classification Using Sensor Data and YOLOv8 Imaging," SSRG International Journal of Electrical and Electronics Engineering, vol. 12, no. 8, pp. 46-56, 2025. Crossref, https://doi.org/10.14445/23488379/IJEEE-V12I8P106
Abstract:
Kidney stones are a prevalent and painful urological condition affecting up to 10% of the global population, particularly men aged 30 to 60. Early detection is essential to prevent complications such as nephrolithiasis and chronic kidney disease. This study presents an integrated system that combines chemical and imaging-based urine analysis to detect and classify urine crystals while measuring pH and turbidity. The system utilizes a pH sensor (PH-4502C) and a turbidity sensor (SENO189), whose outputs are interpreted through logistic regression. Imaging is conducted using a Raspberry Pi High-Quality Camera mounted on a microscope, and crystal classification is performed using the YOLOv8 object detection model trained on labeled datasets of calcium oxalate and triple phosphate crystals. All modules are operated through a Raspberry Pi 4 Model B. Validation with 30 clinical urine samples demonstrated high concordance with standard laboratory results. The system achieved an R² value of 0.983 for pH detection, 96.67% accuracy in turbidity classification, and an R² of 0.976 with a mean absolute error of 0.733 for crystal counting. Overall risk assessment achieved 96.67% accuracy, 100% precision, 88.89% recall, and an F1 score of 94.12%. These results confirm the system’s accuracy, reliability, and suitability for practical use. It offers a low-cost, noninvasive, and real-time solution for early kidney stone detection, with strong potential for application in point-of-care diagnostic settings.
Keywords:
Kidney stones, Urine crystals, pH sensor, Turbidity analysis, YOLOv8, Raspberry Pi.
References:
[1] Firoz Khan et al., “A Comprehensive Review on Kidney Stones, its Diagnosis and Treatment with Allopathic and Ayurvedic Medicines,” Urology & Nephrology Open Access Journal, vol. 7, no. 4, pp. 69-74, 2019.
[CrossRef] [Google Scholar] [Publisher Link]
[2] Mohammed M. A. Abdullah Al-Abdaly et al., “The Influence of Kidney Stones and Salivary Uric Acid on Dental Calculus Formation and Periodontal Status among Some Saudi Patients Aged 25 - 70 Years,” International Journal of Clinical Medicine, vol. 11, no. 10, pp. 565-578, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[3] Khamidov Obid Abdurakhmanovich et al., “Ultrasound Diagnosis of Urolithiasis,” Central Asian Journal of Medical and Natural Science, vol. 2, no. 2, pp. 18-24, 2021.
[Google Scholar] [Publisher Link]
[4] Kathryn Gillams et al., “Gender Differences in Kidney Stone Disease (KSD): Findings from a Systematic Review,” Current Urology Reports, vol. 22, no. 10, 2021.
[CrossRef] [Google Scholar] [Publisher Link]
[5] John D. Denstedt, “Medical and Surgical Management of Urolithiasis,” Asian Journal of Urology, vol. 5, no. 4. pp. 203-204, 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[6] Leonardo Ferreira Fontenelle, and Thiago Dias Sarti, “Kidney Stones: Treatment and Prevention,” American Family Physician, vol. 99, no. 8, pp. 490-496, 2019.
[Google Scholar] [Publisher Link]
[7] Yu Liu et al., “Epidemiology of Urolithiasis in Asia,” Asian Journal of Urology, vol. 5, no. 4, pp. 205-214, 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[8] Grzegorz Wróbel, and Tadeusz Kuder, “The Role of Selected Environmental Factors and the Type of Work Performed on the Development of Urolithiasis - A Review Paper,” Intnational Journal of Occupational Medicine and Environmental Health, vol. 32, no. 6, pp. 761-775, 2019.
[CrossRef] [Google Scholar] [Publisher Link]
[9] Christine Cudis, Davao City Ranks 3rd in PH with Most Kidney Diseases, Philippine News Agency, 2022. [Online]. Available: https://www.pna.gov.ph/articles/1177310.
[10] Kyriaki Stamatelou, and David S. Goldfarb, “Epidemiology of Kidney Stones,” Healthcare, vol. 11, no. 3, pp. 1-25, 2023.
[CrossRef] [Google Scholar] [Publisher Link]
[11] Nasrin Borumandnia et al., “Longitudinal Trend of Urolithiasis Incidence Rates among World Countries during Past Decades,” BMC Urology, vol. 23, no. 1, 2023.
[CrossRef] [Google Scholar] [Publisher Link]
[12] Zahid Ullah, and Mona Jamjoom, “Early Detection and Diagnosis of Chronic Kidney Disease Based on Selected Predominant Features,” Journal of Healthcare Engineering, vol. 2023, 2023.
[CrossRef] [Google Scholar] [Publisher Link]
[13] Diagnosis of Kidney Stones, National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK), 2017. [Online]. Available: https://www.niddk.nih.gov/health-information/urologic-diseases/kidney-stones/diagnosis.
[14] Flora Rodger, Giles Roditi, and Omar M. Aboumarzouk, “Diagnostic Accuracy of Low and Ultra-Low Dose CT for Identification of Urinary Tract Stones: A Systematic Review,” Urologia Internationalis, vol. 100, no. 4, pp. 375-385, 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[15] Firoz Khan et al., “A Comprehensive Review on Kidney Stones, its Diagnosis and Treatment with Allopathic and Ayurvedic Medicines,” Urology & Nephrology Open Access Journal, vol. 7, no. 4, pp. 69-74, 2019.
[CrossRef] [Google Scholar] [Publisher Link]
[16] Kidney Stone Testing, Tesing, 2021. [Online]. Available: https://www.testing.com/kidney-stone-testing/#:~:text=Blood%20tests%20can%20also%20measure,and%20the%20uric%20acid%20test
[17] Joshua Y.C. Yang et al., “NonâRadiological Assessment of Kidney Stones Using the Kidney Injury Test (KIT), A Spot Urine Assay,” BJU International, vol. 125, no. 5, pp. 732-738, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[18] Nathaniel P. Roberson et al., “Comparison of Ultrasound versus Computed Tomography for the Detection of Kidney Stones in the Pediatric Population: A Clinical Effectiveness Study”, Pediatric Radiology, vol. 48, pp. 962-972, 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[19] Mohankumar Vijayakumar et al., “Review of Techniques for Ultrasonic Determination of Kidney Stone Size,” Research and Reports in Urology, vol. 10, pp. 57-61, 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[20] Brindha Devi V. et al., “SelfâAttention based Progressive Generative Adversarial Network Optimized with Arithmetic Optimization Algorithm for Kidney Stone Detection,” Concurrency and Computation Practice and Experience, vol. 35, no. 6, 2023.
[CrossRef] [Google Scholar] [Publisher Link]
[21] David S.H. Bell, and Edison Goncalves, “Alkalinization of the Urine and Lowering of Urine Uric Acid Content in Diabetic Patients with a Low Urine PH Results in Prevention and Dissolution of Uric Acid Stones - A Case Report and A Retrospective Outcome Study,” Frontiers in Medical Case Reports, vol. 2, no. 5, pp. 1-4, 2021.
[CrossRef] [Google Scholar] [Publisher Link]
[22] C.L. Chang et al., “Primary Hyperoxaluria: The Baragwanath Experience,” South African Journal of Child Health, vol. 16, no. 2, pp. 89-92, 2022.
[CrossRef] [Google Scholar] [Publisher Link]
[23] Tomas Salek et al., “Post-Collection Acidification of Spot Urine Sample is Not Needed before Measurement of Electrolytes,” Biochemia Medica, vol. 32, no. 2, pp. 194-199, 2022.
[CrossRef] [Google Scholar] [Publisher Link]
[24] Sevgi Polat, and Perviz Sayan, “In Vitro Study on the Influence of Proline on Struvite Crystals,” Hittite Journal of Science & Engineering, vol. 7, no. 4, pp. 271-277, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[25] R.P. Reimer et al., “Detection and Size Measurements of Kidney Stones on Virtual Non-Contrast Reconstructions Derived from Dual-Layer Computed Tomography in an Ex Vivo Phantom Setup,” European Radiology, vol. 33, no. 4, pp. 2995-3003, 2023.
[CrossRef] [Google Scholar] [Publisher Link]
[26] Sevgi Polat, “Effect of Avocado (Persea Gratissima) Leaf Extract on Calcium Oxalate Crystallization,” Acta Pharmaceutica Sciencia, vol. 58, no. 1, pp. 35-48, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[27] Mohammed I. Rasool et al., “Therapeutic Potential of Medicinal Plants for the Management of Renal Stones: A Review,” Baghdad Journal of Biochemistry and Applied Biological Sciences, vol. 3, no. 2, pp. 69-98, 2022.
[CrossRef] [Google Scholar] [Publisher Link]
[28] Visith Thongboonkerd, “Proteomics of Crystal-Cell Interactions: A Model for Kidney Stone Research,” Cells, vol. 8, no. 9, pp. 1-12, 2019.
[CrossRef] [Google Scholar] [Publisher Link]
[29] Hyperoxaluria, StatPearls Publishing LLC, National Library of Madicine, 2025. [Online]. Available: https://www.ncbi.nlm.nih.gov/books/NBK558987/figure/article-23199.image.f1/
[30] Corey Cavanaugh, and Mark A. Perazellap, “Urine Sediment Examination in the Diagnosis and Management of Kidney Disease: Core Curriculum 2019,” American Journal of Kidney Diseases, vol. 73, no. 2, pp. 258-272, 2019.
[CrossRef] [Google Scholar] [Publisher Link]
[31] Triple Phosphate Crystals, Biron. [Online]. Available: https://www.biron.com/en/glossary/triple-phosphate-crystals/
[32] Wen-Yaw Chung et al., “Development of a Portable Multi-Sensor Urine Test and Data Collection Platform for Risk Assessment of Kidney Stone Formation,” Electronics, vol. 9, no. 12, pp. 1-18, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[33] Anton Yudhana et al., “Multi Sensor Application-based for Measuring the Quality of Human Urine on First-Void Urine,” Sensing and Bio-Sensing Research, vol. 34, 2021.
[CrossRef] [Google Scholar] [Publisher Link]
[34] Jessie Jaye R. Balbin et al., “Detection and Identification of Triple Phosphate Crystals and Calcium Oxalate Crystals in Human Urine Sediment Using Harr Feature, Adaptive Boosting and Support Vector Machine via Open CV,” ICBET '20: Proceedings of the 2020 10th International Conference on Biomedical Engineering and Technology, pp. 34-39, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[35] Sania Akhtar, Muhammad Hanif, and Hamidi Malih, “Automatic Urine Sediment Detection and Classification Based on YoloV8,” Computational Science and Its Applications - ICCSA 2023, 23rd International Conference, Athens, Greece, 2023.
[CrossRef] [Google Scholar] [Publisher Link]
[36] Neeraj Dahiya et al., “Optimised RFO Tuned RF-DETR Model for Precision Urine Microscopy for Renal and Systemic Disease Diagnosis,” Scientific Reports, vol. 15, no. 1, 2025.
[CrossRef] [Google Scholar] [Publisher Link]
[37] K.S. Shashikala et al., “Automated Detection of Urine Sediments Using YOLOv8,” 2024 3rd International Conference on Automation, Computing and Renewable Systems (ICACRS), Pudukkottai, India, pp. 899-904, 2024.
[CrossRef] [Google Scholar] [Publisher Link]
[38] Lara Hamawy et al., “Microscopic Urinary Sediments Detection Using Deep Learning,” 2024 Second Jordanian International Biomedical Engineering Conference (JIBEC), Amman, Jordan, pp. 34-38, 2024.
[CrossRef] [Google Scholar] [Publisher Link]
[39] Jie Wang, and Hong Zhao, “Improved Yolov8 Algorithm for Water Surface Object Detection,” Sensors, vol. 24, no. 15, pp. 1-19, 2024.
[CrossRef] [Google Scholar] [Publisher Link]
[40] Nermeen Gamal Rezk et al., “Secure Hybrid Deep Learning for MRI-Based Brain Tumor Detection in Smart Medical IoT Systems,” Diagnostics, vol. 15, no. 5, pp. 1-17, 2025.
[CrossRef] [Google Scholar] [Publisher Link]
[41] Ranjana Battur, and Jagadisha Narayana, “A Novel Approach for Content-based Image Retrieval System using Logical AND and OR Operations,” International Journal of Advanced Computer Science and Applications, vol. 14, no. 9, pp. 518-528, 2023.
[CrossRef] [Google Scholar] [Publisher Link]
[42] Josefine Neuendorf, Urine Sediment, Springer Cham, 2020.
[CrossRef] [Google Scholar] [Publisher Link]