Skip to content

farshadsangari/brain_mri_segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Segmentation is a fundamental concept in computer vision, image processing, and pattern recognition. It involves the partitioning of an image or signal into multiple regions or segments, each of which corresponds to a different object or part of the image. Segmentation can be used for various purposes, such as object recognition, tracking, and classification

MRI segmentation is the process of dividing an image into multiple segments or regions of interest. This technique is important in medical imaging for identifying and isolating specific structures or regions within an image. Various techniques have been developed for MRI segmentation, including deep learning methods using convolutional neural networks. Accurate and efficient segmentation can greatly aid in the diagnosis and treatment of various medical conditions.

Model Architecture

In this project, we implemented a residual-UNET model. The UNET model architecture can be seen in the figure below.

cvae_architecture
Standard U-Net

The Residual-Unet model employs residual connections, which allow for an improved flow of gradients during training. By utilizing residual connections, we can more efficiently propagate information through the network, which can lead to faster convergence during training. Overall, the use of residual connections in the Residual-Unet architecture can significantly enhance the performance of the model, particularly in tasks that require deep neural networks.
Residual block
Residual block

Dataset

The dataset consists of magnetic resonance (MR) images of the brain along with manually-segmented fluid-attenuated inversion recovery (FLAIR) abnormality masks. These images were sourced from The Cancer Imaging Archive (TCIA) and correspond to a cohort of 110 patients who were part of The Cancer Genome Atlas (TCGA) lower-grade glioma collection. Each patient has at least one FLAIR sequence and genomic cluster data available.

The data for each patient is contained within a single folder, resulting in a total of 110 directories, each corresponding to a different patient. The functional magnetic resonance imaging (fMRI) images in each directory are of size 256 x 256. The labels for each fMRI image are also images of size 256 x 256, and their filenames end with the keyword mask

Residual block
Samples of fMRI images and corresponding labels

To access the dataset, click on Here

Requirement

First, you need to install the required dependencies. You can do this by running the following command in your terminal:

make requirements

This command will automatically install all the necessary libraries and dependencies needed to run the code in this repository. Make sure you have the required libraries installed before proceeding with the next steps.

3.Training

All three models mentioned above are trained using the CIFAR-10 dataset and different loss functions.

After installing the required dependencies, for instance, you can run the following command to for training the model with default arguments.

./train.sh

If you want to customize other options, you can run the following command and choose the arguments you want to modify.

python train.py --help

Results

In this section, we compare the results of three models: Standard-Unet, Residual-Unet, and Residual-Unet with augmented data.

Loss
BCE Loss loss_ce
Dice loss loss_ce_adverserial
Jaccard loss loss_angular

Based on the various metrics we analyzed, the third model, Residual-Unet with augmented data, yielded the best results. Therefore, it can be concluded that augmenting the data significantly improved the performance of the Residual-Unet model, making it the most effective model for the given task.

Below are some predictions made by our best-performing model, Residual-Unet with augmented data.

The first column displays the input image, while the second column showcases the mask or ground truth, which serves as a reference for comparison. The last column depicts the predicted mask generated by the model, which is based on the input image and the training it has received

loss_ce
loss_ce_adverserial
loss_angular
loss_angular

Conclusion

The use of residual connections can significantly expedite the convergence process in a model designed for segmentation, as demonstrated by the comparison of metric plots. Furthermore, augmenting data can improve the generalization of our segmentation model and enhance its performance on unseen data. By incorporating these techniques, we can create a more robust and efficient model for segmentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published