MrSanjay's picture
Update README.md
09ffb4b verified
---
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](https://www.kaggle.com/datasets/priyamchoksi/credit-card-transactions-dataset?resource=download&select=credit_card_transactions.csv)
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
1. Clone the repository:
```bash
git clone https://github.com/D3V-S4NJ4Y/Credit-Card-Fraud-Detection-System
```
2. Install required packages:
```bash
pip install -r requirements.txt
```
4. Run the application:
```bash
streamlit run app.py
```
## πŸ‘₯ User Roles
**Default--> Usersname: Password**
- admin: admin
- manager: 123456
- Register New User with Correct Email id for Email Alerts
1. **User**
- View basic transaction details
- Submit transactions
- Receive alerts
3. **Manager**
- Advanced analysis
- Team management
- Performance monitoring
4. **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
```python
EMAIL_CONFIG = {
"smtp_user": "your-email@gmail.com",
"smtp_password": "your-app-password",
"smtp_server": "smtp.gmail.com",
"smtp_port": 587
}
```
### Risk Thresholds
```python
RISK_THRESHOLDS = {
'CRITICAL': 0.9,
'HIGH': 0.7,
'MEDIUM': 0.5,
'LOW': 0.2
}
```
## πŸ”’ Security Best Practices
1. Use environment variables for sensitive data
2. Regular password updates
3. Session timeout implementation
4. Activity logging
5. 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](LICENSE.md) file for details.
## πŸ‘¨β€πŸ’» Author
**Sanjay Kumar**
- Email: sanjay.dev925@gmail.com
- GitHub: [Your GitHub Profile](https://github.com/D3V-S4NJ4Y)
## πŸ™ 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!