Spaces:
Sleeping
Sleeping
| title: Fraud Detection | |
| emoji: π | |
| colorFrom: green | |
| colorTo: purple | |
| sdk: gradio | |
| sdk_version: 5.42.0 | |
| app_file: app.py | |
| pinned: false | |
| license: apache-2.0 | |
| short_description: Financial transactions fraud detection. | |
| # π Credit Card Fraud Detection System | |
| **Instantly detect fraudulent transactions with AI-powered risk assessment** | |
| This system uses an **XGBoost machine learning model** to analyse credit card transactions and predict fraud risk in real-time. Simply enter transaction details and get an immediate risk assessment. | |
| ## π Quick Start | |
| 1. **Single Transaction**: Enter transaction details β Get instant fraud probability | |
| 2. **Batch Processing**: Upload CSV file β Process multiple transactions at once | |
| 3. **Risk Assessment**: Receive colour-coded risk levels with clear recommendations | |
| ## π― How It Works | |
| The AI model analyses **40+ transaction features** including: | |
| - Transaction amount and timing | |
| - Card details and type | |
| - Email domain patterns | |
| - Geographic information | |
| - User behaviour history | |
| ## π Risk Levels Explained | |
| | Risk Level | Probability | What It Means | Action Required | | |
| |------------|-------------|---------------|-----------------| | |
| | π΄ **High Risk** | β₯80% | Very likely fraud | Block transaction immediately | | |
| | π‘ **Medium Risk** | 50-79% | Suspicious activity | Manual review needed | | |
| | π **Low Risk** | 20-49% | Some concerns | Monitor closely | | |
| | π’ **Very Low Risk** | <20% | Normal transaction | Process as usual | | |
| ## π‘ Example Use Cases | |
| - **Banks**: Screen transactions before processing | |
| - **E-commerce**: Protect against fraudulent purchases | |
| - **Fintech**: Real-time fraud monitoring | |
| - **Research**: Analyse transaction patterns | |
| ## π οΈ Features | |
| β **Real-time predictions** - Results in under 1 second | |
| β **High accuracy** - Trained on large transaction dataset | |
| β **Easy to use** - Simple web interface, no coding required | |
| β **Batch processing** - Handle multiple transactions at once | |
| β **Professional insights** - Clear risk levels and recommendations | |
| ## π Model Performance | |
| - **Algorithm**: XGBoost (Extreme Gradient Boosting) | |
| - **Training Data**: Thousands of real transaction records | |
| - **Accuracy**: High precision with low false positives | |
| - **Speed**: Real-time inference (<100ms per prediction) | |
| ## π§ How to Use | |
| ### For Single Transactions: | |
| 1. Fill in the transaction form | |
| 2. Click "Analyse Transaction" | |
| 3. View risk assessment and follow recommendations | |
| ### For Multiple Transactions: | |
| 1. Prepare CSV file with transaction data | |
| 2. Upload file in "Batch Processing" tab | |
| 3. Download results with fraud probabilities | |
| ## π CSV Format for Batch Processing | |
| Your CSV should include columns like: | |
| ``` | |
| TransactionAmt, card4, P_emaildomain, addr1, addr2, card1, card2, etc. | |
| ``` | |
| ## β‘ Try It Now | |
| No setup required - just enter your transaction details and get instant results! | |
| ## π‘οΈ Important Notes | |
| - This is a **demonstration system** for educational purposes | |
| - For production use, implement proper security measures | |
| - Always combine AI predictions with human expertise | |
| - Follow your organisation's fraud prevention policies | |
| ## π¬ Technical Details | |
| The model uses advanced feature engineering including: | |
| - Logarithmic transformations | |
| - Time-based features | |
| - Interaction variables | |
| - Categorical encoding | |
| - Missing value handling | |
| Built with Python, scikit-learn, XGBoost, and Gradio. | |
| --- | |
| **Ready to detect fraud?** Start by entering a transaction above! π |