Spaces:
Sleeping
Sleeping
| 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! |