Anomaly Detection via Contrastive Learning on Graph using Embedding
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.