Temporal and Relational Graph Neural Networks for Fraud Detection in Transaction Networks
Abstract
Financial fraud in credit card and bank transactions remains a significant challenge, as traditional detection systems often struggle to keep pace with evolving fraudulent strategies. This paper addresses the problem by formulating fraud detection as a supervised link prediction task in transaction networks, with the contribution positioned as a task-specific integration of temporal encoding, edge-level attributes, graph message passing, and relation-specific decoding rather than a new standalone GNN operator. We introduce a graph neural network (GNN) framework that integrates temporal encoding, edge-aware message passing, and a relation-specific decoder, trained using weighted binary cross-entropy as the main objective, with focal loss evaluated as an alternative imbalance-aware objective in the ablation study. Extensive experiments on two benchmark datasets, the ULB Credit Card Fraud dataset (ULB) and a heterogeneous Bank Transaction dataset, demonstrate that the proposed model achieves the strongest performance among the evaluated classical machine learning, homogeneous GNN, and heterogeneous GNN baselines. The ULB dataset is modeled as an induced temporal-context graph because raw entity identifiers are unavailable, whereas the bank transactions dataset is modeled as an observed heterogeneous entity-relation graph. On ULB, the model attains an F1 of 0.901, an AUROC of 0.990, and an AUPRC of 0.901. On the bank transactions dataset, it reaches an F1 of 0.914, an AUROC of 0.992, and an AUPRC of 0.966. Cross-dataset evaluations confirm strong generalization, with F1 up to 0.854 (ULB $\rightarrow$ bank) and 0.874 (bank $\rightarrow$ ULB). Ablation studies reveal that temporal encoding, edge attributes, and relation-specific decoding each contribute significantly to performance. Moreover, scalability analysis reveals near-linear offline inference growth within the evaluated edge range, indicating computational feasibility for moderate-scale transaction graphs. Overall, the proposed framework offers a robust, efficient, and transferable GNN-based solution for detecting link-based fraud in financial systems.