A Tale of Two Classes: Adapting Supervised Contrastive Learning to Binary Imbalanced Datasets

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Mildenberger, David, Hager, Paul, Rueckert, Daniel, Menten, Martin J
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917964587991040
author Mildenberger, David
Hager, Paul
Rueckert, Daniel
Menten, Martin J
author_facet Mildenberger, David
Hager, Paul
Rueckert, Daniel
Menten, Martin J
contents Supervised contrastive learning (SupCon) has proven to be a powerful alternative to the standard cross-entropy loss for classification of multi-class balanced datasets. However, it struggles to learn well-conditioned representations of datasets with long-tailed class distributions. This problem is potentially exacerbated for binary imbalanced distributions, which are commonly encountered during many real-world problems such as medical diagnosis. In experiments on seven binary datasets of natural and medical images, we show that the performance of SupCon decreases with increasing class imbalance. To substantiate these findings, we introduce two novel metrics that evaluate the quality of the learned representation space. By measuring the class distribution in local neighborhoods, we are able to uncover structural deficiencies of the representation space that classical metrics cannot detect. Informed by these insights, we propose two new supervised contrastive learning strategies tailored to binary imbalanced datasets that improve the structure of the representation space and increase downstream classification accuracy over standard SupCon by up to 35%. We make our code available.
format Preprint
id arxiv_https___arxiv_org_abs_2503_17024
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle A Tale of Two Classes: Adapting Supervised Contrastive Learning to Binary Imbalanced Datasets
Mildenberger, David
Hager, Paul
Rueckert, Daniel
Menten, Martin J
Machine Learning
Computer Vision and Pattern Recognition
Supervised contrastive learning (SupCon) has proven to be a powerful alternative to the standard cross-entropy loss for classification of multi-class balanced datasets. However, it struggles to learn well-conditioned representations of datasets with long-tailed class distributions. This problem is potentially exacerbated for binary imbalanced distributions, which are commonly encountered during many real-world problems such as medical diagnosis. In experiments on seven binary datasets of natural and medical images, we show that the performance of SupCon decreases with increasing class imbalance. To substantiate these findings, we introduce two novel metrics that evaluate the quality of the learned representation space. By measuring the class distribution in local neighborhoods, we are able to uncover structural deficiencies of the representation space that classical metrics cannot detect. Informed by these insights, we propose two new supervised contrastive learning strategies tailored to binary imbalanced datasets that improve the structure of the representation space and increase downstream classification accuracy over standard SupCon by up to 35%. We make our code available.
title A Tale of Two Classes: Adapting Supervised Contrastive Learning to Binary Imbalanced Datasets
topic Machine Learning
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2503.17024