Source-linked AI summary

Towards Cross-domain Few-shot Graph Anomaly Detection

Jiazhen Chen, Sichao Fu, Zhibin Zhang, Zheng Ma, Mingbin Feng, Tony S. Wirjanto, Qinmu Peng

arXiv:2410.08629v1cs.LG

TL;DR

Cross-domain few-shot GAD seeks to detect anomalies in a sparsely labeled target graph despite distribution differences from a related source graph. CDFS-GAD combines graph contrastive learning, domain-specific prompts, a domain-adaptive hypersphere loss, and self-training. The authors report superior performance across cross-domain pairs and few-shot conditions compared with existing GAD methods.

  • Problem

    Few-shot GAD methods often assume auxiliary and target graphs share a distribution, while cross-domain shifts and sparse target labels complicate anomaly detection.

    Source: §I · p. 2
  • Method

    CDFS-GAD combines domain-adaptive graph contrastive learning, domain-specific prompt tuning, a domain-adaptive hypersphere loss, and self-training.

    Source: §I · p. 2
  • Results

    Experiments on twelve cross-domain pairs under varying few-shot conditions report superior performance over existing GAD methods.

    Source: §I · p. 3
  • Takeaways & Limitations

    The authors report that the integrated components enhance target-domain detection accuracy under few-shot constraints.

    Source: §IV · p. 10

Abstract

from arXiv · show

Few-shot graph anomaly detection (GAD) has recently garnered increasing attention, which aims to discern anomalous patterns among abundant unlabeled test nodes under the guidance of a limited number of labeled training nodes. Existing few-shot GAD approaches typically adopt meta-training methods trained on richly labeled auxiliary networks to facilitate rapid adaptation to target networks that possess sparse labels. However, these proposed methods often assume that the auxiliary and target networks exist in the same data distributions-an assumption rarely holds in practical settings. This paper explores a more prevalent and complex scenario of cross-domain few-shot GAD, where the goal is to identify anomalies within sparsely labeled target graphs using auxiliary graphs from a related, yet distinct domain. The challenge here is nontrivial owing to inherent data distribution discrepancies between the source and target domains, compounded by the uncertainties of sparse labeling in the target domain. In this paper, we propose a simple and effective framework, termed CDFS-GAD, specifically designed to tackle the aforementioned challenges. CDFS-GAD first introduces a domain-adaptive graph contrastive learning module, which is aimed at enhancing cross-domain feature alignment. Then, a prompt tuning module is further designed to extract domain-specific features tailored to each domain. Moreover, a domain-adaptive hypersphere classification loss is proposed to enhance the discrimination between normal and anomalous instances under minimal supervision, utilizing domain-sensitive norms. Lastly, a self-training strategy is introduced to further refine the predicted scores, enhancing its reliability in few-shot settings. Extensive experiments on twelve real-world cross-domain data pairs demonstrate the effectiveness of the proposed CDFS-GAD framework in comparison to various existing GAD methods.

I. INTRODUCTION

Cross-domain few-shot GAD uses limited target labels alongside labeled data from a related source domain, but domain shifts and label scarcity complicate knowledge transfer. CDFS-GAD combines domain-adaptive representation learning, target-specific modeling, and self-training; experiments report superior performance across twelve cross-domain pairs.

I. INTRODUCTION

  • Prior few-shot GAD methods often assume auxiliary and target networks share a distribution, while cross-domain methods can lack direct target supervision.The paper notes that acquiring enough same-domain labels can be costly and challenging.Source: §I · p. 2
  • Domain shifts in graph structure, attributes, and anomaly distributions, together with scarce target labels, complicate transfer from a related source domain.The setting aims to use limited target-domain labels to guide adaptation.Source: §I · p. 2
  • CDFS-GAD combines contrastive learning and domain-specific prompts with a domain-adaptive hypersphere loss and self-training for cross-domain few-shot detection.The framework targets shared and domain-specific features while using limited target labels.Source: §I · p. 2
  • The paper presents cross-domain few-shot GAD as a new problem setting and reports superior performance on twelve cross-domain pairs under varying few-shot conditions.The comparison is against existing GAD methods.Source: §I · pp. 2–3

II. METHOD

The method formulates cross-domain few-shot GAD on attributed source and target graphs, using labels from both domains to rank target nodes. Its pipeline combines a shared graph encoder with domain-specific feature preprocessing and further adaptation modules.

A. Problem Formulation

  • The problem is defined on attributed source and target graphs, with full source labels and only a limited labeled subset in the target domain.The target subset includes labeled anomalies; the remaining target nodes are unlabeled.Source: A. Problem Formulation · p. 3
  • The model assigns each target node an anomaly score, ranking anomalous nodes higher and normal nodes lower.The objective uses labeled data from both domains.Source: A. Problem Formulation · p. 3

B. Overview

  • CDFS-GAD jointly trains on labeled data from both domains, then applies contrastive learning, domain-specific prompts, a domain-adaptive hypersphere loss, and pseudo-label self-training.The contrastive module aligns cross-domain features and refines within-domain normality representations.Source: B. Overview · p. 3

1) Encoder:

  • A shared GraphSAGE encoder receives domain-specific initial node representations produced by separate MLP preprocessors.The separate preprocessors address differences in feature dimensionality and distribution across domains.Source: 1) Encoder · pp. 3–4

2) Domain-Adaptive Contrastive Learning:

The domain-adaptive contrastive module uses unlabeled data to improve normal-node representations within each graph and align representations across domains. It combines node-to-graph contrasts within a domain with graph-level contrasts between domains.

2) Domain-Adaptive Contrastive Learning:

  • The module uses abundant unlabeled data to improve majority-normal node representations and align domains despite their feature discrepancies.It is designed to reduce the risk that training only on scarce labels limits generalization.Source: 2) Domain-Adaptive Contrastive Learning · p. 4
  • Within each domain, node representations are contrasted with their graph-level representations; corrupted node representations provide negative pairs.The graph embedding aggregates node embeddings, and the corrupted features are generated by shuffling node features across the graph.Source: 2) Domain-Adaptive Contrastive Learning · p. 4
  • Across domains, positive pairs use source and target graph representations, while negative pairs contrast the target graph with a corrupted source representation.This graph-level contrast avoids requiring direct node mappings between domains.Source: 2) Domain-Adaptive Contrastive Learning · p. 4

16 Compute anomaly score for the nodes in Gt

The contrastive-learning objective includes source-domain learning to balance training across the two domains.

  • Inter- and intra-domain contrastive learning is also applied to the source domain to balance learning across both domains.Source: §16 · p. 4

3) Domain-Specific Prompt Learning:

Domain-specific prompts are added to a shared encoder to capture domain-unique information while retaining domain-invariant feature learning.

3) Domain-Specific Prompt Learning:

1) Domain Adaptive Graph Anomaly Detection:

The method uses hypersphere classification to separate normal and anomalous nodes, adapting its center to the distinct anomaly distributions of each domain.

1) Domain Adaptive Graph Anomaly Detection:

2) Self-Training:

CDFS-GAD uses score-based pseudo-labels to refine training, and evaluates across cross-domain pairs built from four review and e-commerce datasets.

2) Self-Training:

  • Self-training selects pseudo-anomalous and pseudo-normal nodes by score percentiles to form a dataset for model refinement.Source: 2) Self-Training · p. 5
  • The selected pseudo-labels retrain the model with hypersphere classification loss, and final anomaly scores are computed using Eq. 8.Source: 2) Self-Training · p. 5

A. Datasets

  • The experiments use YelpHotel, YelpRes, YelpNYC, and Amazon, covering hotel, restaurant, and e-commerce reviews.Source: A. Datasets · p. 5
  • The four datasets are paired into twelve cross-domain pairs spanning different degrees of similarity, including transitions across cities, service sectors, and e-commerce.Source: A. Datasets · pp. 5–6

B. Implementation Details

CDFS-GAD generally outperforms the compared methods across cross-domain pairs, with stronger results on relatively similar Yelp pairs and a marginal decline on Amazon pairs. Its comparison with meta-GDN highlights the value of adapting to both shared and domain-specific information.

B. Implementation Details

C. Baselines and Evaluation Metrics

  • The comparison covers eight methods across unsupervised, semi-supervised, few-shot, and cross-domain GAD, with different methods using different combinations of source- and target-domain labels.Meta-GDN uses disjoint source-graph subgraphs as auxiliary networks; SemiGNN and ANEMONE-FS use target-domain labeled data.Source: C. Baselines and Evaluation Metrics · p. 6

D. Comparison Study

  • CDFS-GAD generally outperformed other methods across 12 pairs, with evident gains on similar Yelp pairs and a marginal decline on Amazon-involving pairs.The paper relates the stronger Yelp results to domain similarities and the Amazon decline to differences in anomaly generation and service industry.Source: D. Comparison Study · p. 7
  • CDFS-GAD surpassed meta-GDN, whose same-domain assumption for auxiliary and target networks does not fit the cross-domain setting.The authors attribute CDFS-GAD’s advantage to components that capture both domain-invariant and domain-specific information.Source: D. Comparison Study · p. 7
  • Unsupervised methods generally trailed ACT, while meta-GDN often did better than both; SemiGNN and ANEMONE-FS were not consistently strong with few-shot labels.The authors attribute the latter methods’ underperformance to loss functions less robust in extremely label-scarce settings than meta-GDN’s deviation network.Source: D. Comparison Study · p. 7

E. Evaluation under Different Shots

CDFS-GAD remains comparatively stable across shot settings and outperforms meta-GDN, while target-only methods lag particularly in one-shot evaluation. Ablations indicate that prompt learning, contrastive learning, both-domain supervision, the domain-adaptive hypersphere loss, and self-training each contribute to performance.

E. Evaluation under Different Shots

  • CDFS-GAD consistently outperformed meta-GDN across K-shot settings, while target-only SemiGNN and ANEMONE-FS lagged especially in one-shot evaluation.The paper links relative stability of CDFS-GAD and meta-GDN to cross-domain labels and anomaly detectors designed for few-shot settings.Source: E. Evaluation under Different Shots · pp. 7–8

F. Ablation Study

  • Removing domain-specific prompt learning or intra-domain contrastive learning reduced performance, while removing both contrastive components impaired representation of shared and domain-specific features.The authors note that domain-specific anomaly attributes remain important alongside domain-invariant information.Source: F. Ablation Study · p. 8
  • Replacing the domain-adaptive hypersphere loss with separate domain-specific centers reduced performance; the authors credit the additional domain-invariant center with greater detection flexibility.This design uses both within-domain and cross-domain information to identify anomalies.Source: F. Ablation Study · p. 8
  • Removing source-domain supervision or self-training reduced performance, and the authors say retraining on confident predictions helps mitigate few-shot overfitting.The self-training variant uses joint-learning predictions from labeled source and target data.Source: F. Ablation Study · p. 8

G. Parameters Sensitivity

CDFS-GAD’s AUC-ROC is relatively stable across tested hyperparameter settings, although the basis count matters more for the YelpRes–Amazon pair. Its embeddings separate normal and anomalous nodes more clearly than those of meta-GDN and ACT, and the conclusion reports superior performance across domain pairs and few-shot conditions.

G. Parameters Sensitivity

  • CDFS-GAD remained relatively stable in AUC-ROC across tested hyperparameter settings, with an optimal self-training band around β1 = 0.03 and β2 = 0.25.The authors report that α performs moderately worse at either extreme and that larger m is more beneficial for the YelpRes–Amazon domain gap.Source: G. Parameters Sensitivity · p. 9

H. t-SNE Visualization

  • CDFS-GAD embeddings separated anomalous and normal nodes more clearly than meta-GDN and ACT embeddings in the one-shot visualization.The t-SNE account identifies orange points as anomalous and blue points as normal.Source: H. t-SNE Visualization · p. 9

IV. CONCLUSION

  • The conclusion presents CDFS-GAD as the first investigation of cross-domain few-shot GAD and reports superior performance across domain pairs and few-shot conditions.It describes combining domain-adaptive contrastive learning and prompt tuning with a domain-adaptive hypersphere loss and self-training.Source: §IV · pp. 9–10
Loading 2410.08629v1…