Coder Social home page Coder Social logo

simple-universeg's Introduction

Simple Variant of UniverSeg on 2D Brain MRI

This is the code repository for the implementation of the training and inference scripts of the UniverSeg model

Installation

Install the packages from requirements.txt file using pip.

pip install -r requirements.txt

Download a dataset

Download the data into the data directory and specify its location in the project/utils/const.py for variable DATA_FOLDER

Training Configurations

To add data augmentation

Set the value of JSON keys ("do_in_task_augmentation" or/and "do_task_augmentation") to true otherwise keep false.

Training

Train a model with Augmentation + Combined Losses.

Modify the configurations file, go to the project directory, and use the following command -

python main_Augmentation_.py --config ../configurations/configs_final.json

Inference

To run inference of the trained model, go to the src directory, use the following command -

python Inference.py --config ../configurations/configs1.json

Task

To train a simpler variant of UniverSeg, which trains on several labels of 24 seg-protocol of 2D brain MRI and generalize to holdout labels. Few Shot Segmentation Task on a Query Image using a Support Set

Pre-trained UniverSeg Model

The pre-trained UniverSeg model is described at project/models/original_universeg/model.py

Evaluation Script (project/main.py)

This script evaluates the pre-trained UniverSeg model on Neurite OASIS Sample Data with 24 seg protocol.

Utilities scripts (project/utils folder)

  • dataset.py: Loads the Neurite OASIS data.
  • visualization.py: For visualizing the Original Image, Ground truths, Soft Predictions and Predictions

Plots for visualization (project/Plots)

  • choose_labels.ipynb
  • plot_selected_labels.ipynb

Licenses

Code is released under the Apache 2.0 license.

Code Details

Adapted Code:

Additional Code:

  • main.py: Included Dice Score and HD95 evaluation metrics.
  • choose_labels.ipynb: Provides a comparison of the sizes of different Regions of Interest (ROIs) in Brain MRI images.
  • plot_selected_labels.ipynb: Highlights labels to provide an overview of the various categories of labelled data.

simple-universeg's People

Contributors

akshatgurbuxani avatar avarshn avatar jueqiw avatar maryam2079 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.