Decoupling Anomaly Discrimination and Representation Learning: Self-supervised Learning for Anomaly Detection on Attributed Graph

Yanming Hu, Chuan Chen, Bowen Deng, Yujing Lai, Hao Lin, Zibin Zheng, Jing Bian

Introduction

Detecting anomalies in attributed graphs—networks where nodes possess specific features, such as social networks or citation indices—presents a unique set of challenges. Traditional Graph Neural Networks (GNNs) are inherently designed as "low-pass filters," which tend to smooth the features of a node with those of its neighbors. This "semantic mixture" often causes anomalies, which may be structurally connected to many normal nodes, to be buried within the feature space of the majority. Furthermore, the scarcity of labeled anomalies and the extreme class imbalance in real-world datasets make supervised learning impractical.

The DSLAD Framework

To address these issues, the authors propose DSLAD (Decoupled Self-supervised Learning for Anomaly Detection). The core philosophy of DSLAD is the separation of representation learning from the specific task of anomaly discrimination. By decoupling these objectives, the model prevents the joint optimization process from being dominated by the majority patterns of normal nodes.

The DSLAD architecture decouples the GNN-based representation learning from the anomaly discriminator, using a dynamic weighting strategy to balance the two tasks.

The framework consists of four primary modules:

  1. Discrimination Pair Sampling: Generates positive pairs (node and local neighborhood) and negative pairs (node and random neighborhood) to facilitate contrastive learning.
  2. GNN-Based Embedding: Utilizes a GCN encoder to map nodes into a low-dimensional space and a GCN autoencoder for attribute reconstruction.
  3. Anomaly Discrimination: Computes two complementary scores: a Context Anomaly score (measuring neighborhood fit via bilinear pooling) and a Reconstruction Anomaly score (measuring feature uniqueness via a masked autoencoder).
  4. Contrastive Representation Learning: Employs an InfoNCE loss to ensure the GNN learns high-quality, discriminative features independently of the noisy anomaly signals early in training.

A critical innovation is the dynamic weighting function, $\pi(\beta)$. At the onset of training, the model prioritizes general representation learning to establish a stable feature map. As training matures, the focus shifts toward the anomaly discrimination task, allowing the model to identify outliers within a well-defined feature space.

Experimental Evaluation

The model was rigorously tested on six benchmark datasets: citation networks (Cora, Citeseer, Pubmed, ACM) and social networks (BlogCatalog, Flickr). Following standard protocols, synthetic anomalies—both attribute-based (feature swapping) and structural (clique creation)—were injected to evaluate detection performance.

DSLAD consistently outperformed state-of-the-art baselines, including CoLA, DOMINANT, and SL-GAD. Notably, on the Flickr dataset, DSLAD achieved an ROC-AUC of 0.8631, representing a significant improvement over the previous best of 0.7966.

Key Insights and Visualization

The success of DSLAD stems from resolving the "GNN Contradiction." While standard GNNs assume neighbors are similar (assortativity), anomalies inherently break this rule. By decoupling the learning process, DSLAD avoids forcing anomalies to conform to the features of their normal neighbors.

t-SNE visualization of the learned feature space, demonstrating that DSLAD effectively clusters anomalies (red stars) into distinguishable groups, separating them from the normal nodes (blue dots).

As shown in the t-SNE visualization, DSLAD creates a clear margin between normal and abnormal nodes. Unlike previous methods where anomalies remained scattered and mixed, DSLAD’s decoupled approach allows for the formation of distinct anomaly clusters. This separation power was further validated using the Wasserstein distance to measure the gap between the score distributions of the two classes.

Conclusion

DSLAD represents a significant advancement in self-supervised graph anomaly detection. By prioritizing representation learning and gradually introducing discrimination, the framework overcomes the semantic mixture problem that plagues traditional GNN-based detectors. Future research may focus on refining hyperparameter sensitivity and extending the framework to handle naturally occurring, large-scale anomalies in real-world production environments.

Summary updated

BibTeX
@article{hu2024decoupling,
  author = {Yanming Hu and Chuan Chen and Bowen Deng and Yujing Lai and Hao Lin and Zibin Zheng and Jing Bian},
  title = {{Decoupling Anomaly Discrimination and Representation Learning: Self-supervised Learning for Anomaly Detection on Attributed Graph}},
  journal = {Data Sci. Eng.},
  year = {2024},
  doi = {10.1007/s41019-024-00249-8},
}
Figure