Skip to content

A realtime fraud detection model trained on the IEEE-CIS Fraud Detection dataset using XGBoost & Streamlit

Notifications You must be signed in to change notification settings

architasaha21/Detective.AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Detective.AI – Real-Time Fraud Detection System

Detective.AI is a machine learning-powered web application that detects fraudulent transactions in real-time. Trained on the IEEE-CIS Fraud Detection dataset, this app leverages XGBoost, SMOTE, and Streamlit to deliver fast and reliable predictions based on transaction data.

πŸš€ Features

  • Predicts fraudulent vs legitimate transactions
  • User-friendly Streamlit interface
  • XGBoost model with SMOTE to handle class imbalance
  • Custom preprocessing pipeline (label encoding, scaling)
  • Interactive form inputs for simulation

🧠 Model Details

Component Description
Model XGBoost Classifier
Preprocessing SMOTE Oversampling, Label Encoding
Input Features TransactionAmt, card1, card2, addr1, addr2, P_emaildomain, ProductCD_W, card4_visa, card6_credit, M6_T, etc.
Target Variable isFraud (Binary Classification)

πŸ“ Project Structure

Detective.AI/
β”‚
β”œβ”€β”€ models/ # All serialized ML assets
β”‚ β”œβ”€β”€ fraud_detection_model.joblib
β”‚ β”œβ”€β”€ model_columns.joblib
β”‚ └── email_encoder.joblib
β”‚
β”œβ”€β”€ app.py # Main Streamlit app
β”œβ”€β”€ requirements.txt # Project dependencies
└── README.md # You're reading it 

πŸ§ͺ Model Evaluation

Classification Report

Class Precision Recall F1-Score Support
0 (Legitimate) 0.98 0.98 0.98 113,952
1 (Fraudulent) 0.54 0.54 0.54 4,154
Accuracy 0.97 118,106
Macro Avg 0.76 0.76 0.76 118,106
Weighted Avg 0.97 0.97 0.97 118,106

🚨 Note: While the model achieves high overall accuracy, the recall for fraudulent transactions (class 1) is moderate. This is expected due to the imbalanced nature of the dataset. Techniques like SMOTE have been applied to mitigate this.

About

A realtime fraud detection model trained on the IEEE-CIS Fraud Detection dataset using XGBoost & Streamlit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages