← all repositories
liuzhuang13/DenseNet

CVPR Best Paper code: half the parameters, all the connections

Original Lua implementation of the CVPR 2017 Best Paper that matches ResNet's ImageNet accuracy with less than half the parameters by connecting every layer to every other layer in dense blocks.

DenseNet
Not currently ranked — collecting fresh signals.
star history

What it does

DenseNet is a convolutional network architecture where every layer inside a dense block receives feature maps from all preceding layers and passes its own output to all subsequent layers in feed-forward fashion. This repository holds the authors’ original Lua/Torch implementation, built on Facebook’s fb.resnet.torch framework, with training code and results for CIFAR-10/100, SVHN, and ImageNet. A later memory-efficient revision squeezed the largest 190-layer variant onto a single Titan X GPU instead of the four GPUs required by the standard recursive-concatenation approach.

The interesting bit

The connectivity pattern sounds like a memory nightmare—concatenating every layer’s output balloons the feature map count—but the authors tame it with 1×1 bottleneck convolutions and 0.5 channel compression between blocks. The result is a network that achieves similar ImageNet accuracy to ResNet with roughly half the FLOPs and less than half the parameters. They also showed that wide, shallow variants can outperform deep ones on the time/accuracy and memory/accuracy tradeoff curve.

Key highlights

  • CVPR 2017 Best Paper; original Lua/Torch code extending fb.resnet.torch
  • Dense blocks connect every layer to every other layer feed-forward
  • Matches ResNet on ImageNet with less than half the parameters and roughly half the FLOPs
  • Memory-efficient training modes (-optMemory 3 and -optMemory 4) use customized densely connected layers to slash GPU memory usage
  • Authors recommend Wide-DenseNet-BC (shallow but wide) for practical deployments where memory and training time matter
  • Torch pretrained models are deprecated; users are directed to PyTorch’s official torchvision models

Caveats

  • Pretrained Torch models are deprecated and no longer maintained
  • The implementation is built on fb.resnet.torch, so it is an extension of that framework rather than a standalone codebase

Verdict

Worth a look if you are studying the evolution of network architectures or need to reproduce the original 2016–2017 CIFAR/ImageNet benchmarks. Skip it if you just want a modern, maintained DenseNet for production—use PyTorch’s built-in implementation instead.

Frequently asked

What is liuzhuang13/DenseNet?
Original Lua implementation of the CVPR 2017 Best Paper that matches ResNet's ImageNet accuracy with less than half the parameters by connecting every layer to every other layer in dense blocks.
Is DenseNet open source?
Yes — liuzhuang13/DenseNet is open source, released under the BSD-3-Clause license.
What language is DenseNet written in?
liuzhuang13/DenseNet is primarily written in Lua.
How popular is DenseNet?
liuzhuang13/DenseNet has 4.9k stars on GitHub.
Where can I find DenseNet?
liuzhuang13/DenseNet is on GitHub at https://github.com/liuzhuang13/DenseNet.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.