{"id":27012078,"url":"https://github.com/natgluons/gnn-frauddetectionsystem-visualization","last_synced_at":"2025-08-10T22:07:52.406Z","repository":{"id":253531767,"uuid":"842633925","full_name":"natgluons/GNN-FraudDetectionSystem-Visualization","owner":"natgluons","description":"Syndicate Detection using GNN, PyTorch, and D3.js for interactive fraud detection and visualization in large-scale data","archived":false,"fork":false,"pushed_at":"2024-08-29T20:46:53.000Z","size":255,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T11:48:47.455Z","etag":null,"topics":["d3js-graph","fraud-detection","gnn","graph-neural-networks","graph-scaling","graph-visualization","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/natgluons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-08-14T18:44:39.000Z","updated_at":"2025-03-25T12:12:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"8befc898-baab-4131-97ed-370c9ffb6814","html_url":"https://github.com/natgluons/GNN-FraudDetectionSystem-Visualization","commit_stats":null,"previous_names":["natgluons/gnnmodel_sampling","natgluons/gnn-frauddetectionsystem","natgluons/gnn-frauddetectionsystem-visualization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/natgluons/GNN-FraudDetectionSystem-Visualization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natgluons%2FGNN-FraudDetectionSystem-Visualization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natgluons%2FGNN-FraudDetectionSystem-Visualization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natgluons%2FGNN-FraudDetectionSystem-Visualization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natgluons%2FGNN-FraudDetectionSystem-Visualization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natgluons","download_url":"https://codeload.github.com/natgluons/GNN-FraudDetectionSystem-Visualization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natgluons%2FGNN-FraudDetectionSystem-Visualization/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269794110,"owners_count":24476745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["d3js-graph","fraud-detection","gnn","graph-neural-networks","graph-scaling","graph-visualization","pytorch"],"created_at":"2025-04-04T11:47:45.348Z","updated_at":"2025-08-10T22:07:52.389Z","avatar_url":"https://github.com/natgluons.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Syndicate Detection using Graph Neural Networks (GNN)\n\nThis project implements a sophisticated Fraud Detection System (FDS) enhanced with Graph Neural Network (GNN) techniques, tailored to identify fraudulent activities within digital ecosystems, specifically within online gambling and digital financial transactions in Indonesia.\n\n## Overview\n\nWith the rise of complex and organized fraud syndicates in the digital ecosystem, traditional rule-based fraud detection methods fall short. This project introduces a GNN-based approach to model relationships and behaviors within the transaction network, offering a powerful tool to detect fraud syndicates by analyzing patterns, connections, and centrality measures.\n\n### Features\n- **Graph Scaling**: Handles large-scale datasets, with the capability to process bulk inputs of up to 10,000 users.\n- **Node Embeddings**: Uses GNN to generate embeddings for nodes (users, transactions), which can then be clustered and analyzed.\n- **Fraud Detection**: Utilizes a combination of graph analysis and machine learning to distinguish between fraudulent and non-fraudulent users.\n- **Interactive Visualization**: Provides a network graph visualization with search functionality to zoom in on specific user IDs, displaying key metrics such as risk score, syndicate score, and transaction details.\n- **Real-time Analysis**: Supports real-time detection with the ability to search and analyze user-specific data on demand.\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/natgluons/Syndicate-Indication-using-Network-Graph-Analytics.git\n   ```\n2. Navigate to the project directory:\n   ```bash\n   cd Syndicate-Indication-using-Network-Graph-Analytics\n   ```\n3. Install the necessary Python packages:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n### 1. Train the Model\n\nBefore using the system for detection, you need to train the model using the provided `train_hgt_model.py` script:\n\n```bash\npython train_hgt_model.py --data_dir ./realdata --model_dir ./model\n```\n\n### 2. Perform Fraud Detection\n\nOnce the model is trained, use the `hgt_kmeans_riskscore_graph.py` script to perform fraud detection on a new set of data:\n\n```bash\npython hgt_kmeans_riskscore_graph.py --data_dir ./realdata --model_path ./model/trained_hgt_model_realdata.pth --output_dir ./result\n```\n\n### 3. Visualize the Network Graph\n\nUse the `index.html` and `network_graph.js` files to visualize the network graph. This provides an interactive interface where you can search for specific user IDs and zoom in to view their relationships and metrics:\n\n1. Start a local server (for example, using Python's `http.server`):\n   ```bash\n   python -m http.server\n   ```\n2. Open `index.html` in your web browser.\n\n### 4. Search and Analyze Specific Users\n\n- Enter the user ID in the search bar and click \"Search\" to zoom in on the node representing that user.\n- The node will be highlighted, and a tooltip will display detailed information about the user's inbound/outbound transactions, risk score, and syndicate score.\n\n## Data Description\n\n- **Nodes**: Represent users or entities (e.g., merchants, customers).\n- **Edges**: Represent transactions between entities.\n- **Features**: Various features are extracted from nodes and edges, such as transaction amounts, account types, and other demographic attributes.\n\n## Methodology\n\n- **Heterogeneous Graph Transformer (HGT)**: Used to handle the complex relationships within the heterogeneous graph of transactions.\n- **K-means Clustering**: Applied to cluster similar behaviors together, separating fraudulent and non-fraudulent entities.\n- **Syndicate Score**: A composite score calculated using in-degree, out-degree, and betweenness centrality measures to identify potential syndicate activities.\n\n![image](https://github.com/user-attachments/assets/b3acadc2-304e-4343-861f-f425453fb4a3)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatgluons%2Fgnn-frauddetectionsystem-visualization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatgluons%2Fgnn-frauddetectionsystem-visualization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatgluons%2Fgnn-frauddetectionsystem-visualization/lists"}