Skip to content

fractaloid007/kindey-CNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

KITS19 Segmentation Challenge

Official MICCAI2019 repo: https://github.com/neheller/kits19

ABOUT: There are more than 400,000 new cases of kidney cancer each year, and surgery is its most common treatment. Due to the wide variety in kidney and kidney tumor morphology, there is currently great interest in how tumor morphology relates to surgical outcomes, as well as in developing advanced surgical planning techniques. Automatic semantic segmentation is a promising tool for these efforts, but morphological heterogeneity makes it a difficult problem. The goal of this challenge, is to accelerate the development of reliable kidney and kidney tumor semantic segmentation methodologies, and within this repository, you will find my dedicated efforts and code as an attempt to address this problem.

Unknown

Acknowledgments

I would like to express my gratitude to the following individuals and organizations for their valuable contributions, support, and inspiration throughout this project:

-Marco Domenico Santambrogio, Full Professor @Politecnico di Milano.

-Eleonora D'Arnese, PhD, Post-Doc Researcher @Politecnico di Milano.

-Isabella Poles, PhD Student in Information Technology and Computer Science @Politecnico di Milano.

-NecstLab, @Politecnico di Milano

Dataset

You can obtain the dataset by visiting the official KITS19 repository:

KITS19 GitHub Repository

Once you're on the KITS19 repository, you can follow their instructions to download the dataset.

Table of Contents

Preprocessing

  1. Import the necessary libraries, including PyTorch and Nibabel for image manipulation.
  2. Define the make_img_path(cid) function to get the path to the imaging file for a given case.
  3. Define the make_seg_path(cid) function to get the path to the segmentation file for a given case.
  4. Create output folders for preprocessed data: train and valid.
  5. Preprocess training images and save them as NumPy files (.npy) in their respective folders.

Dataset

  1. Define the KitsDataset class representing the custom dataset for this project.
  2. Provide the paths to folders containing images and segmentations.
  3. Use the len method to get the dataset's length.
  4. Define the getitem function to obtain a sample from the dataset with the necessary features for your network.
  5. Load images and segments as PyTorch tensors using torch.tensor.
  6. Apply transformations and normalizations to the image. Finally, return a sample containing the image and mask.

Training the Model

  1. Define the set_parameter_requires_grad function to set the requires_grad flag for model parameters.
  2. Create the segmentation model based on the FCN-ResNet101 architecture using the createModel function.
  3. Define the collate_fn function to handle batch sample grouping and potential errors.
  4. Define the train_model function to train the model.
  5. Iterate through each training and validation epoch, calculating losses and evaluation metrics.
  6. Save the model's weights based on the lowest validation loss.
  7. At the end of training, load the model with the best weights.

Main

  1. Create the training and validation datasets using the KitsDataset class.
  2. Define data loaders for training and validation using the created datasets.
  3. Create the segmentation model using the createModel function.
  4. Define the optimizer and loss function for model training.
  5. Train the model using the train_model function.
  6. Finally, perform image segmentation using the trained model.

Please note that this project is a part of my academic coursework, and it is not intended to be a perfect or production-ready solution. Please feel free to reach out if you have any questions or need further assistance. This README provides an overview of the project's structure and the processes involved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors