Coder Social home page Coder Social logo

dgfraud's Introduction



PRs Welcome GitHub Downloads GitHub release

A Deep Graph-based Toolbox for Fraud Detection

Introduction: DGFraud is a Graph Neural Network (GNN) based toolbox for fraud detection. It integrates the implementation & comparison of state-of-the-art GNN-based fraud detection models. It also includes several utility functions such as graph preprocessing, graph sampling, and performance evaluation. The introduction of implemented models can be found here.

We welcome contributions on adding new fraud detectors and extending the features of the toolbox. Some of the planned features are listed in TODO list.

If you use the toolbox in your project, please cite the paper below and the algorithms you used :

@inproceedings{liu2020alleviating,
  title={Alleviating the Inconsistency Problem of Applying Graph Neural Network to Fraud Detection},
  author={Liu, Zhiwei and Dou, Yingtong and Yu, Philip S. and Deng, Yutong and Peng, Hao},
  booktitle={Proceedings of the 43nd International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year={2020}
}

Useful Resources

Table of Contents

Installation

git clone https://github.com/safe-graph/DGFraud.git
cd DGFraud
python setup.py install

Requirements

* python 3.6, 3.7
* tensorflow>=1.14.0,<2.0
* numpy>=1.16.4
* scipy>=1.2.0

Dataset

DBLP

We uses the pre-processed DBLP dataset from Jhy1993/HAN You can run the FdGars, Player2Vec, GeniePath and GEM based on the DBLP dataset. Unzip the archive before using the dataset:

cd dataset
unzip DBLP4057_GAT_with_idx_tra200_val_800.zip

Example dataset

We implement example graphs for SemiGNN, GAS and GEM in data_loader.py. Because those models require unique graph structures or node types, which cannot be found in opensource datasets.

User Guide

Running the example code

You can find the implemented models in algorithms directory. For example, you can run Player2Vec using:

python Player2Vec_main.py 

You can specify parameters for models when running the code.

Running on your datasets

Have a look at the load_data_dblp() function in utils/utils.py for an example.

In order to use your own data, you have to provide:

  • adjacency matrices or adjlists (for GAS);
  • a feature matrix
  • a label matrix then split feature matrix and label matrix into testing data and training data.

You can specify a dataset as follows:

python xx_main.py --dataset your_dataset 

or by editing xx_main.py

The structure of code

The repository is organized as follows:

  • algorithms/ contains the implemented models and the corresponding example code;
  • base_models/ contains the basic models (GCN);
  • dataset/ contains the necessary dataset files;
  • utils/ contains:
    • loading and splitting the data (data_loader.py);
    • contains various utilities (utils.py).

Implemented Models

Model Paper Venue Reference
SemiGNN A Semi-supervised Graph Attentive Network for Financial Fraud Detection ICDM 2019 BibTex
Player2Vec Key Player Identification in Underground Forums over Attributed Heterogeneous Information Network Embedding Framework CIKM 2019 BibTex
GAS Spam Review Detection with Graph Convolutional Networks CIKM 2019 BibTex
FdGars FdGars: Fraudster Detection via Graph Convolutional Networks in Online App Review System WWW 2019 BibTex
GeniePath GeniePath: Graph Neural Networks with Adaptive Receptive Paths AAAI 2019 BibTex
GEM Heterogeneous Graph Neural Networks for Malicious Account Detection CIKM 2018 BibTex

Model Comparison

Model Application Graph Type Base Model
SemiGNN Financial Fraud Heterogeneous GAT, LINE, DeepWalk
Player2Vec Cyber Criminal Heterogeneous GAT, GCN
GAS Opinion Fraud Heterogeneous GCN, GAT
FdGars Opinion Fraud Homogeneous GCN
GeniePath Financial Fraud Homogeneous GAT
GEM Financial Fraud Heterogeneous GCN

TODO List

  • GraphConsis Implementation
  • Add preprocessed Yelp datasets
  • The memory-efficient implementation of SemiGNN
  • The log loss for GEM model
  • Time-based sampling for GEM
  • Add sampling methods
  • Benchmarking SOTA models
  • Scalable implementation
  • TensorFlow 2.0+ implementation
  • Pytorch version

How to Contribute

You are welcomed to contribute to this open-source toolbox. The detailed instructions will be released soon. Currently, you can create issues or send email to [email protected] for enquiry.

dgfraud's People

Contributors

yingtongdou avatar yutongd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.