Home

Awesome

MutualNet: Adaptive ConvNet via Mutual Learning from Network Width and Resolution (ECCV'20 Oral, TPAMI) [ECCV] [TPAMI]

Updates

MutualNet is extended to 3D (spatiotemporal) networks for video action recognition. We apply MutualNet to state-of-the-art ConvNet based video models such as SlowFast and X3D. An illustration of the model structure is shown below

<p><img src="imgs/videostructure.JPG" width="1000" /></p>

We achieve runtime adaptive action recognition while outperforming previous state-of-the-arts. The results based on Slow-only, SlowFast and X3D networks are shown below

<p><img src="imgs/videoresults1.JPG" width="1000" /></p>

MutualNet achieves substantially better accuracy-efficiency trade-off compared to previous state-of-the-art ConvNet based video models as shown below

<p><img src="imgs/videoresults2.JPG" width="600" /></p>

For more details and results, please check our TPAMI version here.

Abstract

This work proposes a method to train a network that is executable at dynamic resource constraints (e.g., FLOPs) during runtime. The proposed mutual learning scheme for input resolution and network width significantly improves the accuracy-efficiency tradeoffs over Slimmable Networks on various tasks such as image classification, object detection and instance segmentation. The method is also promising to serve as a plug-and-play strategy to boost a single network. It substantially outperforms a set of popular data augmentation and regularization methods. The overall framework is shown below.

<p><img src="imgs/framework.PNG" width="800" /></p>

We feed different sub-networks with different scaled images. This allows each sub-network to learn multi-scale representations from both network scale and input scale as illustrated below.

<p><img src="imgs/mutuallearning.PNG" width="800" /></p>

Install

Run

Training

To train MobileNet v1, run the codes below

python train.py app:apps/mobilenet_v1.yml

Training hyperparameters are in the .yml files. width_mult_list is just used to print training logs for corresponding network widths. During testing, you can assign any desired width between the width lower bound and upper bound. To train other models, just use the corresponding .yml files.

Testing

Modify test_only: False to test_only: True in .yml file to enable testing.

Modify pretrained: /PATH/TO/YOUR/WEIGHTS to assign trained weights.

Modify width_mult_list to test more network widths.

python train.py app:apps/mobilenet_v1.yml

Note that this is to test the performance of all width-resolution configuration. You can obtain the query table by choosing the best-performed configuration at certain contraints (FLOPs). The query tables that we obtained for MobileNet v1 and MobileNet v2 are shown below.

MobileNet v1:

MFLOPs569518466418380342309269239215187166146127111766341302113
Width-Reso1.0-2241.0-0.951.0-0.91.0-1920.95-1920.9-1920.85-1920.8-1920.75-1920.85-1600.8-1600.75-1600.7-1600.65-1600.6-1600.5-1600.45-1600.35-1600.25-1920.25-1600.25-128
Acc72.471.771.270.970.670.269.769.168.467.767.266.565.664.763.560.358.954.452.750.145.5

MobileNet v2:

MLOPs300284269254221209198187164154128107898457
Width-Reso1.0-2240.95-2240.9-2240.85-2241.0-1920.95-1920.9-1920.85-1920.8-1920.75-1920.7-1920.75-1600.7-1600.85-1280.7-128
Acc72.972.772.472.071.871.671.471.070.470.169.668.367.665.864.2

For deployment, you only need to keep the model weights and the query table, where the size of the query table is negligible. So the memory footprint (#params) is the same as a single model. If you want a more fine-grained query table, you can test with a smaller width stepsize.

Results and model weights

For those who do not have access to Google Drive: here is the link to all model weights in [BaiduYun]. The extraction code is 4y6m.

Performance over the whole FLOPs specturm

Comparison with US-Net under different backbones on ImageNet.

Model weights: [MobileNet v1], [MobileNet v2] Results compared with US-Net

Scaling up model compared with EfficienNet

The best model scaling on MobileNet v1 compared with EfficientNet

ModelBest Model ScalingFLOPsTop-1 Acc
EfficientNetd=1.4, w=1.2, r=1.32.3B75.6%
MutualNet (Model)w=1.6, r=1.32.3B77.1%

Boosting performance of a single network

Top-1 accuracy on Cifar-10 and Cifar-100

WideResNet-28-10GPU search hoursCifar-10Cifar-100
Baseline096.1%81.2%
Cutout096.9%81.6%
Mixup097.3%82.5%
AutoAugment500097.4%82.9%
Fast AutoAugment3.597.3%82.7%
MutualNet097.3%83.8%

Compared with state-of-the-art performance boosting methods on ImageNet

ResNet-50Additional CostTop-1 Acc
Baseline\76.5%
Cutout\77.1%
Mixup\77.9%
CutMix\78.6%
KDTeacher Network76.5%
SENetSE Block77.6%
AutoAugment15000 GPU search hours77.6%
Fast AutoAugment450 GPU search hours77.6%
MutualNet (Model)\78.6%

Citation

If you find this useful in your work, please consider citing,

@inproceedings{yang2020mutualnet,
  title={MutualNet: Adaptive ConvNet via Mutual Learning from Network Width and Resolution},
  author={Yang, Taojiannan and Zhu, Sijie and Chen, Chen and Yan, Shen and Zhang, Mi and Willis, Andrew},
  booktitle={European Conference on Computer Vision},
  pages={299--315},
  year={2020},
  organization={Springer}
}

Reference

- The code is based on the implementation of Slimmable Networks.