Skip to content

RakuJa/AI-Credit-Card-Fraud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Credit-Card-Fraud

Built with

Python Polars scikit-learn Matplotlib NumPy Plotly

Rust github unsafe forbidden

MIT

Simulation software using trained model

Ui

Required dependencies

sudo pacman -Syu libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev

How to run

create a .env file like this.

MODEL_PATH=path/to/model/folder/

The model must be named lgb.txt if lightgbm and model.onnx if onnx

MODEL_PATH=python/model/
RUST_LOG=warn

ONNX

cargo run --release

LightGBM

cargo run --release --features lightgbm

Training

Where to find the dataset

The dataset can be found at https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud and should be downloaded and put inside the /python/dataset/ folder naming the file "data.arff"

How to train

Setup environmental variables to have granular control over the training process. For the first run it's recommended to keep everything enabled

After that run the main.py file.

Results

Overview

Model training results

In depth

Confusion Matrices
Decision Tree Confusion Matrix Random Forest Confusion Matrix
Logistic Regression Confusion Matrix LightGBM Confusion Matrix
AdaBoost Confusion Matrix CatBoost Confusion Matrix
XGBoost Confusion Matrix TabNet Confusion Matrix
Roc Curves
Decision Tree Roc Curve Random Forest Roc Curve
Logistic Regression Roc Curve LightGBM Roc Curve
AdaBoost Roc Curve CatBoost Roc Curve
XGBoost Roc Curve TabNet Roc Curve
Spider Charts
Decision Tree Spider Chart Random Forest Spider Chart
Logistic Regression Spider Chart LightGBM Spider Chart
AdaBoost Spider Chart CatBoost Spider Chart
XGBoost Spider Chart TabNet Spider Chart
Model F1 Score and Time

Model training results

Random Forest, XGBoost and TabNet are the best w.r.t. all the parameters we've chosen.

  • Random Forest: Best F1 score but slow
  • TabNet: Good F1 score, slowest (even using GPU)
  • XGBoost: Good F1 score, fastest

We will choose XGBoost to have a good trade-off between time and F1 score.

Acknowledgments

Code

  • Design by Meru
  • Code by me (RakuJa)

Dataset

The dataset has been collected and analysed during a research collaboration of Worldline and the Machine Learning Group (http://mlg.ulb.ac.be) of ULB (Université Libre de Bruxelles) on big data mining and fraud detection. More details on current and past projects on related topics are available on https://www.researchgate.net/project/Fraud-detection-5 and the page of the DefeatFraud project

Please cite the following works:

Andrea Dal Pozzolo, Olivier Caelen, Reid A. Johnson and Gianluca Bontempi. Calibrating Probability with Undersampling for Unbalanced Classification. In Symposium on Computational Intelligence and Data Mining (CIDM), IEEE, 2015

Dal Pozzolo, Andrea; Caelen, Olivier; Le Borgne, Yann-Ael; Waterschoot, Serge; Bontempi, Gianluca. Learned lessons in credit card fraud detection from a practitioner perspective, Expert systems with applications,41,10,4915-4928,2014, Pergamon

Dal Pozzolo, Andrea; Boracchi, Giacomo; Caelen, Olivier; Alippi, Cesare; Bontempi, Gianluca. Credit card fraud detection: a realistic modeling and a novel learning strategy, IEEE transactions on neural networks and learning systems,29,8,3784-3797,2018,IEEE

Dal Pozzolo, Andrea Adaptive Machine learning for credit card fraud detection ULB MLG PhD thesis (supervised by G. Bontempi)

Carcillo, Fabrizio; Dal Pozzolo, Andrea; Le Borgne, Yann-Aël; Caelen, Olivier; Mazzer, Yannis; Bontempi, Gianluca. Scarff: a scalable framework for streaming credit card fraud detection with Spark, Information fusion,41, 182-194,2018,Elsevier

Carcillo, Fabrizio; Le Borgne, Yann-Aël; Caelen, Olivier; Bontempi, Gianluca. Streaming active learning strategies for real-life credit card fraud detection: assessment and visualization, International Journal of Data Science and Analytics, 5,4,285-300,2018,Springer International Publishing

Bertrand Lebichot, Yann-Aël Le Borgne, Liyun He, Frederic Oblé, Gianluca Bontempi Deep-Learning Domain Adaptation Techniques for Credit Cards Fraud Detection, INNSBDDL 2019: Recent Advances in Big Data and Deep Learning, pp 78-88, 2019

Fabrizio Carcillo, Yann-Aël Le Borgne, Olivier Caelen, Frederic Oblé, Gianluca Bontempi Combining Unsupervised and Supervised Learning in Credit Card Fraud Detection Information Sciences, 2019

Yann-Aël Le Borgne, Gianluca Bontempi Reproducible machine Learning for Credit Card Fraud Detection - Practical Handbook

Bertrand Lebichot, Gianmarco Paldino, Wissam Siblini, Liyun He, Frederic Oblé, Gianluca Bontempi Incremental learning strategies for credit cards fraud detection, IInternational Journal of Data Science and Analytics

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors