Beyond Random Augmentations: Pretraining with Hard Views

## Abstract

Abstract Many Self-Supervised Learning (SSL) methods aim for model invariance to different image augmentations known as views . To achieve this invariance, conventional approaches make use of random sampling operations within the image augmentation pipeline. We hypothesize that the efficacy of pretraining pipelines based on conventional random view sampling can be enhanced by explicitly selecting views that benefit the learning progress. A simple, yet effective approach is to select hard views that yield a higher loss. In this paper, we present Hard View Pretraining (HVP), a learning-free strategy that builds upon this hypothesis and extends random view generation. HVP exposes the model to harder, more challenging samples during SSL pretraining, which enhances downstream performance. It encompasses the following iterative steps: 1) randomly sample multiple views and forward each view through the pretrained model, 2) create pairs of two views and compute their loss, 3) adversarially select the pair yielding the highest loss depending on the current model state, and 4) run the backward pass with the selected pair. As a result, HVP achieves linear evaluation accuracy improvements of 1% on average on ImageNet for both 100 and 300 epoch pretraining and similar improvements on transfer tasks across DINO, SimSiam, iBOT, and SimCLR.

## 1 Introduction

Various approaches to learning effective and generalizable visual representations in Self-Supervised Learning (SSL) exist. One way to categorize many SSL methods is to distinguish generative and discriminative approaches []. While generative methods aim at generating image input, discriminative methods, with contrastive learning [, ] being the most known approach, aim at learning a latent representation in which similar image views are located closely and dissimilar ones distantly.

Such views are generated by applying a sequence of (randomly sampled) image transformations and are usually composed of geometric (cropping, rotation, etc.) and appearance (color distortion, blurring, etc.) transformations. A body of literature [, , , , ] has illuminated the effects of image views on representation learning and identified *random resized crop* (RRC) transformation, which randomly crops the image and resizes it back to a fixed size, as well as color distortion as one of the essential augmentations for effective discriminative learning. However, despite this finding and to our best knowledge, little research has gone into identifying more effective ways for generating views to improve performance. In this paper, we seek to extend the random view generation to expose the model to harder samples during discriminative pretraining by selecting views that yield a high loss according to the current model state.

Figure: (a)

Some Supervised Learning works that address this shortcoming and attempt to leverage task difficulty include Spatial Transformer Networks [] and Adversarial AutoAugment [], which either directly learn geometric transformations or generate augmentation policies that yield hard samples. However, these approaches have not been used successfully for unsupervised learning and Adversarial AutoAugment does not include RRC in its search space. In contrast to what we propose, integrating any of these methods into existing self-supervised learning pipelines is non-trivial.

Related SSL approaches exist that aim at controlling view hardness through adversarial [, ] or cooperative [] models. A work that takes a similar perspective to ours in leveraging the information content of views for SSL is []. Motivated by mutual information theory, they derive an objective to adversarially learn view generators for contrastive learning. While such approaches offer important insights into view optimality, they usually require learning additional models before the actual SSL training or non-trivial changes to the pipeline and thus, are not easily integrated into existing SSL methods.

In contrast, we propose a fully learning-free and easy-to-integrate approach that leads to significant improvements over standard pretraining.
Importantly, and different to [], our approach leverages the current model state and operates on a per-sample basis during pretraining. It applies the following simple strategy: we sample a few views and forward each pair through the currently trained model. Next, we identify the pair that yields the highest loss among all pairs, use it for the backward pass, and repeat (see Fig. 1(a)). While being agnostic to any discriminative loss, this strategy exposes the pretrained model to samples that the model at any given point in the training trajectory finds challenging. As our results show, sampling only four views is sufficient to achieve noticeable improvements. A work following a similar concept is []. However, their approach targets speeding up pretraining and thus, requires controlling hyperparameters such as learning rate or augmentation magnitude, which resemble confounding factors. In contrast, our method and empirical validation does not rely on any changes of hyperparameters, and we also employ higher budgets (longer pretraining, full ImageNet dataset) across different model architectures.

Overall, our contributions can be summarized as follows:

- •
We propose *Hard View Pretraining (HVP)*, an easy-to-use method complementing SSL by extending the common random view generation to automatically expose the model to harder samples during pretraining. HVP simply requires the ability to compute sample-wise losses.
- •
We demonstrate the effectiveness and compatibility of our approach using ImageNet-1k [] pretraining across four popular SSL methods that cover a diverse range of discriminative objectives such as SimSiam [], DINO [], iBOT [], and SimCLR [];
- •
HVP improves all baselines noticeably compared to using common pretraining, and we show this on a diverse set of transfer tasks, including linear evaluation, finetuning, object detection, and segmentation;
- •
We present insights into the underlying mechanisms and robustness of HVP.

We make our PyTorch [] code, models, and all used hyperparameters publicly available under [https://anonymous.4open.science/r/pretraining-hard-views/](https://anonymous.4open.science/r/pretraining-hard-views/).

## 2 Related Work

### 2.1 Discriminative Self-Supervised Learning

The core idea behind the discriminative learning framework [] is to learn image representations by contrasting positive pairs (two views of the same image) against negative pairs (two views of different images) []. To work well in practice and to prevent model collapse, contrastive learning methods often require a large number of negative samples [, , , , , ] stored in memory banks [, ] or, for instance, in the case of SimCLR, implicitly in large batches []. Non-contrastive approaches, such as BYOL [], SimSiam [], DINO [] and others [, , ], can only use positive pairs without causing model collapse but rely on other techniques, such as Siamese architectures, whitening of embeddings, clustering, maximizing the entropy of the embeddings, momentum encoders, and more.

### 2.2 Optimizing for Hard Views in SSL

Past work has shown that optimizing augmentation policies or views directly can be beneficial. Hence, the realm of learning task-specific augmentation policies based on data has seen quick development [, , , , , , ].
However, these approaches do not include the random resize crop operation into their search spaces and thus, are limited in leveraging the geometric perspective to control view hardness. In contrast to learning hard augmentations, another family of approaches
optimizes directly on the pixel level to control view hardness [, ].
Other approaches leverage hard views in order to improve performance. Similar to us, [] uses the current model state for selecting hard views in order to accelerate SSL pretraining. However, their approach requires controlling hyperparameters such as learning rate and augmentation magnitude, while predominantly training on a smaller version of ImageNet. In contrast, our work offers a more complete analysis of hard view pretraining, demonstrating the benefits without potential confounding factors such as hyperparameter adjustments. Moreover, focusing on performance rather than pretraining speedups, we employ higher budgets (longer pretraining, larger batch sizes) across the full ImageNet dataset and different architectures (ResNets and ViTs).
In a similar vein, [] leverages the view content for better performance. Under the lens of mutual information, they derive an objective to adversarially learn view generators for contrastive learning. While such methods can complement our approach, they are less easily integrated into existing discriminative pipelines due to the need for adversarial network training or do not use the current model state to control learning hardness.

## 3 Method

### 3.1 Self-supervised Learning Framework

In this section, we introduce our approach, which is also depicted in Algorithm 12. Many different self-supervised discriminative learning [] objectives exist, each characterized by variations stemming from design choices, such as by the use of positive and negative samples or asymmetry in the encoder-projector network structure. For simplicity of exposure, we will introduce our approach based on the SimSiam objective [], but we do note that our method can be used with any other discriminative SSL objective that allows the computation of sample-wise losses.

SimSiam works as follows. Assume a given set of images $\mathcal{D}$, an image augmentation distribution $\mathcal{T}$, a minibatch of $M$ images $\mathbf{x}=\left\{x_{i}\right\}_{i=1}^{M}$ sampled uniformly from $\mathcal{D}$, and two sets of randomly sampled image augmentations $A$ and $B$ sampled from $\mathcal{T}$. SimSiam applies $A$ and $B$ to each image in $\mathbf{x}$ resulting in $\mathbf{x}^{A}$ and $\mathbf{x}^{B}$. Both augmented sets of views are subsequently projected into an embedding space with $\mathbf{z}^{A}=g_{\theta}(f_{\theta}(\mathbf{x}^{A}))$ and $\mathbf{h}^{B}=f_{\theta}(\mathbf{x}^{B})$ where $f_{\theta}$ represents an encoder (or backbone) and $g_{\theta}$ a projector network. SimSiam then minimizes the following objective:

$$ $\mathcal{L}(\theta)=\frac{1}{2}\left(D(\mathbf{z}^{A},\mathbf{h}^{B})+D( \mathbf{z}^{B},\mathbf{h}^{A})\right)$ (1) $$

where *D* denotes the negative cosine similarity function. Intuitively, when optimizing $\theta$, the embeddings of the two augmented views are attracted to each other.

### 3.2 Pretraining with Hard Views

We now formalize how we expose the model to more challenging views during pretraining. In a nutshell, Hard View Pretraining extends the random view generation by sampling adversarially harder views during pretraining. Instead of having two sets of augmentations $A$ and $B$, we now sample $N$ sets of augmentations, denoted as $\mathcal{A}=\{A_{1},A_{2},\ldots,A_{N}\}$. Each set $A_{i}$ is sampled from the image augmentation distribution $\mathcal{T}$, and applied to each image in $\mathbf{x}$, resulting in $N$ augmented sets of views $\mathbf{x}^{A_{1}},\mathbf{x}^{A_{2}},\ldots,\mathbf{x}^{A_{N}}$. Similarly, we obtain $N$ sets of embeddings $\mathbf{z}^{A_{1}},\mathbf{z}^{A_{2}},\ldots,\mathbf{z}^{A_{N}}$ and predictions $\mathbf{h}^{A_{1}},\mathbf{h}^{A_{2}},\ldots,\mathbf{h}^{A_{N}}$ through the encoder and projector networks. We then define a new objective function that seeks to find the pair $(x_{i}^{A_{k}},x_{i}^{A_{l}})$ of a given image $x_{i}$ that yields the highest loss:

$$ $\displaystyle(x_{i}^{A_{k}},x_{i}^{A_{l}})$ $\displaystyle=\operatorname*{arg\,max}_{k,l;k\neq l}\mathcal{L}(\theta)_{i,k,l}$ (2) $\displaystyle=\operatorname*{arg\,max}_{k,l;k\neq l}\frac{1}{2}\left(D(z_{i}^{ A_{k}},h_{i}^{A_{l}})+D(z_{i}^{A_{l}},h_{i}^{A_{k}})\right),$ $$

where $\mathcal{L}(\theta)_{i,k,l}$ simply denotes a sample-wise variant of Eq. 1.

Figure: Algorithm 1 Pretraining with Hard Views

Overall, we first generate $N$ augmented views for each image $x_{i}$ in the minibatch. Then, we create all combinatorially possible $\binom{N}{2}$ pairs of augmented images for $x_{i}$. Subsequently, we use Eq. 2 to compute the sample-wise loss for each pair which corresponds to invoking forward passes. We then select all pairs that yielded the highest loss to form the new *hard* minibatch of augmented sets $\textbf{x}^{A_{k_{*}}}$ and $\textbf{x}^{B_{l_{*}}}$, discard the other pairs and use the hard minibatch for optimization. As shown in Algorithm 12, we repeat this process in each training iteration.

Intuitively, our approach introduces a more challenging learning scenario in which the model is encouraged to learn more discriminate features by being exposed to harder views. In the early stages of training, the embedding space lacks a defined structure for representing similarity among views. As training progresses, our method refines the concept of similarity through exposure to increasingly harder views given the current model state. By limiting the number of sampled views, we upper-bound the difficulty of learning to avoid overly difficult tasks that would impede learning. This ensures a gradual and controlled evolution of the embedding space, where the difficulty of views escalates in tandem with the model’s growing capacity to differentiate them. Consequently, our method systematically advances the representation of challenging views within the embedding space, which we believe to be the reason for improved feature learning.

While we exemplified the integration of HVP with the SimSiam objective, integrating it into other contrastive methods is as straightforward. The only requirement of HVP is to be able to compute sample-wise losses (to select the views with the highest loss). In our experiments section and in addition to SimSiam, we study the application of HVP to the objectives of DINO, iBOT, and SimCLR (see also Appendix J.1 for a formal exemplary definition for the integration of HVP into SimCLR).

### 3.3 Implementation and Evaluation Protocols

#### 3.3.1 Implementation

We now describe the technical details of our approach.
HVP can be used with any SSL method that allows computing sample-wise losses, and the only two elements in the pipeline we adapt are: 1) the data loader (which now needs to sample $N$ views for each image) and 2) the forward pass (which now invokes the *select* function to identify and return the hard views).

**Table 1: Average top-1 linear and *k*-NN classification accuracy on the ImageNet validation set for 100 and 300-epoch pretrainings across 3 seeds.**
| Method | Arch. | 100 epochs | 300 epochs |  |  |
| --- | --- | --- | --- | --- | --- |
| Lin. | *k*-NN | Lin. | *k*-NN |  |  |
| DINO | ViT-S/16 | 73.52 | 68.80 | 75.48 | 72.62 |
| + HVP | ViT-S/16 | 74.67 | 70.72 | 76.56 | 73.65 |
| Impr. |  | +1.15 | +1.92 | +1.08 | +1.03 |
| DINO | RN50 | 71.93 | 66.28 | 75.25 | 69.53 |
| + HVP | RN50 | 72.87 | 67.33 | 75.65 | 70.05 |
|  |  | +0.94 | +1.05 | +0.40 | +0.52 |
| SimSiam | RN50 | 68.20 | 57.47 | 70.35 | 61.40 |
| + HVP | RN50 | 68.98 | 58.97 | 70.90 | 62.97 |
|  |  | +0.78 | +1.50 | +0.55 | +1.57 |
| SimCLR | RN50 | 63.37 | 52.83 | 65.50 | 55.65 |
| + HVP | RN50 | 65.33 | 54.76 | 67.30 | 56.80 |
|  |  | +1.96 | +1.93 | +1.80 | +1.15 |
| iBOT | ViT-S/16 | 69.55 | 62.93 | 72.76 | 66.92 |
| + HVP | ViT-S/16 | 70.27 | 62.75 | 73.99 | 67.16 |
|  |  | +0.73 | -0.18 | +1.23 | +0.24 |

The image transformation distribution $\mathcal{T}$ taken from the baselines is left unchanged. Note, for the view selection one could simply resort to RRC only and apply the rest of the operations after the hard view selection (see Section 5.1 for a study on the influence of appearance on the selection).

All experiments were conducted with $N=4$ sampled views, yielding $\binom{N}{2}=6$ pairs to compare, except for DINO which uses 10 views (2 global, 8 local heads) per default. For DINO, we apply HVP to both global and local heads but to remain tractable, we upper-bound the number of total pair comparisons to 128. SimCLR uses positive and negative samples. In accordance with the simplicity of HVP, we do not alter its objective, which naturally leads to selecting hard views that are adversarial to positive and “cooperative" to negative views. For iBOT, we use the original objective as defined by the authors with global views only.

#### 3.3.2 Evaluation Protocols

We now describe the protocols used to evaluate the performance in our main results section. In self-supervised learning, it is common to assess pretraining performance with the linear evaluation protocol by training a linear classifier on top of frozen features or finetuning the features on downstream tasks. Our general procedure is to follow the baseline methods as closely as possible, including hyperparameters and code bases (if reported). It is common to use RRC and horizontal flips during training and report the test accuracy on central crops. Due to the sensitivity of hyperparameters, and as done by [], we also report the quality of features with a simple weighted nearest neighbor classifier (k-NN).

## 4 Main Results

Here, we discuss our main results on image classification, object detection, and segmentation tasks. All results are self-reproduced using the baseline code and available hyperparameters and are averaged over 3 seeds. All hyperparameters are reported in Appendix H.

### 4.1 Evaluations on ImageNet

We report the top-1 validation accuracy on frozen features, as well as the k-NN classifier performance, in Table 1.
For DINO, we additionally compare ResNet-50 [] against the ViT-S/16 [] architecture. We point out that both methods, vanilla,  and  vanilla+HVP always receive the same number of data samples for training. Our method compares favorably against all baselines with an increased performance of approximately $1\%$ on average for 100 and 300 epoch pretraining, showing the benefit of sampling hard views.

Due to limited compute resources, we run the pretrainings for 100 epochs and 300 epochs (200 epochs for SimCLR) and batch sizes of 512 (100 epoch) or 1024 (200 & 300 epoch trainings), respectively. This choice is in line with a strategy that favors the evaluation of a diverse and larger set of baselines over the evaluation of a less diverse and smaller set and underpins the broad applicability of HVP. We primarily ran our experiments with 8xNVIDIA GeForce RTX 2080 Ti nodes,
with which the cheapest runs required ${\sim}3.5$ days for pretraining and linear evaluation and the most expensive runs required ${\sim}25$ days. Moreover, we emphasize that HVP is insensitive to the baseline hyperparameters and simply reusing these consistently resulted in improvements of the reported magnitudes across all experiments.

### 4.2 Transfer to Other Datasets and Tasks

**Table 2: 100 epoch models trained with HVP compare favorably against models trained without it when transferred to other datasets through fine-tuning (F.T.) or the linear evaluation protocol (Lin.).**
| Method | Arch. | CIFAR10 | CIFAR100 | Flowers102 | iNat 21 | Food101 |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Lin. | F.T. | Lin. | F.T. | Lin. | F.T. | Lin. | F.T. | Lin. | F.T. |  |  |
| SimSiam | RN50 | 82.60 | 95.50 | 54.20 | 77.20 | 34.27 | 56.40 | 32.50 | 60.30 | 65.70 | 83.90 |
| + HVP | RN50 | 84.40 | 96.10 | 57.10 | 78.20 | 38.37 | 58.90 | 33.90 | 60.90 | 67.10 | 84.70 |
| Impr. |  | +1.80 | +0.60 | +2.90 | +1.00 | +4.10 | +2.50 | +1.40 | +0.60 | +1.40 | +0.80 |
| DINO | ViT-S/16 | 94.53 | 98.53 | 80.63 | 87.90 | 91.10 | 93.20 | 46.93 | 53.97 | 73.30 | 87.50 |
| + HVP | ViT-S/16 | 95.13 | 98.65 | 81.27 | 88.23 | 92.07 | 93.60 | 49.03 | 54.16 | 74.13 | 87.91 |
| Impr. |  | +0.60 | +0.12 | +0.63 | +0.33 | +0.97 | +0.40 | +2.10 | +0.19 | +0.83 | +0.41 |

We now demonstrate the transferability of features learned with HVP. For all transfer experiments, we use our 100-epoch ImageNet pretrained SimSiam ResNet-50 and DINO ViT-S/16 models.

#### 4.2.1 Linear Evaluation and Finetuning

In Table 2, we apply both the linear evaluation (Lin.) and finetuning (F.T.) protocols to our models across a diverse set of datasets consisting of CIFAR10 [], CIFAR100, Flowers102[], Food101[], and iNaturalist 2021 []. Our results show that the improvements achieved by sampling hard views we observed so far also transfer to other datasets.

**Table 3: Object Detection (OD) and Instance Segmentation (IS) AP50 performance on COCO for 100/300 epoch pretraining.**
| Method | Arch. | OD | IS |  |  |
| --- | --- | --- | --- | --- | --- |
|  |  | 100 | 300 | 100 | 300 |
| iBOT | ViT-S/16 | 66.13 | 66.80 | 63.10 | 63.63 |
| + HVP | ViT-S/16 | 66.50 | 67.13 | 63.50 | 64.23 |
| Impr. |  | +0.37 | +0.33 | +0.40 | +0.60 |
| DINO | ViT-S/16 | 65.90 | 66.60 | 62.83 | 63.63 |
| + HVP | ViT-S/16 | 66.37 | 67.00 | 63.37 | 64.00 |
| Impr. |  | +0.47 | +0.40 | +0.53 | +0.37 |

#### 4.2.2 Object Detection and Instance Segmentation

For object detection and instance segmentation, we use the COCO [] dataset with Cascade Mask R-CNN [, ]. Table 3, where we report the AP50 performance, shows that the features learned with HVP also transfer favorably to these tasks and outperform the iBOT and DINO baseline with a 100-ep. and 300-ep. pretraining. More details and performance results on this task are provided in Appendix G.1.

### 4.3 Longer Trainings

Figure: Figure 2: Longer ImageNet-1k training on ViT-S/16 (3 seeds).
Refer to caption: extracted/5615638/figures/alternating_training.png

In Fig. 2, we show the effect of applying HVP for longer trainings on ImageNet-1k with DINO and ViT-S/16. Due to the extra overhead from HVP’s selection phase that requires additional forward passes and because of our limited compute resources, we apply HVP only every third pretraining step (n-step training) to make the long trainings feasible. Our results show that the performance gains from using hard views persist with longer training and that the baseline performance is achieved with fewer epochs.
Notably, while accounting for HVP’s time overhead, we reach the officially reported 800-epoch performance of DINO ViT-S/16 at 77% about 85 epochs earlier (performance at 500 epochs, factoring in the 1.43$\times$ slowdown for HVP; see Appendix I for details).

In Appendix I, we discuss time complexity and demonstrate that HVP remains beneficial even when normalizing for the time overhead in the naive n-step HVP training regime, where it improves the linear eval. performance by 0.3% and k-NN performance by 0.5% over baseline on average. We also discuss other methods to reduce the time complexity overhead of using hard views. For instance, and in contrast to others [], using small resolutions during the selection phase in HVP has not enabled us to outperform the baseline performance.

Figure: Figure 3: Left: In over 40% of the cases, the adversarially selected view pair is also the one with the lowest IoU throughout SimSiam+HVP pretraining. We attribute the spike in the early phase to the random initialization of the embedding. Right: When using HVP (blue), a shift to smaller IoU values is visible when compared to standard pretraining (orange). Both results are based on 3 seeds.
Refer to caption: extracted/5615638/figures/minsim_is_min_iou_minsim.png

## 5 Empirical Analysis of HVP

In this section, we discuss studies designed to shed light on the mechanisms underlying HVP. We address the following questions: 1) “Which pattern can be observed that underlies the hard view selection?”
and 2) “What are the effects on empowering the adversary?”. For all experiments conducted here, we use our 100-epoch, ImageNet-pretrained SimSiam+HVP models with four sampled views. In Appendix E.1, we also analyze whether we can infer a “manual" augmentation policy from the following observed patterns.

### 5.1 Q1: Which Patterns Can be Observed with HVP?

When visually studying examples and the views selected by HVP in Figures 1(b) and 6 (in the appendix), we notice that both geometric and appearance characteristics seem to be exploited, for instance, see the brightness difference between the views of the first two rows in Fig. 1(b).
We also see a generally higher training loss (Fig. 7 in the appendix) indicative of an increased task difficulty.

#### 5.1.1 Logging Augmentation Data

To assess these observations, we logged relevant hyperparameter data during SimSiam training with HVP. The logs include for each view the sampled geometric and appearance parameters from the data augmentation operations (such as the height/width of the crops or the brightness; see Section D in the appendix for more details), as well as the loss and whether the view was selected. As evaluated metrics, we chose the Intersection over Union (IoU), Relative Distance (normalized distance of the center points views), color distortion distance (the Euclidean distance between all four color distortion parameters), and the individual color distortion parameters.

#### 5.1.2 Importance of Augmentation Metrics

Given 300k such samples, we then used fANOVA [] to determine how predictive these metrics are. This resulted in the metric with the highest predictive capacity on the loss being the IoU, explaining 15% of the variance in performance, followed by brightness with 5% (for more details see Fig. 9 in the appendix). The importance of IoU in HVP is further underpinned by the following observation: the fraction of view pairs selected by HVP, which are also the pairs with the lowest IoU among all six pairs (N=4), is over 40% (random: ${\sim}16.7\%$) during training. Moreover, when using HVP, a shift to smaller IoU values can be observed when comparing against standard pretraining (see Fig. 3).

Figure: Figure 4: Left: The average IoU of view pairs selected by SimSiam+HVP (blue) compared against the default SimSiam training (green). Right: Using static color augmentation for all pairs before the selection increases the dependency on the IoU.
Refer to caption: extracted/5615638/figures/iou_select_vs_not_select_all_seeds.png

#### 5.1.3 Taking a Closer Look at the Intersection over Union

We also examined the IoU value over the course of training in Fig. 4 (left).
An observable pattern is that the IoU value with HVP (Fig. 4 (left) in blue) is smaller and varies more when compared against training without HVP (green). We believe this is due to the sample-wise and stateful nature of the adversarial selection as HVP chooses different IoU values between varying samples and model states. Lastly, we assessed the effect of the color augmentation on the pair selection. For this study, we sampled *one* set of color augmentations (as opposed to one for each view) per iteration and applied it to all views. We apply sampled data augmentations to each view only after identifying the hardest pair.
As we show in Fig. 4 (right), the fraction of selected pairs that are also the hardest pairs slightly increases in this case. One possible explanation for this is that it reflects the non-negligible role of color variation between views (as shown previously with the importance analysis), where HVP is given less leverage to increase hardness through a static appearance and instead, depends more on leveraging the IoU. Another key observation is that HVP often chooses view pairs that incorporate zooming in and out or an increased distance between the views (see last row of Fig. 1(b)).

### 5.2 Q2: What are the Effects of Strong Adversaries?

It is well known that adversarial learning can suffer from algorithmic instability [], e.g. by giving an adversary too much capacity. Here, we further explore the space of adversarial capacity for pretraining with hard views by adapting and varying HVP hyperparameters in order to gain a better understanding of their impact and robustness on discriminative learning. Additionally, we report further results on learning an adversary in Appendix F.1.

#### 5.2.1 Robustness to Augmentation Hyperparameters

Figure: Figure 5: With HVP, SimSiam appears more robust to augmentation hyperparameter variation. We show this for RandomResizedCrop (left) and ColorJitter (right). For RRC, the values indicate the lower value of the sampling range and for CJ the value corresponds to the intensity of the color cues. Results are averaged over two seeds and SimSiam default values are RRC=0.2 and CJ=0.5.
Refer to caption: extracted/5615638/figures/robustness_to_aug_params_rrc_strength.png

In assessing the robustness of HVP to augmentation hyperparameters, we conducted an analysis focusing on two primary augmentation operations: RandomResizedCrop (RRC) and ColorJitter (CJ). Our findings depicted in Fig. 5 suggest that HVP enhances the robustness of SSL methods, like SimSiam, against variations in these hyperparameters. Note, when varying one operation, either RRC or CJ, we maintained the other operation at its default configuration. In both settings, we observe less performance degradation with extreme augmentation values and overall smaller degradation rates for HVP. We believe that this robustness stems from hard view pretraining which inadvertently equips the model to handle stronger augmentations.

#### 5.2.2 Increasing the Number of Views

In our initial experiments, we explored variations in the number of sampled views $N$ with SimSiam and HVP. As can be seen in Fig. 8 in the appendix, while $N=8$ views still outperform the baseline in terms of linear evaluation accuracy, it is slightly worse than using $N=4$ views (-0.05% for 100 epochs
pretraining on linear evaluation). We interpret this result as the existence of a “sweet spot" in setting the number of views, where, in the limit, a higher number of views corresponds to approximating a powerful adversarial learner, capable of choosing very hard and unfavorable learning tasks that lead to model collapse and performance deterioration. We experimented with such an adversarial learner and report results in Appendix F.1.

## 6 Conclusion

In this study, we presented HVP, a new data augmentation and learning strategy for Self-Supervised Learning designed to challenge pretrained models with more demanding samples. This method, while straightforward in its design, has proven to be a powerful tool, pushing the effectiveness of the traditional random view generation in SSL.
When combined with methods like DINO, SimSiam, iBOT, and SimCLR, HVP consistently showcased improvements of 1% on average in linear evaluation and a diverse set of transfer tasks. As the landscape of self-supervised learning continues to evolve, methods like HVP underscore the potential for further advancements in the field. By continuously challenging models with harder samples and refining augmentation techniques, we anticipate even greater strides in model performance and generalization in future research endeavors. Our study also investigates the efficiency and robustness of HVP. While it introduces computational overhead due to additional forward passes, we empirically show the benefit of our method even when accounting for this overhead. One naive approach of alternating between standard and HVP training steps allows the method to remain beneficial in long training runs. All in all, this makes HVP appealing for adoption in scenarios where significant improvements in absolute performance are desired, as well as in cases where time efficiency is important, as the improvements, though smaller, still make it worth adopting.

## Appendix

## Appendix A Examples Sampled by HVP

Figure: Figure 6: We depict row-wise ten example images from the ImageNet train set along with their sampled views with a finished, 100-epoch trained SimSiam ResNet50 model. Left: original image with the overlaid randomly sampled crops (colored dashed rectangles). Right: All views after applying resizing and appearance augmentations. The pair that is selected adversarially by HVP is highlighted in solid lines, eg. View 1 and View 4 in the first row.
Refer to caption: extracted/5615638/figures/example_views_full_page.png

## Appendix B Training Loss

Figure: Figure 7: The training loss over 100 epochs. Comparing the DINO vanilla method with DINO + HVP. The spike and drop in the loss curve of DINO is caused by freezing the last layer in the first epoch which was proposed by the authors as a strategy to enhance downstream performance. For HVP we can only see a drop and no spike. We believe this is because HVP exposes the model to hard views from the beginning of training (i.e. the loss is immediately maximized).
Refer to caption: extracted/5615638/figures/dino-loss.png

## Appendix C Effect of More Views on Linear Evaluation Performance

Figure: Figure 8: Setting the number of views too high can result in performance deterioration. This shows that diminishing returns exist, likely because the adversary becomes too strong, resulting in a too hard learning task.
Refer to caption: extracted/5615638/figures/ncrops_plot.png

## Appendix D Assessing the Importance of Metrics with fANOVA

To assess the importance of various metrics on the training loss, we apply fANOVA [] on data that we logged during training with HVP. We used 300k samples that contain the following sampled parameters from the geometric and appearance data augmentation operations for each view: all random resized crop parameters (height and width of the original image, coordinates of crop corners and height and width of the crop), all Colorjitter (color distortion) strengths (brightness, contrast, saturation, hue), grayscale on/off, Gaussian blurring on/off, horizontal flip on/off, loss, and if the crop was selected or not. The metrics we chose are Intersection over Union (IoU), Relative Distance (sample-wise normalized distance of the center points of crop pairs), color distortion distance (the Euclidean distance between all four color distortion operation parameters, i.e. brightness, contrast, saturation, hue), and the individual color distortion parameters of the Colorjitter operation. As can be seen in Fig. 9, the metric with the highest predictive capacity on the loss is the IoU with an importance of 15.2% followed by brightness with 5.1%. The relative distance has an importance of 3.3%, the Colorjitter distance 2.3%, the contrast 1.6%, the saturation 1.4%, hue 0.6%, and all parameters jointly 1.7%.

Figure: Figure 9: Application of fANOVA [] on logged training data to determine metrics with high predictive capacity on the training loss.
Refer to caption: extracted/5615638/figures/fanova_plot.png

## Appendix E Additional Empirical Analysis

### E.1 Can a Manual Augm. Policy be Derived?

**Table 4: Top-1 lin. eval. accuracies for the manual IoU policy.**
| IoU Policy Type | SimSiam | DINO |
| --- | --- | --- |
| Baseline (B) | 68.20 | 73.50 |
| B+range(0.3-0.35) | -0.80 | -1.47 |
| B+range(0.3-0.35)+alt. | +0.10 | -0.45 |
| B+range(0.4-0.6) | +0.55 | -0.40 |
| B+range(0.4-0.6)+alt. | +0.25 | -0.20 |
| B+range(0.1-0.8) | -33.95 | -1.50 |
| B+range(1.0-0.1) | +0.07 | - |

Since harder pretraining tasks seem beneficial according to observations made in Q1, a natural question arises: can we mimic the adversarial selection with a manually scripted augmentation policy? Such a policy would replace HVP and lower the computational cost. Since the IoU plays an important role, below, we study several ways to construct a simple manual augmentation policy based on IoU.

#### E.1.1 Deriving an Augmentation Policy

We implemented the following rejection sampling algorithm in the augmentation pipeline: we linearly approximate the IoU values from Fig. 4 (left; in blue) with start and end values of 0.30 and 0.35 (ignoring the dip in the early phase). For each iteration, we then check if the pairs exceed the IoU value and if so, we reject the pair and re-sample a new pair. This ensures that only pairs are sampled that entail a minimum task difficulty (by means of a small enough IoU). We varied different hyperparameters, e.g., IoU start/end ranges, inverse schedules, and alternating between the IoU schedule and the standard augmentation
. Training both SimSiam and DINO
models for 100 epochs yielded performance drops or insignificant improvements (see Table 4).
These results indicate that using a manual policy based on metrics in pixel space such as the IoU is non-trivial. Additionally, these results show that transferring such a policy from SimSiam to DINO does not work well, possibly due to additional variations in the augmentation pipeline such as multi-crop. In contrast, we believe that HVP is effective and transfers well since it 1) operates on a similarity level of latent embeddings that may be decorrelated from the pixel space and 2) has access to the current model state.

#### E.1.2 Assessing the Difficulty of Predicting the Pair Selected by HVP

We further validate the previous result and assess an upper limit on the performance for predicting the hardest pair. By fitting a gradient boosting classification tree [], we predict the selected view pair conditioned on all SimSiam hyperparameter log data from Q1 except for the flag that indicates whether a view was selected. As training and test data, we used the logs from two seeds (each 300k samples) and the logs from a third seed, respectively. We also tuned hyperparameters on train/valid splits and applied a 5-fold CV. However, the resulting average test performance in all scenarios never exceeded 40%, indicating that it is indeed challenging to predict the hardness of views based on parameter-level data. This further supports our hypothesis that deriving a policy for controlling and increasing hardness based on geometric and appearance parameters is non-trivial and that such a policy must function on a per-sample basis and have access to the current model state as in HVP.

## Appendix F Learning View Generation

### F.1 Adversarial Learner

In this experiment, we explore adversarially learning a network to output the transformation matrix for view generation. We use Spatial Transformer Network (STN) [] to allow generating views by producing 6D transformation matrices (allowing translating, rotating, shearing, scaling, affine transformations, and combinations thereof) in a differentiable way since most common augmentations are not off-the-shelf differentiable. We optimize the STN jointly with the DINO objective and a ViT-tiny. We train it alongside the actual pretrained network using the same (inverted) objective. For our experiments, we use DINO with multi-crop, i.e. 2 global and 8 local heads. As STN we use a small CNN followed by a linear layer for outputting the 10*6D transformation matrices. In this scenario, we use a ViT-tiny/16 with a 300 epoch pretraining on CIFAR10 with a batch size of 256. All other hyperparameters are identical to the ones reported in the DINO paper.

Figure 10 visualizes the procedure. The STN takes the raw image input and generates a number of transformation matrices that are applied to transform the image input into views. These views are then passed to the DINO training pipeline. Both networks are trained jointly with the same loss function. DINO is trained with its original contrastive objective, where the STN is trained by inverting the gradient after the DINO during backpropagation.

Figure: Figure 10: Illustration of adversarial learning with a Spatial Transformer Network (STN) jointly with contrastive learning (here: DINO).

The STN, without using auxiliary losses, starts zooming in and generating single-color views. To counteract this behavior, we experimented with different penalties on the transformation matrices produced by the STN. For instance, in order to limit the zooming pattern, we can use the determinants of the sub-matrices of the transformation matrix to penalize based on the area calculated and apply a regression loss (e.g. MSE). We refer to this type of penalty as *Theta Crops Penalty* (TCP). Additionally, we also restrict its parameters to stay within a sphere with different parameters for local and global crops. Next to determinant-based penalty losses, we also experimented with other penalty functions such as the weighted MSE between the identity and the current transformation matrix or penalties based on histograms of the input image and generated views after applying the transformation. To avoid strong uni-dimensional scaling behavior, we also implemented restricting scaling in a symmetric way (i.e. applied to both x and y dimensions) and refer to this as *scale-sym.*. We report our best results in Table 5 which are all TCP-based. As can be seen, no setting is able to outperform the baseline. Our best score was achieved with translation-scale-symmetric which is very similar to random cropping. When removing the symmetries in scaling, the performance drops further. Removing a constraint adds one transformation parameter and therefore one dimension. This can be seen as giving more capacity to the adversarial learner which in turn can make the task significantly harder. Similarly, when adding rotation, the performance drops further and in part drastically. This is on the one hand due to the penalties not being fully able to restrict the output of the STN. On the other, the task of extracting useful information from two differently rotated crops is even harder, and learning spatial invariance becomes too challenging. All in all, we experienced two modes: either the STN is too restricted, leading to *static output* (i.e. independent of image content, the STN would produce constant transformation matrices) or the STN has too much freedom, resulting in extremely difficult tasks. See Fig. 11 for an example of the former behavior.

Figure: Figure 11: Example for static output behavior of the STN.
Refer to caption: extracted/5615638/figures/stn_crops.png

**Table 5: Linear evaluation and finetuning classification performance on CIFAR10. Top-1 accuracy on the validation set of CIFAR10 for our best results reported with different STN transformation modes.**
| Mode | Penalty | Lin. | F.T. |
| --- | --- | --- | --- |
| baseline | - | 86.1 | 92.7 |
| translation-scale-sym. | TCP | 83.7 | 90.3 |
| translation-scale | TCP | 82.8 | 89.7 |
| rotation-translation | TCP | 56.7 | - |
| rotation-translation-scale | TCP | 31.7 | - |
| rotation-translation-scale-sym. | TCP | 77.6 | - |
| affine | TCP | 78.3 | 83.5 |

### F.2 Cooperative Learner

To investigate the effect of a *cooperative*, i.e. easy pair selection, we conducted a small experiment. Instead of selecting the pair yielding the worst loss, we inverted the objective and selected the pair with the best loss. As expected, this led to model collapses with a linear eval. performance of 0.1%. This result is in line with previous findings that highlight the importance of strong augmentations in CL.

## Appendix G Additional Results

### G.1 Object Detection and Instance Segmentation

Here we provide more detailed results on object detection and instance segmentation, shown in Tab. 6 and Tab. 7 respectively. We followed iBOT’s default configurations which employed Cascade Mask R-CNN as the task layer.

**Table 6: Additional object detection and instance segmentation results on the COCO dataset. The ViT-S/16 models were pretrained for 100 epochs.**
| Method | Arch. | Object Detection | Instance Segmentation |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
|  |  | $\mathbf{AP^{b}}$ | $\mathbf{AP^{b}_{50}}$ | $\mathbf{AP^{b}_{75}}$ | $\mathbf{AP^{m}}$ | $\mathbf{AP^{m}_{50}}$ | $\mathbf{AP^{m}_{75}}$ |
| iBOT | ViT-S/16 | 47.00 | 66.13 | 50.63 | 40.67 | 63.10 | 43.37 |
| + HVP | ViT-S/16 | 47.27 | 66.50 | 50.90 | 40.90 | 63.50 | 43.83 |
| Improvement |  | +0.27 | +0.37 | +0.27 | +0.23 | +0.40 | +0.47 |
| DINO | ViT-S/16 | 46.50 | 65.90 | 50.30 | 40.43 | 62.83 | 43.27 |
| + HVP | ViT-S/16 | 47.07 | 66.37 | 50.63 | 40.80 | 63.37 | 43.87 |
| Improvement |  | +0.57 | +0.47 | +0.33 | +0.37 | +0.53 | +0.60 |

**Table 7: Additional object detection and instance segmentation results on the COCO dataset. The ViT-S/16 models were pretrained for 300 epochs.**
| Method | Arch. | Object Detection | Instance Segmentation |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
|  |  | $\mathbf{AP^{b}}$ | $\mathbf{AP^{b}_{50}}$ | $\mathbf{AP^{b}_{75}}$ | $\mathbf{AP^{m}}$ | $\mathbf{AP^{m}_{50}}$ | $\mathbf{AP^{m}_{75}}$ |
| iBOT | ViT-S/16 | 47.60 | 66.80 | 51.33 | 41.10 | 63.63 | 44.07 |
| + HVP | ViT-S/16 | 48.03 | 67.13 | 51.73 | 41.50 | 64.23 | 44.40 |
| Improvement |  | +0.43 | +0.33 | +0.40 | +0.40 | +0.60 | +0.33 |
| DINO | ViT-S/16 | 47.27 | 66.60 | 51.00 | 41.00 | 63.63 | 44.03 |
| + HVP | ViT-S/16 | 47.50 | 67.00 | 51.33 | 41.17 | 64.00 | 44.13 |
| Improvement |  | +0.23 | +0.40 | +0.33 | +0.17 | +0.37 | +0.10 |

## Appendix H Hyperparameters

### H.1 Evaluations on ImageNet

#### H.1.1 DINO

For DINO, we report the ViT pretraining hyperparameters in Table 8. For ResNet-50, we use the same hyperparameters. Note, for HVP we limit the total number of comparisons to 128 across all heads. Linear evaluation is executed for 100 epochs and we use a learning rate of $0.001$, SGD optimizer (AdamW [] during pretraining), a batch size of 1024, a momentum of $0.9$, and no weight decay.

**Table 8: Pretraining ImageNet hyperparameters for the runs with DINO. For 300 epochs, we use a batch size of 1024.**
| Hyperparameter | Value | Hyperparameter | Value |
| --- | --- | --- | --- |
| architecture | vit-small | epochs: | 100 |
| img-size | 224 | warmup-epochs: | 10 |
| patch-size | 16 | freeze-last-layer: | 1 |
| out-dim | 65536 | lr: | 0.0005 |
| norm-last-layer | true | min-lr: | 1.0e-06 |
| momentum-teacher | 0.996 | optimizer: | AdamW |
| use-bn-in-head | false | weight-decay: | 0.04 |
| teacher-temp | 0.04 | weight-decay-end: | 0.4 |
| warmup-teacher-temp | 0.04 | global-crops-scale: | 0.4, 1.0 |
| warmup-teacher-temp-epochs | 0 | global-crops-size: | 224 |
| fp16 | true | local-crops-number: | 8 |
| batch-size | 512 | local-crops-scale | 0.05, 0.4 |
| clip-grad | 3.0 | local-crops-size: | 96 |
| drop-path-rate | 0.1 |  |  |

#### H.1.2 SimSiam

In Table 9, we report the ResNet-50 pretraining hyperparameters. Linear evaluation is executed for 90 epochs (as reported by the SimSiam authors) and we use a learning rate of 0.1, LARS optimizer [], a batch size of 4096, and no weight decay.

**Table 9: Pretraining ImageNet hyperparameters for the runs with SimSiam. For 300 epochs, we use a batch size of 1024.**
| Hyperparameter | Value |
| --- | --- |
| architecture | resnet50 |
| batch-size | 512 |
| blur-prob | 0.5 |
| crops-scale | 0.2, 1.0 |
| crop-size | 224 |
| feature-dimension | 2048 |
| epochs | 100 |
| fix-pred-lr | true |
| lr | 0.05 |
| momentum | 0.9 |
| predictor-dimension | 512 |
| weight-decay | 0.0001 |
| optimizer | SGD |

#### H.1.3 SimCLR

We report the ResNet-50 pretraining hyperparameters for SimCLR in Table 10. Linear evaluation is executed for 90 epochs with a learning rate of 0.1, SGD optimizer, batch size of 4096, and no weight decay.

**Table 10:**
| Hyperparameter | Value |
| --- | --- |
| architecture | resnet50 |
| proj-hidden-dim | 2048 |
| out-dim | 128 |
| use-bn-in-head | true |
| batch-size | 4096 |
| optim | LARS |
| lr | 0.3 |
| sqrt-lr | false |
| momentum | 0.9 |
| weight-decay | 1e-4 |
| epochs | 100 |
| warmup-epochs | 10 |
| zero-init-residual | true |

### H.2 Transfer to Other Datasets and Tasks

For linear evaluation on the transfer datasets, we simply used the same hyperparameters for linear evaluation on ImageNet (DINO and SimSiam respectively). For finetuning DINO ViT-S/16, we used the hyperparameters reported in Table 11 and for SimSiam ResNet-50 we used the hyperparameters in Table 12

**Table 11: Finetuning hyperparameters for DINO ViT-S/16.**
| Hyperparameter | CIFAR10 | CIFAR100 | Flowers102 | iNat 21 | Food101 |
| --- | --- | --- | --- | --- | --- |
| lr | 7.5e-6 | 7.5e-6 | 5e-5 | 5e-5 | 5e-5 |
| weight-decay | 0.05 | 0.05 | 0.05 | 0.05 | 0.05 |
| optimizer | AdamW | AdamW | AdamW | AdamW | AdamW |
| epochs | 300 | 300 | 300 | 100 | 100 |
| batch-size | 512 | 512 | 512 | 512 | 512 |

**Table 12: Finetuning hyperparameters for SimSiam and ResNet-50.**
| Hyperparameter | CIFAR10 | CIFAR100 | Flowers102 | iNat 21 | Food101 |
| --- | --- | --- | --- | --- | --- |
| lr | 7.5e-6 | 5e-6 | 5e-4 | 7e-5 | 5e-6 |
| weight-decay | 0.05 | 0.05 | 0.05 | 0.05 | 0.05 |
| optimizer | AdamW | AdamW | AdamW | AdamW | AdamW |
| epochs | 300 | 300 | 300 | 100 | 100 |
| batch-size | 512 | 512 | 512 | 512 | 512 |

**Table 13: Slowdown factors for HVP and the alternating training method, where *step* refers to the interval at which HVP is applied during training (i.e., step=1 refers to full HVP and step=3 indicates that HVP is approx. used 33% of the training time). Measurements are averages across 3 seeds.**
| Step | SimSiam<br>(RN50) | DINO<br>(ViT-S/16) | DINO<br>(RN50) | iBOT<br>(ViT-S/16) |
| --- | --- | --- | --- | --- |
| 1 (HVP) | x1.64 | x2.21 | x2.01 | x2.13 |
| 2 | x1.38 | x1.61 | x1.56 | x1.57 |
| 3 | x1.32 | x1.43 | x1.42 | x1.38 |
| 4 | x1.29 | x1.34 | x1.35 | x1.29 |

### H.3 Object Detection and Instance Segmentation

Our experiments utilized Open MMLab’s detection library [] for object detection and instance segmentation on COCO []. We followed iBOT’s default configuration.

**Table 14: Hyperparameters object detection and instance segmentation on COCO.**
| Obj. Det. & Inst. Segm. on COCO |  |
| --- | --- |
| Hyperparameter | Value |
| epochs | 12 |
| batch-size | 32 |
| lr | 0.02 |

## Appendix I Computational Overhead of HVP

The additional forward passes that HVP introduces for the selection phase increase the time complexity of the individual baseline methods. Several possible approaches exist to mitigate this overhead, one of which is to alternate between the vanilla and HVP training step. We measured the overhead factors for different alternating frequencies (i.e., after how many training steps we use the hard views from HVP; we refer to this as *step*) for SimSiam, DINO, and iBOT which we report in Table 13. In Fig. 12, we demonstrate the improvements when applying the n-step training method and when also normalizing the x-axis (epochs) for the increased time overhead of HVP for the 3-step setting with DINO and ViT-S/16. It can be seen that even after normalizing for the time overhead, applying HVP remains beneficial. We assume, as *n* is reduced, that improvements become more significant (but HVP also more expensive) and approximate “full" HVP. Below, we propose additional ways that may allow using hard views more efficiently.

Figure: Figure 12: Longer DINO training with time normalization (3 seeds).
Refer to caption: extracted/5615638/figures/alternating_training_time_normalized.png

As an alternative to the alternating training, we also experimented with a 50% image resolution reduction for the selection phase but observed that the final performance was negatively affected by it or that baseline performance could not be improved.

The details of hardware and software used for this analysis are: one single compute node with 8 NVIDIA RTX 2080 Ti, AMD EPYC 7502 (32-Core Processor), 512GB RAM, Ubuntu 22.04.3 LTS, PyTorch 2.0.1, CUDA 11.8. For DINO’s 2 global and 8 local views (default), applying HVP with nviews=2 sampled for each original view results in 4 global and 16 local views. Since considering all combinations would yield over 77k unique comparisons ($\binom{4}{2}\times\binom{16}{8}$), to remain tractable, we limit the number of total comparisons to 64. For training experiments that exceed the limit of 8x RTX 2080 Ti, we apply gradient accumulation.

While technically there can be a memory overhead with HVP, with the number of sampled views chosen in this paper, the backward pass of the methods that compute gradients only for the selected view pair still consumes more memory than the selection part of HVP (even for 8 sampled views in SimSiam). Note, that selection and the backward computation are never executed at the same time but sequentially.

We emphasize that further ways exist to optimize HVP’s efficiency which remain to be explored. For instance:

- •
using embeddings of views from “earlier” layers in the networks or
- •
using 4/8 bit low-precision for the view selection or
- •
using one GPU just for creating embeddings and selecting the hardest views while the remaining GPUs are used for learning or
- •
other approaches to derive manual augmentation policies or
- •
bypassing forwarding of similar pairs.

## Appendix J Hard View Pretraining Objectives

### J.1 SimCLR

In this section, we are going to introduce the application of HVP with the SimCLR objective. Assume a given set of images $\mathcal{D}$, an image augmentation distribution $\mathcal{T}$, a minibatch of $M$ images $\mathbf{x}=\left\{x_{i}\right\}_{i=1}^{M}$ sampled uniformly from $\mathcal{D}$, and two sets of randomly sampled image augmentations $A=\left\{t_{i}\sim\mathcal{T}\right\}_{i=1}^{M}$ and $B$ sampled from $\mathcal{T}$. We apply $A$ and $B$ to each image in $\mathbf{x}$ resulting in $\mathbf{x}^{A}$ and $\mathbf{x}^{B}$. Both augmented sets of views are subsequently projected into an embedding space with $\mathbf{z}^{A}=g_{\theta}(f_{\theta}(\mathbf{x}^{A}))$ and $\mathbf{z}^{B}=g_{\theta}(f_{\theta}(\mathbf{x}^{B}))$ where $f_{\theta}$ represents an encoder (or backbone) and $g_{\theta}$ a projector network. Contrastive learning algorithms then minimize the following objective function:

$$ $\mathcal{L(\mathbf{\mathcal{T},x;\theta})}=-\log\frac{\exp(\text{sim}(\mathbf{ z}_{i}^{A},\mathbf{z}_{i}^{B})/\tau)}{\sum_{i\neq j}\exp(\text{sim}(\mathbf{z} _{i}^{A},\mathbf{z}_{j}^{B})/\tau)}$ (3) $$

where $\tau$ denotes a temperature parameter and *sim* a similarity function that is often chosen as cosine similarity. Intuitively, when optimizing $\theta$, embeddings of two augmented views of the same image are attracted to each other while embeddings of different images are pushed further away from each other.

To further enhance the training process, we introduce a modification to the loss function where instead of having two sets of augmentations $A$ and $B$, we now have "N" sets of augmentations, denoted as $\mathcal{A}=\{A_{1},A_{2},\ldots,A_{N}\}$. Each set $A_{i}$ is sampled from the image augmentation distribution $\mathcal{T}$, and applied to each image in $\mathbf{x}$, resulting in "N" augmented sets of views $\mathbf{x}^{A_{1}},\mathbf{x}^{A_{2}},\ldots,\mathbf{x}^{A_{N}}$.

Similarly, we obtain $N$ sets of embeddings $\mathbf{z}^{A_{1}},\mathbf{z}^{A_{2}},\ldots,\mathbf{z}^{A_{N}}$ through the encoder and projector networks defined as:

$$ $\mathbf{z}^{A_{i}}=g_{\theta}(f_{\theta}(\mathbf{x}^{A_{i}})),\quad i=1,2, \ldots,N$ $$

We then define a new objective function that seeks to find the pair of augmented images that yield the highest loss. The modified loss function is defined as:

$$ $\mathcal{L}_{\text{max}}(\mathcal{T},\mathbf{x};\theta)=\max_{k,l:k\neq l} \mathcal{L}(\mathcal{T},\mathbf{x};\theta)_{kl}$ $$

where

$$ $\mathcal{L}(\mathcal{T},\mathbf{x};\theta)_{kl}=-\log\frac{\exp(\text{sim}( \mathbf{z}_{k}^{A_{k}},\mathbf{z}_{k}^{A_{l}})/\tau)}{\sum_{i\neq j}\exp(\text {sim}(\mathbf{z}_{i}^{A_{k}},\mathbf{z}_{j}^{A_{l}})/\tau)}$ $$

and $k,l\in\{1,2,\ldots,N\}$ and $i,j\in\{1,2,\ldots,M\}$.

For each iteration, we evaluate all possible view pairs and contrast each view against every other example in the mini-batch. Intuitively, the pair that yields the highest loss is selected, which is the pair that at the same time minimizes the numerator and maximizes the denominator in the above equation. In other words, the hardest pair is the one, that has the lowest similarity with another augmented view of itself and the lowest dissimilarity with all other examples.

## Appendix K Societal Impact

This paper introduces a novel Self-Supervised Learning (SSL) method that significantly enhances the efficiency and robustness of machine learning models.
There are many potential societal consequences of machine learning and SSL in general, none which we feel must be specifically highlighted here.
Regarding our specific approach, we would like to highlight its marked improvement in performance. Our findings suggest that the enhanced performance on downstream tasks may indicate the learning of more robust and fine-tunable general-purpose features. While direct benefits against adversarial attacks are not confirmed, our model’s state-dependent objective hints at potential future advantages in addressing such challenges in SSL.

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: 1. How does HVP address the potential issue of false pairs in hard view selection? Were any additional measures considered for identifying or filtering these pairs?
2. Could the authors further clarify HVP’s unique advantages compared to existing view-construction methods and provide relevant experimental comparisons?
3. Given HVP’s reliance on loss maximization, which may limit its use in tasks with complex pairwise losses (e.g., MAE or relational consistency tasks like Relational KD), could the authors discuss potential adaptations to extend HVP’s applicability?
soundness: 2
strengths: - HVP introduces a straightforward, loss-based hard view selection mechanism that enhances SSL training without requiring additional components or extensive hyperparameter tuning. This simplicity makes it highly practical for integration into existing SSL pipelines.
- The paper presents extensive experiments across different SSL frameworks, model architectures (e.g., CNNs and Vision Transformers), and datasets. This broad evaluation supports the generalizability of HVP and its effectiveness in improving SSL methods.
- The method is demonstrated on large-scale datasets such as ImageNet and COCO, where it consistently outperforms baselines, particularly in challenging settings. HVP’s strong performance on both linear evaluation and transfer tasks, including object detection and segmentation, highlights its robustness and adaptability to diverse downstream applications.
summary: This paper proposes Hard View Pretraining (HVP), an approach for improving self-supervised learning (SSL) by selecting challenging, high-loss views during pretraining. Unlike conventional SSL methods that rely on random augmentations, HVP samples multiple views for each input, computes the pairwise loss, and selects the view pair with the highest loss. This adversarial selection of views enables the model to learn more robust representations by iteratively exposing it to more difficult training examples. The method integrates seamlessly with popular SSL frameworks, including DINO, SimSiam, iBOT, and SimCLR, demonstrating consistent performance gains across various models and transfer tasks. HVP achieves state-of-the-art results on the DINO ViT-B/16 model with a 0.6% improvement in linear evaluation accuracy (78.8%) and demonstrates its scalability across different architectures and datasets.
weaknesses: 1. HVP’s reliance on high-loss pair selection may result in false positive pairs (i.e., views from different instances within the same image) being chosen, which could hinder representation learning. The paper does not clearly address whether the current HVP method can effectively avoid or mitigate this issue.
2. The related work section does not thoroughly discuss other existing view construction methods such as [1,2,3,4] nor does it compare HVP with these methods experimentally. The absence of experimental comparisons with these methods limits the paper’s ability to demonstrate HVP’s distinct advantages in SSL.
3. HVP’s reliance on loss maximization may limit its effectiveness in tasks where pairwise loss is not a straightforward metric, such as pixel-level reconstruction tasks (e.g., Masked Autoencoders[5]) or relational consistency tasks like Relational Knowledge Distillation[6]. The paper could explore adaptations to broaden HVP’s applicability in such contexts.

[1]Tamkin, Alex, et al. “Viewmaker networks: Learning views for unsupervised representation learning.” CVPR 2020.

[2] Peng, Xiangyu, et al. "Crafting better contrastive views for siamese representation learning." CVPR 2022.

[3] Han, Ligong, et al. "Constructive assimilation: Boosting contrastive learning performance through view generation strategies." arXiv:2304.00601.

[4]Li, Xiaojie, et al. “GenView: Enhancing View Quality with Pretrained Generative Model for Self-Supervised Learning.” ECCV. 2024.

[5] He, Kaiming, et al. “Masked autoencoders are scalable vision learners.” CVPR. 2022.

[5]Zheng, Mingkai, et al. “Weak Augmentation Guided Relational Self-Supervised Learning.” TPAMI 2024.

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 3
questions: Please refer to weakness for the details.
soundness: 3
strengths: 1. Innovative approach: A new self supervised learning pre training method HVP has been proposed, which improves the model's generalization ability by selecting difficult views. This is a novel research direction.

2. Wide applicability: The HVP method is not only applicable to one SSL method, but can be integrated into various popular SSL frameworks such as SimSiam, DINO, iBOT, and SimCLR, demonstrating good compatibility.

3. Significant performance improvement: HVP has shown better performance than existing methods on multiple datasets and tasks, particularly achieving new optimal accuracy on DINO ViT-B/16.
summary: The main content of this article is to introduce a new self supervised learning (SSL) pre training method called Hard View Pretraining (HVP). The core idea of this method is to enhance the learning performance of the model by selecting views with higher difficulty (i.e. views that generate higher loss). The HVP strategy includes the following iterative steps:

1. Randomly sample multiple views and propagate each view forward through a pre trained model.

2. Create a pair of two views and calculate their loss.

3. Adversarially select the view pairing that generates the highest loss based on the current model state.

4. Perform backpropagation on the selected view pairing.

In addition, the author also explores the computational cost of HVP, its integration with existing methods, and how to optimize the efficiency of HVP.
weaknesses: Although this article proposes a promising self supervised learning pre training method HVP and demonstrates its effectiveness on multiple tasks, there are also some potential shortcomings:

1. Computational cost: The HVP method requires additional forward propagation to select the most difficult view pairs, which may increase the computational cost of training, especially on large-scale datasets and complex models. Please try to compare the computational cost of proposed approach and existing ones for a more comprehensive performance evaluation.

2. Hyperparameter adjustment: Although HVP does not require adjusting too many hyperparameters, some adjustments may still be needed in determining the number of views and selecting the most difficult view pairs, which may require additional experimental and computational resources.

3. Validation of generalization ability: Although the article demonstrates the effectiveness of HVP on multiple datasets and tasks, further validation is needed for its generalization ability on a wider range of tasks and datasets.

4. Theoretical analysis: The article mainly focuses on experimental results, and the theoretical analysis behind why HVP is effective may not be in-depth enough, especially in understanding how the model learns useful features from difficult views. Maybe a proof of underlying theory (e.g., how HVP affects the geometry of the learned feature space, or providing theoretical bounds on the expected improvement from using hard views) will be helpful.

5. Memory overhead: In some cases, HVP may increase memory overhead, especially when dealing with a large number of views and complex models, which may limit its application in resource constrained environments.

6. Stability of opponent models: When exploring the capacity of opponent models, the article mentions the issue of algorithm stability, indicating that in some cases, HVP may be affected by model crashes. Please conduct a systematic study of how different adversarial strengths affect training stability and performance.

7. Dependence on existing processes: Although HVP can be integrated into existing SSL frameworks, its effectiveness may depend on specific data augmentation distributions and model architectures, which may limit its applicability in different settings.

8. Diversity of experimental design: Although the article provides a wide range of experiments to validate the effectiveness of HVP, more experiments may be needed to explore the performance of HVP under different conditions, such as different learning rates, batch sizes, and training period.

---

confidence: 5
contribution: 2
initial_rating: 6
presentation: 3
questions: Follow strengths and weaknesses.
soundness: 3
strengths: The paper is well written, so many experiments have been done. 
The method is simple and easy to incorporate in existing SSL pipelines, maybe seen as a plug-n-play method.
summary: The authors have proposed and validated an augmentation  method to train SSL models. The methods finds hardest views (HVP) based on loss in SSL to refine the learned representations. Thorough investigation has been done with DINO, SimSiam, SimCLR. 
The method is simple and easy to incorporate in existing SSL pipelines. Transfer learning experiments have been done, many datasets are used.
weaknesses: When we choose hardest views based on loss value, then it is certainly encouraging few augmentation strategies over others which defies the purpose of randomness of augmentations. 
So, it may results performance improvement on unseen example (validation set) of the dataset ion which model is trained however, generalizability of model become questionable in reference to  domain adaptation. 

Initially the model parameters are not effective, therefore, the higher loss may not be a good indicator of hard view. 

As per Table 1, it is evident that longer pretraining is improving the performance even with original methods. Now, computation analysis suggests HVP approximately require 2x time of computation than original method (simSiam, simCLR, DINO iBOT), respectively. It conveys if original methods are pretrained twice number of epochs then they consume same computation resources like HVP. So, maybe, a fair comparison from computation perspective to compare HVP vs Original methods might require pretraining double. Like DINO with 100/300 epochs improves.  

Random crop is dominant augmentation to receive the hard view as per loss, it introduces , i) information loss in visual concept, ii) spatial characteristics are randomly changed. Thus, it is important to understand whether hypothesis behind HVP stand without random crop. 
The nonlinear transforms such as MPD and LCM two very recent augmentations without crop. It would be good to comment on such augmentations. 
MPD: Möbius Transform for Mitigating Perspective Distortions in Representation Learning
LCM: Log Conformal Maps for Robust Representation Learning to Mitigate Perspective Distortion

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: - To leverage the computed embeddings from all views, one can take the average embedding and identify the one with the largest distance from it. This selected embedding can then be contrasted with either the other individual embeddings or their average. This might ensure that the additional computation from data augmentation is utilized effectively. Would adopting this strategy improve the method?
    
- In Appendix C, the training loss of DINO is notably high during the early stages. Could HVP be applied only in the later stages of training instead of throughout the entire process? If so, would it still enhance performance?
soundness: 3
strengths: - Good writing and clarity. The motivation is well-articulated, and the differences from prior work are clearly outlined. Overall, the writing is strong and clear.
    
- Simplicity. The approach is straightforward to implement and adaptable to a variety of architectures.
summary: The paper introduces Hard View Pretraining (HVP), a novel self-supervised learning method aimed at improving pretraining pipelines by selecting hard views. Traditional SSL methods rely on random augmentations to create image views for model training. The authors hypothesize that by selecting the hardest views (those yielding higher loss), the learning process can be improved, resulting in better model performance. The method can be seamlessly combined with existing method like DIMO, SimSiam, iBOT and SimCLR, and the results show the effectiveness across many architectures and datasets.
weaknesses: - The related works in Sec 2.2 are not comprehensive. There might be missing references for view selection. For example, Tian et al. [1] has a thorough discussion on the topic of "What Are the Optimal Views for Contrastive Learning?" Similar to your paper, Tian et al.  [1] studies the input view for contrastive learning. Moreover, Peng et al. [2] propose to generate contrastive views which could avoid most false positives (i.e., object vs. background). Similar to your paper, Peng et a. [2] studies the view selection. Thus, to clarity the distinction from the prior research, it is suggested to discuss the relation with the semantic-aware view selection in [2].
    
- Compuational overhead. The data augmentation significantly increases computational demands. Table 15 shows that HVP slows down the training of all models, despite efforts to use the hard view more efficiently. Please ensure a fair comparison under the same training budget or runtime. For example, the baseline (DINO) could be trained longer to match the computational budget of DINO+HVP.
   
    
- Minors. The authors report achieving a state-of-the-art 78.8% linear probing accuracy on ImageNet. To ensure a fair and comprehensive comparison, please include the results of DINO+HVP using the ViT-B/16 architecture (400 epochs) in the main table. Typo: the legend of figure 6 should be DINO+HVP rather than DINO+HVS.

- Minors. Lack of theoretical analysis: The method could be framed within the context of regularization techniques for self-supervised learning.

Meta-review: The rebuttal provided clarifications about the proposed method and its analysis that were useful for assessing the paper's contribution and responded adequately to most reviewer concerns. After discussion, reviewer AeuA recommended acceptance, k3VL recommended marginal acceptance, xunC recommended marginally below acceptance. Reviewer mBDk was not involved in the rebuttal. The AC agreed this work is valuable to the ICLR community. The final version should include all reviewer comments, suggestions, and additional clarifications from the rebuttal.

Decision: Accept (Poster)