TL;DR
Standard machine learning models often rely on spurious visual shortcuts (like background scenery) rather than learning the actual object of interest. GRAMCLUST automatically detects these hidden environments by clustering the Gram matrices of neural features—capturing visual style and texture—and trains a robust classifier on the resulting pseudo-groups. Crucially, it eliminates the need for group annotations during both training and validation, while outperforming existing baselines.
What Problem Does This Paper Address?
When trained with Empirical Risk Minimization (ERM), deep neural networks tend to exploit easy spurious correlations—for example, associating waterbirds with aquatic backgrounds and landbirds with forests. As a result, the model fails when evaluated on underrepresented minority groups (e.g., a waterbird on dry land).
Existing robust optimization frameworks like GroupDRO mitigate this by minimizing worst-case group loss, but they demand ground-truth group labels for every training sample. Recent unsupervised group discovery techniques (such as EIIL, GEORGE, and JTT) remove this training annotation requirement, yet they still rely on an annotated validation set to tune hyperparameters or trigger early stopping. In real-world applications where spurious attributes are unknown or expensive to label, this requirement remains a major roadblock.
Methods
The authors propose GRAMCLUST, a two-stage pipeline requiring zero group annotations:
- Pseudo-Environment Discovery:
- An "identification model" (a VGG-19 pre-trained on ImageNet) is fine-tuned for a single epoch with standard ERM. Because neural networks fit simple spurious correlations first, early representations strongly capture dataset biases.
- For every image, feature Gram matrices—second-order statistics that encode image style and texture rather than semantic content—are extracted from intermediate convolutional layers (specifically
conv5_1). - To make clustering computationally feasible on large datasets, these high-dimensional Gram matrices are projected into a lower-dimensional space using random matrices (Johnson–Lindenstrauss projection) and grouped into $E'$ clusters using $k$-means.
- Pseudo-groups are formed by pairing each discovered pseudo-environment with the ground-truth target class.
- Robust Optimization and Unsupervised Cross-Validation:
- A target classifier (ResNet-50) is trained via GroupDRO over the discovered pseudo-groups.
- For model selection, the authors cluster the validation set using the learned training clusters and select hyperparameters that maximize worst pseudo-group accuracy (
GRAMCLUST-cv).
Images ➔ Early-Trained VGG-19 ➔ Gram Matrices ➔ Random Projection ➔ k-Means ➔ Inferred Pseudo-Groups ➔ GroupDRO Classifier
Datasets
The authors evaluate the approach on three image benchmarks:
- Waterbirds: Bird photos from CUB superimposed on Places365 backgrounds (spuriously correlating bird species with water/land scenes).
- CelebA: Over 200,000 face images used to predict hair color ("blond" vs. "not blond"), which is heavily confounded with gender.
- COCO-on-Places-224: A modified benchmark introduced by the authors based on COCO-on-Places. Segmented MS COCO objects are pasted onto Places365 backgrounds at a native $224 \times 224$ resolution (rebuilt from the original $64 \times 64$ to preserve visual details).
Key Insights and Ideas
- Gram Matrices as Confounder Detectors: Gram matrices have a theoretical connection to Maximum Mean Discrepancy (MMD) with a polynomial kernel. Matching or clustering Gram matrices effectively groups images by feature distribution (lighting, background, texture), which makes them natural proxies for visual environments.
- Full Channel Correlations Matter: Comparing Gram matrices against simpler channel-wise mean and variance (
MeanVar) showed that preserving cross-channel correlations is vital for scaling to complex datasets like CelebA, whereMeanVardropped accuracy by over 8 percentage points. - Beating Ground-Truth Annotations: On Waterbirds, GRAMCLUST actually outperformed GroupDRO trained with true group labels (85.3% vs. 83.9%). Inspection revealed that human-assigned group labels contained confusing edge cases (e.g., images labeled "water" that actually showed dense foliage and sand), whereas Gram-based clustering grouped images strictly by their true visual environment.
Key Results
GRAMCLUST sets a new state of the art among methods that do not use training group annotations:
- Waterbirds: Reaches 85.3% worst-group test accuracy, beating JTT (82.9%), EIIL (78.7%), and standard ERM (65.0%).
- CelebA: Achieves 80.3% worst-group accuracy—a +24.3 point improvement over JTT (56.0%) and +37.9 over ERM (42.4%). EIIL failed to scale to CelebA altogether.
- COCO-on-Places-224: Scores 73.2% on the systematically-shifted test set, outperforming all unannotated baselines (68.5%–71.6%).
- Annotation-Free Tuning: Model selection using pseudo-groups (
GRAMCLUST-cv) proved as effective as—or even better than—tuning against true group labels (GRAMCLUST-orig).
Limitations and Future Work
- Modality Scope: The method explicitly targets visual statistics (texture, background, style) via Gram matrices and VGG architectures; extending this paradigm to text or tabular data is not covered.
- Shortcut Assumption: The identification step assumes that the network captures spurious features within the first epoch of training, which may fail if spurious patterns are more complex than the target class semantics.
- Sensitivity to Cluster Count: Increasing the number of clusters beyond the true number of environments causes a slight drop in validation performance, though it remains competitive with GroupDRO.
Summary updated