Skip to content

Anti-Money Laundering detection model that leverages a pipeline based on Graph Neural Networks to identify sophisticated fraud patterns, combined with a Contextual Multi-Armed Bandit to adapt to evolving financial crime behaviors.

Notifications You must be signed in to change notification settings

flod6/FinTech_Assignment2_FlorianDahlbender

Repository files navigation

FinTech: Business Models and Applications — Assignment 2 | Florian Dahlbender

ComplAI AML Solutions

ComplAI is a modular FinTech solution that detects accounts involved in money laundering by leveraging Graph Neural Networks (GNNs) and Contextual Multi-Armed Bandits (CMABs) to identify suspects in real time. Implementing the GNN enables the exploitation of information in transaction networks, while the CMAB's online learning capability allows it to adapt to new and evolving money laundering patterns.

Features

Data Simulation

  • Data generator to simulate transactions
  • Generator to model the transactions in graph structure
  • Two real-world money laundering patterns (layering and smurfing)

GNN Layer

  • Pretrained GNN model using unsupervised learning
    • GraphSAGE architecture for capturing local graph structure (An alternative model capable of directly processing edge attributes was also tested, but GraphSAGE outperformed it and was therefore used for the MVP.)
    • Trained with Deep Graph Infomax for unsupervised node representation learning
  • Leverages transactions represented in a graph structure
  • Embeddings generator for each account

MAB Layer

  • Pretrained CMAB model trained
    • Thompson Sampling CMAB algorithm to make decisions
    • Trained through online learning
  • Classification by leveraging the embeddings

ComplAI UI Pipeline

  • User interface using new simulated data and graphs
  • Automatic generation of embeddings and predictions on simulated data
  • Dashboard to investigate suspicious accounts and make decisions
  • CMAB online learning by updating the pretrained model based on the decisions made during the investigation
  • Monitoring tool to assess the performance of the last update as well as the overall model performance

Requirements

Tech Stack

  • Programming Language:
    • Python 3.12
  • Front End:
    • Streamlit (UI)
  • Back End & ML:
    • torch (GNN)
    • torch_geometric (GNN)
    • mabwiser (CMAB)
    • scikit-learn (Model Evaluation)
  • Utilities:
    • pandas (Data Processing)
    • numpy (Data Processing)
    • matplotlib (Data Visualization)
    • networkx (Graph Creation)

Project Structure

complai/
├── Data/                      
│   ├── Processed/                        # Contains all data and graphs used for model training
│   └── Application_Data/                 # Contains the history of investigated accounts and the logo
│ 
├── Model_Development/          
│   ├── data_simulations.py               # Generator for synthetic transaction data
│   ├── train_GNN.py                      # GNN training script
│   ├── train_MAB.py                      # CMAB training script
│   ├── Models/                           # Stores the pretrained model
│   └── utils/
│       ├── utils_data_prep.py            # Utility functions for data generation
│       ├── utils_train_GNN.py            # Utility functions to train the GNN
│       └── utils_train_online_MAB.py     # Utility functions to train the MAB online
│
├── Application/
│   ├── main.py                           # Script to run the app
│   ├── app.py                            # Streamlit front end for the app
│   └── utils/                 
│       └── utils_app.py                  # Utility functions for the app backend
│
├── requirements.txt                      # Libraries and packages used for the MVP
└── README.md                             # Project Documentation

Installation Guide

  1. Clone the Repository
git clone https://github.com/flod6/FinTech_Assignment2_FlorianDahlbender.git
cd FinTech_Assignment2_FlorianDahlbender
  1. Create new Environment
conda create -n complai_env python=3.12
conda activate complai_env
  1. Install Requirements
pip install -r requirements.txt
  1. Install torch and torch_geometric manually, as the version depends on the user's system
  1. Run the Application
cd FinTech_Assignment2_FlorianDahlbender/Application
streamlit run app.py

Or run the file Application/main.py directly in the python editor.

Academic Context

This MVP was built as part of an academic assignment for the course FinTech: Business Models & Applications (BM26BAM), for the academic program MSc Business Analytics & Management, at Rotterdam School of Management, Erasmus University.

Future Outlook

  • Train the models on real transaction data
  • Improve GNN architecture and fine-tuning under a supervised setting
  • Integrate with banking software and extend the pipeline to other departments

Keywords

FinTech, AML, Graph Neural Networks, Multi Armed Bandit

Disclaimer

This is an educational project with simulated data and hypothetical predictions.

License

© 2025 Florian Dahlbender. © 2025 Florian Dahlbender. Licensed under the MIT License. You are free to use, modify, and distribute this software for personal or commercial purposes, provided you include the original copyright and license.

Maintainer: Florian Dahlbender | MSc BAM | RSM

About

Anti-Money Laundering detection model that leverages a pipeline based on Graph Neural Networks to identify sophisticated fraud patterns, combined with a Contextual Multi-Armed Bandit to adapt to evolving financial crime behaviors.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages