Home

Awesome

Masked Image Modeling with Local Multi-Scale Reconstruction

PyTorch implementation of <br> Masked Image Modeling with Local Multi-Scale Reconstruction <br> CVPR 2023 Highlight (Top 2.6%)

<p align="center"> <img src="model.png" width="1000"> </p>

Masked Image Modeling (MIM) achieves outstanding success in self-supervised representation learning. Unfortunately, MIM models typically have huge computational burden and slow learning process, which is an inevitable obstacle for their industrial applications. Although the lower layers play the key role in MIM, existing MIM models conduct reconstruction task only at the top layer of encoder. The lower layers are not explicitly guided and the interaction among their patches is only used for calculating new activations. Considering the reconstruction task requires non-trivial inter-patch interactions to reason target signals, we apply it to multiple local layers including lower and upper layers. Further, since the multiple layers expect to learn the information of different scales, we design local multi-scale reconstruction, where the lower and upper layers reconstruct fine-scale and coarse-scale supervision signals respectively. This design not only accelerates the representation learning process by explicitly guiding multiple layers, but also facilitates multi-scale semantical understanding to the input. Extensive experiments show that with significantly less pre-training burden, our model achieves comparable or better performance on classification, detection and segmentation tasks than existing MIM models.

Pre-Trained Models

Backbone#ParamsTargetGPU Hours/Ep.PT EpochPT ResolutionPT log/ckptTop-1 (%)
ViT-B86MHOG0.71600224x224log/ckpt84.0
ViT-L307MHOG1.0800224x224log/ckpt85.8
Swin-B88MPixel1.0400224x224log/ckpt84.0
Swin-B88MHOG1.1400224x224log/ckpt84.1
Swin-L197MHOG1.6800224x224log/ckpt85.6

The pre-training and fine-tuning instruction can be found in ViT, Swin and semantic_segmentation.

Citation

If you find this project useful in your research, please consider cite:

@inproceedings{wang2023masked,
  title={Masked Image Modeling with Local Multi-Scale Reconstruction},
  author={Wang, Haoqing and Tang, Yehui and Wang, Yunhe and Guo, Jianyuan and Deng, Zhi-Hong and Han, Kai},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={2122--2131},
  year={2023}
}

Acknowledgement

This code is built upon the implementation from MAE, GreenMIM, MMSeg and BEiT.