Deep Clustering via Center-Oriented Margin Free-Triplet Loss for Skin Lesion Detection in Highly Imbalanced Datasets

Saban Ozturk, Tolga Cukur

Detecting melanoma—a rare but potentially fatal skin cancer—is a classic "needle in a haystack" problem for machine learning. In typical medical datasets, malignant cases are vastly outnumbered by benign ones. This paper, published by researchers Şaban Öztürk and Tolga Çukur, proposes a shift in strategy: instead of training a model to classify images, we should train it to cluster them using a clever new loss function.

TL;DR

The authors introduce a deep clustering framework for melanoma detection that overcomes extreme class imbalance by maximizing the separation between malignant and benign clusters in a latent space. Their core innovation, the Center-Oriented Margin-Free Triplet Loss (COM-Triplet), uses an adaptive margin to create highly distinct disease clusters, outperforming standard classifiers in both supervised and unsupervised scenarios.

What Problem Does This Paper Address?

Standard deep learning classifiers (using Cross-Entropy loss) are designed to minimize overall error. When a dataset is 98% benign and 2% malignant—as is the case with the ISIC2020 dataset—a model can achieve 98% accuracy simply by guessing "benign" every time. This bias toward the majority class leads to high false-negative rates, which is unacceptable in cancer screening.

While techniques like oversampling or data augmentation help, they often lead to overfitting on the few available minority-class samples. The authors argue that clustering is a more robust proxy for detection because it focuses on the underlying semantic distance between samples rather than just a classification boundary.

Methods

The researchers propose two variants: Supervised Deep Clustering (SDC) and Unsupervised Deep Clustering (UDC). Both rely on a novel loss function:

  • COM-Triplet Loss: Traditional triplet loss forces an "Anchor" image to be closer to a "Positive" image (same class) than a "Negative" image (different class) by a fixed margin ($\alpha$). COM-Triplet improves this in two ways:
  • Global Context: It considers all pairwise distances between the Anchor, Positive, and Negative samples, ensuring clusters are compact and well-separated from each other.
  • Adaptive Margin: Instead of a manually tuned, fixed hyperparameter $\alpha$, the margin is calculated dynamically based on the current distance between cluster centers. This "tuning-free" approach allows the model to adapt as the clusters evolve during training.
  • Unsupervised Variant (UDC): To handle unlabeled data, the model uses a Gaussian Mixture Model (GMM) to generate pseudo-labels for the image embeddings, which then guide the triplet selection process.
  • Inference: Once trained, a new image is embedded into the latent space. The model calculates its distance to the learned "malignant" and "benign" cluster prototypes and assigns a label based on the closest center.

Datasets

The study utilizes three major public dermoscopic image databases:

  1. ISIC2020: 33,126 images (The primary benchmark, featuring a severe 1.76% melanoma rate).
  2. ISIC2019: 25,331 images.
  3. HAM10000: 10,015 images.

The authors specifically analyzed how performance changes as they artificially varied the imbalance ratio from 1:1 (balanced) to 1:60 (highly imbalanced).

Key Insights and Ideas

  • Clustering as a Defense Against Bias: By focusing on maximizing inter-cluster distance rather than minimizing classification error, the model treats the minority class with equal "importance" in the latent space.
  • The Power of Adaptive Margins: Fixed margins in triplet loss often lead to suboptimal performance because they don't account for the natural variance in cluster density. Making the margin a function of the data itself (the distance between $P$ and $N$ samples) significantly stabilizes training.
  • VGG16's Resilience: Interestingly, the authors found that the older VGG16 backbone often outperformed more modern architectures like EfficientNetB3 in this specific clustering task, suggesting that simpler feature extractors might be less prone to overfitting in highly imbalanced medical contexts.

Key Results

  • Superior Accuracy: On the ISIC2020 split test set, the Supervised (SDC) model achieved an AUC of 88.81%, significantly higher than a standard VGG16 classifier (81.11%) and traditional triplet loss (84.42%).
  • Resilience to Imbalance: As the imbalance ratio worsened from 1:1 to 1:60, the AUC of standard classifiers dropped sharply. In contrast, the COM-Triplet model showed a much more gradual decline, maintaining high performance even at extreme ratios.
  • Unsupervised Success: The UDC variant achieved a 70.85% AUC on ISIC2020 without using any ground-truth labels during training, outperforming shallow clustering methods like K-Means (61.87%) and even some supervised baselines.

Limitations and Future Work

  • Binary Focus: The current work focuses on the binary "melanoma vs. benign" problem. Real-world clinical settings involve multi-class diagnosis (e.g., distinguishing between basal cell carcinoma, squamous cell carcinoma, and various benign lesions).
  • Artifact Sensitivity: The paper notes that dermoscopic images often contain artifacts (hair, gel bubbles, scales). While they used center-cropping, integrating explicit artifact removal pre-processing could further boost performance.
  • Computational Overhead: Iterative clustering with GMMs and triplet selection is more computationally intensive than standard single-pass classification, which might impact training time on very large-scale datasets.

Summary updated

Abstract

Melanoma is a fatal skin cancer that is curable and has dramatically increasing survival rate when diagnosed at early stages. Learning-based methods hold significant promise for the detection of melanoma from dermoscopic images. However, since melanoma is a rare disease, existing databases of skin lesions predominantly contain highly imbalanced numbers of benign versus malignant samples. In turn, this imbalance introduces substantial bias in classification models due to the statistical dominance of the majority class. To address this issue, we introduce a deep clustering approach based on the latent-space embedding of dermoscopic images. Clustering is achieved using a novel center-oriented margin-free triplet loss (COM-Triplet) enforced on image embeddings from a convolutional neural network backbone. The proposed method aims to form maximally-separated cluster centers as opposed to minimizing classification error, so it is less sensitive to class imbalance. To avoid the need for labeled data, we further propose to implement COM-Triplet based on pseudo-labels generated by a Gaussian mixture model (GMM). Comprehensive experiments show that deep clustering with COM-Triplet loss outperforms clustering with triplet loss, and competing classifiers in both supervised and unsupervised settings.
BibTeX
@article{ozturk2022deep,
  author = {Saban Ozturk and Tolga Cukur},
  title = {{Deep Clustering via Center-Oriented Margin Free-Triplet Loss for Skin Lesion Detection in Highly Imbalanced Datasets}},
  journal = {IEEE Journal of Biomedical and Health Informatics},
  year = {2022},
  url = {https://openreview.net/forum?id=K8kMR5CdSe},
}

Loading related content...

Figure