Giter Site home page Giter Site logo

cross-iterationbatchnorm's Introduction

Cross-Iteration Batch Normalization

By Zhuliang Yao, Yue Cao, Shuxin Zheng, Gao Huang, Stephen Lin.

This repo is an official implementation of "Cross-Iteration Batch Normalization" on COCO object detection based on open-mmlab's mmdetection. This repository contains a PyTorch implementation of the CBN layer, as well as some training scripts to reproduce the COCO object detection and instance segmentation results reported in our paper.

Introduction

CBN is initially described in arxiv. A well-known issue of Batch Normalization is its significantly reduced effectiveness in the case of small mini-batch sizes. Here we present Cross-Iteration Batch Normalization (CBN), in which examples from multiple recent iterations are jointly utilized to enhance estimation quality. A challenge is that the network activations from different iterations are not comparable to each other due to changes in network weights. We thus compensate for the network weight changes via a proposed technique based on Taylor polynomials, so that the statistics can be accurately estimated. On object detection and image classification with small mini-batch sizes, CBN is found to outperform the original batch normalization and a direct calculation of statistics over previous iterations without the proposed compensation technique.

Citing CBN

@article{zhu2020CBN,
  title={Cross-Iteration Batch Normalization},
  author={Yao, Zhuliang and Cao, Yue and Zheng, Shuxin and Huang, Gao and Lin, Stephen},
  journal={arXiv preprint arXiv:2002.05712},
  year={2020}
}

Main Results

Backbone Method Norm APb APb0.50 APb0.75 APm APm0.50 APm0.75 Download
R-50-FPN Faster R-CNN - 36.8 57.9 39.8 - - - model
R-50-FPN Faster R-CNN SyncBN 37.5 58.4 40.6 - - - model
R-50-FPN Faster R-CNN GN 37.7 59.2 41.2 - - - model
R-50-FPN Faster R-CNN CBN 37.6 58.5 40.9 - - - model
R-50-FPN Mask R-CNN - 37.6 58.5 41.0 34.0 55.2 36.2 model
R-50-FPN Mask R-CNN SyncBN 38.5 58.9 42.0 34.3 55.7 36.7 model
R-50-FPN Mask R-CNN GN 38.5 59.4 41.8 35.0 56.4 37.3 model
R-50-FPN Mask R-CNN CBN 38.4 58.9 42.2 34.7 55.9 37.0 model

*All results are trained with 1x schedule. Normalization layers of backbone are fixed by default.

Installation

Please refer to INSTALL.md for installation and dataset preparation.

Demo

Test

Download the pretrained model

# Faster R-CNN
python tools/test.py {configs_file} {downloaded model} --gpus 4 --out {tmp.pkl} --eval bbox
# Mask R-CNN
python tools/test.py {configs_file} {downloaded model} --gpus 4 --out {tmp.pkl} --eval bbox segm

Train Mask R-CNN

One node with 4GPUs:

# SyncBN
./tools/dist_train.sh ./configs/cbn/mask_rcnn_r50_fpn_syncbn_1x.py 4
# GN
./tools/dist_train.sh ./configs/cbn/mask_rcnn_r50_fpn_gn_1x.py 4
# CBN
./tools/dist_train.sh ./configs/cbn/mask_rcnn_r50_fpn_cbn_buffer3_burnin8_1x.py 4

TODO

  • Clean up mmdetection code base
  • Add CBN layer support
  • Add default configs for training
  • Upload pretrained models for quick test demo
  • Provide a conv_module of Conv & CBN
  • Speedup CBN layer with CUDA/CUDNN

Thanks

This implementation is based on mmdetection. Ref to this link for more details about mmdetection.

cross-iterationbatchnorm's People

Contributors

caoyue10 avatar howal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.