Giter VIP home page Giter VIP logo

laudnet's Introduction

LAUDNet

This is the official PyTorch implementation of "Latency-aware Unified Dynamic Networks for Efficient Image Recognition", which is the extension of our NeurIPS 2022 paper: Latency-Aware Spatial-wise Dynamic Networks. The original LASNet code is at this URL.

Introduction

We present Latency-aware Unified Dynamic Networks (LAUDNet), a unified framework that consolidates three representative dynamic paradigms: spatial-wise adaptive computation, dynamic layer skipping and dynamic channel skipping within a singular formulation. To accurately evaluate the practical latency of our model, we present a latency predictor that considers algorithms, scheduling strategies, hardware properties concurrently and accurately evaluates inference latency of dynamic operators. LAUDNet shows superior latency-accuracy tradeoff on a range of tasks (ImageNet classification, COCO object detection and instance segmentation) and a range of hardware devices (V100, RTX3090, RTX3060, TX2 and Nano).

Usage

This repo consists of three components: code for ImageNet classification, MMDetection detection & segmentation and latency predictor.

ImageNet classification

CNNs

Main dependencies:

  • Python: 3.9
  • PyTorch: 1.13.1
  • Torchvision: 0.14.1
  • Timm: 0.6.12

See a sample training script for training details.

Vision Transformers

We implement the three dynamic-inference paradigms (i.e. token skipping, layer (block) skipping, and head (channel) skipping) based on the AdaViT repo.

MMDetection detection & segmentation

RetinaNet, Faster-RCNN and MaskRCNN

Prerequisites:

  1. Prepare an ImageNet pretrained LAUDNet model.
  2. Setup a MMDetection-2.21.0 environment.
  3. Replace corresponding files in your mmcv environment with files in mmcv_replace_file.

See a sample training script for training details.

DDQ-DETR and Mask2Former

Prerequisites:

  1. Prepare an ImageNet pretrained LAUDNet model.
  2. Setup a MMDetection-3.3.0 environment.

See a sample training script for training details.

Latency predictor

See a sample evaluation script for evaluation details.

Performance

fig1

Model Zoo

model Checkpoint Link
LAUD-ResNet101 channel-2222 target-0.5 Tsinghua Cloud
LAUD-ResNet101 layer target-0.5 Tsinghua Cloud

Citation

@ARTICLE{han2024latency,
  author={Han, Yizeng and Liu, Zeyu and Yuan, Zhihang and Pu, Yifan and Wang, Chaofei and Song, Shiji and Huang, Gao},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={Latency-aware Unified Dynamic Networks for Efficient Image Recognition}, 
  year={2024},
  volume={},
  number={},
  pages={1-17},
  doi={10.1109/TPAMI.2024.3393530}
}

Contact

If you have any questions, please feel free to contact the authors.

Yizeng Han: [email protected], [email protected].

Zeyu Liu: [email protected], [email protected].

Zhihang Yuan: [email protected].

Yifan Pu: [email protected].

laudnet's People

Contributors

yizenghan avatar lzy-tony avatar yifanpu001 avatar

Stargazers

 avatar zzp avatar yhzhouowo avatar Jeff Carpenter avatar Rui Huang avatar  avatar Andy Du avatar Vladislav Sorokin avatar Rockey avatar An-zhi WANG avatar Song Kaifeng avatar  avatar Yuchao Jin avatar liujingcs avatar  avatar  avatar Honghui Wang avatar  avatar Sandalots avatar 爱可可-爱生活 avatar TIAN Xin avatar Jiayi Guo avatar Dongchen Han avatar  avatar Rui Lu avatar Haojun Jiang(蒋昊峻) avatar Haofeng Yuan avatar yangle15 avatar  avatar Rainforest Wang avatar  avatar Zhuofan Xia avatar Andrew Zhao avatar Yang Yue avatar Zanlin Ni avatar Henry Zheng avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cv-ip everestrs

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.