Regulating Model Reliance on Non-robust Features by Smoothing Input Marginal Density

Peiyu Yang, Naveed Akhtar, Mubarak Shah, Ajmal Mian

Abstract

Deep learning models often rely on non-robust, spurious features—such as background colors or irrelevant patterns—rather than the actual objects of interest. This paper introduces a novel regularization technique that smooths the marginal probability density of the input. By forcing models to prioritize consistent, robust features, this method significantly improves reliability against adversarial attacks and dataset biases.

Introduction

Machine learning models are frequently "right for the wrong reasons." This phenomenon, known as feature leakage or spurious correlation, occurs when a model learns to identify a class based on irrelevant environmental cues (e.g., identifying a "bird" by the presence of blue water). While these features may be predictive within a specific training set, they fail when the environment changes or under adversarial perturbations.

Existing solutions, such as input gradient regularization, typically smooth the conditional density $p(x|y)$. The authors argue this approach is insufficient as it leaves models susceptible to non-robust features appearing across multiple classes. They propose a global regularization strategy targeting the marginal input density to address these cross-class spurious correlations.

Methodology: Marginal Density Smoothing

The proposed framework distinguishes robust from non-robust features based on attribution consistency. Robust features provide stable evidence for predictions despite minor input variations, whereas non-robust features cause internal logic fluctuations.

The Core Idea

The authors regularize the gradients of the marginal probability density $p_\theta(x)$ with respect to the input. Smoothing this density suppresses the model's sensitivity to fluctuating, non-robust features. Since direct calculation of this density is computationally intractable, the authors demonstrate that the gradient of the log-marginal density is equivalent to the gradient of the log-partition function of the model's outputs ($\nabla_x \log Z_{f(x)}$).

Numerical Stability and Efficiency

Standard implementations of such gradients are prone to numerical instability. To overcome this, the authors developed an efficient implementation using a Taylor series approximation. This reduces computational complexity from $O(n)$ to $O(1)$ relative to the number of classes, making the method feasible for large-scale architectures like ResNet-34.

Numerical stability of the proposed efficient implementation compared to standard gradient calculations.

Experimental Evaluation

The method was evaluated on several benchmarks designed to test model failure modes:

  • BlockMNIST: Tests feature leakage by appending irrelevant "null blocks" to MNIST images.
  • CelebA-Hair: Examines spurious correlations (e.g., correlating "blond hair" with "female").
  • Waterbirds: Misleading backgrounds (land vs. water) for bird classification.
  • CIFAR-10/100: General robustness against pixel noise and adversarial attacks.

Key Results

Reducing Feature Leakage and Improving Robustness

On BlockMNIST, the proposed regularization reduced the average "Feature Leakage" metric to 2.259, compared to 3.657 for vanilla training. Visual attribution maps confirm that the model shifts its focus from irrelevant patterns back to the primary object.

Robustness comparison on BlockMNIST and CelebA-Hair datasets, showing attribution maps and insertion game performance.

Performance on Spurious Correlations

In the CelebA-Hair dataset, "Worst-Group Accuracy"—performance on rare combinations like blond-haired men—increased from 49.90% (vanilla) to 85.62%. This indicates the model successfully ignored spurious gender-hair color correlations.

Adversarial Defense

The model demonstrated superior robustness against PGD attacks. On BlockMNIST, it maintained 29.36% accuracy under $L_\infty$ attacks, while standard models dropped to 0%.

Conclusion

By smoothing the marginal input density, this regularization technique effectively steers models away from non-robust shortcuts. While the method requires careful tuning of regularization strength to avoid suppressing useful complex features, it offers a practical and efficient path toward more reliable deep learning systems. Future work may involve automated tuning of this strength or applications in self-supervised learning environments.

Summary updated

BibTeX
@inproceedings{yang2024regulating,
  author = {Peiyu Yang and Naveed Akhtar and Mubarak Shah and Ajmal Mian},
  title = {{Regulating Model Reliance on Non-robust Features by Smoothing Input Marginal Density}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72998-0\_19},
}
Figure