Git Product home page Git Product logo

peterzaipinai / mod-moganet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from westlake-ai/moganet

0.0 0.0 0.0 1.05 MB

Code release for MogaNet: Efficient Multi-order Gated Aggregation Network. Homework for backdoor attack defense.

Home Page: https://arxiv.org/abs/2211.03295

License: Apache License 2.0

Shell 0.29% Python 52.18% CSS 0.01% Makefile 0.04% Batchfile 0.05% Jupyter Notebook 47.43%

mod-moganet's Introduction

Within the modern ConvNet framework, we tailor the two feature mixers with conceptually simple yet effective depthwise convolutions to facilitate middle-order information across spatial and channel spaces respectively. We propose MogaNet, a new family of efficient ConvNets, to pursue informative context mining with preferable complexity-performance trade-offs, which shows excellent scalability and attains competitive results among state-of-the-art models with more efficient use of parameters on ImageNet and multifarious typical vision benchmarks, including COCO object detection, ADE20K semantic segmentation, 2D&3D human pose estimation, and video prediction.

Table of Contents
  1. Catalog
  2. Image Classification
  3. License
  4. Acknowledgement
  5. Citation

Catalog

We plan to release implementations of MogaNet in a few months. Please watch us for the latest release. Currently, this repo is reimplemented according to our official implementations in OpenMixup, and we are working on cleaning up experimental results and code implementations. Models are released in GitHub / Baidu Cloud / Hugging Face.

  • ImageNet-1K Training and Validation Code [code] [models] [Hugging Face ๐Ÿค—]
  • Downstream Transfer to Object Detection and Instance Segmentation on COCO [code] [models]
  • Downstream Transfer to Semantic Segmentation on ADE20K [code] [models]
  • Downstream Transfer to 2D Human Pose Estimation on COCO [code] (baseline models are supported)
  • Downstream Transfer to 3D Human Pose Estimation [code] (baseline models will be supported)
  • Downstream Transfer to Video Prediction on MMNIST [code] (baseline models are supported)
  • Image Classification on Google Colab and Notebook Demo [here]

Image Classification

1. Installation

Please check INSTALL.md for installation instructions.

2. Training and Validation

See TRAINING.md for ImageNet-1K training and validation instructions, or refer to our OpenMixup implementations. We released pre-trained models on OpenMixup in moganet-in1k-weights. We have also reproduced ImageNet results with this repo and released args.yaml / summary.csv / model.pth.tar in moganet-in1k-weights. The parameters in the trained model can be extracted by code.

Here is a notebook demo of MogaNet which run the steps to perform inference with MogaNet for image classification.

3. ImageNet-1K Trained Models

Model Resolution Params (M) Flops (G) Top-1 / top-5 (%) Script Download
MogaNet-XT 224x224 2.97 0.80 76.5 | 93.4 args | script model | log
MogaNet-XT 256x256 2.97 1.04 77.2 | 93.8 args | script model | log
MogaNet-T 224x224 5.20 1.10 79.0 | 94.6 args | script model | log
MogaNet-T 256x256 5.20 1.44 79.6 | 94.9 args | script model | log
MogaNet-T* 256x256 5.20 1.44 80.0 | 95.0 config | script model | log
MogaNet-S 224x224 25.3 4.97 83.4 | 96.9 args | script model | log
MogaNet-B 224x224 43.9 9.93 84.3 | 97.0 args | script model | log
MogaNet-L 224x224 82.5 15.9 84.7 | 97.1 args | script model | log
MogaNet-XL 224x224 180.8 34.5 85.1 | 97.4 args | script model | log

4. Analysis Tools

(1) The code to count MACs of MogaNet variants.

python get_flops.py --model moganet_tiny

(2) The code to visualize Grad-CAM activation maps (or variants of Grad-CAM) of MogaNet and other popular architectures.

python cam_image.py --use_cuda --image_path /path/to/image.JPEG --model moganet_tiny --method gradcam

(back to top)

License

This project is released under the Apache 2.0 license.

Acknowledgement

Our implementation is mainly based on the following codebases. We gratefully thank the authors for their wonderful works.

Citation

If you find this repository helpful, please consider citing:

@article{Li2022MogaNet,
  title={Efficient Multi-order Gated Aggregation Network},
  author={Siyuan Li and Zedong Wang and Zicheng Liu and Cheng Tan and Haitao Lin and Di Wu and Zhiyuan Chen and Jiangbin Zheng and Stan Z. Li},
  journal={ArXiv},
  year={2022},
  volume={abs/2211.03295}
}

(back to top)

mod-moganet's People

Contributors

lupin1998 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.