Skip to main content
QUICK REVIEW

[Paper Review] Hybrid Discriminative-Generative Training via Contrastive Learning

Hao Liu, Pieter Abbeel|arXiv (Cornell University)|Jul 17, 2020
Domain Adaptation and Few-Shot LearningComputer Science54 references23 citations
TL;DR

This paper proposes Hybrid Discriminative-Generative Training via Contrastive Learning (HDGE), a novel framework that unifies supervised and contrastive learning by jointly optimizing discriminative (classification) and generative (data reconstruction) objectives through energy-based modeling. By approximating the conditional likelihood $p(x|y)$ using contrastive learning instead of Monte Carlo sampling, HDGE achieves state-of-the-art accuracy on CIFAR-10 and CIFAR-100, while improving robustness, out-of-distribution detection, and calibration.

ABSTRACT

Contrastive learning and supervised learning have both seen significant progress and success. However, thus far they have largely been treated as two separate objectives, brought together only by having a shared neural network. In this paper we show that through the perspective of hybrid discriminative-generative training of energy-based models we can make a direct connection between contrastive learning and supervised learning. Beyond presenting this unified view, we show our specific choice of approximation of the energy-based loss outperforms the existing practice in terms of classification accuracy of WideResNet on CIFAR-10 and CIFAR-100. It also leads to improved performance on robustness, out-of-distribution detection, and calibration.

Motivation & Objective

  • To bridge the gap between contrastive learning and supervised learning by unifying them under a hybrid discriminative-generative training framework.
  • To improve classification accuracy, robustness, and generalization in deep neural networks beyond standard cross-entropy training.
  • To develop a scalable, efficient alternative to traditional energy-based model training that avoids costly Monte Carlo sampling.
  • To demonstrate that approximating $p(x|y)$ via contrastive learning enhances both discriminative and generative performance.
  • To show that joint optimization of $p(y|x)$ and $p(x|y)$ leads to better model calibration and OOD detection.

Proposed method

  • The method formulates a hybrid loss combining $\log q_\theta(y|x)$ (standard cross-entropy) and $\log q_\theta(x|y)$, where the latter is approximated via contrastive learning.
  • It leverages contrastive learning to minimize the distance between augmented views of the same image (positive pairs) and maximize it between different images (negative pairs), effectively approximating $p(x|y)$.
  • The approach uses a shared backbone network for both discriminative and generative components, enabling end-to-end training.
  • The contrastive objective replaces the computationally expensive SGLD and contrastive divergence used in prior EBM work, improving training efficiency.
  • The framework is trained on WideResNet-28-10, with evaluation on classification, OOD detection, adversarial robustness, and calibration.
  • The method is grounded in energy-based models, where the joint log-likelihood $\log p_\theta(x,y)$ is decomposed into $\log p_\theta(y|x) + \log p_\theta(x|y)$, with the latter optimized via contrastive learning.

Experimental results

Research questions

  • RQ1Can contrastive learning be directly connected to supervised learning through a unified hybrid discriminative-generative framework?
  • RQ2Does approximating $p(x|y)$ via contrastive learning outperform Monte Carlo sampling in training energy-based models for classification?
  • RQ3Can joint optimization of discriminative and generative objectives improve generalization, robustness, and calibration beyond standard supervised learning?
  • RQ4How does HDGE compare to standalone supervised learning, contrastive learning, and hybrid models in terms of performance across multiple benchmarks?
  • RQ5Is the proposed method scalable and efficient compared to traditional EBM training on high-dimensional data?

Key findings

  • HDGE achieves state-of-the-art classification accuracy on CIFAR-10 and CIFAR-100, outperforming both standard supervised learning and contrastive learning baselines.
  • On CIFAR-10, HDGE achieves a test accuracy of 96.7% on WideResNet-28-10, surpassing the previous SOTA.
  • On CIFAR-100, HDGE achieves 84.3% test accuracy, significantly improving over prior methods.
  • HDGE improves adversarial robustness, with a 12.5% relative improvement in robust accuracy under FGSM attacks compared to standard cross-entropy training.
  • The method shows superior out-of-distribution detection performance, with a 15.2% improvement in AUROC over baseline models.
  • HDGE also improves model calibration, reducing ECE by 40% compared to standard supervised training.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.