Skip to content

This project is an intelligent dashboard designed to help analysts investigate anomalous financial transactions. It uses an IsolationForest model to detect anomalies and a surrogate XGBoost model with SHAP to provide human-readable explanations for why a transaction is flagged as suspicious.

License

Notifications You must be signed in to change notification settings

bagwanmisbah/Transaction-Review-Copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transaction-Review

An interactive and explainable AI dashboard designed to assist financial analysts in detecting, investigating, and managing anomalous transactions.

https://transaction-copilot-misbah.streamlit.app

image image

The Problem

Financial fraud is a massive problem, and analysts often have to sift through thousands of transactions to find suspicious activity. Standard machine learning models can flag transactions but often act as "black boxes," leaving the analyst wondering why a transaction was flagged. This project tackles that problem by not just identifying anomalies but also explaining the reasoning behind each prediction.

Key Features

Intelligent Anomaly Detection: Utilizes an unsupervised IsolationForest model to score and rank millions of transactions by risk, even in a highly imbalanced dataset.

Explainable AI (XAI) Pipeline: Implements a novel surrogate model approach (XGBoost) to enable the use of SHAP, providing clear, human-readable explanations and waterfall plots for each flagged transaction.

Interactive Review Queue: A paginated, user-friendly interface built with Streamlit that allows analysts to efficiently work through a prioritized list of high-risk cases.

Case Management System: A complete analyst workflow with action buttons to mark cases as "Safe," "Fraud," or "Manual Review," which dynamically updates the queue.

Automated Reporting: A feature to export lists of confirmed fraud or manually reviewed cases directly to a downloadable Excel file.

Technology Stack

Language: Python

Machine Learning: Scikit-learn, XGBoost

Explainable AI: SHAP

Data Manipulation: Pandas

Dashboarding: Streamlit

Plotting: Matplotlib

How It Works

The application uses a two-stage model:

An Isolation Forest model first identifies statistical anomalies in the transaction data.

A surrogate XGBoost model, trained to mimic the Isolation Forest, is then used to generate SHAP explanations, providing insight into the "black box" of the primary model.

This entire engine is wrapped in a Streamlit app that provides a user-friendly interface for an analyst to interact with the model's findings.

How to Run Locally

Clone the repository:

git clone https://github.com/bagwanmisbah/Transaction-Review-Copilot.git
cd your-repo

Create and activate a virtual environment:

python -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
Install dependencies:

pip install -r requirements.txt

Run the Streamlit app:

streamlit run app.py

About

This project is an intelligent dashboard designed to help analysts investigate anomalous financial transactions. It uses an IsolationForest model to detect anomalies and a surrogate XGBoost model with SHAP to provide human-readable explanations for why a transaction is flagged as suspicious.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published