Improving Diffusion Models's Data-Corruption Resistance using Scheduled Pseudo-Huber Loss

Artem Khrapov, Vadim Popov, Tasnima Sadekova, Assel Yermekova, Mikhail A. KudinovarXiv 2024 · DOI

Abstract

Standard diffusion models are surprisingly fragile; a small percentage of "poisoned" images in a training set can cause a model to lose its grip on a concept entirely. This paper introduces Scheduled Pseudo-Huber Loss, a robust alternative to the standard squared error ($L_2$) loss. By making the loss function time-dependent, the model can ignore outliers during the early stages of generation while maintaining high-fidelity detail in the final steps. Experiments across text-to-image and text-to-speech tasks demonstrate that this method significantly improves resilience to dataset corruption with virtually no computational overhead.

Introduction

Diffusion models have revolutionized generative AI, but they suffer from a "perfectionist" problem. They typically utilize Mean Squared Error ($L_2$ loss) during training, which penalizes large errors quadratically. While effective for clean datasets, this sensitivity becomes a liability when training data is corrupted or contains outliers.

If a dataset includes "poisoned" samples—images that do not match their captions—the $L_2$ loss forces the model to reconcile these contradictions. This often results in "concept erasure," where the model fails to generate the intended subject correctly. To address this, the authors propose a training process that is inherently resistant to such corruptions without requiring expensive data filtering.

Overview of the corruption problem and the robustness of Huber Loss compared to standard L2 loss.

Methods: Scheduled Pseudo-Huber Loss

The authors propose replacing the standard $L_2$ loss with a Pseudo-Huber loss, a smooth, differentiable approximation of the Huber loss. Huber loss acts like $L_2$ (quadratic) for small errors but like $L_1$ (linear) for large errors, preventing the model from over-reacting to massive outliers.

Delta-Scheduling

The core innovation is making the Huber parameter ($\delta$) time-dependent. In diffusion, time steps represent the transition from pure noise to a clean image:

  • Early steps (high noise): The model defines global structure. The authors use a schedule that prioritizes robustness to ignore outliers that would otherwise distort the concept.
  • Late steps (low noise): The model fills in fine details. Here, the schedule shifts the loss to behave more like standard $L_2$ to ensure high-quality, sharp results.

This "Delta-Scheduling" is mandatory; a fixed Huber loss either lacks robustness or fails to capture textural detail. The authors found that an exponential decrease of $\delta$ over timesteps provides the best balance between structural integrity and visual fidelity.

Experimental Setup

The researchers evaluated their method across two modalities:

  1. Image Generation: Using 7 datasets (characters, styles, landscapes), they intentionally corrupted data by replacing 15% to 45% of images with outliers (images with the lowest CLIP similarity to the target concept).
  2. Text-to-Speech (TTS): Using a multi-speaker Grad-TTS model, they fine-tuned on a clean target speaker dataset mixed with corrupting records from different speakers.

To quantify performance, they introduced the Resilience Factor ($R$), which compares the similarity of images generated by a corrupted model against those from a model trained on clean data.

Key Results

Resilience metric across training steps for different loss functions and corruption levels (0.15, 0.3, 0.45). Scheduled Huber loss consistently maintains higher resilience.
  • Text-to-Image: Scheduled Pseudo-Huber loss outperformed standard $L_2$ in 5 out of 7 categories at a 45% corruption level. While $L_2$ models produced fractal-like artifacts or unrelated images when poisoned, Huber-trained models continued to produce recognizable, high-quality subjects.
  • Text-to-Speech: In the audio domain, Huber-trained models showed significantly higher minimum similarity scores, meaning they were much less likely to produce a voice sample that sounded like the corrupting speaker.
  • Efficiency: As this is a simple change to the loss function, it adds virtually zero computational overhead compared to standard $L_2$ training.

Limitations and Future Work

While highly effective against outliers, the method has limitations. If an entire dataset is uniformly corrupted, the model will still learn the corrupted concept. Additionally, the authors did not test against specific state-of-the-art adversarial poisoning tools like Nightshade, noting that their method might be perceived as a way to bypass such data protections. Future research may focus on finding optimal $\delta$ schedules for different data types to further enhance robustness.

Summary updated

BibTeX
@misc{khrapov2024improving,
  author = {Artem Khrapov and Vadim Popov and Tasnima Sadekova and Assel Yermekova and Mikhail A. Kudinov},
  title = {{Improving Diffusion Models's Data-Corruption Resistance using Scheduled Pseudo-Huber Loss}},
  year = {2024},
  eprint = {2403.16728},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.16728},
}
Figure