Skip to content

RiccardoGalarducci/3D-semantic-segmentation-RSNA2022

Repository files navigation

3D Semantic Segmentation - RSNA 2022

The RSNA 2022 Cervical Spine Fracture Detection is a kaggle competition organized by the Radiological Socity of North America (RSNA) along with the American Society of Neuroradiology (ASNR) and the American Society of Spine Radiology (ASSR). The ultimate goal of the challenge is to develop an AI system used to aid in the detection and localization of cervical spine fractures.

The training dataset provided is constituted by 2019 CT scans of the cervical spine, with one folder for each scan, containing image data in dicom file format. In addition, segmentation masks (pixel level annotations) are provided for a subset (87 scans) of the training data. The pixels assume values of 1 to 7 for C1 to C7 (seven cervical vertebrae) and 8 to 19 for T1 to T12. This data is provided in the nifti file format.

This repository contains the first task of the RSNA 2022 challenge, i.e., develop a 3D semantic segmentation model to segment the 1932 unlabelled CT scans in the training data.

Description

The project is composed by four main steps which are briefly summarized below.

1. Data Preparation

The data preparation phase includes multiple transformations performed over the CT scans and the segmentation masks. We resize the CT scans, which differ in length, to a target spatial size, ensuring that all inputs have the same dimensions. Then, we scale the intensity of each volume and apply several image augmentation techniques. For the multi-class segmentation masks, we apply binary one-hot encoding.

2. Model Implementation

The 3D segmentation model has U-Net architecture which is state-of-the-art for 3D segmentation of medical images. We exploit MONAI library for its implementation.

3. Model Training

The model has been trained using AdamW optimizer with learning rate scheduler. The loss function employed is given by the weighted combination of Dice Loss and BCE (Binary Cross Entropy) Loss which has been shown to yields the best result in terms of segmentation, pixel-wise accuracy, generalization and adversarial attacks. $\alpha$ and $\beta$ parameter has been chosen during the model selection phase.

$$\text{Loss} = \alpha \cdot \text{BCE} + \beta \cdot \text{Dice Loss}$$

The model has been trained for 530 epochs. The figures below shows the losses behaviour during training (left) and the dice metrics used for model evaluation (right).

4. Prediction

As last step we predict the segmentation masks for the unlabelled CT scans using the best trained model according to the model selection phase.

The figure below shows the predicted segmentation masks by the model for some slices of a CT scan.

Repository Overview

At the root level of this repository, you will find the jupyter notebook for the training and prediction of the 3D semantic segmentation model. More specifically:

  • 3d-semantic-segmentation.ipynb: This notebook contains the initial training process of the 3D U-Net model, including setting up the model architecture, defining training parameters, and running the first training iterations;
  • 3d-semantic-segmentation-resume-training.ipynb: This notebook is used for resuming the training of the 3D U-Net model from a saved checkpoint, allowing the training process to continue;
  • 3d-semantic-segmentation-prediction.ipynb: This notebook is dedicated to generating predictions using the trained 3D U-Net model on the test data, and evaluating the predictions through visualizations to assess model effectiveness.

Collaborators

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published