Contrastive Deep Nonnegative Matrix Factorization For Community Detection

Yuecheng Li, Jialong Chen, Chuan Chen, Lei Yang, Zibin Zheng

TL;DR

The paper introduces Contrastive Deep Nonnegative Matrix Factorization (CDNMF), a novel community detection algorithm that combines Deep NMF with graph contrastive learning. By jointly modeling network topology and node attributes while filtering out false negative samples, CDNMF captures both hierarchical and community-level structures, significantly outperforming state-of-the-art methods on real-world graph datasets.

What Problem Does This Paper Address?

Community detection (CD) is the task of partitioning a network into groups of densely connected nodes. Nonnegative Matrix Factorization (NMF) has become a popular tool for this because its mathematical properties align naturally with community membership, offering excellent interpretability.

However, traditional NMF-based methods suffer from three major limitations:

  1. Shallow Architectures: They typically rely on a single or double-layer mapping, making it difficult to capture the complex, hierarchical structures found in real-world networks.
  2. Topology Bias: They often focus exclusively on the network's connections (topology) while completely ignoring node attributes (e.g., text features in a citation network).
  3. Localized Focus: They excel at finding similarities between immediate neighbors but struggle to capture global, community-level structural information.

The authors propose CDNMF to address all three challenges simultaneously.

Methods

CDNMF integrates deep matrix factorization with a dual-view contrastive learning framework. The architecture consists of three main components:

The general framework of Contrastive Deep Nonnegative Matrix Factorization (CDNMF).
  1. Deep NMF (DNMF) Layer: Instead of a shallow factorization, the authors stack multiple NMF layers to decompose both the network adjacency matrix ($A$) and the node attribute matrix ($X$). This deep structure allows the model to learn hierarchical representations at different abstraction levels.
  2. Debiased Negative Sampling Layer: In standard contrastive learning, negative samples are chosen randomly. However, in community detection, a randomly selected node might actually belong to the same community as the anchor node (a false negative). CDNMF uses the intermediate node representations to generate "pseudo-labels," ensuring that negative samples are only drawn from entirely different communities.
  3. Graph Contrastive Learning Layer: The model treats network topology and node attributes as two distinct "views" of the same network. It maximizes the representation similarity of the same node across both views (positive pairs) while minimizing the similarity between nodes from different pseudo-labeled communities (negative pairs).

The entire pipeline is optimized jointly using a combined loss function that balances reconstruction errors, graph regularization, and contrastive loss.

Datasets

The authors evaluated their model on three widely used public citation network benchmarks:

  • Cora: 2,708 nodes, 5,429 edges, 7 classes (communities).
  • Citeseer: 3,327 nodes, 4,732 edges, 6 classes.
  • PubMed: 19,717 nodes, 44,338 edges, 3 classes.

In these datasets, nodes represent documents, edges represent citations, and node attributes represent unique word vectors.

Key Insights and Ideas

  • The Power of Depth: Deepening the NMF architecture allows the model to learn multi-level organizational principles. Early layers capture local community structures, while deeper layers capture broader, global relationships.
  • Fixing the "False Negative" Trap: Standard contrastive learning can inadvertently penalize a model for pulling together nodes that belong to the same community. By introducing a debiased sampling layer based on pseudo-labels, the authors successfully expand the embedding distance between different communities without disrupting intra-community cohesion.
  • Dual-View Synergy: Network topology tells you who is talking to whom, while node attributes tell you what they are talking about. Combining them via contrastive learning ensures the model doesn't get fooled by anomalous links or noisy attribute data.

Key Results

The authors compared CDNMF against 12 state-of-the-art methods, including shallow NMF variants, network embedding methods (like Node2Vec), and deep learning approaches (like VGAER). Performance was measured using Accuracy (ACC) and Normalized Mutual Information (NMI).

Community detection performance with ACC and NMI on three datasets.

CDNMF achieved the best performance across almost all metrics. For example, on the Cora dataset, CDNMF achieved an ACC of 0.6081, substantially outperforming the closest deep NMF baseline, DANMF (0.5499).

Ablation studies confirmed that utilizing both topology ($A$) and attributes ($X$) yields significantly better results than relying on a single view alone:

Results of ablation experiments based on Cora and Citeseer.

Additionally, convergence analysis demonstrated that the fine-tuning stage of the model stabilizes rapidly, typically within 20 epochs.

The analysis of the convergence rate of our algorithm.

Limitations and Future Work

While the paper demonstrates strong empirical results, it does not deeply explore the computational complexity or scalability of stacking multiple NMF layers alongside MLPs for massive, billion-scale graphs. The authors note that a promising future direction is to explore how this contrastive framework can be integrated with other advanced matrix factorization variants.

Summary updated

BibTeX
@inproceedings{li2024contrastive,
  author = {Yuecheng Li and Jialong Chen and Chuan Chen and Lei Yang and Zibin Zheng},
  title = {{Contrastive Deep Nonnegative Matrix Factorization For Community Detection}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10446107},
}
Figure