How tanishk-dot/federated-fraud-detection works
Federated Fraud Detection trains a shared temporal-graph fraud model across simulated banks while keeping raw transactions local, with optional client-level differential privacy and encrypted aggregation. The user-facing workflow runs from the React dashboard through its API client to FastAPI for inference, data testing, training, and simulation; offline training is also exposed through the training runner. Data is loaded or encoded into transaction sequences, scored by the model, and evaluated or displayed. The README documents additional comparison and privacy-utility capabilities. Some backend routes and training internals were only partially sampled, so uncertain connections are omitted.
Main entry points: run_training.py Training orchestrator · temporal_graph_transformer.py Temporal graph model · main.py FastAPI service · client.py Bank client
Components 19
Web dashboard
- Dashboard routes
frontend/src/App.tsx - Workflow pages
frontend/src/pages - API client
frontend/src/api.ts
API and inference
- FastAPI service
backend/main.py - Metrics and results
backend/main.py
Model and data
- Feature encoding
src/data/feature_engineering.py - Federated datasets
src/data/dataset.py - Temporal graph model
src/models/temporal_graph_transformer.py - Temporal encoder
src/models/temporal_transformer.py - Graph encoder
src/models/graph_encoder.py - Cross-modal fusion
src/models/fusion.py - Contrastive head
src/models/contrastive_head.py
Federated training
- Training orchestrator
run_training.py - Bank client
src/federated/client.py - DP utilities
src/federated/dp_utils.py - Privacy accounting
src/federated/dp_accounting.py - Homomorphic encryption
src/federated/homomorphic_encryption.py - Proxy server
src/federated/proxy_server.py
Other components
- Dashboard user
Connections 22
- Dashboard user → Dashboard routes: uses
frontend/src/App.tsx - Dashboard routes → Workflow pages: routes to
frontend/src/App.tsx - Workflow pages → API client: requests
frontend/src/pages/Overview.tsx - API client → FastAPI service: calls HTTP API
frontend/src/api.ts - FastAPI service → Feature encoding: encodes transactions
backend/main.py - FastAPI service → Temporal graph model: runs inference
backend/main.py - FastAPI service → Training orchestrator: starts training
backend/main.py - FastAPI service → Metrics and results: serves results
backend/main.py - Training orchestrator → Temporal graph model: trains model
run_training.py - Training orchestrator → Homomorphic encryption: aggregates encrypted updates
run_training.py - Training orchestrator → Proxy server: uses proxy
run_training.py - Training orchestrator → Privacy accounting: tracks privacy
run_training.py - Bank client → Temporal graph model: trains locally
src/federated/client.py - Bank client → Federated datasets: loads client data
src/federated/client.py - Bank client → DP utilities: uses DP
src/federated/client.py - Federated datasets → Training orchestrator: supplies training data
README.md - Temporal graph model → Temporal encoder: uses encoder
src/models/temporal_graph_transformer.py - Temporal graph model → Graph encoder: uses encoder
src/models/temporal_graph_transformer.py - Temporal graph model → Cross-modal fusion: fuses modalities
src/models/temporal_graph_transformer.py - Temporal graph model → Contrastive head: scores anomalies
src/models/temporal_graph_transformer.py - Proxy server → Homomorphic encryption: uses encryption
src/federated/proxy_server.py - Training orchestrator → Bank client: coordinates clients