{"id":13751593,"url":"https://github.com/safe-graph/UGFraud","last_synced_at":"2025-05-09T18:31:37.943Z","repository":{"id":45818170,"uuid":"268647110","full_name":"safe-graph/UGFraud","owner":"safe-graph","description":"An Unsupervised Graph-based Toolbox for Fraud Detection","archived":false,"fork":false,"pushed_at":"2022-04-18T04:54:53.000Z","size":7453,"stargazers_count":132,"open_issues_count":2,"forks_count":26,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T08:34:52.149Z","etag":null,"topics":["anomaly-detection","data-science","fraud-detection","fraud-prevention","graph-algorithms","machine-learning","opensource","outlier-detection","security-tools","spam-detection","toolbox"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/safe-graph.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}},"created_at":"2020-06-01T22:34:14.000Z","updated_at":"2025-04-14T02:57:28.000Z","dependencies_parsed_at":"2022-08-31T19:10:15.125Z","dependency_job_id":null,"html_url":"https://github.com/safe-graph/UGFraud","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/safe-graph%2FUGFraud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/safe-graph%2FUGFraud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/safe-graph%2FUGFraud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/safe-graph%2FUGFraud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/safe-graph","download_url":"https://codeload.github.com/safe-graph/UGFraud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253303024,"owners_count":21886873,"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","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":["anomaly-detection","data-science","fraud-detection","fraud-prevention","graph-algorithms","machine-learning","opensource","outlier-detection","security-tools","spam-detection","toolbox"],"created_at":"2024-08-03T09:00:49.416Z","updated_at":"2025-05-09T18:31:36.245Z","avatar_url":"https://github.com/safe-graph.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://image.flaticon.com/icons/svg/1671/1671517.svg\"\u003e\n        \u003cimg src=\"https://github.com/safe-graph/UGFraud/blob/master/UGFraud_logo.png\" width=\"400\"/\u003e\n    \u003c/a\u003e\n    \u003cbr\u003e\n\u003cp\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://travis-ci.org/github/safe-graph/UGFraud\"\u003e\n        \u003cimg alt=\"Building\" src=\"https://travis-ci.org/safe-graph/UGFraud.svg?branch=master\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/safe-graph/UGFraud/blob/master/LICENSE\"\u003e\n        \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/safe-graph/UGFraud\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pepy.tech/project/ugfraud\"\u003e\n        \u003cimg alt=\"Downloads\" src=\"https://pepy.tech/badge/ugfraud\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/UGFraud/\"\u003e\n        \u003cimg alt=\"Pypi version\" src=\"https://img.shields.io/pypi/v/ugfraud\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\n\u003cp\u003eAn Unsupervised Graph-based Toolbox for Fraud Detection\n\u003c/h3\u003e\n\n**Introduction:** \nUGFraud is an unsupervised graph-based fraud detection toolbox that integrates several state-of-the-art graph-based fraud detection algorithms. It can be applied to bipartite graphs (e.g., user-product graph), and it can estimate the suspiciousness of both nodes and edges. The implemented models can be found [here](#implemented-models).\n\nThe toolbox incorporates the Markov Random Field (MRF)-based algorithm, dense-block detection-based algorithm, and SVD-based algorithm. For MRF-based algorithms, the users only need the graph structure and the prior suspicious score of the nodes as the input. For other algorithms, the graph structure is the only input.\n\nMeanwhile, we have a [deep graph-based fraud detection toolbox](https://github.com/safe-graph/DGFraud) which implements state-of-the-art graph neural network-based fraud detectors.\n\nWe welcome contributions on adding new fraud detectors and extending the features of the toolbox. Some of the planned features are listed in [TODO list](#todo-list). \n\nIf you use the toolbox in your project, please cite the [paper](https://arxiv.org/abs/2006.06069) below and the [algorithms](#implemented-models) you used :\n```bibtex\n@inproceedings{dou2020robust,\n  title={Robust Spammer Detection by Nash Reinforcement Learning},\n  author={Dou, Yingtong and Ma, Guixiang and Yu, Philip S and Xie, Sihong},\n  booktitle={Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery \\\u0026 Data Mining},\n  year={2020}\n}\n```\n\n**Useful Resources**\n- [PyGOD: A Python Library for Graph Outlier Detection (Anomaly Detection)](https://github.com/pygod-team/pygod)\n- [DGFraud: A Deep Graph-based Fraud Detection Toolbox](https://github.com/safe-graph/DGFraud)\n- [Graph-based Fraud Detection Paper List](https://github.com/safe-graph/graph-fraud-detection-papers) \n- [Awesome Fraud Detection Papers](https://github.com/benedekrozemberczki/awesome-fraud-detection-papers)\n- [Attack and Defense Papers on Graph Data](https://github.com/safe-graph/graph-adversarial-learning-literature)\n- [PyOD: A Python Toolbox for Scalable Outlier Detection (Anomaly Detection)](https://github.com/yzhao062/pyod)\n- [PyODD: An End-to-end Outlier Detection System](https://github.com/datamllab/pyodds)\n- [DGL: Deep Graph Library](https://github.com/dmlc/dgl)\n- [Outlier Detection DataSets (ODDS)](http://odds.cs.stonybrook.edu/)\n\n**Table of Contents**\n- [Installation](#installation)\n- [User Guide](#user-guide)\n- [Implemented Models](#implemented-models)\n- [Model Comparison](#model-comparison)\n- [TODO List](#todo-list)\n- [How to Contribute](#how-to-contribute)\n\n\n## Installation\nYou can install UGFraud from `pypi`:\n\n```bash\npip install UGFraud\n```\n\nor download and install from `github`:\n\n```bash\ngit clone https://github.com/safe-graph/UGFraud.git\ncd UGFraud\npython setup.py install\n```\n\n### Dataset\nThe demo data is not the intact data (`rating` and `date` information are missing). The rating information is only used in ZooBP demo. If you need the intact date to play demo, please email [bdscsafegraph@gmail.com](mailto:bdscsafegraph@gmail.com) to download the intact data from [Yelp Spam Review Dataset](http://odds.cs.stonybrook.edu/yelpchi-dataset/). The `metadata.gz` file in `/UGFraud/Yelp_Data/YelpChi` includes:\n- `user_id`: 38063 number of users\n- `product_id`: 201 number of products\n- `rating`: from 1.0 (low) to 5.0 (high)\n- `label`: -1 is not spam, 1 is spam\n- `date`: data creation time\n\n\n## User Guide\n\n### Running the example code\nYou can find the implemented models in `/UGFraud/Demo/` directory. For example, you can run fBox using:\n```bash\npython eval_fBox.py \n```\n\n### Running on your datasets\nCheck out the `data_to_network_graph` function in `/UGFraud/Demo/demo_pre.py` to convert your data into the [networkx](https://networkx.github.io/documentation/stable/tutorial.html#creating-a-graph) graph.\n\nIn order to use your own data, you have to provide the following information at least:\n* a dict of dict:\n```\n'user_id':{\n        'product_id':\n                {\n                'label': 1\n                }\n```\n* a dict of prior\n\nYou can use `dict_to networkx(graph_dict)` function from `/Utils/helper.py` file to convert your graph_dict into a networkx graph.\nFor more details, please see `data_to_network_graph.py`.\n\n### The structure of code\nThe `/UGFraud` repository is organized as follows:\n- `Demo/` contains the implemented models and the corresponding example code;\n- `Detector/` contains the basic models;\n- `Yelp_Data/` contains the necessary dataset files;\n- `Utils/` contains the every help functions.\n\n\n## Implemented Models\n\n| Model  | Paper  | Venue  | Reference  |\n|-------|--------|--------|--------|\n| **SpEagle** | [Collective Opinion Spam Detection: Bridging Review Networks and Metadata](https://www.andrew.cmu.edu/user/lakoglu/pubs/15-kdd-collectiveopinionspam.pdf)  | KDD 2015  | [BibTex](https://github.com/safe-graph/UGFraud/blob/master/reference/speagle.txt) |\n| **GANG** | [GANG: Detecting Fraudulent Users in Online Social Networks via Guilt-by-Association on Directed Graph](https://ieeexplore.ieee.org/document/8215519)  | ICDM 2017  | [BibTex](https://github.com/safe-graph/UGFraud/blob/master/reference/gang.txt)|\n| **fBox** | [Spotting Suspicious Link Behavior with fBox: An Adversarial Perspective](https://arxiv.org/pdf/1410.3915.pdf)  | ICDM 2014 | [BibTex](https://github.com/safe-graph/UGFraud/blob/master/reference/fbox.txt) |\n| **Fraudar** | [FRAUDAR: Bounding Graph Fraud in the Face of Camouflage](https://bhooi.github.io/papers/fraudar_kdd16.pdf)  | KDD 2016 | [BibTex](https://github.com/safe-graph/UGFraud/blob/master/reference/fraudar.txt) |\n| **ZooBP** | [ZooBP: Belief Propagation for Heterogeneous Networks](http://www.vldb.org/pvldb/vol10/p625-eswaran.pdf)  | VLDB 2017 | [BibTex](https://github.com/safe-graph/UGFraud/blob/master/reference/zoobp.txt)  |\n| **SVD** | [Singular value decomposition and least squares solutions](https://link.springer.com/content/pdf/10.1007/978-3-662-39778-7_10.pdf)  | - |[BibTex](https://github.com/safe-graph/UGFraud/blob/master/reference/svd.txt) |\n| **Prior** | Evaluating suspicioueness based on prior information  | - |  - |\n\n\n## Model Comparison\n| Model  | Application  | Graph Type  | Model Type  |\n|-------|--------|--------|-------|\n| **SpEagle** | Review Spam | Tripartite  | MRF  |\n| **GANG** | Social Sybil  | Bipartite |  MRF    |\n| **fBox** | Social Fraudster  | Bipartite |  SVD |\n| **Fraudar** |  Social Fraudster | Bipartite | Dense-block  |\n| **ZooBP** | E-commerce Fraud | Tripartite | MRF   |\n| **SVD** | Dimension Reduction  | Bipartite |  SVD  |\n\n\n## TODO List\n- Homogeneous graph implementation\n\n\n## How to Contribute\nYou are welcomed to contribute to this open-source toolbox. Currently, you can create issues or send email to [bdscsafegraph@gmail.com](mailto:bdscsafegraph@gmail.com) for inquiry.\n","funding_links":[],"categories":["异常检测","2017"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsafe-graph%2FUGFraud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsafe-graph%2FUGFraud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsafe-graph%2FUGFraud/lists"}