Tools Used:
Introduction
Detecting kidney stones in medical images is really important, but it can take a lot of time and effort for doctors. For my project, I wanted to see if I could use deep learning to help make this process easier and faster. So, I built a model using TensorFlow and Keras that can look at a scan and tell if there are kidney stones or not.
Project Overview
To get started, I found a dataset of real ultrasound images of kidneys. Some of the images had kidney stones and some didn’t. I used pandas to help organize the data and Jupyter Notebook to write and test my code.
How It Works
I built a deep learning model using TensorFlow and Keras. The model is a Convolutional Neural Network (CNN), which is great for classifying grid like data (ultrasound images in my case). I trained the model on the ultrasound images, teaching it to recognize patterns that show whether there are kidney stones or not.
Results
After training, my model did amazingly well! It got 100% accuracy on the test set, which means it didn’t make any mistakes. Here are the main results:
- Precision: 1.00
- Recall: 1.00
- F1-score: 1.00
Confusion Matrix
Here’s a confusion matrix from my model’s evaluation. As you can see, it got everything in the validation dataset right:

What I Did
- Found and organized the ultrasound image dataset
- Built and trained the deep learning model with TensorFlow and Keras
- Tested the model and made graphs in Jupyter Notebook
- Wrote up everything I did so others can follow along
Feature work
While 100% accuracy sounds great, it can sometimes mean that the model is too good at memorizing the training data instead of learning to generalize. This is called overfitting. While my model did well on the test set, it’s important to test it on new data to make sure it works well in real life. I plan to do this by using a different dataset of ultrasound images that I haven’t trained on yet.
For now, I tested the model on images that I found on the internet and it performed well. Here is an example of an image that the model predicted correctly:

The model predicted that this image has no kidney stones, and it was right! This shows that the model can work well on new images, but I still need to test it on a larger dataset to be sure.
If you want to see my code or try it out yourself, check out my GitHub: