Abstract
Class imbalance has a detrimental effect on the predictive performance of most supervised learning algorithms as the imbalanced distribution can lead to a bias preferring the majority class. To solve this problem, we propose a Supervised Contrastive Learning (SCL) method with Tree-structured Parzen Estimator (TPE) technique for imbalanced tabular datasets. Contrastive learning (CL) can extract the information hidden in data even without labels and has shown some potential for imbalanced learning tasks. SCL further considers the label information based on CL, which also addresses the insufficient data augmentation techniques of tabular data. Therefore, in this work, we propose to use SCL to learn a discriminative representation of imbalanced tabular data. Additionally, the hyper-parameter temperature of SCL has a decisive influence on the performance and is difficult to tune. We introduce TPE, a well-known Bayesian optimization technique, to automatically select the best temperature. Experiments are conducted on both binary and multi-class imbalanced tabular datasets. As shown in the results obtained, TPE outperforms three other hyper-parameter optimization (HPO) methods such as grid search, random search, and genetic algorithm. More importantly, the proposed SCL-TPE method achieves much-improved performance compared with the state-of-the-art methods.
Introduction
Class imbalance—where one class significantly outnumbers others—is a pervasive challenge in machine learning. Standard models often develop a bias toward the majority class, leading to poor predictive accuracy for rare but critical minority samples, such as those found in medical diagnosis or fraud detection.
While Contrastive Learning (CL) has achieved remarkable success in computer vision by learning to group similar images, its application to tabular data is non-trivial. Tabular data lacks the intuitive spatial structures that allow for easy data augmentation (e.g., flipping or rotating). Furthermore, the performance of contrastive models is highly sensitive to the temperature hyper-parameter ($\tau$), which is notoriously difficult to tune manually.
Methodology
The proposed SCL-TPE framework addresses these challenges through a two-stage pipeline that situates Supervised Contrastive Learning within the broader taxonomy of imbalanced learning strategies.
Supervised Contrastive Learning (SCL)
Unlike standard self-supervised contrastive learning, which relies solely on augmented versions of the same data point, SCL leverages label information. It pulls all samples belonging to the same class closer together in the embedding space while pushing samples from different classes apart. This approach effectively uses labels as a substitute for complex tabular data augmentations; even simple techniques like Gaussian blur become effective when the model can leverage actual class labels to define "positives."
Tree-structured Parzen Estimator (TPE)
The temperature parameter ($\tau$) in SCL dictates the "hardness" of the contrastive loss. To optimize this, the authors integrate TPE, a Bayesian optimization technique. TPE models the performance as a probability distribution and intelligently searches for the optimal $\tau$ that minimizes the negative Area Under the Curve (AUC).
Classification
Once the SCL encoder learns a robust, discriminative feature representation, a simple three-layer softmax classifier is trained on these embeddings to perform the final classification task.
Experimental Setup
The method was evaluated on 15 imbalanced tabular datasets from the KEEL and UCI repositories, including 8 binary datasets (e.g., Glass0, Ecoli2) and 7 multi-class datasets (e.g., Glass, Wine). These datasets ranged from 148 to 5,472 samples with varying imbalance ratios.
Results and Discussion
SCL-TPE achieved state-of-the-art results across nearly all benchmarks, consistently outperforming ten popular sampling methods (such as SMOTE and ADASYN) paired with various classifiers.
Key Insights
- Labels as Augmentation Substitutes: Label information compensates for the lack of sophisticated data augmentation in tabular domains. By treating all class members as "positives," the model learns a more robust structure.
- Optimization Efficiency: TPE proved more effective and faster than Grid Search, Random Search, and Genetic Algorithms. By updating a single posterior model, TPE avoids the high computational cost of population-based methods like GA.
- Performance Gains: On the Glass0 dataset, SCL-TPE reached an accuracy of 0.837 and an AUC of 0.842, significantly higher than BSMOTE with MLP. In multi-class scenarios like the Wine dataset, it achieved an accuracy of 0.972, a 2.8% improvement over the runner-up.
Conclusion
SCL-TPE provides a powerful framework for handling imbalanced tabular data by combining discriminative feature learning with automated hyper-parameter optimization. Future work will focus on developing domain-specific tabular augmentations and exploring alternative HPO solvers like HEBO to further enhance efficiency.
Summary updated