Diversity through Disagreement for Better Transferability

Matteo Pagliardini, Martin Jaggi, François Fleuret, Sai Praneeth Karimireddy

TL;DR

This paper introduces D-BAT, a novel training method for ensembles of models that encourages disagreement on out-of-distribution (OOD) data while enforcing agreement on in-distribution data. This approach effectively mitigates "shortcut learning" by promoting the discovery of diverse, transferable features, leading to improved OOD generalization, uncertainty estimation, and overall model robustness.

What Problem Does This Paper Address?

Modern deep learning models, trained with standard gradient-based methods like SGD, often exhibit a "simplicity bias." This bias leads them to favor simpler, often spurious, features present in the training data, even if more complex features are more predictive. This is particularly problematic in real-world scenarios where test data distributions can differ from training data (Out-of-Distribution or OOD generalization). This reliance on shortcuts hinders model transferability to new domains, makes them brittle to distribution shifts, and can lead to overconfident predictions on unfamiliar data. The paper aims to address this by developing a method that encourages models to learn diverse predictive features, rather than relying on a single, potentially spurious, shortcut.

Methods

The core contribution is the D-BAT (Diversity-By-disAgreement Training) algorithm. D-BAT trains an ensemble of models with a novel objective:

  • Agreement on In-Distribution Data: Models are trained to agree on the predictions for data drawn from the original training distribution (D). This ensures they learn the underlying patterns of the known data.
  • Disagreement on Out-of-Distribution Data: Crucially, models are trained to disagree on predictions for data drawn from an OOD distribution (Dood). This disagreement acts as a signal to avoid relying on features that are specific to the training distribution and might not generalize.

The authors show that D-BAT naturally emerges from the concept of generalized discrepancy. They propose two algorithmic variants: one for binary classification and another for multi-class classification, which can train full ensembles. The training can be sequential (first train a base model, then train others to disagree) or simultaneous. They advocate for sequential training as it helps preserve the simplest, potentially most robust, solution.

Datasets

The paper utilizes a combination of artificial and natural datasets:

  • Artificial Datasets:
    • M/F-D (MNIST/Fashion-MNIST Dominoes): Combines MNIST digits (0s and 1s) with Fashion-MNIST images (coats/dresses).
  • M/C-D (MNIST/CIFAR-10 Dominoes): Combines MNIST digits (0s and 1s) with CIFAR-10 images (trucks/cars).
  • MM-Dominoes: A variation combining MNIST 0s/1s with MNIST 7s/9s. These datasets are designed to have a "spurious" feature (e.g., MNIST digit shape) that is perfectly predictive on the training distribution but not on the OOD distribution.

  • Natural Datasets:

    • Camelyon17: A cancer detection dataset where images are sourced from different hospitals, creating natural distribution shifts between splits.
  • CIFAR-10: Used for evaluating uncertainty estimation and OOD detection. The training set uses a subset of classes, and the OOD set uses the remaining classes or CIFAR-100.

Key Insights and Ideas

  • Simplicity Bias is a Double-Edged Sword: While simplicity bias can aid generalization on the training distribution, it actively harms OOD generalization by promoting reliance on spurious correlations.
  • Disagreement as a Signal for Diversity: Forcing models to disagree on OOD data is a powerful mechanism to encourage them to explore different predictive features, thus increasing diversity within the ensemble.
  • D-BAT as a Functional Extension of Discrepancy: The proposed method is grounded in the theoretical concept of discrepancy, but adapted to encourage functional diversity among predictors.
  • OOD Uncertainty is Key: D-BAT not only improves accuracy on OOD data but also provides more reliable uncertainty estimates, making it useful for safety-critical applications.
  • Sequential Training Preserves Simplicity: Training models sequentially (first a base ERM model, then others to disagree) helps retain the benefits of the simplest predictor while adding diversity.

Key Results

  • Improved Test Accuracy: D-BAT consistently improves test accuracy on OOD datasets compared to standard Empirical Risk Minimization (ERM) and other baseline methods like deep ensembles and MC-Dropout. For instance, on the M/F-D and M/C-D datasets, D-BAT shows significant gains.
  • Mitigation of Shortcut Learning: Experiments on artificial datasets demonstrate that D-BAT effectively avoids relying on spurious features, achieving much higher accuracy on OOD data than ERM, which fails completely.
  • Enhanced Uncertainty Estimation: For OOD samples, D-BAT ensembles produce lower confidence (higher uncertainty) predictions compared to deep ensembles and MC-Dropout, which tend to be overconfident. This is visualized through histograms of predicted probabilities.
  • Competitive Performance on Natural Datasets: On the Camelyon17 dataset, D-BAT also shows significant improvements in test accuracy, demonstrating its effectiveness on real-world distribution shifts.
  • Comparison to Prior Work: D-BAT outperforms or offers a more robust approach compared to recent methods addressing simplicity bias and OOD generalization, particularly in challenging scenarios with extreme simplicity bias.

Limitations and Future Work

  • Computational Cost: Training ensembles inherently increases computational cost compared to single models.
  • Hyperparameter Tuning: The D-BAT coefficient ($\alpha$) requires tuning, as shown in Figure 2.
  • Future Work: The authors suggest exploring the application of D-BAT to more complex tasks and architectures. They also highlight the potential for D-BAT to be extended to scenarios with more than two models in the ensemble, which is addressed by Algorithm 2. The paper also hints at future work in comparing D-BAT with other diversity measures, such as mutual information, and exploring its effectiveness in more complex OOD settings.

Summary updated

BibTeX
@inproceedings{pagliardini2023diversity,
  author = {Matteo Pagliardini and Martin Jaggi and François Fleuret and Sai Praneeth Karimireddy},
  title = {{Diversity through Disagreement for Better Transferability}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=K7CbYQbyYhY},
}
Figure