Confidence-aware Denoised Fine-tuning of Off-the-shelf Models for Certified Robustness

Suhyeok Jang, Seojin Kim, Jinwoo Shin, Jongheon Jeong

Abstract

The remarkable advances in deep learning have led to the emergence of many off-the-shelf classifiers, e.g., large pre-trained models. However, since they are typically trained on clean data, they remain vulnerable to adversarial attacks. Despite this vulnerability, their superior performance and transferability make off-the-shelf classifiers still valuable in practice, demanding further work to provide adversarial robustness for them in a post-hoc manner. A recently proposed method, denoised smoothing, leverages a denoiser model in front of the classifier to obtain provable robustness without additional training. However, the denoiser often creates hallucination, i.e., images that have lost the semantics of their originally assigned class, leading to a drop in robustness. Furthermore, its noise-and-denoise procedure introduces a significant distribution shift from the original distribution, causing the denoised smoothing framework to achieve sub-optimal robustness. In this paper, we introduce Fine-Tuning with Confidence-Aware Denoised Image Selection (FT-CADIS), a novel fine-tuning scheme to enhance the certified robustness of off-the-shelf classifiers. FT-CADIS is inspired by the observation that the confidence of off-the-shelf classifiers can effectively identify hallucinated images during denoised smoothing. Based on this, we develop a confidence-aware training objective to handle such hallucinated images and improve the stability of fine-tuning from denoised images. In this way, the classifier can be fine-tuned using only images that are beneficial for adversarial robustness. We also find that such a fine-tuning can be done by merely updating a small fraction (i.e., 1%) of parameters of the classifier. Extensive experiments demonstrate that FT-CADIS has established the state-of-the-art certified robustness among denoised smoothing methods across all $l_2$-adversary radius in a variety of benchmarks, such as CIFAR-10 and ImageNet.

Introduction

Deep learning models are notoriously fragile; small, invisible perturbations, known as adversarial examples, can easily trick them. Randomized smoothing is a popular defense that provides a mathematical guarantee (certified robustness) that a model’s prediction won't change within a certain radius. However, it usually requires training a model from scratch on noisy data, which is prohibitively expensive for modern, large-scale models.

Denoised smoothing attempts to fix this by placing a pre-trained denoiser (like a diffusion model) in front of a standard "off-the-shelf" classifier. This allows us to use powerful pre-trained models without retraining them. But there are two major catches:

  1. Distribution Shift: Denoised images look different from the clean images the classifier was trained on.
  2. Hallucinations: Sometimes the denoiser "hallucinates," changing the actual content of the image (e.g., turning an "acorn" into a "fig"). Forcing a model to label a hallucinated image with its original label during fine-tuning actually hurts its performance and robustness.
Examples of semantic hallucinations during the noise-and-denoise process, where the denoiser alters the image content, leading to incorrect classifications.

Methodology

The authors introduce FT-CADIS (Fine-Tuning with Confidence-Aware Denoised Image Selection) to solve these issues. The core idea is to use the classifier's own confidence to filter out "hallucinated" images generated during the denoising process.

The FT-CADIS framework: (I) Confidence-aware selection of non-hallucinated images and (II) Parameter-efficient fine-tuning using selective cross-entropy and masked adversarial losses.

FT-CADIS employs a selective training objective:

  • Confidence-Aware Selection: For a given image, the system generates multiple denoised versions. It only keeps the "non-hallucinated" ones—those where the classifier still predicts the original correct label with high confidence.
  • Selective Cross-Entropy Loss ($L^{SCE}$): The model is fine-tuned only on these high-confidence, semantically correct images. This helps the model adapt to the "look" of denoised images without being confused by hallucinations.
  • Masked Adversarial Loss ($L^{MAdv}$): To further boost robustness, adversarial training is applied only when the denoiser is extremely stable (i.e., when all generated denoised samples for a specific image are non-hallucinated).
  • Parameter-Efficient Fine-tuning (LoRA): Instead of updating the whole model, they use Low-Rank Adaptation (LoRA), updating only about 1% of the parameters. This makes the process scalable to massive models.

Experimental Results

The researchers evaluated FT-CADIS on two gold-standard computer vision benchmarks, CIFAR-10 and ImageNet, using a ViT-B/16 as the base classifier and a pre-trained Diffusion Model as the denoiser.

FT-CADIS established new state-of-the-art results for certified robustness:

  • ImageNet Performance: At a high noise level ($\sigma = 1.00$) and a large adversarial radius ($\epsilon = 2.0$), FT-CADIS improved certified accuracy from 29.5% to 39.4% compared to previous leading methods.
  • Efficiency: On ImageNet, FT-CADIS achieved these results in roughly 8.4 GPU days, significantly faster than previous multi-scale denoising approaches that required 32 GPU days.
  • Consistency: Unlike previous methods that saw accuracy "crash" at high noise levels, FT-CADIS remained stable, effectively bridging the gap between clean-data performance and noisy-data robustness.

Discussion and Conclusion

The most elegant insight of this work is using the classifier as its own filter. If a denoised image makes the classifier lose confidence, it is likely a hallucination. By ignoring these samples, the model avoids learning incorrect features. Furthermore, the success of LoRA suggests that the necessary knowledge is already in the model; it just needs a light "nudge" to handle the distribution shift.

While training is efficient, certifying the model remains slow due to the 100,000 inferences per image required for mathematical guarantees—a standard limitation of randomized smoothing. Additionally, the reliance on LoRA means the method currently requires white-box access to model weights. Future work may explore prompt-tuning for black-box models and methods to accelerate the certification process for real-time deployment.

Summary updated

BibTeX
@article{jang2024confidence,
  author = {Suhyeok Jang and Seojin Kim and Jinwoo Shin and Jongheon Jeong},
  title = {{Confidence-aware Denoised Fine-tuning of Off-the-shelf Models for Certified Robustness}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=99GovbuMcP},
}
Figure