GraphGuard: Contrastive Self-Supervised Learning for Credit-Card Fraud Detection in Multi-Relational Dynamic Graphs

Kristófer Reynisson, Marco Schreyer, Damian BortharXiv 2024 · DOI

Introduction

Detecting credit card fraud is a persistent challenge for financial institutions, characterized by a constant evolution of tactics. Traditional machine learning approaches, primarily supervised models, face three significant obstacles: extreme class imbalance, where fraudulent transactions are rare; concept drift, as spending patterns and fraud techniques change over time; and verification latency. This latency—the delay between a transaction occurring and its confirmation as fraudulent—often renders supervised models obsolete by the time they are trained on labeled data.

To overcome these hurdles, the authors of "GraphGuard" propose a self-supervised learning (SSL) framework. By focusing on the inherent structural properties of transaction data rather than relying solely on immediate labels, GraphGuard can identify anomalies in real-time using the vast quantities of unlabeled data available to banks.

Methodology

GraphGuard adapts the Contrastive Learning for Anomaly Detection (CoLA) framework for the multi-relational and dynamic nature of financial transactions. The framework operates through three primary phases.

1. Graph Construction

Transactions are represented as nodes in a dynamic graph. Edges are established between transactions that share categorical attributes, such as a common Card ID or Merchant ID. To prevent temporal data leakage (i.e., "looking into the future"), edges are directed from more recent transactions to older ones. This ensures the model only learns from historically available context.

2. Instance Pair Sampling

The core of the contrastive task involves comparing a "target node" against its "local subgraph" (its immediate neighborhood). The model generates:

  • Positive Pairs: The actual target node paired with its true local neighborhood.
  • Negative Pairs: The target node paired with a neighborhood sampled from a different part of the graph.

A critical step in this process is the "anonymization" of the target node's features within the subgraph. By setting these features to zero, the model is forced to learn from the relationships and structural context rather than simply memorizing node-specific attributes.

3. Contrastive Learning

Graph Neural Networks (GNNs), such as Graph Convolutional Networks (GCN) or Relational GCNs (R-GCN), are employed to generate embeddings for both the node and the subgraph. A discriminator then predicts the likelihood that the pair is a "fit." If a transaction's embedding does not align with its neighborhood's pattern, it receives a high anomaly score. The "Secret Sauce" of GraphGuard is its Multi-Relational (MR) augmentation, which allows the model to distinguish between different types of links (e.g., shared card vs. shared merchant), providing a more nuanced understanding of transaction context.

Experimental Evaluation

The researchers evaluated GraphGuard using two datasets:

  1. Real-World Dataset: Approximately 700,000 transactions with a 0.41% fraud rate, provided by an industry partner.
  2. Synthetic Dataset: 1.3 million transactions with a 0.83% fraud rate, generated using the Sparkov tool to benchmark performance across different topological properties.

Key Insights and Results

The study yielded several surprising insights into the nature of graph-based fraud detection:

  • The Dominance of Card ID: In real-world tests, graphs constructed using only Card ID relations significantly outperformed those incorporating Merchant ID relations. This suggests that a cardholder's individual history is a far more reliable signal for fraud than the general activity at a merchant.
  • The Camouflage Problem: The authors found that time-weighted sampling—giving more weight to transactions closer in time—actually decreased performance on real-world data. They hypothesize that because fraudsters often execute "bursts" of transactions, these fraudulent nodes appear very similar to their immediate neighbors, allowing them to "camouflage" within the local subgraph.
  • Structural vs. Attribute Anomaly: By zeroing out target node features, the model effectively identifies structural anomalies—instances where a transaction's position in the network is inherently suspicious regardless of its specific details.

On the real-world dataset, the simplest version of the model (Uni-relational, Card ID only) achieved a PR-AUC of 9.78%. On the synthetic dataset, the full Multi-Relational GraphGuard setup performed better, reaching a PR-AUC of 14.98%.

Conclusion

GraphGuard demonstrates that self-supervised contrastive learning is a powerful tool for credit card fraud detection, particularly in addressing verification latency. While the model's performance is sensitive to graph construction and hyperparameter tuning, its ability to learn from the structural relationships of unlabeled data represents a significant step forward. Future work will investigate semi-supervised hybrids to further enhance detection capabilities by incorporating small amounts of confirmed fraud labels.

Summary updated

BibTeX
@misc{reynisson2024graphguard,
  author = {Kristófer Reynisson and Marco Schreyer and Damian Borth},
  title = {{GraphGuard: Contrastive Self-Supervised Learning for Credit-Card Fraud Detection in Multi-Relational Dynamic Graphs}},
  year = {2024},
  eprint = {2407.12440},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.12440},
}
Figure