Cross-Domain Graph Anomaly Detection via Test-Time Training with Homophily-Guided Self-Supervision
Delaram Pirhayati, Arlei Silva
TL;DR
This work tackles cross-domain graph anomaly detection when labeled anomalies are scarce and feature spaces differ across domains. It introduces GADT3, a test-time training framework that adapts to the target domain by learning a target-specific encoder with a frozen source decoder, guided by a homophily-based self-supervised loss and reinforced by Normal Structure-preserved Attention Weighting (NSAW) and domain-specific encoders. A class-aware regularization term addresses extreme label imbalance, and an adaptive early-stopping criterion ensures stable adaptation without target labels. Theoretical guarantees show monotonic improvement in anomaly separation during test-time training, and empirical results across six datasets and large-scale graphs demonstrate substantial improvements over state-of-the-art baselines, highlighting the approach’s privacy-preserving, scalable applicability to cybersecurity and other cross-domain anomaly tasks.
Abstract
Graph Anomaly Detection (GAD) has demonstrated great effectiveness in identifying unusual patterns within graph-structured data. However, while labeled anomalies are often scarce in emerging applications, existing supervised GAD approaches are either ineffective or not applicable when moved across graph domains due to distribution shifts and heterogeneous feature spaces. To address these challenges, we present GADT3, a novel test-time training framework for cross-domain GAD. GADT3 combines supervised and self-supervised learning during training while adapting to a new domain during test time using only self-supervised learning by leveraging a homophily-based affinity score that captures domain-invariant properties of anomalies. Our framework introduces four key innovations to cross-domain GAD: an effective self-supervision scheme, an attention-based mechanism that dynamically learns edge importance weights during message passing, domain-specific encoders for handling heterogeneous features, and class-aware regularization to address imbalance. Experiments across multiple cross-domain settings demonstrate that GADT3 significantly outperforms existing approaches, achieving average improvements of over 8.2\% in AUROC and AUPRC compared to the best competing model.
