Learning Robust Representations by Projecting Superficial Statistics Out

Haohan Wang, Zexue He, Zachary C. Lipton, Eric P. Xing

Introduction

Deep neural networks are notorious for "cheating" by relying on superficial textures and backgrounds rather than actual semantic meaning. This reliance leads to catastrophic failures when the environment or domain changes. To address this, researchers have introduced a novel differentiable module called the Neural Gray-Level Co-occurrence Matrix (NGLCM) to capture these superficial textures, along with a projection method known as Heteroscedastic EXtraction (HEX) to explicitly "subtract" them from the model’s decision-making process. This approach significantly improves performance on unseen data domains.

The Challenge of Domain Generalization

Imagine training an AI to recognize "happiness" in photos. If the training data predominantly features happy people outdoors and sad people indoors, the AI might simply learn to detect "grass" as a proxy for "happy." This is a classic failure of Domain Generalization (DG).

Standard deep learning models are inherently "lazy." They gravitate toward high-frequency, superficial statistics—like texture or local color patterns—because these features are easier to optimize than complex, semantic "gestalt" features. When these models encounter a new domain (e.g., a sketch instead of a photo, or a novel background), they break down because the superficial correlations they relied upon have shifted. The goal of this research is to force models to ignore these "shortcuts" and focus on robust, semantic signals.

Methodology: NGLCM and HEX

To prevent models from taking superficial shortcuts, the authors propose a two-part solution:

  1. NGLCM (Neural Gray-Level Co-occurrence Matrix): Inspired by classical computer vision, NGLCM is a new, differentiable neural network building block. It is specifically designed to excel at capturing texture (pixel-to-pixel relationships) while remaining intentionally "blind" to the overall shape or semantic meaning of an image. It acts as a dedicated sensor for the superficial information the model needs to avoid.
  2. HEX (Heteroscedastic EXtraction/Projection): This is the core strategy for "projecting out" the unwanted information. The model is split into two branches: one for raw data and one for the NGLCM texture features. Instead of simply adding them together, HEX uses a linear projection (a "residual maker matrix") to ensure the final representation used for classification is mathematically orthogonal to the texture features. In simpler terms, it forces the model to make a prediction using only the information that cannot be explained by superficial textures.

The authors also compare HEX to Adversarial (ADV) methods, which use a "reverse gradient" to try and make the representation uninformative for a texture-predicting sub-network, finding HEX to be more stable.

Evaluation Datasets

The researchers evaluated their approach on a mix of standard benchmarks and custom-designed "trap" datasets designed to test reliance on spurious correlations:

  • Synthetic Facial Expressions: A dataset where sentiment labels are intentionally correlated with specific backgrounds during training but remain independent during testing.
Examples from the Synthetic Facial Expressions dataset
  • MNIST with Surface Regularities: Digit recognition where "surface" patterns (Fourier-filtered noise) are added to trick the model.
  • MNIST-Rotation: A standard DG benchmark where the model is trained on certain rotation angles and tested on others.
  • Office Dataset: A common domain adaptation set featuring images from Amazon, Webcams, and DSLRs.
  • PACS: A challenging benchmark involving four distinct domains: Photo, Art painting, Cartoon, and Sketch.

Key Insights

  • Subtraction over Ignorance: Most DG methods try to find "invariant" features by looking at multiple domains. This paper argues that if we know what kind of information is superficial (like texture), we should explicitly model it and subtract it.
  • Differentiable Classical CV: The paper demonstrates that classical computer vision techniques like GLCM still hold immense value. By making them differentiable, they can be seamlessly integrated into modern end-to-end deep learning pipelines.
  • Preventing the "Clever Hans" Effect: By using the HEX projection, the authors provide a mathematical guarantee that the classifier isn't cheating using the specific superficial signals captured by the NGLCM.
  • Stability vs. Adversaries: While adversarial training is a popular way to "forget" information, the authors found that their linear projection method (HEX) was often more stable and faster to converge.

Results and Performance

  • Robustness to Spurious Correlation: In the facial expression task, as the correlation between background and label increased, standard CNNs' performance plummeted. HEX remained remarkably stable, proving it successfully ignored the background shortcuts.
  • State-of-the-Art on MNIST-Rotation: HEX achieved an average accuracy of 95.8%, outperforming popular methods like DANN (94.3%) and CrossGrad (95.3%).
  • Competitive on PACS: On the difficult PACS dataset, HEX achieved 70.2% average accuracy. This is particularly impressive because HEX does not require "domain labels" (knowing which image belongs to which domain) during training, unlike many of its competitors.
  • Efficiency: The NGLCM component is computationally tiny compared to the rest of the network (e.g., AlexNet), meaning this robustness comes at a very low cost in terms of model complexity.

Limitations and Future Work

While highly effective, the approach has a few limitations. The authors note the potential for Semantic Leakage; if NGLCM accidentally captures some useful semantic information, HEX will project that out too, potentially hurting performance on standard, independent and identically distributed (i.i.d.) data. Additionally, while generally stable, HEX performance can sometimes fluctuate during training, requiring a robust validation set to select the best model.

Currently, the method focuses heavily on texture. Future work could involve designing new modules to capture other types of superficial statistics, such as specific color distributions or lighting conditions, to make models even more universally robust.

Summary updated

Abstract

Despite impressive performance as evaluated on i.i.d. holdout data, deep neural networks depend heavily on superficial statistics of the training data and are liable to break under distribution shift. For example, subtle changes to the background or texture of an image can break a seemingly powerful classifier. Building on previous work on domain generalization, we hope to produce a classifier that will generalize to previously unseen domains, even when domain identifiers are not available during training. This setting is challenging because the model may extract many distribution-specific (superficial) signals together with distribution-agnostic (semantic) signals. To overcome this challenge, we incorporate the gray-level co-occurrence matrix (GLCM) to extract patterns that our prior knowledge suggests are superficial: they are sensitive to the texture but unable to capture the gestalt of an image. Then we introduce two techniques for improving our networks' out-of-sample performance. The first method is built on the reverse gradient method that pushes our model to learn representations from which the GLCM representation is not predictable. The second method is built on the independence introduced by projecting the model's representation onto the subspace orthogonal to GLCM representation's. We test our method on the battery of standard domain generalization data sets and, interestingly, achieve comparable or better performance as compared to other domain generalization methods that explicitly require samples from the target distribution for training.
BibTeX
@inproceedings{wang2019learning,
  author = {Haohan Wang and Zexue He and Zachary C. Lipton and Eric P. Xing},
  title = {{Learning Robust Representations by Projecting Superficial Statistics Out}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
}
Figure