Class-Attribute Priors: Adapting Optimization to Heterogeneity and Fairness Objective

Xuechen Zhang, Mingchen Li, Jiasi Chen, Christos Thrampoulidis, Samet Oymak

Abstract

In modern machine learning, datasets often exhibit significant heterogeneity, where classes differ in frequency, inherent difficulty, and label noise. Standard optimization techniques typically apply uniform hyperparameters across all categories, leading to suboptimal performance on minority or challenging classes. This paper introduces Class-attribute Priors (CAP), a meta-learning framework that generates class-specific optimization strategies—such as loss weights or logit adjustments—based on high-level class attributes. By mapping attributes to hyperparameters through a shared, low-dimensional function, CAP avoids the overfitting risks associated with individual class tuning. Experiments on long-tailed and noisy datasets, including ImageNet-LT and CIFAR-100-LT, demonstrate that CAP significantly improves both balanced accuracy and fairness metrics.

Introduction

Deep learning models are increasingly deployed in real-world scenarios where data is rarely balanced. The "long-tail" distribution, where a few majority classes dominate the training set while many minority classes have sparse representation, remains a fundamental challenge. Beyond simple frequency imbalances, classes also vary in their "difficulty"—some are naturally more distinct, while others are easily confused or contain higher levels of label noise.

Traditional approaches to this problem involve manual hyperparameter tuning or specialized loss functions. However, as the number of classes ($K$) grows, tuning a unique parameter for every class becomes computationally prohibitive and prone to overfitting on the "tail." This paper presents Class-attribute Priors (CAP), a framework designed to personalize optimization for every class by leveraging shared relationships between class traits and optimal training strategies.

The CAP Framework

The core innovation of CAP is the Attribute-to-Hyperparameter (A2H) function. Instead of treating hyperparameters as independent variables for each class, CAP defines them as a function of a class-attribute vector $A_k$. These attributes can include empirical observations like sample frequency, training difficulty (e.g., average loss), or noise estimates.

Linearized Mapping

To ensure efficiency and robustness, CAP utilizes a linearized mapping: $$S_k = W \cdot \mathcal{F}(A_k)$$ where $S_k$ is the optimization strategy (e.g., a weight in the loss function), $\mathcal{F}$ is a feature transformation, and $W$ is a weight matrix. Because $W$ is shared across all classes, the search space remains constant relative to the number of classes, effectively bypassing the "Curse of K."

Implementation Modes

CAP can be integrated into the machine learning pipeline in two primary ways:

  1. Bilevel Optimization: CAP dynamically learns the optimal weight matrix $W$ on a validation set while the model trains on the training set. This allows the loss function to evolve as the model learns.
  2. Post-hoc Adjustment: CAP can be applied after training to shift the model's logits. This is particularly useful for satisfying specific fairness constraints or accuracy goals without retraining the entire model.

Theoretical Motivation

Through theoretical analysis using a Gaussian Mixture Model (GMM), the authors demonstrate that the optimal margin for any given class is not solely a function of its frequency. Instead, the optimal margin depends on a combination of frequency (how often the class appears) and difficulty (the variance or predictability of the class). This finding justifies the CAP approach of using multiple attributes to inform the optimization strategy, as relying on frequency alone is insufficient in complex, noisy environments.

Experimental Results

CAP was evaluated against state-of-the-art (SOTA) methods on several benchmark datasets designed to test long-tailed and noisy learning.

Performance on Long-Tailed Benchmarks

On ImageNet-LT, which features 1,000 classes and a high imbalance ratio, CAP achieved a balanced error of 49.31%. This outperformed the previous SOTA, AutoBalance (50.91%), and significantly improved upon the standard Cross-Entropy baseline (55.59%). Similar gains were observed on CIFAR-100-LT, where CAP reached a balanced error of 56.38%, compared to 58.21% for standard Logit Adjustment.

Robustness to Noise

When synthetic label noise was added to CIFAR-10-LT, the synergy of attributes became even more apparent. By combining frequency and difficulty attributes, CAP achieved a balanced error of 38.36%, whereas using frequency alone resulted in a higher error of 39.91%. This suggests that CAP successfully identifies when a class is rare versus when it is simply noisy.

Fairness and Tail-End Performance

CAP excels at improving the "worst-case" performance of a model. In post-hoc experiments on CIFAR-100-LT, CAP improved the Quantile Error (the error of the worst 20% of classes) by 18.34%. In contrast, standard logit adjustment actually degraded performance on these metrics in certain configurations, highlighting CAP's flexibility in optimizing for specific fairness objectives like Conditional Value at Risk (CVaR).

Discussion and Limitations

While CAP provides a powerful framework for personalized optimization, its effectiveness depends on the selection of meaningful attributes. Currently, frequency and difficulty are the primary drivers, but more complex attributes like inter-class similarity could further enhance the model. Additionally, CAP assumes a shared meta-strategy across all classes; if a dataset contains extreme outliers that do not follow general attribute-to-hyperparameter trends, the shared mapping might be too restrictive.

Conclusion

Class-attribute Priors (CAP) represent a significant step toward more nuanced and fair machine learning optimization. By moving away from "one-size-fits-all" hyperparameters and leveraging the shared traits of classes, CAP provides a stable, efficient, and highly effective method for tackling data heterogeneity. Future work will explore extending CAP to automate other aspects of the pipeline, such as class-specific data augmentation and regularization strategies.

Summary updated

BibTeX
@inproceedings{zhang2024class,
  author = {Xuechen Zhang and Mingchen Li and Jiasi Chen and Christos Thrampoulidis and Samet Oymak},
  title = {{Class-Attribute Priors: Adapting Optimization to Heterogeneity and Fairness Objective}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i15.29631},
}
Figure