ResNet

Last updated on Feb 12, 2021

ResNet-101

Parameters 45 Million
FLOPs 8 Billion
File Size 170.45 MB
Training Data ImageNet
Training Resources 8x NVIDIA V100 GPUs
Training Time

Training Techniques Weight Decay, SGD with Momentum
Architecture 1x1 Convolution, Bottleneck Residual Block, Batch Normalization, Convolution, Global Average Pooling, Residual Block, Residual Connection, ReLU, Max Pooling, Softmax
ID resnet101
LR 0.1
Epochs 90
LR Gamma 0.1
Momentum 0.9
Batch Size 32
LR Step Size 30
Weight Decay 0.0001
SHOW MORE
SHOW LESS
ResNet-152

Parameters 60 Million
FLOPs 12 Billion
File Size 230.34 MB
Training Data ImageNet
Training Resources 8x NVIDIA V100 GPUs
Training Time

Training Techniques Weight Decay, SGD with Momentum
Architecture 1x1 Convolution, Bottleneck Residual Block, Batch Normalization, Convolution, Global Average Pooling, Residual Block, Residual Connection, ReLU, Max Pooling, Softmax
ID resnet152
LR 0.1
Epochs 90
LR Gamma 0.1
Momentum 0.9
Batch Size 32
LR Step Size 30
Weight Decay 0.0001
SHOW MORE
SHOW LESS
ResNet-18

Parameters 12 Million
FLOPs 2 Billion
File Size 44.66 MB
Training Data ImageNet
Training Resources 8x NVIDIA V100 GPUs
Training Time

Training Techniques Weight Decay, SGD with Momentum
Architecture 1x1 Convolution, Bottleneck Residual Block, Batch Normalization, Convolution, Global Average Pooling, Residual Block, Residual Connection, ReLU, Max Pooling, Softmax
ID resnet18
LR 0.1
Epochs 90
LR Gamma 0.1
Momentum 0.9
Batch Size 32
LR Step Size 30
Weight Decay 0.0001
SHOW MORE
SHOW LESS
ResNet-34

Parameters 22 Million
FLOPs 4 Billion
File Size 83.26 MB
Training Data ImageNet
Training Resources 8x NVIDIA V100 GPUs
Training Time

Training Techniques Weight Decay, SGD with Momentum
Architecture 1x1 Convolution, Bottleneck Residual Block, Batch Normalization, Convolution, Global Average Pooling, Residual Block, Residual Connection, ReLU, Max Pooling, Softmax
ID resnet34
LR 0.1
Epochs 90
LR Gamma 0.1
Momentum 0.9
Batch Size 32
LR Step Size 30
Weight Decay 0.0001
SHOW MORE
SHOW LESS
ResNet-50

Parameters 26 Million
FLOPs 4 Billion
File Size 97.75 MB
Training Data ImageNet
Training Resources 8x NVIDIA V100 GPUs
Training Time

Training Techniques Weight Decay, SGD with Momentum
Architecture 1x1 Convolution, Bottleneck Residual Block, Batch Normalization, Convolution, Global Average Pooling, Residual Block, Residual Connection, ReLU, Max Pooling, Softmax
ID resnet50
LR 0.1
Epochs 90
LR Gamma 0.1
Momentum 0.9
Batch Size 32
LR Step Size 30
Weight Decay 0.0001
SHOW MORE
SHOW LESS
README.md

Summary

Residual Networks, or ResNets, learn residual functions with reference to the layer inputs, instead of learning unreferenced functions. Instead of hoping each few stacked layers directly fit a desired underlying mapping, residual nets let these layers fit a residual mapping. They stack residual blocks ontop of each other to form network: e.g. a ResNet-50 has fifty layers using these blocks.

How do I load this model?

To load a pretrained model:

import torchvision.models as models
resnet18 = models.resnet18(pretrained=True)

Replace the model name with the variant you want to use, e.g. resnet18. You can find the IDs in the model summaries at the top of this page.

To evaluate the model, use the image classification recipes from the library.

python train.py --test-only --model='<model_name>'

How do I train this model?

You can follow the torchvision recipe on GitHub for training a new model afresh.

Citation

@article{DBLP:journals/corr/HeZRS15,
  author    = {Kaiming He and
               Xiangyu Zhang and
               Shaoqing Ren and
               Jian Sun},
  title     = {Deep Residual Learning for Image Recognition},
  journal   = {CoRR},
  volume    = {abs/1512.03385},
  year      = {2015},
  url       = {http://arxiv.org/abs/1512.03385},
  archivePrefix = {arXiv},
  eprint    = {1512.03385},
  timestamp = {Wed, 17 Apr 2019 17:23:45 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/HeZRS15.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

Results

Image Classification on ImageNet

Image Classification on ImageNet
MODEL TOP 1 ACCURACY TOP 5 ACCURACY
ResNet-152 78.31% 94.06%
ResNet-101 77.37% 93.56%
ResNet-50 76.15% 92.87%
ResNet-34 73.3% 91.42%
ResNet-18 69.76% 89.08%