GitHub - mrinal054/FUSegNet (original) (raw)

FUSegNet: A Deep Convolutional Neural Network for Foot Ulcer Segmentation

Summary

FUSegNet and x-FUSegNet are implemented on top of qubvel's implementation.

FUSegNet is a novel model for foot ulcer segmentation in diabetes patients. The model introduces the parallel scSE (P-scSE) module, combining additive and max-out scSE, fused in the middle of each decoder stage. FUSegNet achieves a data-based dice score of 92.70% on a chronic wound dataset, outperforming other state-of-the-art models. In the MICCAI 2021 FUSeg Challenge, the submitted x-FUSegNet model achieves a top score of 89.23%, leading the leaderboard.

Preprint link.

Saved models

Our saved (trained) models can be downloaded from the following links-

Code description

Packages installation

pip install -r requirements.txt

Note: It is better to install torch and its associated packages manually as these are very sensitive to hardware and the OS. The torch packages mentioned in the requirements.txt file are used for a 64-bit Ubuntu PC with an 8-core 3.4 GHz CPU and a single NVIDIA RTX 2080Ti GPU with a CUDA compilation version of 10.1.

Network architecture

Directory setup

The directory structure is shown below. Note that if checkpoints, plots, and predictions folders are not created beforehand, they will be generated automatically.

.
|-- fusegnet_all.py
|-- fusegnet_train.py
|-- fusegnet_test.py
|-- xfusegnet_all.py
|-- xfusegnet_train.py
|-- xfusegnet_test.py
|-- utils
|-- dataset
    |-- train
        |-- images
            |-- (training and validation images are kept here)
        |-- labels 
            |-- (training and validation labels are kept here)
    |-- test
        |-- images 
            |-- (test images are kept here)
        |-- labels 
            |-- (test labels are kept here)
|-- checkpoints
    |-- (models will be stored here)
|-- plots
    |-- (loss curves will be stored here)
|-- predictions
    |-- (model predictions will be store here)

Parameters setup

fusegnet_all.py, fusegnet_train.py, xfusegnet_all.py, and xfusegnet_train.py have a section called Parameters where the user can set the model parameters. The following are the model parameters used to train FUSegNet and xFUSegNet.

BASE_MODEL = 'FuSegNet' # give any name for the model ENCODER = 'efficientnet-b7' # encoder model ENCODER_WEIGHTS = 'imagenet' # encoder weights BATCH_SIZE = 2 # no. of batches IMAGE_SIZE = 224 # height and width n_classes = 1 # no. of classes excluding background ACTIVATION = 'sigmoid' # output activation. sigmoid for binary and softmax for multi-class segmentation DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu") # sets gpu if available LR = 0.0001 # learning rate EPOCHS = 200 # no. of epochs WEIGHT_DECAY = 1e-5 # for L2 penalty SAVE_WEIGHTS_ONLY = True # if True, saves weights only TO_CATEGORICAL = False # if True, converts to onehot SAVE_BEST_MODEL = True # if True, saves the best model only SAVE_LAST_MODEL = False # if True, saves the model after completing the training PERIOD = None # periodically save checkpoints RAW_PREDICTION = False # if true, then stores raw predictions (i.e. before applying threshold) PATIENCE = 30 # no. of epoches waits before early stopping EARLY_STOP = True # if True, enables early stopping

How to use

Mode: end-to-end

Mode: train only

Mode: test (inference) only

Mode: feature visualization

Supported squeeze-and-excitation (SE) modules

Currently, our implementation supports the following SEs:

The user needs to pass the attention type to decoder_attention_type in fusegnet_all.py, fusegnet_train.py, xfusegnet_all.py, or xfusegnet_train.py. For instance,decoder_attention_type = 'pscse'

Results

Reference

[1] Pavel Iakubovskii, "Segmentation Models Pytorch", GitHub repository, GitHub, 2019. URL: https://github.com/qubvel/segmentation_models.pytorch
[2] C. Wang et al., “Fully automatic wound segmentation with deep convolutional neural networks,” Sci. Rep., vol. 10, no. 1, 2020.
[3] MICCAI FUSeg Challenge 2021. URL: https://fusc.grand-challenge.org/