KidneyStone-X
A computer vision pipeline that detects kidney stones on CT slices with YOLOv8, outlines the kidney with a U-Net, and shows which pixels drove each detection.
mAP@0.5 of 0.965 on validation- Role
- Team of three
- Context
- CBCA 241 Image and Video Processing, Bennett University, November 2025
- Stack
- PyTorch, Ultralytics YOLOv8, U-Net, OpenCV
- Outcome
- Detector precision 0.923, recall 0.914, mAP@0.5 0.965 on validation.
The problem
A kidney stone on a CT slice is a few bright pixels. Bone is bright too, and the spine sits a few centimetres away. A detector has to tell them apart.
What I built
- A ResNet18 stone or no-stone classifier as a sanity check on the data. It reached 99.65% validation accuracy, which confirmed the signal was there before we invested in detection.
- A YOLOv8 detector that boxes each stone.
- A U-Net that outlines the kidney region, to give each detection anatomical context.
- A quantification step that writes stone measurements for each image to a CSV.
- Occlusion-sensitivity heatmaps for explainability, after Grad-CAM and SHAP proved a poor fit for this task.
Results
- Detector on validation: precision 0.923, recall 0.914, mAP@0.5 0.965, mAP@[0.5 to 0.95] 0.897.
- Kidney segmentation: mean Dice 0.84 and mean IoU 0.78 on a small curated set.
- The first detector confidently boxed vertebrae as stones, because the automatic labels had treated bright bone as stone. We fixed it by labelling 185 images by hand and using them as ground truth.
Limits
The validation split comes from the same curated subset as the training data, so the headline scores mostly measure label consistency. The stricter mAP@[0.5 to 0.95] of 0.897 is the more honest number.
It has not been tested on scans from another hospital, and it is not a clinical tool.
