RefineNet: Multi-Path Refinement Networks for High-Resolution Semantic Segmentation

Overview

Multipath RefineNet

A MATLAB based framework for semantic image segmentation and general dense prediction tasks on images.

This is the source code for the following paper and its extension:

  1. RefineNet: Multi-Path Refinement Networks for High-Resolution Semantic Segmentation; CVPR 2017
    https://arxiv.org/abs/1611.06612
  2. RefineNet extension in TPAMI 2019: DOI Link

Pytorch implementation

This codebase only provides MATLAB and MatConvNet based implementation.

Vladimir Nekrasov kindly provides a Pytorch implementation and a light-weight version of RefineNet at:
https://github.com/DrSleep/refinenet-pytorch

Update notes

  • 23 Dec 2016: We did a major update of our code.
  • (new!) 13 Feb 2018:
    1. Multi-scale prediction and evaluation code are added. We add demo files for multi-scale prediction, fusion and evaluation. Please refer to the Testing section below for more details.
    2. New models available: trained models using improved residual pooling. Available for these datasets: NYUDv2, Person_Parts, PASCAL_Context, SUNRGBD, ADE20k. These models will give better performance than the reported results in our CVPR paper.
    3. New models available: trained models using ResNet-152 for all 7 datasets. Apart from ResNet-101 based models, our ResNet-152 based models of all 7 datasets are now available for download.
    4. Updated trained model for VOC2012: this updated model is slightly better than the previous one. We previously uploaded a wrong model.
    5. All models are now available in Google Drive and Baidu Pan.
    6. More details are provided on testing, training and implementation. Please refer to Important notes in each section below.

Results

  • Results on the CityScapes Dataset (single scale prediction using ResNet-101 based RefineNet) RefineNet Results on the CityScapes Dataset

Trained models

  • (new!) Trained models for the following datasets are available for download.
  1. PASCAL VOC 2012
  2. Cityscapes
  3. NYUDv2
  4. Person_Parts
  5. PASCAL_Context
  6. SUNRGBD
  7. ADE20k
  • Downloads for the above datasets. Put the downloaded models in ./model_trained/
  • Important notes:
    • For the test set performance of our method on the dataset PASCAl VOC and Cityscapes, kindly note that we do not use any images in the validation set for training. Our models are trained only using the training set images.
    • The trained models of the the following datasets are using improved residual pooling: NYUDv2, Person_Parts, PASCAL_Context, SUNRGBD, ADE20k. These models will give better performance than the reported results in our CVPR paper. Please also refer to the Network architecture section below for more details about improved pooling.
    • The model for VOC2012 is updated. We previously uploaded a wrong model.

Network architecture and implementation

  • You can find the network graphs that illustrate our architecture in the folder net_graphs. Please refer to our paper for more details.
  • We include in this folder the details of improved residual pooling which improves the residual pooling block described in our CVPR paper.
  • Important notes:
    • In our up-sampling and fusion layer, we simply use down-sampling for gradient back-propagation. Please refer to the implementation of our fusion layer for details: My_sum_layer.m.
    • please refer to our training demo files for more details on implementation

Installation

  • Install MatConvNet and CuDNN. We have modified MatConvNet for our task. A modified copy of MatConvNet is provided in ./lib/. You need to compile the provided MatConvNet before running. Details of this modification and compiling can be found in main/my_matconvnet_resnet/README.md.

  • An example script for exporting lib paths is main/my_matlab.sh

  • Download the following ImageNet pre-trained models and place them in ./model_trained/:

    • imagenet-resnet-50-dag, imagenet-resnet-101-dag, imagenet-resnet-152-dag.

    They can be downloaded from: MatConvNet, we also have a copy in Google Drive, Baidu Pan.

Testing

1. Multi-scale prediction and evaluation (new!)

  • First download the trained models and put them in ./model_trained/. Please refer to the above section Trained Models.

  • Then refer to the below example scripts for prediction on your images:

    • demo_predict_mscale_[dataset name].m
    • e.g., demo_predict_mscale_voc.m, demo_predict_mscale_nyud, demo_predict_mscale_person_parts
  • You may need to carefully read through the comments in these demo scripts before using.

  • Important notes:

    • In the default setting, the example scripts will perform multi-scale prediction and fuse multi-scale results to generate final prediction.
    • The generated masks and scores maps will be saved in your disk. Note that the score maps are saved in the format of uint8 with values in [0 255]. You need to cast them into double and normalize into [0 1] if you want to use them.
    • The above demo files are able to perform multi-scale prediction and evaluation (e.g., in terms of IoU scores) in a single run. However, in the default setting, the performance evaluation part is disabled. Please refer to the comments in the demo files to turn on the performance evaluation.
    • Trained models using improved residual pooling will give better performance than the reported results in our CVPR paper. Please refer to the above section Trained models for more details.
    • For the images from NYUDv2 dataset, you may need to remove the white borders of the images before applying our models. More details and crop tools can be found in the NYUDv2 dataset webpage.

2. Single scale prediction and evaluation

  • Single scale prediction and evaluation can be done by changing the scale setting in the multi-scale prediction demo files. Please refer the the above section for multi-scale prediction.

  • We also provide simplified demo files for prediction with much less configurations. They are only for single scale prediction. Examples can be found at: demo_test_simple_voc.m and demo_test_simple_city.m.

3. Evaluation and fusion on saved results (score map files and mask files) (new!)

  • We provide an example script to perform multi-scale fusion on a number of predictions (score maps) saved in your disk:
    • demo_fuse_saved_prediction_voc.m : fuse multiple cached predictions to generate the final prediction
  • We provide an example script to evaluate the prediction masks saved in your disk:
    • demo_evaluate_saved_prediction_voc.m : evaluate the segmentation performance, e.g., in terms of IoU scores.

Training

  • The following demo files are provided for training a RefineNet on your own dataset. Please carefully read through the comments in the demo files before using this training code.
    • demo_refinenet_train.m
    • demo_refinenet_train_reduce_learning_rate.m
  • Important notes:
    • We use step-wise policy to reduce learning rate, and more importantly, you need to manually reduce the learning rate during the training stage. The setting of maximum training iteration just serves as a simple example and it should be adapted to your datasets. More details can be found in the comments of the training demo files.
    • We use the improved version of chained pooling in this training code, which may achieve better result than using the above provided models.

Citation

If you find the code useful, please cite our work as

@inproceedings{Lin:2017:RefineNet,
  title = {Refine{N}et: {M}ulti-Path Refinement Networks for High-Resolution Semantic Segmentation},
  shorttitle = {RefineNet: Multi-Path Refinement Networks},
  booktitle = {CVPR},
  author = {Lin, G. and Milan, A. and Shen, C. and Reid, I.},
  month = jul,
  year = {2017}
}

and

@article{lin2019refinenet,
  title={RefineNet: Multi-Path Refinement Networks for Dense Prediction},
  author={Lin, Guosheng and Liu, Fayao and Milan, Anton and Shen, Chunhua and Reid, Ian},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  year={2019},
  publisher={IEEE},
  doi={10.1109/TPAMI.2019.2893630}, 
}

License

For academic usage, the code is released under the permissive BSD license. For any commercial purpose, please contact the authors.

Owner
Guosheng Lin
Guosheng Lin
Neural Motion Learner With Python

Neural Motion Learner Introduction This work is to extract skeletal structure from volumetric observations and to learn motion dynamics from the detec

Jinseok Bae 14 Nov 28, 2022
Soft actor-critic is a deep reinforcement learning framework for training maximum entropy policies in continuous domains.

This repository is no longer maintained. Please use our new Softlearning package instead. Soft Actor-Critic Soft actor-critic is a deep reinforcement

Tuomas Haarnoja 752 Jan 07, 2023
Implementation of BI-RADS-BERT & The Advantages of Section Tokenization.

BI-RADS BERT Implementation of BI-RADS-BERT & The Advantages of Section Tokenization. This implementation could be used on other radiology in house co

1 May 17, 2022
SAMO: Streaming Architecture Mapping Optimisation

SAMO: Streaming Architecture Mapping Optimiser The SAMO framework provides a method of optimising the mapping of a Convolutional Neural Network model

Alexander Montgomerie-Corcoran 20 Dec 10, 2022
Bringing Characters to Life with Computer Brains in Unity

AI4Animation: Deep Learning for Character Control This project explores the opportunities of deep learning for character animation and control as part

Sebastian Starke 5.5k Jan 04, 2023
A lightweight Python-based 3D network multi-agent simulator. Uses a cell-based congestion model. Calculates risk, loudness and battery capacities of the agents. Suitable for 3D network optimization tasks.

AMAZ3DSim AMAZ3DSim is a lightweight python-based 3D network multi-agent simulator. It uses a cell-based congestion model. It calculates risk, battery

Daniel Hirsch 13 Nov 04, 2022
PFLD pytorch Implementation

PFLD-pytorch Implementation of PFLD A Practical Facial Landmark Detector by pytorch. 1. install requirements pip3 install -r requirements.txt 2. Datas

zhaozhichao 669 Jan 02, 2023
Unleashing Transformers: Parallel Token Prediction with Discrete Absorbing Diffusion for Fast High-Resolution Image Generation from Vector-Quantized Codes

Unleashing Transformers: Parallel Token Prediction with Discrete Absorbing Diffusion for Fast High-Resolution Image Generation from Vector-Quantized C

Sam Bond-Taylor 139 Jan 04, 2023
Pytorch implementation of "Neural Wireframe Renderer: Learning Wireframe to Image Translations"

Neural Wireframe Renderer: Learning Wireframe to Image Translations Pytorch implementation of ideas from the paper Neural Wireframe Renderer: Learning

Yuan Xue 7 Nov 14, 2022
Recurrent Scale Approximation (RSA) for Object Detection

Recurrent Scale Approximation (RSA) for Object Detection Codebase for Recurrent Scale Approximation for Object Detection in CNN published at ICCV 2017

Yu Liu (Louis) 239 Dec 28, 2022
Unofficial Tensorflow Implementation of ConvNeXt from A ConvNet for the 2020s

Tensorflow Implementation of "A ConvNet for the 2020s" This is the unofficial Tensorflow Implementation of ConvNeXt from "A ConvNet for the 2020s" pap

DK 11 Oct 12, 2022
Code & Models for Temporal Segment Networks (TSN) in ECCV 2016

Temporal Segment Networks (TSN) We have released MMAction, a full-fledged action understanding toolbox based on PyTorch. It includes implementation fo

1.4k Jan 01, 2023
Official pytorch implementation of the AAAI 2021 paper Semantic Grouping Network for Video Captioning

Semantic Grouping Network for Video Captioning Hobin Ryu, Sunghun Kang, Haeyong Kang, and Chang D. Yoo. AAAI 2021. [arxiv] Environment Ubuntu 16.04 CU

Hobin Ryu 43 Nov 25, 2022
Object DGCNN and DETR3D, Our implementations are built on top of MMdetection3D.

This repo contains the implementations of Object DGCNN (https://arxiv.org/abs/2110.06923) and DETR3D (https://arxiv.org/abs/2110.06922). Our implementations are built on top of MMdetection3D.

Wang, Yue 539 Jan 07, 2023
Official PyTorch implementation for paper "Efficient Two-Stage Detection of Human–Object Interactions with a Novel Unary–Pairwise Transformer"

UPT: Unary–Pairwise Transformers This repository contains the official PyTorch implementation for the paper Frederic Z. Zhang, Dylan Campbell and Step

Frederic Zhang 109 Dec 20, 2022
An implementation of based on pytorch and mmcv

FisherPruning-Pytorch An implementation of Group Fisher Pruning for Practical Network Compression based on pytorch and mmcv Main Functions Pruning f

Peng Lu 15 Dec 17, 2022
Convenient tool for speeding up the intern/officer review process.

icpc-app-screen Convenient tool for speeding up the intern/officer applicant review process. Eliminates the pain from reading application responses of

1 Oct 30, 2021
Good Semi-Supervised Learning That Requires a Bad GAN

Good Semi-Supervised Learning that Requires a Bad GAN This is the code we used in our paper Good Semi-supervised Learning that Requires a Bad GAN Ziha

Zhilin Yang 177 Dec 12, 2022
This is the winning solution of the Endocv-2021 grand challange.

Endocv2021-winner [Paper] This is the winning solution of the Endocv-2021 grand challange. Dependencies pytorch # tested with 1.7 and 1.8 torchvision

Vajira Thambawita 14 Dec 03, 2022
Main repository for the HackBio'2021 Virtual Internship Experience for #Team-Greider ❤️

Hello 🤟 #Team-Greider The team of 20 people for HackBio'2021 Virtual Bioinformatics Internship 💝 🖨️ 👨‍💻 HackBio: https://thehackbio.com 💬 Ask us

Siddhant Sharma 7 Oct 20, 2022