--- 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! 👆