{ "cells": [ { "cell_type": "markdown", "id": "7f1cd83066fd0ab8", "metadata": { "id": "7f1cd83066fd0ab8" }, "source": [ "# Kidney Segmentation for the KITs19 Challenge\n", "**Authors:** Aayush Bajaj (z5362216), Song, Marc, Liam, Samuel\n", "**Date:** November, 2024" ] }, { "cell_type": "markdown", "id": "e14479faa3a28346", "metadata": { "id": "e14479faa3a28346" }, "source": [ "## Table of Contents\n", "\n", "1. [Introduction](#Introduction)\n", "2. [Data Sources](#Data-Sources)\n", "3. [Exploratory Analysis](#Exploratory-analysis)\n", "4. [Models and Methods](#Models-methods)\n", "5. [Results](#results)\n", "6. [Discussion](#discussion)\n", "7. [Writing](#writing)" ] }, { "cell_type": "markdown", "id": "f229cef07984647c", "metadata": { "id": "f229cef07984647c" }, "source": [ "\n", "## 1. Introduction\n", "\n", "The project we selected was number 018: Kidney (and tumour) segmentation. The purpose of which is to accurately segment kidneys from computed tomography (CT) scans using machine learning. Manual segmentation of the imaged organs for diagnosis has always taken quite long manually, and inconsistent in quality depending on the skill of the radiologist. By using the speed and effectiveness of AI-assisted image segmentation, initial diagnosis can be done much faster at a more consistent rate.\n", "\n", "In this project we implement the models of U-Net, V-Net, SAM-Net and nnU-Net and evaluate their effectiveness in use for medical image segmentation." ] }, { "cell_type": "markdown", "id": "f0fd714d05e81627", "metadata": { "id": "f0fd714d05e81627" }, "source": [ "\n", "## 2. Data Sources\n", "The dataset is the same used for the Kits19 Grand Challenge. It is sourced from the University of Minnesota Medical Center and contains 300 selected CT imaging scans from patients who underwent nephrectomy (kidney surgery) for one or more kidney tumors.\n", "\n", "The imaging is provided in NIFTI format, a 3D format typically with shape (n x 512 x 512). More detail on the shape of the imagery is provided below in the Exploratory Analysis.\n", "\n", "Manual segmentation labels were produced and confirmed by medical students to be used as target masks. Background features were labelled 0, with kidneys labelled 1 and the tumours labelled 2." ] }, { "cell_type": "markdown", "id": "8d412ab0a46ff8ec", "metadata": { "id": "8d412ab0a46ff8ec" }, "source": [ "\n", "## 3. Exploratory Analysis\n" ] }, { "cell_type": "markdown", "id": "3ba7e4d1cc3ad2b1", "metadata": { "id": "3ba7e4d1cc3ad2b1" }, "source": [ "\n", "\n", "### Starter Code\n", "Our initial directory hierarchy looked like:\n", "```\n", "├── starter_code\n", "│ ├── evaluation.py\n", "│ ├── get_imaging.py\n", "│ ├── get_imaging_v2.py\n", "│ ├── __init__.py\n", "│ ├── __pycache__\n", "│ ├── utils.py\n", "│ └── visualize.py\n", "\n", "```\n", "Where the above `starter_code` directory was provided by the associated [grandchallenge](https://kits19.grand-challenge.org/) [github](https://github.com/neheller/kits19).\n", "\n", "Upon running the `get_imaging.py` file, another directory named `data` was populated with 300 case files of the patients described [above](#2-Data-Sources):\n", "\n", "```\n", "data\n", "├── case_00000\n", "│ ├── imaging.nii.gz\n", "│ └── segmentation.nii.gz\n", "├── case_00001\n", "│ ├── imaging.nii.gz\n", "│ └── segmentation.nii.gz\n", "...\n", "├── case_00298\n", "│ └── imaging.nii.gz\n", "├── case_00299\n", "│ └── imaging.nii.gz\n", "├── kits.json\n", "└── LICENSE\n", "```\n", "\n", "Here, we had both the volume data and segmentation mask data for the first 210 patients, but only had access to the volume data for the remaining 90 patients. This is reflected in the above output of `tree -L 3`\n", "\n", "For each of the first 210 patients, we had 2 files: `imaging.nii.gz` and `segmentation.nii.gz`. The first of these contained the 3D medical images obtained via CT (Computed Tomography) scans and the latter, the segmentation masks (or ternary masks) for the kidney and kidney tumours.\n", "\n", "\n", "Taking averages over the 300 patients, the average disk-size of the CT volume was 91.57MB, and that of the segmentation mask was 0.30MB. Overall, the `data` directory was 26.9GiB in size.\n" ] }, { "cell_type": "markdown", "id": "9f52b78819cd62cd", "metadata": { "id": "9f52b78819cd62cd" }, "source": [ "\n", "### Visualisations\n", "The next step would be to leverage the `starter_code` files to gain some insight on the data itself. Running the `visualize.py` file as a module in python we were able to stitch together some GiF's:\n", "\n", "
Axial
\n", "Coronal
\n", "Sagittal
\n", "