Hard Patches Mining for Masked Image Modeling

Haochen Wang, Kaiyou Song, Junsong Fan, Yuxi Wang, Jin Xie +1 more
2/14/2026

No official code found. Best implementation: Haochen-Wang409/HPM (109 stars, Apache-2.0, last commit 2025-04-16).

Abstract

Masked image modeling (MIM) has attracted much research attention due to its promising potential for learning scalable visual representations. In typical approaches, models usually focus on predicting specific contents of masked patches, and their performances are highly related to pre-defined mask strategies. Intuitively, this procedure can be considered as training a student (the model) on solving given problems (predict masked patches). However, we argue that the model should not only focus on solving given problems, but also stand in the shoes of a teacher to produce a more challenging problem by itself. To this end, we propose Hard Patches Mining (HPM), a brand-new framework for MIM pre-training. We observe that the reconstruction loss can naturally be the metric of the difficulty of the pretraining task. Therefore, we introduce an auxiliary loss predictor, predicting patch-wise losses first and deciding where to mask next. It adopts a relative relationship learning strategy to prevent overfitting to exact reconstruction loss values. Experiments under various settings demonstrate the effectiveness of HPM in constructing masked images. Furthermore, we empirically find that solely introducing the loss prediction objective leads to powerful representations, verifying the efficacy of the ability to be aware of where is hard to reconstruct.11Code: https://github.com/Haochen-wang409/HPM

View on arXivView PDF

Code Implementations(1)

Haochen-Wang409/HPMCommunity100%
Apache-2.0

[CVPR'23 & TPAMI'25] Hard Patches Mining for Masked Image Modeling & Bootstrap Masked Visual Modeling via Hard Patch Mining

1097Shell, PythonMar 8, 20231 years agoApache-2.0
ade20kcococomputer-visioncvpr2023imagenet+5 more

Cite this paper

@article{wang2026hard,
  title  = {Hard Patches Mining for Masked Image Modeling},
  author = {Haochen Wang and Kaiyou Song and Junsong Fan and Yuxi Wang and Jin Xie and Zhaoxiang Zhang},
  year   = {2026},
  eprint = {2304.05919},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2304.05919},
  journal = {CVPR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2304.05919.svg)](https://codeofpaper.com/paper/2304.05919)

Discussion