Skip to content

Anomaly Detection via Contrastive Learning on Graph using Embedding

Jul 2026 · International journal of software engineering and knowledge engineering · 0 citations

TL;DR

A graph embedding-based error detection method via contrastive learning that treats each triple as a hyper-node, enabling data-driven modeling of semantic consistency and integrates a semantic matching-based scoring mechanism with a contrastive learning-based scoring mechanism.

Abstract

Errors in graph-structured data introduce significant noise, severely constraining the performance of downstream tasks. Existing anomaly detection methods face the dual challenges of unknown error patterns and scarce annotated data. Traditional rule-based approaches suffer from poor generalizability, while embedding-based methods, which typically generate negative samples via random substitution, struggle to capture complex error types that are semantically related yet structurally incorrect. To address these issues, this paper proposes a graph embedding-based error detection method via contrastive learning. Specifically, the method first establishes a complementary shared view through structural linking rules. Departing from traditional node-centric modeling paradigms, it treats each triple as a hyper-node, enabling data-driven modeling of semantic consistency. Subsequently, we design local and global semantic-aware encoding modules. These modules not only leverage Bidirectional Gated Recurrent Units (Bi-GRU) to model the local semantic structure of triples, but also employ attention mechanisms to mitigate the negative propagation of potential errors at the global level. Finally, by integrating a semantic matching-based scoring mechanism with a contrastive learning-based scoring mechanism, our model can jointly evaluate the internal self-consistency of triples with complex relational patterns and their external consistency. In addition, our experimental results on two open-source datasets demonstrate that the proposed method outperforms or ranks second to existing state-of-the-art baselines in error detection tasks, exhibiting strong validity and performance.

View source

Similar papers

Book Open access Jul 2026

Retrieval-Augmented Contrastive Learning for Dynamic Graph Anomaly Detection

Detecting anomalous nodes in continuously evolving graphs without labeled supervision requires representations that capture both local temporal context and globally consistent normal behavior—a combination that current methods do not jointly address. Existing dynamic anomaly detectors rely on localized temporal neighborhoods and cannot leverage globally similar normal patterns elsewhere in the graph, while existing retrieval-augmented graph methods either require labels or do not enforce strict temporal causality during retrieval. We propose DGRA-CL (Dynamic Graph Retrieval-Augmented Contrastive Learning), an unsupervised framework that learns discriminative temporal node representations for anomaly detection without labeled data. DGRA-CL transforms dynamic graphs into temporal sequences, employs time- and context-aware contrastive learning to learn normal node behavior patterns, retrieves similar normal exemplars from a training pool under a strict causality constraint, and fuses them via similarity-weighted aggregation to construct baseline representations. Anomalies are detected via deviation-based scoring measuring distance from these normal baselines. On four real-world dynamic graphs, DGRA-CL achieves statistically significant AUC gains of 1–2 points over the strongest baselines on three of four benchmarks (UCI Messages, Bitcoin-Alpha, Digg) and competitive performance on Reddit, while operating without anomaly labels and generalizing to unseen nodes.

Kamal Berahmand, S. Forouzandeh, Mehrnoush Mohammadi et al. · 2 citations
Open access Aug 2026

TGPA: Transferable graph prompt attack with hierarchical subgraph augmentation.

A novel transferable graph prompt attack, called TGPA, is proposed, which shifts the attack paradigm by introducing a hierarchical structural decoupling mechanism, which reduces the performance of pre-trained graph models with graph prompts by up to 28.9%, while guaranteeing robustness, stealthiness, and transferability.

Ju Jia, Haonan Wang, Tian Wu et al. · 0 citations
Open access Aug 2026

Generate and Filter: A GNN-Based Approach for Graph Anomaly Detection.

A novel framework, Generate and Filter graph learning for Graph Anomaly Detection (GFGAD), which generates a diverse set of synthetic anomalies with enriched feature and structural information to balance the data distribution and significantly outperforms state-of-the-art baselines.

Mengyu Li, Yonghao Liu, Ximing Li et al. · 0 citations
Book Open access Aug 2026

CR-Aug: Community Risk-Guided Adaptive Augmentation for Semi-supervised Graph Anomaly Detection

Recently, semi-supervised graph anomaly detection (GAD) has garnered increasing attention under a challenging setting where only a limited number of normal nodes are labeled during training. To better exploit the limited normal supervision and compensate for the absence of real anomaly labels, existing methods often adopt a single, uniform anomaly modeling and pseudo-anomaly generation strategy applied across the entire graph, while overlooking the inherent heterogeneity among communities in graph data. Consequently, the generated pseudo-anomalies exhibit limited diversity and specificity, failing to represent the complex distributions of real-world anomalies. To address this challenge, we propose CR-Aug, a novel Community Risk-Guided Adaptive Augmentation framework, which is designed to overcome this limitation by leveraging community-specific prior knowledge more effectively. It comprises two core components: Community Risk Profiling (CRP) and Risk-Guided Synthesis (RGS). Specifically, CRP quantifies community-level risks by measuring the affinity discrepancy between the labeled normal subset and the overall community. Guided by the derived risk scores, RGS then dynamically adapts the generation process through risk-weighted sampling and adaptive mixing. This strategy facilitates the synthesis of diverse pseudo-anomalies, thereby providing the classifier with more discriminative supervisory signals. Extensive experiments on multiple benchmark datasets demonstrate that CR-Aug significantly outperforms state-of-the-art semi-supervised GAD methods, validating the effectiveness of incorporating community-level risk profiles.

Jing Huang, Yicun Liu, Zhixin Li et al. · 0 citations
Open access Aug 2026

Local anomaly detection via subgraph embedding on multivariate data streams

This study addresses the crucial challenge of local anomaly detection in multivariate data streams, which is essential for applications such as fault detection and damage localization in industrial contexts. Traditional approaches often neglect two critical aspects: the significance of relational features in assessing similarity and the necessity of pinpointing specific data streams that exhibit abnormal patterns. To address these gaps, we introduce a novel subgraph embedding-based method. Our approach constructs dynamic graphs to model relational features and identifies anomalies by detecting subgraphs within these graphs. The core innovation lies in an entropy-based transformer integrated with an autoencoder, which maps subgraphs into a low-dimensional space to effectively discriminate abnormal subgraphs. Experiments on EEG and industrial datasets show that the proposed model achieves average F1-score improvements of 0.07 and 0.105 over the compared baselines, respectively. The results indicate that entropy-based subgraph embedding can improve local anomaly detection performance, although the model does not achieve the best value for every metric on every dataset.

Gen Li, Jason J. Jung · 0 citations