Hard Sample Aware Network for Contrastive Deep Graph Clustering

Yue Liu, Xihong Yang, Sihang Zhou, Xinwang Liu, Zhen Wang, Ke Liang, Wenxuan Tu, Liang Li, Jingcan Duan, Cancan Chen · DOI

Introduction

Deep graph clustering is a fundamental task in unsupervised graph representation learning, aiming to partition nodes into distinct groups without manual labels. While contrastive learning has emerged as a dominant paradigm—relying on pulling positive pairs together and pushing negative pairs apart—current state-of-the-art methods suffer from two critical limitations. First, they often overlook the graph's topological structure when determining node similarity, relying primarily on node attributes. Second, they typically focus on "hard negatives" (dissimilar nodes in different clusters) while neglecting "hard positives" (dissimilar nodes within the same cluster). This neglect hinders the model's ability to establish robust cluster boundaries.

Methodology: The HSAN Framework

The Hard Sample Aware Network (HSAN) addresses these gaps through a comprehensive similarity measure and a dynamic weight modulating function.

The HSAN framework consists of attribute and structure encoding, clustering for pseudo-label generation, and a hard-sample aware contrastive loss.

Comprehensive Similarity Measure

HSAN calculates node similarity ($S$) by integrating both attribute and structure embeddings. By using a learnable linear combination weighted by a parameter $\alpha$, the model effectively balances the node's content with its position in the graph's topology.

Weight Modulating Function

The core innovation of HSAN is its difficulty-aware weighting strategy. Using high-confidence pseudo-labels generated via K-means clustering on the learned embeddings, the model identifies potential positive and negative pairs. A modulating function ($M$) then adjusts the learning signal:

  • Hard Positives: Pairs in the same cluster with low similarity are up-weighted to encourage tighter clustering.
  • Hard Negatives: Pairs in different clusters with high similarity are up-weighted to enforce separation.
  • Easy Samples: Well-separated or well-clustered pairs are down-weighted to focus training on more informative samples.

This logic is integrated into a modified infoNCE loss, where a focusing factor $\beta$ (typically between 1 and 2) controls the intensity of the weighting.

Experimental Evaluation

The authors evaluated HSAN against 13 state-of-the-art methods across six benchmark datasets, including citation networks (CORA, CITE), e-commerce graphs (AMAP), and air traffic networks (BAT, EAT, UAT).

Performance comparison of HSAN against state-of-the-art deep graph clustering methods across various metrics and datasets.

Key Results

HSAN consistently outperformed competing models across all metrics, including Accuracy (ACC), Normalized Mutual Information (NMI), Adjusted Rand Index (ARI), and F1 score.

  • Performance Gains: On the CORA dataset, HSAN achieved an accuracy of 77.07%, significantly surpassing the previous best hard-sample mining method, GDCL (70.83%).
  • Robustness: The framework demonstrated strong performance on smaller, noisier datasets like BAT, indicating that the weighting strategy effectively filters noise and prioritizes meaningful relationships.
  • Visual Clarity: t-SNE visualizations confirmed that HSAN produces more distinct and compact clusters compared to baseline methods like DAEGC or SDCN.

Conclusion and Future Work

HSAN demonstrates that explicitly mining both hard positives and hard negatives, while incorporating structural information, leads to superior graph clustering performance. A current limitation is the reliance on a fixed confidence threshold ($\tau$) for pseudo-labeling. Future research will explore dynamic or learnable thresholds to further enhance the model's adaptability across diverse graph structures.

Summary updated

BibTeX
@inproceedings{liu2023hard,
  author = {Yue Liu and Xihong Yang and Sihang Zhou and Xinwang Liu and Zhen Wang and Ke Liang and Wenxuan Tu and Liang Li and Jingcan Duan and Cancan Chen},
  title = {{Hard Sample Aware Network for Contrastive Deep Graph Clustering}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i7.26071},
}
Figure