Online Deep Clustering for Unsupervised Representation Learning

Xiaohang Zhan, Jiahao Xie, Ziwei Liu, Yew-Soon Ong, Chen Change Loy

Introduction

In computer vision, unsupervised representation learning aims to teach models to understand visual data without human-annotated labels. A prominent approach is Deep Clustering (DC), which iteratively groups features into clusters to generate pseudo-labels for training. However, traditional DC methods suffer from significant instability. As shown in Figure 1, the standard DC pipeline involves alternating between offline clustering and network updates, leading to a "pulsating" training process that hinders steady feature evolution.

Comparison of training pipelines: Deep Clustering (offline) vs. Online Deep Clustering (ODC). ODC enables uninterrupted network updates similar to supervised learning.

The Problem: Instability in Offline Clustering

The primary flaw in traditional Deep Clustering is the "classifier reset." Because clustering happens offline for the entire dataset every epoch, the resulting cluster indices (pseudo-labels) are permuted. A specific visual concept might be assigned "Label 5" in one epoch and "Label 102" in the next. This forces the model's classifier to relearn mappings from scratch repeatedly, causing the training loss to spike at the start of every epoch.

Methods: Online Deep Clustering (ODC)

To address this, the authors propose Online Deep Clustering (ODC). ODC integrates the clustering process directly into the training iterations, allowing labels and network parameters to evolve simultaneously.

Dynamic Memory Modules

ODC utilizes two key components to manage this online process:

  1. Samples Memory: Stores features and pseudo-labels for every image in the dataset.
  2. Centroids Memory: Maintains the mean feature (centroid) for every cluster.

The ODC Training Iteration

During each training batch, the system performs four synchronized steps:

  • Forward Pass: Features are extracted from the current batch.
  • Backpropagation: The model is updated using pseudo-labels retrieved from the Samples Memory.
  • Label Re-assignment: New features are compared against the Centroids Memory to update the sample's pseudo-label.
  • Centroid Update: The corresponding cluster centers are updated incrementally based on the new sample features.

Key Results and Stability

The most immediate benefit of ODC is the stabilization of the training process. As illustrated in Figure 2, the training loss for ODC decreases smoothly, whereas traditional Deep Clustering exhibits massive periodic spikes corresponding to the offline re-clustering steps.

Training loss comparison: Deep Clustering shows "pulsating" instability due to epoch-wise re-clustering, while ODC maintains a smooth, steady descent.

Performance Benchmarks

ODC demonstrates superior performance across various tasks:

  • ImageNet Classification: ODC achieves 57.6% top-1 accuracy on ResNet-50, significantly higher than the 52.2% achieved by DeepCluster.
  • Transfer Learning: On the VOC2007 object detection task, ODC reaches 78.2% mAP, outperforming its offline counterpart by over 9%.
  • Unsupervised Fine-tuning: ODC acts as a powerful fine-tuner for other self-supervised models. For instance, applying ODC to a model pre-trained on rotation prediction boosted its VOC07 score from 67.4% to 74.5%.

Conclusion

Online Deep Clustering transforms the unstable, disjointed process of traditional deep clustering into a smooth, continuous learning paradigm. By leveraging dynamic memory to update labels on the fly, ODC not only improves training stability but also sets a new standard for unsupervised representation learning and downstream task performance.

Summary updated

BibTeX
@inproceedings{zhan2020online,
  author = {Xiaohang Zhan and Jiahao Xie and Ziwei Liu and Yew-Soon Ong and Chen Change Loy},
  title = {{Online Deep Clustering for Unsupervised Representation Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00672},
}
Figure