Enhancing Contrastive Learning for Ordinal Regression via Ordinal Content Preserved Data Augmentation

Jiyang Zheng, Yu Yao, Bo Han, Dadong Wang, Tongliang Liu

Standard contrastive learning has achieved remarkable success across various computer vision tasks. However, it often falls short in ordinal regression—the task of predicting categories with a natural, inherent order, such as age groups, disease severity levels, or star ratings. The root of this limitation lies in the "strong" data augmentations (like heavy blurring or color jittering) typically employed in contrastive learning. These predefined transformations accidentally erase the subtle, critical features that define ordered categories.

To address this, researchers introduce Ordinal Content Preserved Contrastive Learning (OCP-CL), a generative augmentation framework based on the principle of minimal change. OCP-CL disentangles ordinal content from style, creating diverse training images that strictly preserve the critical information needed for accurate ranking.

The Problem with Standard Augmentations

Unlike standard classification, the differences between adjacent categories in ordinal regression are often incredibly subtle. For instance, in an age estimation task, the distinction between a 50-year-old and a 60-year-old might come down to fine wrinkles or graying hair.

Standard augmentations like Gaussian blur and color jitter can destroy critical ordinal features such as wrinkles and gray hair.

When standard Contrastive Learning (CL) is applied, it relies on strong augmentations to create different views of the same data. However, as illustrated above, these augmentations can be too strong for ordinal datasets. A heavy Gaussian blur might smooth out defining wrinkles, while color jittering might mask gray hair. When the model attempts to find common features between the original and the augmented image, it fails to learn the "ordinal content" because that essential information was destroyed. The standard CL assumption—that the label is invariant to all augmentations—is frequently violated in these scenarios.

Methodology: Disentanglement and Generation

To overcome this "invariance breach," the authors propose replacing predefined geometric or color transforms with a targeted generative approach. OCP-CL creates "strong" augmentations that are guaranteed to keep the ordinal label intact.

The OCP-CL framework utilizes a generative model to disentangle ordinal and non-ordinal latent factors, ensuring the generated augmentations preserve critical category information.

1. Disentanglement via Minimal Change

The core innovation lies in how the generative model (based on StyleGAN2) is trained. The latent space is partitioned into two sets:

  • $z_o$ (Ordinal Factors): Latent variables containing the information necessary to determine the category.
  • $z_n$ (Non-ordinal Factors): Variables controlling "style" (e.g., lighting, background, camera angle).

To ensure true separation, the method applies the principle of minimal change. Using a mask and an $L_1$ sparsity loss, the model is forced to use the smallest possible number of latent factors to represent the ordinal label. If the model can reconstruct the image while only changing a few variables to match the label, those specific variables must contain the "essence" of the ordinal category.

2. Generating Augmentations

Once trained, the generator creates new training views by fixing the ordinal factors ($z_o$) to match the original image's label and randomly sampling new non-ordinal factors ($z_n$). This produces a "counterfactual" image that looks different in style but is identical in its ordinal characteristics.

These generated images then serve as the strong views in a supervised contrastive loss function, acting as a plug-and-play regularization term that can be added to almost any existing ordinal regression model.

Key Results and Performance

The researchers evaluated OCP-CL on three distinct real-world datasets: Adience (facial age estimation), Diabetic Retinopathy (grading disease severity), and SkyFinder (predicting weather conditions).

Tested against five state-of-the-art (SOTA) baselines, OCP-CL consistently improved performance across the board:

  • Accuracy Boost: On the Adience dataset, models saw an accuracy improvement of up to 5.29%.
  • Error Reduction: Mean Absolute Error (MAE) dropped significantly, with an 8.51% reduction on the Adience dataset.
  • Superior Representations: In transfer learning tests, OCP-CL outperformed other contrastive frameworks like SupCon and SupMoCo, proving that the features it learns are more robust and meaningful for downstream tasks.
  • Qualitative Success: Visualizations confirm the model can change a subject's hair color or background while perfectly maintaining the facial features that indicate their specific age group.

Limitations and Future Directions

While highly effective, the method has limitations. Training a high-quality GAN for every new dataset introduces significant computational overhead compared to simple pixel-wise augmentations. Furthermore, the method's success is bottlenecked by the GAN's generative quality; if the generator fails to capture fine-grained details (like specific medical microaneurysms), the preserved content may be insufficient.

Future work may explore extending this framework to non-image data, where traditional augmentation is even harder to define, but generative disentanglement could still provide substantial benefits.

Summary updated

BibTeX
@inproceedings{zheng2024enhancing,
  author = {Jiyang Zheng and Yu Yao and Bo Han and Dadong Wang and Tongliang Liu},
  title = {{Enhancing Contrastive Learning for Ordinal Regression via Ordinal Content Preserved Data Augmentation}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=kx2XZlmgB1},
}
Figure