CoolFace
Modelpublic

kvirtue/fwa-gnn-rgcn

sourceHugging Facemitupdated 5mo agoView on Hugging Face
1likes
Model Card

FWA GNN — Relational Graph Convolutional Network for Federal Fraud, Waste & Abuse Detection

A heterogeneous R-GCN trained on a synthetic federal grant/loan entity graph to classify contractor and applicant accounts as fraudulent or legitimate. This model is the Phase 2 artifact of the Federal FWA Research Project.

Model Description

Architecture: RGCN_FWA — a 2-layer Heterogeneous R-GCN built with PyTorch Geometric HeteroConv + RGCNConv.

The model operates on a heterogeneous knowledge graph with 7 node types and 15 edge types (including reverse edges). Classification is performed on Account nodes only.

HyperparameterValue
Hidden dim128
Num layers2
Num bases (RGCNConv)30
Dropout0.3
OptimizerAdam, lr=1e-3 → 5e-4 → 2.5e-4 (step decay)
LossBCEWithLogitsLoss (pos_weight tuned for class imbalance)
Epochs trained132

Graph Schema

Node TypeCountFeatures
Account17,13519 CIO-derived features (see feature_stats.json)
Individual21,4483 dense features
Application32,044Learnable embedding
BankAccount14,725Learnable embedding
Address28,479Learnable embedding
Agency12Learnable embedding
PaymentEvent55,345Learnable embedding

Account node features (19-dim): sharing_peer_count, shared_address_count, app_count_6mo, inc_age_days, shared_address_edges, related_controlled_count, max_owner_biz_count, max_payment_count, max_total_amount, payment_hhi, one-hot business type (5), one-hot status (4).

Fraud Typologies Targeted

IDTypologyDescription
FT-SHELLShell company networkShared agents/principals, reused bank accounts, overlapping ownership
FT-BIDRIGBid rigging / collusionCoordinated bids, geographic partitioning, hidden shared infrastructure
FT-SYNTHSynthetic / assembled identityMixed real/fake attributes, recent-only history
FT-RECONTemporal reconstitutionSame infrastructure after debarment with variable time gap

Each typology is planted at three difficulty tiers: easy (1-hop), medium (2-hop), and hard (3+ hop structural fingerprint).

Training Data

Trained on fwa_graph_v1.pt — a synthetic heterogeneous PyG HeteroData object exported from Salesforce Data Cloud. Ground truth labels come from the Phase 0 synthetic generator (dataset/ground_truth/manifest.json).

SplitTotalFraudFraud %
Train12,0133,08725.7%
Val2,55964725.3%
Test2,56364925.3%
Note: The training set uses cluster-stratified splits to prevent data leakage — entities belonging to the same fraud ring land in the same split.

Evaluation Results

Best checkpoint: epoch 132 (lowest val loss = 0.2057).

MetricVal Set
Val Loss0.2057
Precision0.797
Recall0.983
F10.880
AUROC0.9908
Average Precision0.9721

Training converged with AUROC ≥ 0.99 by epoch ~50, with F1 continuing to improve through epoch 132 via precision gains as recall stabilized near 0.98.

Usage

python
import torch
from model import RGCN_FWA, build_model

# Load the graph
data = torch.load("fwa_graph_v1.pt", weights_only=False)

# Load model weights
model = build_model(data, hidden_dim=128, num_layers=2, num_bases=30, dropout=0.3)
model.load_state_dict(torch.load("model_best.pt", weights_only=True))
model.eval()

# Score Account nodes
with torch.no_grad():
    out = model(data.x_dict, data.edge_index_dict)
    logits = out["Account"].squeeze(-1)          # shape: [num_accounts]
    probs  = torch.sigmoid(logits)               # fraud probability per account

# Default threshold: 0.5
predictions = (probs > 0.5).long()

Feature Normalization

Account features must be z-score normalized before inference using the statistics in feature_stats.json:

python
import json, torch

with open("feature_stats.json") as f:
    stats = json.load(f)

mean = torch.tensor(stats["mean"])
std  = torch.tensor(stats["std"])

# data["Account"].x is raw; normalize before passing to the model
data["Account"].x = (data["Account"].x - mean) / (std + 1e-8)

FWA Synthetic Dataset v1

Synthetic Dataset on Hugging Face

Dataset Description FWA Synthetic Graph v1 is a synthetic knowledge graph representing federal grant and loan program entities with planted fraud typologies, designed for Graph Neural Network (GNN) training and Salesforce Data Cloud identity resolution demonstration.

The dataset models realistic federal assistance program operations including applicants, applications, payments, vendors, and agencies. It contains 925 carefully planted fraud clusters across 4 distinct typologies at 3 difficulty tiers, enabling supervised learning for fraud detection models and comprehensive testing of identity resolution workflows.

Files

FileDescription
model_best.ptBest checkpoint weights (state dict, epoch 132)
model.pyRGCN_FWA class and build_model() convenience constructor
feature_stats.jsonMean/std for 19 Account node features (for z-score normalization)
export_metadata.jsonGraph provenance: node/edge counts, fraud label counts, split stats
requirements.txtPython dependencies (PyTorch 2.11, PyG 2.7)
fwa_graph_v1.pt (the full graph, ~140 MB) is not included here — it is generated from the synthetic dataset and Data Cloud export pipeline. See the project README for reconstruction steps.

Intended Use

  • —Research and demonstration of GNN-based fraud detection on federal grant/loan graphs
  • —Baseline for comparing rule-based CIO signals vs. learned graph representations
  • —Integration with Salesforce Einstein Studio BYOM for on-demand scoring via Apex

Out-of-Scope Use

This model is trained on fully synthetic data and is not intended for production deployment against real federal program data without retraining on real, validated datasets with appropriate privacy controls and fairness audits.

Limitations

  • —Graph is static (no temporal edge streaming)
  • —Hard-tier fraud detection (3+ hop patterns) benefits from AUROC ~0.99 at the graph level but individual-entity precision remains ~0.80 — false positive rate requires analyst review before case creation
  • —Learnable embeddings for node types without dense features (Application, BankAccount, etc.) are not transferable — the model must be retrained if the graph topology changes significantly

Citation

bibtex
@misc{kvirtue2026fwagnn,
  author       = {kvirtue},
  title        = {FWA GNN: Relational Graph Convolutional Network for Federal Fraud Detection},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/kvirtue/fwa-gnn-rgcn}}
}