UNet model with VGG11 encoder pre-trained on Kaggle Carvana dataset

Overview

TernausNet: U-Net with VGG11 Encoder Pre-Trained on ImageNet for Image Segmentation

By Vladimir Iglovikov and Alexey Shvets

Introduction

TernausNet is a modification of the celebrated UNet architecture that is widely used for binary Image Segmentation. For more details, please refer to our arXiv paper.

UNet11

loss_curve

Pre-trained encoder speeds up convergence even on the datasets with a different semantic features. Above curve shows validation Jaccard Index (IOU) as a function of epochs for Aerial Imagery

This architecture was a part of the winning solutiuon (1st out of 735 teams) in the Carvana Image Masking Challenge.

Installation

pip install ternausnet

Citing TernausNet

Please cite TernausNet in your publications if it helps your research:

@ARTICLE{arXiv:1801.05746,
         author = {V. Iglovikov and A. Shvets},
          title = {TernausNet: U-Net with VGG11 Encoder Pre-Trained on ImageNet for Image Segmentation},
        journal = {ArXiv e-prints},
         eprint = {1801.05746},
           year = 2018
        }

Example of the train and test pipeline

https://github.com/ternaus/robot-surgery-segmentation

Comments
  • training example

    training example

    Hello, Thank you for this upload and congrats on winning the Kaggle challenge. Is it possible for you to provide an example of how to train the network? I can't seem to put everything just right for it to run.

    opened by pmcrodrigues 3
  • 'from unet_models import unet11' reports error

    'from unet_models import unet11' reports error

    Hello, authors, Thanks to your sharing code and paper. I read 'Example.ipynb' then implement related codes. When I type 'from unet_models import unet11', I get an error 'File "unet_models.py", line 16 def init(self, in_: int, out: int): SyntaxError: invalid syntax'

    How can I fix it? My Pytorch version is 0.1.12.

    opened by shawnyuen 1
  • Fix nn.Upsample deprecation warning

    Fix nn.Upsample deprecation warning

    nn.Upsample causes the warning: "nn.Upsample is deprecated. Use nn.functional.interpolate instead."

    proof: https://github.com/pytorch/pytorch/blob/862b8cae51321a16936d87567e8a455186ca2d85/torch/nn/modules/upsampling.py#L129

    https://pytorch.org/docs/stable/_modules/torch/nn/functional.html#upsample

    opened by pokidyshev 0
  • Update to PyTorch 0.4

    Update to PyTorch 0.4

    • Removedvariable

    • replaced volatile=True with with torch.no_grad():

    • replaced cuda with to(device)

      Unfortunately to does not appear to support non_blocking/async.

    opened by gothos-folly 0
  • About num_classes

    About num_classes

    Hello, @ternaus! Thanks for your code, it's really cool, but meaning of num_classes, for instance, in Unet16, isn't clear.

    If I have car and background then I consider that image has 2 num_classes: 0 - background and 1 - car. But according to your code, in my example, you suppose that image has only one class. Why?

    Thanks in advance.

    opened by Oktai15 0
  • Sourcery Starbot ⭐ refactored ternaus/TernausNet

    Sourcery Starbot ⭐ refactored ternaus/TernausNet

    Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

    Here's your pull request refactoring your most popular Python repo.

    If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

    Review changes via command line

    To manually merge these changes, make sure you're on the master branch, then run:

    git fetch https://github.com/sourcery-ai-bot/TernausNet master
    git merge --ff-only FETCH_HEAD
    git reset HEAD^
    
    opened by sourcery-ai-bot 1
  • what is the difference between UNet11 and UNet16

    what is the difference between UNet11 and UNet16

    Hello, I want to ask what is the difference between UNet11 and UNet16. I only find that their channel numbers may be different,I hope you will kindly reply me

    opened by yearep7 0
  • sigmoid output?

    sigmoid output?

    Your paper indicates a final sigmoid output layer, but the models in model.py do not have such a layer and the outputs are not in the range [0,1]. Do I just add a torch.sigmoid in the forward call? In a somewhat unrelated matter, it doesn't seem that your loss function is available. I'm new to machine learning/pytorch/computers and any help would be appreciated. Thank you.

    opened by godsmokescrack 0
  • Change VGG11_2D to VGG11_3D

    Change VGG11_2D to VGG11_3D

    I followed this code, everything good for 2D model. Now, I want to use it for 3D model. I changed 2D to 3D, example: self.pool = nn.MaxPool2d(2,2) => self.pool = nn.MaxPool3d(2,2) ....... but, at the line 49 ( the picture); : models.vgg11(pretrained=pretrained).features is 2D model. I want to use vgg11 for 3D. How do I do? Thank you image

    p/s: I visualizered vgg11; it is 2D model image

    opened by tphankr 0
Owner
Vladimir Iglovikov
Ph.D. in Physics. Kaggle GrandMaster. Veteran of Russian Spetsnaz. Co-creator of Albumentations.
Vladimir Iglovikov
Pytorch-Swin-Unet-V2 - a modified version of Swin Unet based on Swin Transfomer V2

Swin Unet V2 Swin Unet V2 is a modified version of Swin Unet arxiv based on Swin

Chenxu Peng 26 Dec 3, 2022
PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization using Augmented-Self Reference and Dense Semantic Correspondence) and pre-trained model on ImageNet dataset

Reference-Based-Sketch-Image-Colorization-ImageNet This is a PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization usin

Yuzhi ZHAO 11 Jul 28, 2022
A collection of pre-trained StyleGAN2 models trained on different datasets at different resolution.

Awesome Pretrained StyleGAN2 A collection of pre-trained StyleGAN2 models trained on different datasets at different resolution. Note the readme is a

Justin 1.1k Dec 24, 2022
Codes to pre-train T5 (Text-to-Text Transfer Transformer) models pre-trained on Japanese web texts

t5-japanese Codes to pre-train T5 (Text-to-Text Transfer Transformer) models pre-trained on Japanese web texts. The following is a list of models that

Kimio Kuramitsu 1 Dec 13, 2021
LIAO Shuiying 6 Dec 1, 2022
Source code and dataset for ACL2021 paper: "ERICA: Improving Entity and Relation Understanding for Pre-trained Language Models via Contrastive Learning".

ERICA Source code and dataset for ACL2021 paper: "ERICA: Improving Entity and Relation Understanding for Pre-trained Language Models via Contrastive L

THUNLP 75 Nov 2, 2022
Annotate datasets with a semi-trained or fully trained YOLOv5 model

YOLOv5 Auto Annotator Annotate datasets with a semi-trained or fully trained YOLOv5 model Prerequisites Ubuntu >=20.04 Python >=3.7 System dependencie

Akash James 3 May 14, 2022
Chinese clinical named entity recognition using pre-trained BERT model

Chinese clinical named entity recognition (CNER) using pre-trained BERT model Introduction Code for paper Chinese clinical named entity recognition wi

Xiangyang Li 109 Dec 14, 2022
Pre-trained model, code, and materials from the paper "Impact of Adversarial Examples on Deep Learning Models for Biomedical Image Segmentation" (MICCAI 2019).

Adaptive Segmentation Mask Attack This repository contains the implementation of the Adaptive Segmentation Mask Attack (ASMA), a targeted adversarial

Utku Ozbulak 53 Jul 4, 2022
The Hailo Model Zoo includes pre-trained models and a full building and evaluation environment

Hailo Model Zoo The Hailo Model Zoo provides pre-trained models for high-performance deep learning applications. Using the Hailo Model Zoo you can mea

Hailo 50 Dec 7, 2022
🐥A PyTorch implementation of OpenAI's finetuned transformer language model with a script to import the weights pre-trained by OpenAI

PyTorch implementation of OpenAI's Finetuned Transformer Language Model This is a PyTorch implementation of the TensorFlow code provided with OpenAI's

Hugging Face 1.4k Jan 5, 2023
DziriBERT: a Pre-trained Language Model for the Algerian Dialect

DziriBERT DziriBERT is the first Transformer-based Language Model that has been pre-trained specifically for the Algerian Dialect. It handles Algerian

null 117 Jan 7, 2023
Tensorflow Implementation for "Pre-trained Deep Convolution Neural Network Model With Attention for Speech Emotion Recognition"

Tensorflow Implementation for "Pre-trained Deep Convolution Neural Network Model With Attention for Speech Emotion Recognition" Pre-trained Deep Convo

Ankush Malaker 5 Nov 11, 2022
A Comprehensive Empirical Study of Vision-Language Pre-trained Model for Supervised Cross-Modal Retrieval

CLIP4CMR A Comprehensive Empirical Study of Vision-Language Pre-trained Model for Supervised Cross-Modal Retrieval The original data and pre-calculate

null 9 Jan 12, 2022
Saeed Lotfi 28 Dec 12, 2022
Repository to run object detection on a model trained on an autonomous driving dataset.

Autonomous Driving Object Detection on the Raspberry Pi 4 Description of Repository This repository contains code and instructions to configure the ne

Ethan 51 Nov 17, 2022
PyTorch implementation of a Real-ESRGAN model trained on custom dataset

Real-ESRGAN PyTorch implementation of a Real-ESRGAN model trained on custom dataset. This model shows better results on faces compared to the original

Sber AI 160 Jan 4, 2023
LSTM model trained on a small dataset of 3000 names written in PyTorch

LSTM model trained on a small dataset of 3000 names. Model generates names from model by selecting one out of top 3 letters suggested by model at a time until an EOS (End Of Sentence) character is not encountered.

Sahil Lamba 1 Dec 20, 2021