Home

Awesome

Learning to Prune Image Captioning Models

Tests Black Documentation Status

PDF | ArXiv

Official pytorch implementation of the paper: "End-to-End Supermask Pruning: Learning to Prune Image Captioning Models"

Published at Pattern Recognition, Elsevier

Released on July 20, 2021

Description

This work explores model pruning for image captioning task at the first time. Empirically, we show that 80% to 95% sparse networks can either match or even slightly outperform their dense counterparts. In order to promote Green Computer Vision, we release the pre-trained sparse models for UD and ORT that are capable of achieving CIDEr scores >120 on MS-COCO dataset; yet are only 8.7 MB (reduction of 96% compared to dense UD) and 14.5 MB (reduction of 94% compared to dense ORT) in model size.

<p align="center"> <img src="resources/pr2021.jpg" width="35%"> </p> <p align="center"> Figure 1: We show that our deep captioning networks with 80% to 95% sparse are capable of either matching or even slightly outperforming their dense counterparts.</p>

Get Started

Please refer to the documentation.

Features

Pre-trained Sparse and ACORT Models

The checkpoints are available at this repo.

Soft-attention models implemented in TensorFlow 1.9 are available at this repo.

CIDEr score of pruning methods

Up-Down (UD)

SparsityNNZDense BaselineSMPLottery ticket (class-blind)Lottery ticket (class-uniform)Lottery ticket (gradual)Gradual pruningHard pruning (class-blind)Hard pruning (class-distribution)Hard pruning (class-uniform)SNIP
0.9502.7 M111.3112.5-107.7109.5109.7-110.0110.238.2
0.9751.3 M111.3110.6-103.8106.6107.0-105.9105.434.7
0.9880.7 M111.3109.0-99.3102.2103.4-101.3100.532.6
0.9910.5 M111.3107.8

Object Relation Transformer (ORT)

SparsityNNZDense BaselineSMPLottery ticket (gradual)Gradual pruningHard pruning (class-blind)Hard pruning (class-distribution)Hard pruning (class-uniform)SNIP
0.9502.8 M114.7113.7115.7115.34.1112.5113.047.2
0.9751.4 M114.7113.7112.9113.20.7106.6106.944.0
0.9880.7 M114.7110.7109.8110.00.996.959.837.3
0.9910.5 M114.7109.3107.1107.0

Acknowledgements

Citation

If you find this work useful for your research, please cite

@article{tan2021end,
  title={End-to-End Supermask Pruning: Learning to Prune Image Captioning Models},
  author={Tan, Jia Huei and Chan, Chee Seng and Chuah, Joon Huang},
  journal={Pattern Recognition},
  pages={108366},
  year={2021},
  publisher={Elsevier},
  doi={10.1016/j.patcog.2021.108366}
}

Feedback

Suggestions and opinions on this work (both positive and negative) are greatly welcomed. Please contact the authors by sending an email to tan.jia.huei at gmail.com or cs.chan at um.edu.my.

License and Copyright

The project is open source under BSD-3 license (see the LICENSE file).

©2021 Universiti Malaya.

Dev Info

Run Black linting:

black --line-length=120 --safe sparse_caption
black --line-length=120 --safe tests
black --line-length=120 --safe scripts