Detail-Preserving Pooling in Deep Networks (CVPR 2018)
Switch branches/tags
Nothing to show
Clone or download
farazsaeedan Update s3pool.lua
mistype-fixed
Latest commit e810bd6 Nov 14, 2018
Permalink
Failed to load latest commit information.
DPPinPytorch Implementation in PyTorch added Aug 6, 2018
datasets DPP deployed Apr 11, 2018
models DPP deployed Apr 11, 2018
visinf_package Update s3pool.lua Nov 14, 2018
.gitignore Initial commit Apr 11, 2018
LICENSE Initial commit Apr 11, 2018
README.md link to paper on arxiv fixed Apr 12, 2018
checkpoints.lua DPP deployed Apr 11, 2018
dataloader.lua DPP deployed Apr 11, 2018
flowchart.png DPP deployed Apr 11, 2018
main.lua DPP deployed Apr 11, 2018
opts.lua DPP deployed Apr 11, 2018
plotter.lua DPP deployed Apr 11, 2018
train.lua DPP deployed Apr 11, 2018

README.md

Detail Preserving Pooling in Torch

This repository contains the code for DPP introduced in the following paper:
Detail-Preserving Pooling in Deep Networks (CVPR 2018)
Faraz Saeedan1, Nicolas Weber1,2*, Michael Goesele1,3*, and Stefan Roth1
1TU Darmstadt (VISINF & GCC), 2NEC Laboratories Europe, 3Oculus Research
*Work carried out while at TU Darmstadt

Citation

If you find DPP useful in your research, please cite:

@inproceedings{saeedan2018dpp,
  title={Detail-preserving pooling in deep networks},
  author={Saeedan, Faraz and Weber, Nicolas and Goesele, Michael and Roth, Stefan},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2018}
}

Requirements

  • This code is built on fb.resnet.torch. Check that repository for requirements and preparations.
  • In addition you need the nnlr package installed in Torch.

Install

  1. Install the visinf package first. This package will give you access to all the models that were used in the paper: Symmetric, asymmetric, full, lite, with and without stochasticity. Please check the reference paper for a description of these variants.

  2. Clone the repository:

    git clone https://github.com/visinf/dpp.git 
  3. Follow one of the recipes below or try your own.

Usage

For training, simply run main.lua. By default, the script runs ResNet-110 with $DPP sym lite$ on CIFAR10 with 1 GPU and 2 data-loader threads. To run the models used in CIFAR10 experiments try:

    th main.lua -data [imagenet-folder with train and val folders] -netType resnetdpp -poolingType DPP_sym_lite -save [folder to save results] -stochasticity 'false' -manualSeed xyz
    th main.lua -data [imagenet-folder with train and val folders] -netType resnetdpp -poolingType DPP_asym_lite -save [folder to save results] -stochasticity 'false' -manualSeed xyz
    th main.lua -data [imagenet-folder with train and val folders] -netType resnetdpp -poolingType DPP_sym_full -save [folder to save results] -stochasticity 'false' -manualSeed xyz
    th main.lua -data [imagenet-folder with train and val folders] -netType resnetdpp -poolingType DPP_asym_full -save [folder to save results] -stochasticity 'false' -manualSeed xyz
    th main.lua -data [imagenet-folder with train and val folders] -netType resnetdpp -poolingType DPP_sym_lite -save [folder to save results] -stochasticity 'true' -manualSeed xyz

replace xyz with your desired random number generator seed.

To train ResNets on ImageNet try:

    th main.lua -depth 50 -batchSize 85 -nGPU 4 -nThreads 8 -shareGradInput true -data [imagenet-folder] -dataset imagenet -LR 0.033 -netType resnetdpp -poolingType DPP_sym_lite

or

    th main.lua -depth 101 -batchSize 85 -nGPU 4 -nThreads 8 -shareGradInput true -data [imagenet-folder] -dataset imagenet -LR 0.033 -netType resnetdpp -poolingType DPP_sym_lite

Different implementations of DPP

There are two different implementation codes of DPP available in the Visinf package:

  1. Black-box implementation: For this implementation we have derived closed form equations for the forward and backward passes of the inverse bilateral pooling component of DPP and implemented them in CUDA. visinf.SpatialInverseBilateralPooling gives access to this implementation, which is very fast and memory efficient. This version can be used for large-scale experiments such as ImageNet, but gives very little insight into various elements inside the block and modifying them is difficult and requires re-deriving and implementing the gradients w.r.t. parameters and inputs.

  2. Implementation based on nngraph: This version is made up of a number of Torch primitive blocks connected to each other in a graph. The internals of the block can be understood easily, examined, and altered if need be. This version is fast but not memory efficient for large image sizes. The memory overhead for CIFAR-sized experiments is moderate.

Contact

If you have further questions or discussions write an email to faraz.saeedan@visinf.tu-darmstadt.de