CoolFace
Modelpublic

amirsoahil101/Credit_Card_Fraud_Synthetic_Detector

sourceHugging Facemitupdated 27d agoView on Hugging Face
0likes
Model Card

๐Ÿ’ณ 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](https://credit-card-fraud-detection-system-md3f6bhxwpbrhz8ogcylwu.streamlit.app/)


๐Ÿ–ผ๏ธ Application Preview & UI

[image]

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](https://credit-card-fraud-detection-system-md3f6bhxwpbrhz8ogcylwu.streamlit.app/)


๐Ÿ–ผ๏ธ 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 NameAccuracy ScoreStatus
Random Forest Classifier ๐Ÿ†0.980 (98.0%)Selected Model
Extra Trees Classifier ๐Ÿ†0.980 (98.0%)Top Performer
K-Neighbors Classifier0.980 (98.0%)Top Performer
XGBoost Classifier0.980 (98.0%)Top Performer
AdaBoost Classifier0.975 (97.5%)High Precision
Decision Tree Classifier0.970 (97.0%)Baseline
Gradient Boosting Classifier0.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 NameFeature CodeDescription / Domain Context
Transaction TimestampTimeElapsed time in seconds since the first dataset transaction
Transaction Behavior Factor 1V1Primary PCA vector for transaction behavior patterns
Account Activity Vector 2V2PCA vector capturing account usage variations
Security Risk Index 3V3PCA vector measuring security variance
Anomalous Pattern Score 4V4PCA vector identifying spending behavior anomalies
Location/Device Metric 5V5PCA vector for contextual transaction parameters
Transaction AmountAmountTotal monetary value of the transaction ($)
Target OutputClass0 = Legitimate Transaction, 1 = Fraudulent

๐Ÿ“ Repository Structure

text
โ”œโ”€โ”€ 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
bash
git clone https://github.com/amirsohail100/Credit-Card-Fraud-Detection-System.git
bash
cd Credit-Card-Fraud-Detection-System
bash
streamlit run app.py
bash
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.