Abstract
Vision Transformers (ViTs) have shown promising performance compared with Convolutional Neural Networks (CNNs), but the training of ViTs is much harder than CNNs. In this paper, we define several metrics, including Dynamic Data Proportion (DDP) and Knowledge Assimilation Rate (KAR), to investigate the training process, and divide it into three periods accordingly: formation, growth and exploration. In particular, at the last stage of training, we observe that only a tiny portion of training examples is used to optimize the model. Given the data-hungry nature of ViTs, we thus ask a simple but important question: is it possible to provide abundant "effective" training examples at EVERY stage of training? To address this issue, we need to address two critical questions: how to measure the "effectiveness" of individual training examples, and how to systematically generate enough number of "effective" examples when they are running out. To answer the first question, we find that the "difficulty" of training samples can be adopted as an indicator to measure the "effectiveness" of training samples. To cope with the second question, we propose to dynamically adjust the "difficulty" distribution of the training data in these evolution stages. To achieve these two purposes, we propose a novel data-centric ViT training framework to dynamically measure the "difficulty" of training samples and generate "effective" samples for models at different training stages. Furthermore, to further enlarge the number of "effective" samples and alleviate the overfitting problem in the late training stage of ViTs, we propose a patch-level erasing strategy dubbed PatchErasing. Extensive experiments demonstrate the effectiveness of the proposed data-centric ViT training framework and techniques.
Introduction
Vision Transformers (ViTs) have revolutionized computer vision, yet they remain notoriously difficult to train compared to traditional Convolutional Neural Networks (CNNs). Unlike CNNs, ViTs lack inherent inductive biases such as locality and translation invariance, making them exceptionally "data-hungry." Current training paradigms often treat all stages of training uniformly, ignoring the model's evolving capacity to learn. This leads to "knowledge exhaustion," particularly in the later stages, where most training data becomes "too easy" and fails to provide meaningful gradients for optimization.
The Three-Stage Lifecycle of ViT Training
To systematically analyze the training process, we introduce two metrics: Dynamic Data Proportion (DDP), which measures the ratio of easy versus hard samples based on prediction confidence, and Knowledge Assimilation Rate (KAR), which tracks the speed of learning. Based on these metrics, we identify three distinct evolution periods in ViT training:
- Formation ($T_1$): The initial phase where the model learns from simple, easy-to-digest samples.
- Growth ($T_2$): A period of rapid knowledge acquisition as the model masters moderate samples.
- Exploration ($T_3$): The final stage where the model struggles to find new information in hard samples, often leading to overfitting on specific image details.
Dynamic Difficulty Adjustment and PatchErasing
We posit that the "difficulty" of a training sample is the best proxy for its "effectiveness." To ensure the model always has challenging but learnable examples, we propose a dynamic data-centric framework. This framework adjusts the strength of data augmentations like MixUp in real-time or according to a predefined curve, effectively shifting the data distribution from easy to hard as the model matures.
Furthermore, to combat "patch-level overfitting"—where a model relies on a few high-response patches to identify objects—we introduce PatchErasing. By randomly erasing patches in a way that aligns with the ViT's input structure, we force the model to learn more robust, global features.
Results and Generality
Our framework consistently improves performance across various architectures on the ImageNet-1K benchmark. DeiT-Small and DeiT-Base saw accuracy increases of 0.7% and 0.6%, respectively, while Swin-Tiny improved by 0.5%. Interestingly, the strategy also provided a 0.5% boost to ResNet-50, suggesting that these data-centric observations are fundamental to deep learning beyond just Transformer architectures. Qualitative analysis via Class Activation Maps (CAM) confirms that models trained with PatchErasing focus on the entire object rather than isolated features, leading to superior generalization.
Summary updated