{"id":34742230,"url":"https://github.com/adn26/fraud-detection-system","last_synced_at":"2026-05-26T15:03:35.871Z","repository":{"id":287602423,"uuid":"965245583","full_name":"adn26/fraud-detection-system","owner":"adn26","description":"A machine learning-based system for detecting potentially fraudulent transactions in real-time.","archived":false,"fork":false,"pushed_at":"2025-04-15T08:27:47.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T15:33:01.347Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adn26.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-12T18:22:53.000Z","updated_at":"2025-04-15T08:27:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8a1ed91-9e2b-4fd8-a8d0-07a513e4d8de","html_url":"https://github.com/adn26/fraud-detection-system","commit_stats":null,"previous_names":["adn26/fraud-detection-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adn26/fraud-detection-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adn26%2Ffraud-detection-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adn26%2Ffraud-detection-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adn26%2Ffraud-detection-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adn26%2Ffraud-detection-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adn26","download_url":"https://codeload.github.com/adn26/fraud-detection-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adn26%2Ffraud-detection-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33525947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-25T04:20:39.723Z","updated_at":"2026-05-26T15:03:35.825Z","avatar_url":"https://github.com/adn26.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fraud Detection System\n\nA machine learning-based system for detecting potentially fraudulent transactions in real-time.\n\n## Overview\n\nThis project implements a fraud detection system using machine learning to identify suspicious transactions. The system analyzes various features of transactions, including:\n- Transaction amount and timing\n- Customer transaction history\n- Terminal transaction history\n- Temporal patterns\n\n## Demo\n\nHere are examples of how the system evaluates transactions:\n\n### Input Interface\n![Transaction Input Form](images/transaction_input.png)\n*The user interface for entering transaction details and historical statistics*\n\n### Example Results\n\n#### Legitimate Transaction Example\n![Legitimate Transaction](images/legitimate_transaction.png)\n*A normal transaction with low fraud probability and no risk factors*\n\n#### Fraudulent Transaction Example\n![Fraudulent Transaction](images/fraudulent_transaction.png)\n*A suspicious transaction flagged with multiple risk factors showing:*\n- High transaction amount (\u003e220)\n- Unusual amount for the customer\n- Unusual amount for the terminal\n\n## Features\n\n- Real-time fraud detection\n- Web-based interface using Streamlit\n- Model training and evaluation\n- Transaction testing capabilities\n- Feature importance visualization\n- Risk factor analysis\n\n## Project Structure\n\n```\nfraud_detection/\n├── app.py                 # Streamlit web application\n├── fraud_detection.py     # Main training and model code\n├── test_fraud_detection.py # Transaction testing script\n├── convert_to_csv.py      # Data conversion utility\n├── requirements.txt       # Python dependencies\n└── README.md             # Project documentation\n```\n\n## Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/fraud_detection.git\ncd fraud_detection\n```\n\n2. Create and activate a virtual environment:\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n3. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\n### Training the Model\n\n1. Place your transaction data in the `data` directory\n2. Run the training script:\n```bash\npython fraud_detection.py\n```\n\n### Testing Transactions\n\n1. Use the test script to check individual transactions:\n```bash\npython test_fraud_detection.py\n```\n\n### Web Interface\n\n1. Start the Streamlit app:\n```bash\nstreamlit run app.py\n```\n\n2. Open your browser and navigate to `http://localhost:8501`\n\n## Features Used for Detection\n\n- Transaction Amount\n- Log-transformed Amount\n- Time of Transaction (Hour, Day, Month)\n- Customer Statistics:\n  - Mean Transaction Amount\n  - Standard Deviation\n  - Transaction Count\n- Terminal Statistics:\n  - Mean Transaction Amount\n  - Standard Deviation\n  - Transaction Count\n\n## Model Performance\n\nThe system uses a Random Forest classifier with the following characteristics:\n- Handles class imbalance\n- Provides probability estimates\n- Evaluates multiple risk factors\n- Visualizes feature importance\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Data preprocessing techniques\n- Feature engineering approaches\n- Machine learning model implementation\n\n## Dataset Description\nThe dataset contains simulated transaction data with the following columns:\n- TRANSACTION_ID: Unique identifier for the transaction\n- TX_DATETIME: Date and time of the transaction\n- CUSTOMER_ID: Unique identifier for the customer\n- TERMINAL_ID: Unique identifier for the merchant terminal\n- TX_AMOUNT: Amount of the transaction\n- TX_FRAUD: Binary variable (0 for legitimate, 1 for fraudulent)\n\n## Fraud Patterns\nThe system detects fraud based on three main patterns:\n1. Transactions with amount \u003e 220\n2. Transactions from compromised terminals\n3. Unusual spending patterns from compromised customer accounts ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadn26%2Ffraud-detection-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadn26%2Ffraud-detection-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadn26%2Ffraud-detection-system/lists"}