Final-year research project

Explainable Credit Card Fraud Detection

A free, browser-hosted showcase for testing an XGBoost fraud model, reviewing evaluation results, and explaining decisions on an imbalanced credit-card transaction dataset.

Live static inference Loading model... Runs entirely in your browser. No paid API. No paid GPU. No server-side inference.

Single transaction

Score a transaction

CSV workflow

Batch score transactions

Upload a CSV with `Time`, `Amount`, and `V1` through `V28`. If the file includes `Class` or `y_true`, the batch summary reports precision and recall.

Held-out test set

Evaluation dashboard

Model comparison

Cross-validation folds

XGBoost classification report


        

XAI layer

Feature importance and explanations

Global SHAP importance

XGBoost gain importance

Dataset

European cardholder transactions

The dataset contains 284,807 transactions made by European cardholders over two days in September 2013. There are 492 fraud cases, so fraud accounts for only 0.172% of all records.

Method

Feature engineering and XGBoost

The raw PCA features are combined with time and amount transformations: hour, day, cyclic hour features, log amount, zero-amount flag, scaled time, and scaled amount.

Metric choice

PR-AUC over raw accuracy

Because the classes are highly imbalanced, the project emphasizes AUPRC, precision, recall, F1, and MCC instead of relying on plain accuracy.

Free hosting

Static Hugging Face Space

This deployed version uses the free Static Space SDK. The model runs in the browser from the exported XGBoost JSON file, so no paid Gradio CPU, paid GPU, hosted database, or external inference endpoint is required.

Hugging Face rejected free Gradio CPU creation for this account with a payment-required response, so the app was converted to a static browser implementation to honor the no-paid-services requirement.