Evolved Hierarchical Masking for Self-Supervised Learning

Zhanzhou Feng, Shiliang Zhang

Abstract

Masked Image Modeling (MIM) has emerged as a powerful paradigm for self-supervised learning, typically relying on static masking strategies like random patches or grids. However, these fixed patterns often fail to capture the multi-scale nature of visual information, either neglecting fine-grained textures or failing to challenge high-level semantic understanding. We present Evolved Hierarchical Masking (EHM), a dynamic framework that generates masks evolving in complexity alongside the model’s maturity. By constructing a visual hierarchy from internal attention maps, EHM transitions from masking local textures in early training to masking entire semantic objects in later stages. Our approach demonstrates superior performance across diverse tasks, including ImageNet-1K classification, ADE20K segmentation, and fine-grained image retrieval.

Introduction

Self-supervised pre-training via Masked Image Modeling (MIM) has revolutionized computer vision. By tasking a model with reconstructing hidden portions of an image, methods like MAE and SimMIM force the network to learn robust representations. Despite their success, these methods generally employ stationary masking policies. Random masking excels at capturing global semantics but often ignores local textures. Conversely, grid-based masking preserves local details but may not sufficiently challenge the model's grasp of complex, contiguous objects.

The fundamental limitation is the lack of a "curriculum." Expecting a nascent model to reconstruct large, semantically meaningful objects is inefficient. We argue that masking should be dynamic, providing a progressive challenge that scales with the model's evolving capabilities.

Methods

Evolved Hierarchical Masking (EHM) introduces a two-stage dynamic process that requires no external supervision or pre-trained encoders.

Adaptive Hierarchy Establishment (AHE)

The framework first builds a visual hierarchy for each image. It utilizes the model’s own internal attention maps to compute similarity between patches. Using a bottom-up clustering approach, similar patches are merged into a binary tree. In this hierarchy, leaf nodes represent fine-grained textures, while nodes closer to the root represent larger, semantically coherent components (e.g., a bird's wing or a car's wheel).

Evolved Mask Generation (EMG)

Rather than selecting patches at random, EHM selects nodes at a specific "masking depth" within the generated hierarchy. This depth evolves throughout the training process:

  • Early Training: The masking depth is shallow, resulting in many small, scattered masks. This forces the model to focus on low-level features like edges and textures.
  • Late Training: The masking depth increases, leading to large, contiguous masks that cover significant object parts. This challenges the model to utilize high-level context and understand object-part relationships.
Comparison of static masking strategies (Grid, Random, Block) versus the proposed Evolved Hierarchical Masking (Early, Median, Final stages).

This evolution creates a natural training curriculum where the reconstruction task becomes increasingly difficult as the model's representational power grows.

Experimental Results

We evaluated EHM using a ViT-B backbone pre-trained on ImageNet-1K.

  • Classification and Segmentation: EHM achieved 84.9% top-1 accuracy on ImageNet-1K, outperforming standard MAE by 1.1%. On the ADE20K semantic segmentation task, it showed a 1.4% improvement over the baseline.
  • Fine-Grained Retrieval: The model demonstrated exceptional performance on the Oxford and Paris landmark datasets. This success is attributed to the "early texture learning" phase, which ensures the preservation of intricate details often lost in purely semantic-focused MIM.
  • Efficiency: The dynamic tree-building process is highly optimized, adding only 8.1% to the total pre-training time, making it a viable alternative to static masking.

Discussion and Conclusion

EHM demonstrates that "masking as curriculum learning" is a potent strategy for self-supervised pre-training. By allowing the model to source its own supervision through evolving attention maps, we bridge the gap between low-level feature extraction and high-level semantic understanding. While EHM shows modest gains in linear probing—a common trait among MIM methods—its performance in fine-tuning and downstream transfer tasks establishes it as a robust framework for building multi-scale visual representations. Future work will explore more complex hierarchical structures and the application of evolved masking to video and multimodal foundation models.

Summary updated

BibTeX
@article{feng2025evolved,
  author = {Zhanzhou Feng and Shiliang Zhang},
  title = {{Evolved Hierarchical Masking for Self-Supervised Learning}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2025},
  doi = {10.1109/tpami.2024.3490776},
}
Figure