DenseNet

Last updated on Feb 14, 2021

densenet121

Parameters 8 Million
FLOPs 4 Billion
File Size 30.88 MB
Training Data ImageNet
Training Resources
Training Time

Training Techniques Nesterov Accelerated Gradient, Weight Decay, Kaiming Initialization
Architecture 1x1 Convolution, Average Pooling, Batch Normalization, Convolution, Dense Block, Dropout, Dense Connections, ReLU, Max Pooling, Softmax
ID densenet121
LR 0.1
Epochs 90
Layers 121
Dropout 0.2
Crop Pct 0.875
Momentum 0.9
Batch Size 256
Image Size 224
Weight Decay 0.0001
Interpolation bicubic
SHOW MORE
SHOW LESS
densenet161

Parameters 29 Million
FLOPs 10 Billion
File Size 110.37 MB
Training Data ImageNet
Training Resources
Training Time

Training Techniques Nesterov Accelerated Gradient, Weight Decay, Kaiming Initialization
Architecture 1x1 Convolution, Average Pooling, Batch Normalization, Convolution, Dense Block, Dropout, Dense Connections, ReLU, Max Pooling, Softmax
ID densenet161
LR 0.1
Epochs 90
Layers 161
Dropout 0.2
Crop Pct 0.875
Momentum 0.9
Batch Size 256
Image Size 224
Weight Decay 0.0001
Interpolation bicubic
SHOW MORE
SHOW LESS
densenet169

Parameters 14 Million
FLOPs 4 Billion
File Size 54.71 MB
Training Data ImageNet
Training Resources
Training Time

Training Techniques Nesterov Accelerated Gradient, Weight Decay, Kaiming Initialization
Architecture 1x1 Convolution, Average Pooling, Batch Normalization, Convolution, Dense Block, Dropout, Dense Connections, ReLU, Max Pooling, Softmax
ID densenet169
LR 0.1
Epochs 90
Layers 169
Dropout 0.2
Crop Pct 0.875
Momentum 0.9
Batch Size 256
Image Size 224
Weight Decay 0.0001
Interpolation bicubic
SHOW MORE
SHOW LESS
densenet201

Parameters 20 Million
FLOPs 6 Billion
File Size 77.37 MB
Training Data ImageNet
Training Resources
Training Time

Training Techniques Nesterov Accelerated Gradient, Weight Decay, Kaiming Initialization
Architecture 1x1 Convolution, Average Pooling, Batch Normalization, Convolution, Dense Block, Dropout, Dense Connections, ReLU, Max Pooling, Softmax
ID densenet201
LR 0.1
Epochs 90
Layers 201
Dropout 0.2
Crop Pct 0.875
Momentum 0.9
Batch Size 256
Image Size 224
Weight Decay 0.0001
Interpolation bicubic
SHOW MORE
SHOW LESS
densenetblur121d

Parameters 8 Million
FLOPs 4 Billion
File Size 30.95 MB
Training Data ImageNet
Training Resources
Training Time

Architecture 1x1 Convolution, Batch Normalization, Convolution, Dense Block, Dropout, Dense Connections, ReLU, Max Pooling, Softmax, Blur Pooling
ID densenetblur121d
Crop Pct 0.875
Image Size 224
Interpolation bicubic
SHOW MORE
SHOW LESS
tv_densenet121

Parameters 8 Million
FLOPs 4 Billion
File Size 30.84 MB
Training Data ImageNet
Training Resources
Training Time

Training Techniques SGD with Momentum, Weight Decay
Architecture 1x1 Convolution, Average Pooling, Batch Normalization, Convolution, Dense Block, Dropout, Dense Connections, ReLU, Max Pooling, Softmax
ID tv_densenet121
LR 0.1
Epochs 90
Crop Pct 0.875
LR Gamma 0.1
Momentum 0.9
Batch Size 32
Image Size 224
LR Step Size 30
Weight Decay 0.0001
Interpolation bicubic
SHOW MORE
SHOW LESS
README.md

Summary

DenseNet is a type of convolutional neural network that utilises dense connections between layers, through Dense Blocks, where we connect all layers (with matching feature-map sizes) directly with each other. To preserve the feed-forward nature, each layer obtains additional inputs from all preceding layers and passes on its own feature-maps to all subsequent layers.

The DenseNet Blur variant in this collection by Ross Wightman employs Blur Pooling

How do I load this model?

To load a pretrained model:

import timm
m = timm.create_model('densenet121', pretrained=True)
m.eval()

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

How do I train this model?

You can follow the timm recipe scripts for training a new model afresh.

Citation

@article{DBLP:journals/corr/HuangLW16a,
  author    = {Gao Huang and
               Zhuang Liu and
               Kilian Q. Weinberger},
  title     = {Densely Connected Convolutional Networks},
  journal   = {CoRR},
  volume    = {abs/1608.06993},
  year      = {2016},
  url       = {http://arxiv.org/abs/1608.06993},
  archivePrefix = {arXiv},
  eprint    = {1608.06993},
  timestamp = {Mon, 10 Sep 2018 15:49:32 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/HuangLW16a.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
@misc{rw2019timm,
  author = {Ross Wightman},
  title = {PyTorch Image Models},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  doi = {10.5281/zenodo.4414861},
  howpublished = {\url{https://github.com/rwightman/pytorch-image-models}}
}

Results

Image Classification on ImageNet

Image Classification on ImageNet
MODEL TOP 1 ACCURACY TOP 5 ACCURACY
densenet161 77.36% 93.63%
densenet201 77.29% 93.48%
densenetblur121d 76.59% 93.2%
densenet169 75.9% 93.02%
densenet121 75.56% 92.65%
tv_densenet121 74.74% 92.15%