Home

Awesome

Deep Fusion Project

This project contains the models used for the experiments in the paper:

Liming Zhao, Jingdong Wang, Xi Li, Zhuowen Tu, and Wenjun Zeng. "On the Connection of Deep Fusion to Ensembling." arXiv preprint arXiv:1611.07718 (2016).

Contact: Liming Zhao (zhaoliming@zju.edu.cn)

Introduction

In this work, we provide a systematic study to the prevailing ResNet architecture by showing a connection from a general deeply-fused net view to ensembling.

ensemble

Our empirical results uncover that the deepest network among the ensemble components does not contribute the most significantly to the overall performance and instead it provides a manner to introduce many layers and thus guarantee the ensemble size.

Guided by the above study and observation, we develop a new deeply-fused network that combines two networks in a merge-and-run fusion manner.

blocks

Our approach demonstrates consistent improvements over the ResNet with the comparable setup on CIFAR-10, CIFAR-100, SVHN, and ImageNet.

Results

MethodDepth#ParamsCIFAR-10CIFAR-100SVHN
DFN-MR1561.7M4.9424.461.66
DFN-MR23214.9M3.9419.251.51
DFN-MR35024.8M3.5719.001.55
MethodDepth#ParamsTop-1 trainTop-5 trainTop-1 valTop-5 val
ResNet9845.0M15.093.2523.386.79
DFN-MR5046.4M14.463.1623.166.61

Requirements

How to Train

Step by step tutorial with jupyter notebook is now available, please check the file tutorial.ipynb.

dataset

You can prepare the *.rec file by yourself, or simply download the Cifar dataset from data.dmlc.ml or my google drive (recommended), which includes both Cifar and SVHN datasets. For ImageNet dataset, follow the mxnet official document to prepare.

training

Current code supports training different deeply-fused nets on Cifar-10, Cifar-100, SVHN and ImageNet, such as plain network, resnet, cross (dfn-mr),half (dfn-il), side (dfn-il without identities), fuse3 (three fusions), fuse6 (six fusions), and ensemble (with sharing weights, training code will come later). All the networks are contained in the network folder.

For example, running the following command can train the DFN-MR network (we call it cross in the coding stage) on Cifar-10.

python train_model.py --dataset=cifar10 --network=cross --depth=56 --gpus=0,1 --dataset=<dataset location>

To train DFN-MR network on ImageNet, run

python train_imagenet.py --network=symbol_cross --gpus=0,1,2,3 --data-dir=<dataset location>

Other usages

visualization

If you want to show the network architecture, run the following command to visualize the network.

python show_model.py --network=half --depth=26 --widen-factor=1

You will obtain a picture half_d26.png in the visualize folder, and more examples can be found there.

Note that you may need to install graphviz for visualization.

show results

The training log are saved to snapshot folder, and you can use get_results.py to obtain the final result of multiple runs in the format of median (mean +/- std, best).

Citation

Please cite our papers on deep fusion in your publications if it helps your research:

@article{WangWZZ16,
  author    = {Jingdong Wang and
               Zhen Wei and
               Ting Zhang and
               Wenjun Zeng},
  title     = {Deeply-Fused Nets},
  journal   = {CoRR},
  volume    = {abs/1605.07716},
  year      = {2016},
  url       = {http://arxiv.org/abs/1605.07716},
}
@article{ZhaoWLTZ16,
  author    = {Liming Zhao and
               Jingdong Wang and
               Xi Li and
               Zhuowen Tu and
               Wenjun Zeng},
  title     = {On the Connection of Deep Fusion to Ensembling},
  journal   = {CoRR},
  volume    = {abs/1611.07718},
  year      = {2016},
  url       = {http://arxiv.org/abs/1611.07718},
}