2,521 research outputs found
Improving Adversarial Robustness of Masked Autoencoders via Test-time Frequency-domain Prompting
In this paper, we investigate the adversarial robustness of vision
transformers that are equipped with BERT pretraining (e.g., BEiT, MAE). A
surprising observation is that MAE has significantly worse adversarial
robustness than other BERT pretraining methods. This observation drives us to
rethink the basic differences between these BERT pretraining methods and how
these differences affect the robustness against adversarial perturbations. Our
empirical analysis reveals that the adversarial robustness of BERT pretraining
is highly related to the reconstruction target, i.e., predicting the raw pixels
of masked image patches will degrade more adversarial robustness of the model
than predicting the semantic context, since it guides the model to concentrate
more on medium-/high-frequency components of images. Based on our analysis, we
provide a simple yet effective way to boost the adversarial robustness of MAE.
The basic idea is using the dataset-extracted domain knowledge to occupy the
medium-/high-frequency of images, thus narrowing the optimization space of
adversarial perturbations. Specifically, we group the distribution of
pretraining data and optimize a set of cluster-specific visual prompts on
frequency domain. These prompts are incorporated with input images through
prototype-based prompt selection during test period. Extensive evaluation shows
that our method clearly boost MAE's adversarial robustness while maintaining
its clean performance on ImageNet-1k classification. Our code is available at:
https://github.com/shikiw/RobustMAE.Comment: Accepted at ICCV 202
Foundation Model-oriented Robustness: Robust Image Model Evaluation with Pretrained Models
Machine learning has demonstrated remarkable performance over finite
datasets, yet whether the scores over the fixed benchmarks can sufficiently
indicate the model's performance in the real world is still in discussion. In
reality, an ideal robust model will probably behave similarly to the oracle
(e.g., the human users), thus a good evaluation protocol is probably to
evaluate the models' behaviors in comparison to the oracle. In this paper, we
introduce a new robustness measurement that directly measures the image
classification model's performance compared with a surrogate oracle (i.e., a
foundation model). Besides, we design a simple method that can accomplish the
evaluation beyond the scope of the benchmarks. Our method extends the image
datasets with new samples that are sufficiently perturbed to be distinct from
the ones in the original sets, but are still bounded within the same
image-label structure the original test image represents, constrained by a
foundation model pretrained with a large amount of samples. As a result, our
new method will offer us a new way to evaluate the models' robustness
performance, free of limitations of fixed benchmarks or constrained
perturbations, although scoped by the power of the oracle. In addition to the
evaluation results, we also leverage our generated data to understand the
behaviors of the model and our new evaluation strategies
Distilling Out-of-Distribution Robustness from Vision-Language Foundation Models
We propose a conceptually simple and lightweight framework for improving the
robustness of vision models through the combination of knowledge distillation
and data augmentation. We address the conjecture that larger models do not make
for better teachers by showing strong gains in out-of-distribution robustness
when distilling from pretrained foundation models. Following this finding, we
propose Discrete Adversarial Distillation (DAD), which leverages a robust
teacher to generate adversarial examples and a VQGAN to discretize them,
creating more informative samples than standard data augmentation techniques.
We provide a theoretical framework for the use of a robust teacher in the
knowledge distillation with data augmentation setting and demonstrate strong
gains in out-of-distribution robustness and clean accuracy across different
student architectures. Notably, our method adds minor computational overhead
compared to similar techniques and can be easily combined with other data
augmentations for further improvements.Comment: Published in NeurIPS 202
Three Towers: Flexible Contrastive Learning with Pretrained Image Models
We introduce Three Towers (3T), a flexible method to improve the contrastive
learning of vision-language models by incorporating pretrained image
classifiers. While contrastive models are usually trained from scratch, LiT
(Zhai et al., 2022) has recently shown performance gains from using pretrained
classifier embeddings. However, LiT directly replaces the image tower with the
frozen embeddings, excluding any potential benefits of contrastively training
the image tower. With 3T, we propose a more flexible strategy that allows the
image tower to benefit from both pretrained embeddings and contrastive
training. To achieve this, we introduce a third tower that contains the frozen
pretrained embeddings, and we encourage alignment between this third tower and
the main image-text towers. Empirically, 3T consistently improves over LiT and
the CLIP-style from-scratch baseline for retrieval tasks. For classification,
3T reliably improves over the from-scratch baseline, and while it underperforms
relative to LiT for JFT-pretrained models, it outperforms LiT for ImageNet-21k
and Places365 pretraining
Beyond Pretrained Features: Noisy Image Modeling Provides Adversarial Defense
Recent advancements in masked image modeling (MIM) have made it a prevailing
framework for self-supervised visual representation learning. The MIM
pretrained models, like most deep neural network methods, are still vulnerable
to adversarial attacks, limiting their practical application, and this issue
has received little research attention. In this paper, we investigate how this
powerful self-supervised learning paradigm can provide adversarial robustness
to downstream classifiers. During the exploration, we find that noisy image
modeling (NIM), a simple variant of MIM that adopts denoising as the pre-text
task, reconstructs noisy images surprisingly well despite severe corruption.
Motivated by this observation, we propose an adversarial defense method by
exploiting the pretrained decoder for denoising, referred to as De^3, through
which NIM is able to enhance adversarial robustness beyond providing pretrained
features. Furthermore, we incorporate a simple modification, sampling the noise
scale hyperparameter from random distributions, and enable the defense to
achieve a better and tunable trade-off between accuracy and robustness.
Experimental results demonstrate that, in terms of adversarial robustness, NIM
is superior compared to MIM thanks to its effective denoising capability.
Moreover, the defense provided by NIM achieves performance on par with
adversarial training while offering the extra tunability advantage. Source code
and models will be made available
Selecting Informative Contexts Improves Language Model Finetuning
We present a general finetuning meta-method that we call information gain
filtration for improving the overall training efficiency and final performance
of language model finetuning. This method uses a secondary learner which
attempts to quantify the benefit of finetuning the language model on each given
example. During the finetuning process, we use this learner to decide whether
or not each given example should be trained on or skipped. We show that it
suffices for this learner to be simple and that the finetuning process itself
is dominated by the relatively trivial relearning of a new unigram frequency
distribution over the modelled language domain, a process which the learner
aids. Our method trains to convergence using 40% fewer batches than normal
finetuning, and achieves a median perplexity of 54.0 on a books dataset
compared to a median perplexity of 57.3 for standard finetuning using the same
neural architecture
Evaluating natural language processing models with generalization metrics that do not need access to any training or testing data
The search for effective and robust metrics has been the focus of recent
theoretical and empirical work on generalization of deep neural networks (NNs).
In this paper, we discuss the performance of natural language processing (NLP)
models, and we evaluate various existing and novel generalization metrics.
Compared to prior studies, we (i) focus on NLP instead of computer vision (CV),
(ii) focus on generalization metrics that predict test error instead of the
generalization gap, (iii) focus on generalization metrics that do not need the
access to data, and (iv) focus on the heavy-tail (HT) phenomenon that has
received comparatively less attention in the study of NNs. We extend recent
HT-based work which focuses on power law (PL) distributions, and we study
exponential and exponentially truncated power law (E-TPL) fitting to the
empirical spectral densities (ESDs) of weight matrices. Our empirical studies
are carried on (i) hundreds of Transformers trained in different settings, in
which we systematically vary different hyperparameters, (ii) a total of 51
pretrained Transformers from eight families of Huggingface NLP models,
including BERT, GPT2, etc., and (iii) a total of 28 existing and novel
generalization metrics. From our empirical analyses, we show that shape
metrics, or the metrics obtained from fitting the shape of the ESDs, perform
uniformly better at predicting generalization performance than scale metrics
commonly studied in the literature, as measured by the rank correlations with
the generalization performance. We also show that among the three HT
distributions considered in our paper, the E-TPL fitting of ESDs performs the
most robustly when the models are trained in experimental settings, while the
PL fitting achieves the best performance on well-trained Huggingface models,
and that both E-TPL and PL metrics (which are both shape metrics) outperform
scale metrics
Efficiently Robustify Pre-trained Models
A recent trend in deep learning algorithms has been towards training large
scale models, having high parameter count and trained on big dataset. However,
robustness of such large scale models towards real-world settings is still a
less-explored topic. In this work, we first benchmark the performance of these
models under different perturbations and datasets thereby representing
real-world shifts, and highlight their degrading performance under these
shifts. We then discuss on how complete model fine-tuning based existing
robustification schemes might not be a scalable option given very large scale
networks and can also lead them to forget some of the desired characterstics.
Finally, we propose a simple and cost-effective method to solve this problem,
inspired by knowledge transfer literature. It involves robustifying smaller
models, at a lower computation cost, and then use them as teachers to tune a
fraction of these large scale networks, reducing the overall computational
overhead. We evaluate our proposed method under various vision perturbations
including ImageNet-C,R,S,A datasets and also for transfer learning, zero-shot
evaluation setups on different datasets. Benchmark results show that our method
is able to induce robustness to these large scale models efficiently, requiring
significantly lower time and also preserves the transfer learning, zero-shot
properties of the original model which none of the existing methods are able to
achieve
- …