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.
- 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
| 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) |
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
| 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.