Spaces:
Running
Running
A newer version of the Streamlit SDK is available: 1.56.0
metadata
title: Fraud-Detection-System
sdk: streamlit
emoji: π
colorFrom: indigo
colorTo: purple
π³ Credit Card & Transaction Fraud Detection System
Overview
A sophisticated real-time fraud detection system using ensemble machine learning models and advanced analytics to protect financial transactions.
π Key Features
- Real-time Fraud Detection: Instant transaction monitoring and analysis
- Multi-Model Ensemble: XGBoost, LightGBM, Random Forest, and Gradient Boosting
- Advanced Analytics Dashboard: Interactive visualizations and insights
- Role-Based Access Control: User, Analyst, Manager, and Admin roles
- Email Alert System: Automated notifications for suspicious activities
- Batch Processing: Handle multiple transactions simultaneously
π Technical Stack
- Frontend: Streamlit
- Backend: Python
- ML Models:
- XGBoost
- LightGBM
- Random Forest
- Gradient Boosting
- Data Processing: Pandas, NumPy
- Visualization: Plotly, Matplotlib
- Security: SHA-256 encryption
π Features In Detail
1. Fraud Detection
- Real-time transaction scoring
- Risk level assessment (LOW, MEDIUM, HIGH, CRITICAL)
- Behavioral analysis
- Location-based risk assessment
- Velocity checks
2. User Interface
- Interactive dashboards
- Real-time monitoring
- Advanced visualization
- Risk score breakdown
- Transaction patterns analysis
3. Security Features
- Role-based access control
- Password encryption
- Session management
- Activity logging
- Audit trails
4. Alert System
- Email notifications
- Risk-based alerting
- Customizable thresholds
- Batch alert processing
π Dataset
The dataset used for this project is the Credit Card Fraud Detection dataset from Kaggle.
π Project Structure
Credit-Card-Fraud-Detection/
βββ π data/ # Data directory
β βββ users.csv # User credentials and roles
β βββ transactions.csv # Dataset of credit card transactions
β βββ models/ # ML model implementations
β βββ xgb_model.json # XGBoost model file
β βββ features.pkl # Saved feature configurations
β
βββ π .streamlit/ # Streamlit configurations
β βββ config.toml # Streamlit settings
β βββ secrets.toml # Secure credentials
β
βββ π app.py # Main Streamlit application
βββ π requirements.txt # Project dependencies
βββ π .env # Environment variables
βββ π .gitignore # Git ignore patterns
βββ π LICENSE # License information
βββ π README.md # Project documentation
π οΈ Installation
- Clone the repository:
git clone https://github.com/D3V-S4NJ4Y/Credit-Card-Fraud-Detection-System
- Install required packages:
pip install -r requirements.txt
- Run the application:
streamlit run app.py
π₯ User Roles
Default--> Usersname: Password
- admin: admin
- manager: 123456
- Register New User with Correct Email id for Email Alerts
User
- View basic transaction details
- Submit transactions
- Receive alerts
Manager
- Advanced analysis
- Team management
- Performance monitoring
Admin
- Full system access
- User management
- System configuration
π Analytics Features
Transaction Analysis
- Risk scoring
- Behavioral patterns
- Anomaly detection
- Historical analysis
Visualization
- 3D risk analysis
- Decision flow diagrams
- Risk component breakdown
- Performance metrics
Reporting
- Real-time dashboards
- Batch analysis reports
- Custom filters
- Export capabilities
βοΈ Configuration
Email Setup
EMAIL_CONFIG = {
"smtp_user": "your-email@gmail.com",
"smtp_password": "your-app-password",
"smtp_server": "smtp.gmail.com",
"smtp_port": 587
}
Risk Thresholds
RISK_THRESHOLDS = {
'CRITICAL': 0.9,
'HIGH': 0.7,
'MEDIUM': 0.5,
'LOW': 0.2
}
π Security Best Practices
- Use environment variables for sensitive data
- Regular password updates
- Session timeout implementation
- Activity logging
- Data encryption
π Logs and Monitoring
- System health monitoring
- User activity logs
- Model performance tracking
- Error logging
π License
This project is licensed under the MIT License - see the LICENSE.md file for details.
π¨βπ» Author
Sanjay Kumar
- Email: sanjay.dev925@gmail.com
- GitHub: Your GitHub Profile
π Acknowledgments
- Machine Learning libraries contributors
- Streamlit community
- Security framework developers
π Support
For support and queries:
- Create an issue in the repository
- Contact: sanjay.dev925@gmail.com
β Star this repository if you find it helpful!