πŸ’³ Credit Card Fraud & Anomaly Detection System

An interactive, production-ready Machine Learning Web Application built with Streamlit to detect fraudulent credit card transactions in real-time based on transformed PCA features and transaction metrics.

Live App


πŸ–ΌοΈ Application Preview & UI

Credit Card Fraud Detection UI

Interactive Streamlit dashboard designed with business-friendly feature inputs, fault-tolerant logic, and instant fraud probability metrics.


πŸ”— Live Application

You can access and test the deployed application directly here: πŸ‘‰ Click Here to Launch Live Demo


πŸ–ΌοΈ Key Features & Capabilities

  • User-Friendly Interface: Business-oriented feature labels replacing raw mathematical PCA names ($V1$–$V5$) for seamless user experience.
  • Smart Decision Dashboard: Clear status classification (Legitimate vs. Fraudulent), Risk Levels, and Model Confidence Score ($0-100%$) instead of raw binary values ($0/1$).
  • Fault-Tolerant Pipeline: Robust exception handling ensuring that the UI renders smoothly even if dependencies or .pkl files are missing.
  • High Accuracy Benchmarks: Powered by high-precision ensemble tree classifiers trained on transaction risk patterns.

πŸ“Š Model Evaluation & Benchmarks

Multiple classification algorithms were evaluated to handle high variance and anomaly patterns. Here is the comparative accuracy metric across models:

Model Name Accuracy Score Status
Random Forest Classifier πŸ† 0.980 (98.0%) Selected Model
Extra Trees Classifier πŸ† 0.980 (98.0%) Top Performer
K-Neighbors Classifier 0.980 (98.0%) Top Performer
XGBoost Classifier 0.980 (98.0%) Top Performer
AdaBoost Classifier 0.975 (97.5%) High Precision
Decision Tree Classifier 0.970 (97.0%) Baseline
Gradient Boosting Classifier 0.970 (97.0%) Baseline

Selected Baseline: The Random Forest Classifier achieved 98.0% accuracy with reliable probability estimation for risk grading.


βš™οΈ Model Features & Input Parameters

UI Parameter Name Feature Code Description / Domain Context
Transaction Timestamp Time Elapsed time in seconds since the first dataset transaction
Transaction Behavior Factor 1 V1 Primary PCA vector for transaction behavior patterns
Account Activity Vector 2 V2 PCA vector capturing account usage variations
Security Risk Index 3 V3 PCA vector measuring security variance
Anomalous Pattern Score 4 V4 PCA vector identifying spending behavior anomalies
Location/Device Metric 5 V5 PCA vector for contextual transaction parameters
Transaction Amount Amount Total monetary value of the transaction ($)
Target Output Class 0 = Legitimate Transaction, 1 = Fraudulent

πŸ“ Repository Structure

β”œβ”€β”€ credit_card_fraud_synthetic.csv     # Primary Transaction Dataset
β”œβ”€β”€ model.ipynb                         # Data Preprocessing, EDA & Model Training
β”œβ”€β”€ .gitignore                          # Git Ignore Rules
β”œβ”€β”€ .gitattributes                      # Git LFS Configuration
β”œβ”€β”€ app.py                              # Fault-Tolerant Streamlit Web Application
β”œβ”€β”€ model.pkl                           # Trained Machine Learning Model
β”œβ”€β”€ scaler.pkl                          # Fitted StandardScaler Object
β”œβ”€β”€ column.pkl                          # Feature Column Definitions
β”œβ”€β”€ requirements.txt                    # Python Dependencies
└── README.md                           # Project Documentation
git clone https://github.com/amirsohail100/Credit-Card-Fraud-Detection-System.git
cd Credit-Card-Fraud-Detection-System
streamlit run app.py
pip install -r requirements.txt

πŸ“„ License

This project is licensed under the MIT License.

πŸ“ Author

πŸ‘€ Amir Sohail

A high-accuracy Machine Learning project evaluating multiple classifiers (Random Forest, Extra Trees, XGBoost, KNN at 98% accuracy) on Credit Card Fraud Data. Features dynamic inputs like Time, PCA components (V1-V5), and Amount to predict transaction legitimacy (Class) via a fault-tolerant Streamlit web UI.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results

  • Accuracy on Credit_Card_Fraud_Synthetic_Detector
    self-reported
    0.980