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

Introduction

Graph clustering is a fundamental task in network analysis, aiming to partition nodes into disjoint groups without manual supervision. While contrastive learning has emerged as a powerful paradigm for this task—by pulling similar nodes together and pushing dissimilar ones apart—existing methods often fall short. They typically overlook the rich structural information of graphs when identifying "hard" samples and neglect "hard positive" pairs (nodes in the same cluster with low feature similarity).

The Hard Sample Aware Network (HSAN) addresses these limitations by incorporating structural connections into a comprehensive similarity measure and dynamically up-weighting both hard negative and hard positive sample pairs to produce more distinct clusters.

Methodology

The HSAN framework consists of three primary modules: attribute and structure encoding, clustering-based pseudo-labeling, and hard sample aware contrastive learning.

The HSAN architecture integrates attribute and structure encoders with a dynamic weighting mechanism for contrastive learning.

Comprehensive Similarity Measure

Unlike traditional methods that rely solely on node attributes, HSAN utilizes an Attribute Encoder (AE) and a Structure Encoder (SE). By combining attribute and structural embeddings through a learnable trade-off parameter, the model ensures that node "hardness" is evaluated from a holistic perspective.

Dynamic Sample Weighting

The core innovation of HSAN lies in its ability to identify and prioritize informative sample pairs. The model generates pseudo-labels via K-means clustering on current embeddings to guide the weighting process:

  • Hard Positives: Pairs with the same pseudo-label but low similarity are assigned higher weights to strengthen their attraction.
  • Hard Negatives: Pairs with different pseudo-labels but high similarity are up-weighted to increase their repulsion.
  • Easy Samples: High-confidence pairs are down-weighted to focus training on more difficult cases.
Weighting curves for positive and negative sample pairs, showing how weights are adjusted based on similarity scores.

Experimental Evaluation

HSAN was evaluated on six benchmark datasets, including citation networks (CORA, CITE), product networks (AMAP), and air-traffic networks (BAT, EAT, UAT).

Key Results

The model consistently outperformed 13 state-of-the-art baselines across multiple metrics including Accuracy (ACC) and Normalized Mutual Information (NMI). Notable performance gains include:

  • CORA Dataset: Achieved an NMI of 59.21%, representing an 18.99% improvement over the previous best hard-negative mining method (ProGCL).
  • BAT Dataset: Reached 77.15% accuracy, significantly surpassing the runner-up (ARGA at 67.86%).

Visualizations using t-SNE confirm that HSAN produces tighter, more distinct clusters compared to baseline methods, which often exhibit significant overlap between groups.

Conclusion

HSAN demonstrates that treating graph structure as a "first-class citizen" and explicitly mining hard positive pairs are crucial for effective graph clustering. While the current model uses a fixed confidence parameter for pseudo-labeling, future research could explore adaptive mechanisms to further enhance robustness and reduce manual hyper-parameter tuning.

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