Optimizing Transformations for Contrastive Learning in a Differentiable Framework

Camille Ruppli, Pietro Gori, Roberto Ardon, Isabelle Bloch

Introduction

Contrastive learning has emerged as a cornerstone of self-supervised representation learning. The paradigm relies on teaching a model that two different "views" (augmentations) of the same image should have similar representations, while views of different images should be distinct. However, the efficacy of this approach is heavily contingent on the choice of transformations. If transformations are too subtle, the task is trivial and the model learns little; if they are too aggressive, they may remove the very features (such as a small tumor in a medical image) that the model needs to identify.

This paper introduces a differentiable framework that moves beyond the traditional "trial and error" approach of hand-picked, random augmentations. By automatically optimizing image transformations, the authors provide a principled way to challenge the model without destroying essential semantic information.

Methodology

The core of the proposed system is a Transformation Network ($M$) that works alongside a standard contrastive encoder ($f$). The process follows a specific pipeline:

  1. The Transformation Network ($M$): This network receives an image and outputs a set of parameters ($\Lambda$). These parameters are specific to that individual image, allowing for instance-specific augmentation.
  2. Differentiable Transformations ($T$): To allow gradients to flow from the loss function back to the transformation network, the authors formulated standard operations—such as cropping, rotation, Gaussian blur, and flips—to be fully differentiable.
  3. Adversarial Optimization: The system is trained using a coupled optimization strategy. The transformation network $M$ attempts to find transformations that minimize mutual information (making the contrastive task harder), while a small amount of supervision (10% labels) ensures the transformed images remain classifiable.
  4. The Encoder ($f$): The primary model is optimized to solve both the contrastive task and the classification task simultaneously, learning robust features in the process.

Experimental Setup and Results

The study focused on medical imaging, a domain where expert labels are expensive and scarce. The authors utilized the BraTs MRI dataset (34,000 slices) and a Chest X-ray dataset (11,200 images). They compared their semi-supervised approach (using only 10% labels) against standard baselines and fully supervised models.

Key Findings

  • Surpassing Full Supervision: On both datasets, the proposed model trained with only 10% labels achieved a higher Area Under the Curve (AUC) than a fully supervised model trained on 100% of the labels.
  • Outperforming SimCLR: On the BraTs dataset, the optimized framework reached an AUC of 0.887, significantly outperforming the standard SimCLR baseline, which reached an AUC of 0.730 using random transformations.
  • The Role of Supervision: The 10% supervision acts as a critical "guardrail." Without it, the transformation network might "cheat" by blurring an image into a featureless gray square to minimize mutual information. The labels force the network to keep the pathological features intact.

Discussion and Interpretability

One of the primary advantages of this framework is its interpretability. Because the transformations are parameterized (e.g., specific crop coordinates or rotation angles), the "hard" views generated by the network are easily understood by humans. This is a significant improvement over generative adversarial (GAN) based augmentations, which can often produce unrealistic or uninterpretable artifacts.

While the addition of the transformation network $M$ increases training time by approximately 20-25%, the authors argue this is a negligible cost compared to the massive gains in accuracy and the drastic reduction in the human labor required for labeling.

Limitations and Future Work

Despite its success, the framework currently uses a fixed order of transformations (e.g., blur followed by crop). Future research could explore optimizing the sequence of operations. Additionally, while the current study focuses on 2D slices, extending the differentiable framework to 3D volumes—common in MRI and CT scans—is a logical next step. Finally, the authors suggest that incorporating pseudo-labels or clustering could potentially reduce the required supervision even further below the 10% threshold.

Summary updated

BibTeX
@inproceedings{ruppli2022optimizing,
  author = {Camille Ruppli and Pietro Gori and Roberto Ardon and Isabelle Bloch},
  title = {{Optimizing Transformations for Contrastive Learning in a Differentiable Framework}},
  booktitle = {MILLanD @ MICCAI},
  year = {2022},
  doi = {10.1007/978-3-031-16760-7\_10},
}
Figure