MicroNet: Improving Image Recognition with Extremely Low FLOPs (ICCV 2021)

Overview

MicroNet: Improving Image Recognition with Extremely Low FLOPs (ICCV 2021)

A pytorch implementation of MicroNet. If you use this code in your research please consider citing

@article{li2021micronet, title={MicroNet: Improving Image Recognition with Extremely Low FLOPs}, author={Li, Yunsheng and Chen, Yinpeng and Dai, Xiyang and Chen, Dongdong and Liu, Mengchen and Yuan, Lu and Liu, Zicheng and Zhang, Lei and Vasconcelos, Nuno}, journal={arXiv preprint arXiv:2108.05894}, year={2021} }

Requirements

  • Linux or macOS with Python ≥ 3.6.
  • Anaconda3, PyTorch ≥ 1.5 with matched torchvision

Models

Model #Param MAdds Top-1 download
MicroNet-M3 2.6M 21M 62.5 model
MicroNet-M2 2.4M 12M 59.4 model
MicroNet-M1 1.8M 6M 51.4 model
MicroNet-M0 1.0M 4M 46.6 model

Evaluate MicroNet on ImageNet

Download the pretrained MicroNet M0-M3 with the link above. The scripts used for evaluation can be found here. For example, if you want to test MicroNet-M3, you can use the following command.

sh scripts/eval_micronet_m3.sh /path/to/imagenet /path/to/output /path/to/pretrained_model

Train MicroNet on ImageNet

The scripts used for training MicroNet M0-M3 can be found here and can be implemented as follows (You can choose to use different scripts for 2 gpu or 4 gpu training based on the resources you can access).

sh scripts/train_micronet_m3_4gpu.sh /path/to/imagenet /path/to/output
Comments
  • Micro-Factorized pointwise convolution

    Micro-Factorized pointwise convolution

    Hi, thanks for your wonderful work, I want to ask whether the proposed Micro-Factorized pointwise convolution is a plug and play model? I want to replace pointwise convolution with your Micro-Factorized pointwise convolution in MobileNetV3 .

    opened by qdd1234 4
  • MaxGroupPooling Module not found!

    MaxGroupPooling Module not found!

    I cannot find the code of MaxGroupPooling used in line 102 of micronet.py. https://github.com/liyunsheng13/micronet/blob/main/backbone/micronet.py#L102 Can you check?

    opened by sithu31296 2
  • Wrong pretrained weights?

    Wrong pretrained weights?

    md5sum * f514ad5f6d691793cfca029f31d87128 micronet-m0.pth f514ad5f6d691793cfca029f31d87128 micronet-m1.pth f514ad5f6d691793cfca029f31d87128 micronet-m2.pth f514ad5f6d691793cfca029f31d87128 micronet-m3.pth All are the m3?

    opened by xuduo35 2
  • Finetune

    Finetune

    Hi @liyunsheng13,

    how to finetune the model. I got the message error:

    torch.nn.modules.module.ModuleAttributeError: 'DataParallel' object has no attribute 'classifier'
    
    

    Thanks

    opened by pribadihcr 1
  • Questions about the implementation

    Questions about the implementation

    Hi.

    I am trying to implement MicroNet in TensorFlow. I am trying to understand the computation differences between SpatialSepConvSF and DepthSpatialSepConv. From the looks of it, their blocks look all the same to me barring the number of output channels that could have been efficiently parameterized through a single class I believe.

    The only difference seems to be the ChannelShuffle layer in the former i.e., the SpatialSepConvSF block. ChannelShuffle isn't mentioned in the paper as well.

    Could you shed some light?

    opened by sayakpaul 1
  • requests for the code

    requests for the code

    Hi, I've already read your paper and thought that's a wonderful job. But when I try to read your code, I found those three blocks are not very clear in it. It confuses me cause I want to use them as the part of other models. So it may be rude, but would you please rewrite the code with the 'Micro-Block-A, Micro-Block-B, and Micro-Block-C' description as it is in the paper. Thank you very much!

    now the codes of the block looks like this: '''

    ##StemLayer
    
    A  ## + MFDC + RELU + Shuffle1 + MFPC + act_layer + Shuffle1 + Shuffle2
    
    A  ## + MFDC + act_layer + Shuffle1 + Shuffle2 + MFPC + act_layer +Shuffle1 + Shuffle2
    
    A? ## + MFDC + act_layer + Shuffle1 + Shuffle2 + MFPC + act_layer +Shuffle1 + Shuffle2
    
    B? ## + MFPC + act_layer + Shuffle1 + MFDC + act_layer + Shuffle2 + MFPC + act_layer + Shuffle1 + Shuffle2
    
    C  ## + MFPC + act_layer + Shuffle1 + MFDC + act_layer + Shuffle2 + MFPC + act_layer + Shuffle1 + Shuffle2
    
    C  ## + MFPC + act_layer + Shuffle1 + MFDC + act_layer + Shuffle2 + MFPC + act_layer + Shuffle1 + Shuffle2
    
    C? ## + MFPC + act_layer
    

    '''

    but it should be like:

    '''

    ##StemLayer
    
    
    A  ## + MFDC + RELU + Shuffle1 + MFPC + act_layer + Shuffle1 + Shuffle2
    
    A  ## + MFDC + act_layer + Shuffle1 + Shuffle2 + MFPC + act_layer + Shuffle1 + Shuffle2
    
    B  ## + MFDC + act_layer + Shuffle1 + Shuffle2 + MFPC + act_layer +Shuffle1 + Shuffle2 + MFPC + act_layer 
    
    C  ## + Shuffle1 + MFDC + act_layer + Shuffle2 + MFPC + act_layer + Shuffle1 + Shuffle2 + MFPC + act_layer
    
    C  ## + Shuffle1 + MFDC + act_layer + Shuffle2 + MFPC + act_layer + Shuffle1 + Shuffle2 + MFPC + act_layer
    
    C  ## + Shuffle1 + MFDC + act_layer + Shuffle2 + MFPC + act_layer + Shuffle1 + Shuffle2 + MFPC + act_layer
    

    '''

    opened by WangChyanhassth-2say 1
  • Please check the pre-trained model url.

    Please check the pre-trained model url.

    First of all, thank you for sharing your good research results.

    I'm trying to download a pre-trained model, but there seems to be a problem with the address.

    opened by cha-noong 1
  • the  stable of convergence

    the stable of convergence

    I trained about 300 epoches, when I use the model to test , different epoches test results are very different , sometimes the result is good , sometimes the result is very bad, how to resolve this problem

    opened by alexliyang 0
  • reproduction of Micronet-M0 4GPU

    reproduction of Micronet-M0 4GPU

    Thanks for your great work, but I have trained the train_micronet_m0_4gpu.sh script, but got best Acc@1 45.86 at epoch 596, lower than 46.6 reported in your repo with pytorch 1.7.1 CUDA 10.2 cudnn 7.6.05.

    And I did not make any modifications to the training program, is there something wrong with my training program?

    opened by HydrogenSulfate 5
  • MicroNet config for Human Pose Estimation task

    MicroNet config for Human Pose Estimation task

    hi, thanks so much for your great work. we have some questions about the MicroNet config for Human Pose Estimation task too. so we appreciate it if you could share the code for key point detection. May i ask the specific time for the code to be released?

    opened by Fzy-k 1
  • how to modify its outputs for target detection?

    how to modify its outputs for target detection?

    Hello, I have a question I would like to ask: If the MicroNet network is used for target detection, then as the backbone network, how to modify its output? That is, how to change the one-dimensional output of the classification network to a multi-dimensional output to prepare for the subsequent feature fusion?

    opened by mingxing113 0
  • It's hard to converge

    It's hard to converge

    My loss down to 0.75 and its hard to converge(150epochs). I use the M3 model, how can i fix the issue? My data is good and i had done some experiment on some other net.

    opened by sungh66 1
  • Questions about training speed

    Questions about training speed

    I am doing related work based on paddleOCR. I replaced the backbone of the CRNN network structure from mobilenet_v3 to micronet. I train on a single machine with 4 cards, the batch_size is 256, and I find that the ips I train are about 60, while the ips of mobilenet_v3 can reach about 200. may I ask if this is normal? And GPU usage has become lower.

    opened by bupt906 1
Owner
Yunsheng Li
Yunsheng Li
Easily benchmark PyTorch model FLOPs, latency, throughput, max allocated memory and energy consumption

⏱ pytorch-benchmark Easily benchmark model inference FLOPs, latency, throughput, max allocated memory and energy consumption Install pip install pytor

Lukas Hedegaard 21 Dec 22, 2022
Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network."

R2RNet Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network." Jiang Hai, Zhu Xuan, Ren Yang, Yutong Hao, Fengzhu

null 77 Dec 24, 2022
Official repository for MixFaceNets: Extremely Efficient Face Recognition Networks

MixFaceNets This is the official repository of the paper: MixFaceNets: Extremely Efficient Face Recognition Networks. (Accepted in IJCB2021) https://i

Fadi Boutros 51 Dec 13, 2022
Official PyTorch implementation of "Contrastive Learning from Extremely Augmented Skeleton Sequences for Self-supervised Action Recognition" in AAAI2022.

AimCLR This is an official PyTorch implementation of "Contrastive Learning from Extremely Augmented Skeleton Sequences for Self-supervised Action Reco

Gty 44 Dec 17, 2022
Code for HLA-Face: Joint High-Low Adaptation for Low Light Face Detection (CVPR21)

HLA-Face: Joint High-Low Adaptation for Low Light Face Detection The official PyTorch implementation for HLA-Face: Joint High-Low Adaptation for Low L

Wenjing Wang 77 Dec 8, 2022
Improving Contrastive Learning by Visualizing Feature Transformation, ICCV 2021 Oral

Improving Contrastive Learning by Visualizing Feature Transformation This project hosts the codes, models and visualization tools for the paper: Impro

Bingchen Zhao 83 Dec 15, 2022
An extremely simple, intuitive, hardware-friendly, and well-performing network structure for LiDAR semantic segmentation on 2D range image. IROS21

FIDNet_SemanticKITTI Motivation Implementing complicated network modules with only one or two points improvement on hardware is tedious. So here we pr

YimingZhao 54 Dec 12, 2022
Image transformations designed for Scene Text Recognition (STR) data augmentation. Published at ICCV 2021 Workshop on Interactive Labeling and Data Augmentation for Vision.

Data Augmentation for Scene Text Recognition (ICCV 2021 Workshop) (Pronounced as "strog") Paper Arxiv Why it matters? Scene Text Recognition (STR) req

Rowel Atienza 152 Dec 28, 2022
[ACL-IJCNLP 2021] Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning

CLNER The code is for our ACL-IJCNLP 2021 paper: Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning CLNER is a

null 71 Dec 8, 2022
Official PyTorch implementation of "Improving Face Recognition with Large AgeGaps by Learning to Distinguish Children" (BMVC 2021)

Inter-Prototype (BMVC 2021): Official Project Webpage This repository provides the official PyTorch implementation of the following paper: Improving F

Jungsoo Lee 16 Jun 30, 2022
QuickAI is a Python library that makes it extremely easy to experiment with state-of-the-art Machine Learning models.

QuickAI is a Python library that makes it extremely easy to experiment with state-of-the-art Machine Learning models.

null 152 Jan 2, 2023
WarpDrive: Extremely Fast End-to-End Deep Multi-Agent Reinforcement Learning on a GPU

WarpDrive is a flexible, lightweight, and easy-to-use open-source reinforcement learning (RL) framework that implements end-to-end multi-agent RL on a single GPU (Graphics Processing Unit).

Salesforce 334 Jan 6, 2023
Pre-trained Deep Learning models and demos (high quality and extremely fast)

OpenVINO™ Toolkit - Open Model Zoo repository This repository includes optimized deep learning models and a set of demos to expedite development of hi

OpenVINO Toolkit 3.4k Dec 31, 2022
This is the repository for the NeurIPS-21 paper [Contrastive Graph Poisson Networks: Semi-Supervised Learning with Extremely Limited Labels].

CGPN This is the repository for the NeurIPS-21 paper [Contrastive Graph Poisson Networks: Semi-Supervised Learning with Extremely Limited Labels]. Req

null 10 Sep 12, 2022
Extremely easy multi instancing software for minecraft speedrunning.

Easy Multi Extremely easy multi/single instancing software for minecraft speedrunning. A couple of goals of this project: Setup multi in minutes No fi

Duncan 8 Jul 16, 2022
Beyond Image to Depth: Improving Depth Prediction using Echoes (CVPR 2021)

Beyond Image to Depth: Improving Depth Prediction using Echoes (CVPR 2021) Kranti Kumar Parida, Siddharth Srivastava, Gaurav Sharma. We address the pr

Kranti Kumar Parida 33 Jun 27, 2022
AdaFocus (ICCV 2021) Adaptive Focus for Efficient Video Recognition

AdaFocus (ICCV 2021) This repo contains the official code and pre-trained models for AdaFocus. Adaptive Focus for Efficient Video Recognition Referenc

Rainforest Wang 115 Dec 21, 2022
[ICCV 2021] Released code for Causal Attention for Unbiased Visual Recognition

CaaM This repo contains the codes of training our CaaM on NICO/ImageNet9 dataset. Due to my recent limited bandwidth, this codebase is still messy, wh

Wang Tan 66 Dec 31, 2022
Official PyTorch implementation of N-ImageNet: Towards Robust, Fine-Grained Object Recognition with Event Cameras (ICCV 2021)

N-ImageNet: Towards Robust, Fine-Grained Object Recognition with Event Cameras Official PyTorch implementation of N-ImageNet: Towards Robust, Fine-Gra

null 32 Dec 26, 2022