Skip to content

Westlake-AI/MogaNet

Repository files navigation

We propose MogaNet, a new family of efficient ConvNets, to pursue informative context mining with preferable complexity-performance trade-offs.

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.

  • ImageNet-1K Training and Validation Code [here] [models]
  • 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]
  • 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.2 / 97.0 args / script model / log
MogaNet-L 224x224 82.5 15.9 84.6 / 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)