{"id":13688894,"url":"https://github.com/pygod-team/pygod","last_synced_at":"2025-10-08T17:23:10.954Z","repository":{"id":37478378,"uuid":"429607784","full_name":"pygod-team/pygod","owner":"pygod-team","description":"A Python Library for Graph Outlier Detection (Anomaly Detection)","archived":false,"fork":false,"pushed_at":"2024-11-14T06:35:15.000Z","size":1095,"stargazers_count":1416,"open_issues_count":11,"forks_count":135,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-05-13T23:15:25.959Z","etag":null,"topics":["anomaly-detection","deeplearning","fraud-detection","graph-anomaly-detection","graph-neural-networks","graphmining","machine-learning","opensource","outlier-detection","python","pytorch","security-tools","toolkit"],"latest_commit_sha":null,"homepage":"https://pygod.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pygod-team.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-11-18T23:18:17.000Z","updated_at":"2025-05-07T07:25:34.000Z","dependencies_parsed_at":"2023-12-05T03:24:16.467Z","dependency_job_id":"78fd72ad-c6c1-4ddd-ac1f-e64d9d8e72dd","html_url":"https://github.com/pygod-team/pygod","commit_stats":{"total_commits":441,"total_committers":19,"mean_commits":"23.210526315789473","dds":0.727891156462585,"last_synced_commit":"bec88df7a53f9af44701124c1724af8c4d941061"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygod-team%2Fpygod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygod-team%2Fpygod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygod-team%2Fpygod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygod-team%2Fpygod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pygod-team","download_url":"https://codeload.github.com/pygod-team/pygod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198452,"owners_count":22030964,"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","deeplearning","fraud-detection","graph-anomaly-detection","graph-neural-networks","graphmining","machine-learning","opensource","outlier-detection","python","pytorch","security-tools","toolkit"],"created_at":"2024-08-02T15:01:26.734Z","updated_at":"2025-10-08T17:23:05.908Z","avatar_url":"https://github.com/pygod-team.png","language":"Python","readme":".. image:: https://raw.githubusercontent.com/pygod-team/pygod/main/docs/pygod_logo.png\n   :width: 1050\n   :alt: PyGOD Logo\n   :align: center\n\n|badge_pypi| |badge_docs| |badge_stars| |badge_forks| |badge_downloads| |badge_testing| |badge_coverage| |badge_license|\n\n.. |badge_pypi| image:: https://img.shields.io/pypi/v/pygod.svg?color=brightgreen\n   :target: https://pypi.org/project/pygod/\n   :alt: PyPI version\n\n.. |badge_docs| image:: https://readthedocs.org/projects/py-god/badge/?version=latest\n   :target: https://docs.pygod.org/en/latest/?badge=latest\n   :alt: Documentation status\n\n.. |badge_stars| image:: https://img.shields.io/github/stars/pygod-team/pygod?style=flat\n   :target: https://github.com/pygod-team/pygod/stargazers\n   :alt: GitHub stars\n\n.. |badge_forks| image:: https://img.shields.io/github/forks/pygod-team/pygod?style=flat\n   :target: https://github.com/pygod-team/pygod/network\n   :alt: GitHub forks\n\n.. |badge_downloads| image:: https://static.pepy.tech/personalized-badge/pygod?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads\n   :target: https://pepy.tech/project/pygod\n   :alt: PyPI downloads\n\n.. |badge_testing| image:: https://github.com/pygod-team/pygod/actions/workflows/testing.yml/badge.svg\n   :target: https://github.com/pygod-team/pygod/actions/workflows/testing.yml\n   :alt: testing\n\n.. |badge_coverage| image:: https://coveralls.io/repos/github/pygod-team/pygod/badge.svg?branch=main\n   :target: https://coveralls.io/github/pygod-team/pygod?branch=main\n   :alt: Coverage Status\n\n.. |badge_license| image:: https://img.shields.io/github/license/pygod-team/pygod.svg\n   :target: https://github.com/pygod-team/pygod/blob/master/LICENSE\n   :alt: License\n\n\n-----\n\nPyGOD is a **Python library** for **graph outlier detection** (anomaly detection).\nThis exciting yet challenging field has many key applications, e.g., detecting\nsuspicious activities in social networks [#Dou2020Enhancing]_  and security systems [#Cai2021Structural]_.\n\nPyGOD includes **10+** graph outlier detection algorithms.\nFor consistency and accessibility, PyGOD is developed on top of `PyTorch Geometric (PyG) \u003chttps://www.pyg.org/\u003e`_\nand `PyTorch \u003chttps://pytorch.org/\u003e`_, and follows the API design of `PyOD \u003chttps://github.com/yzhao062/pyod\u003e`_.\nSee examples below for detecting outliers with PyGOD in 5 lines!\n\n\n**PyGOD is featured for**:\n\n* **Unified APIs, detailed documentation, and interactive examples** across various graph-based algorithms.\n* **Comprehensive coverage** of 10+ graph outlier detectors.\n* **Full support of detections at multiple levels**, such as node-, edge-, and graph-level tasks.\n* **Scalable design for processing large graphs** via mini-batch and sampling.\n* **Streamline data processing with PyG**--fully compatible with PyG data objects.\n\n**Outlier Detection Using PyGOD with 5 Lines of Code**\\ :\n\n.. code-block:: python\n\n\n    # train a dominant detector\n    from pygod.detector import DOMINANT\n\n    model = DOMINANT(num_layers=4, epoch=20)  # hyperparameters can be set here\n    model.fit(train_data)  # input data is a PyG data object\n\n    # get outlier scores on the training data (transductive setting)\n    score = model.decision_score_\n\n    # predict labels and scores on the testing data (inductive setting)\n    pred, score = model.predict(test_data, return_score=True)\n\n\n**Citing PyGOD**\\ :\n\nOur `software paper \u003chttps://jmlr.org/papers/v25/23-0963.html\u003e`_ and `benchmark paper \u003chttps://proceedings.neurips.cc/paper_files/paper/2022/hash/acc1ec4a9c780006c9aafd595104816b-Abstract-Datasets_and_Benchmarks.html\u003e`_ are publicly available.\nIf you use PyGOD or BOND in a scientific publication, we would appreciate citations to the following papers::\n\n    @article{JMLR:v25:23-0963,\n      author  = {Kay Liu and Yingtong Dou and Xueying Ding and Xiyang Hu and Ruitong Zhang and Hao Peng and Lichao Sun and Philip S. Yu},\n      title   = {{PyGOD}: A {Python} Library for Graph Outlier Detection},\n      journal = {Journal of Machine Learning Research},\n      year    = {2024},\n      volume  = {25},\n      number  = {141},\n      pages   = {1--9},\n      url     = {http://jmlr.org/papers/v25/23-0963.html}\n    }\n    @inproceedings{NEURIPS2022_acc1ec4a,\n     author = {Liu, Kay and Dou, Yingtong and Zhao, Yue and Ding, Xueying and Hu, Xiyang and Zhang, Ruitong and Ding, Kaize and Chen, Canyu and Peng, Hao and Shu, Kai and Sun, Lichao and Li, Jundong and Chen, George H and Jia, Zhihao and Yu, Philip S},\n     booktitle = {Advances in Neural Information Processing Systems},\n     editor = {S. Koyejo and S. Mohamed and A. Agarwal and D. Belgrave and K. Cho and A. Oh},\n     pages = {27021--27035},\n     publisher = {Curran Associates, Inc.},\n     title = {{BOND}: Benchmarking Unsupervised Outlier Node Detection on Static Attributed Graphs},\n     url = {https://proceedings.neurips.cc/paper_files/paper/2022/file/acc1ec4a9c780006c9aafd595104816b-Paper-Datasets_and_Benchmarks.pdf},\n     volume = {35},\n     year = {2022}\n    }\n\nor::\n\n    Liu, K., Dou, Y., Ding, X., Hu, X., Zhang, R., Peng, H., Sun, L. and Yu, P.S., 2024. PyGOD: A Python library for graph outlier detection. Journal of Machine Learning Research, 25(141), pp.1-9.\n    Liu, K., Dou, Y., Zhao, Y., Ding, X., Hu, X., Zhang, R., Ding, K., Chen, C., Peng, H., Shu, K., Sun, L., Li, J., Chen, G.H., Jia, Z., and Yu, P.S., 2022. BOND: Benchmarking unsupervised outlier node detection on static attributed graphs. Advances in Neural Information Processing Systems, 35, pp.27021-27035.\n\n----\n\nInstallation\n^^^^^^^^^^^^\n\n**Note on PyG and PyTorch Installation**\\ :\nPyGOD depends on `torch \u003chttps://https://pytorch.org/get-started/locally/\u003e`_ and `torch_geometric (including its optional dependencies) \u003chttps://pytorch-geometric.readthedocs.io/en/latest/install/installation.html#\u003e`_.\nTo streamline the installation, PyGOD does **NOT** install these libraries for you.\nPlease install them from the above links for running PyGOD:\n\n* torch\u003e=2.0.0\n* torch_geometric\u003e=2.3.0\n\nIt is recommended to use **pip** for installation.\nPlease make sure **the latest version** is installed, as PyGOD is updated frequently:\n\n.. code-block:: bash\n\n   pip install pygod            # normal install\n   pip install --upgrade pygod  # or update if needed\n\nAlternatively, you could clone and run setup.py file:\n\n.. code-block:: bash\n\n   git clone https://github.com/pygod-team/pygod.git\n   cd pygod\n   pip install .\n\n**Required Dependencies**\\ :\n\n* python\u003e=3.8\n* numpy\u003e=1.24.3\n* scikit-learn\u003e=1.2.2\n* scipy\u003e=1.10.1\n* networkx\u003e=3.1\n\n\n----\n\n\nQuick Start for Outlier Detection with PyGOD\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`\"A Blitz Introduction\" \u003chttps://docs.pygod.org/en/latest/tutorials/1_intro.html#sphx-glr-tutorials-1-intro-py\u003e`_\ndemonstrates the basic API of PyGOD using the DOMINANT detector. **It is noted that the API across all other algorithms are consistent/similar**.\n\n\n----\n\n\nAPI Cheatsheet \u0026 Reference\n^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nFull API Reference: (https://docs.pygod.org). API cheatsheet for all detectors:\n\n* **fit(data)**\\ : Fit the detector with train data.\n* **predict(data)**\\ : Predict on test data (train data if not provided) using the fitted detector.\n\nKey Attributes of a fitted detector:\n\n* **decision_score_**\\ : The outlier scores of the input data. Outliers tend to have higher scores.\n* **label_**\\ : The binary labels of the input data. 0 stands for inliers and 1 for outliers.\n* **threshold_**\\ : The determined threshold for binary classification. Scores above the threshold are outliers.\n\n**Input of PyGOD**: Please pass in a `PyG Data object \u003chttps://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.data.Data.html#torch_geometric.data.Data\u003e`_.\nSee `PyG data processing examples \u003chttps://pytorch-geometric.readthedocs.io/en/latest/notes/introduction.html#data-handling-of-graphs\u003e`_.\n\n\nImplemented Algorithms\n^^^^^^^^^^^^^^^^^^^^^^\n\n==================  =====  ===========  ===========  ========================================\nAbbr                Year   Backbone     Sampling      Ref\n==================  =====  ===========  ===========  ========================================\nSCAN                2007   Clustering   No           [#Xu2007Scan]_\nGAE                 2016   GNN+AE       Yes          [#Kipf2016Variational]_\nRadar               2017   MF           No           [#Li2017Radar]_\nANOMALOUS           2018   MF           No           [#Peng2018Anomalous]_\nONE                 2019   MF           No           [#Bandyopadhyay2019Outlier]_\nDOMINANT            2019   GNN+AE       Yes          [#Ding2019Deep]_\nDONE                2020   MLP+AE       Yes          [#Bandyopadhyay2020Outlier]_\nAdONE               2020   MLP+AE       Yes          [#Bandyopadhyay2020Outlier]_\nAnomalyDAE          2020   GNN+AE       Yes          [#Fan2020AnomalyDAE]_\nGAAN                2020   GAN          Yes          [#Chen2020Generative]_\nDMGD                2020   GNN+AE       Yes          [#Bandyopadhyay2020Integrating]_\nOCGNN               2021   GNN          Yes          [#Wang2021One]_\nCoLA                2021   GNN+AE+SSL   Yes          [#Liu2021Anomaly]_\nGUIDE               2021   GNN+AE       Yes          [#Yuan2021Higher]_\nCONAD               2022   GNN+AE+SSL   Yes          [#Xu2022Contrastive]_\nGADNR               2024   GNN+AE       Yes          [#Roy2024Gadnr]_\nCARD                2024   GNN+SSL+AE   Yes          [#Wang2024Card]_\n==================  =====  ===========  ===========  ========================================\n\n\n----\n\nHow to Contribute\n^^^^^^^^^^^^^^^^^\n\nYou are welcome to contribute to this exciting project:\n\nSee `contribution guide \u003chttps://github.com/pygod-team/pygod/blob/main/CONTRIBUTING.rst\u003e`_ for more information.\n\n\n----\n\nPyGOD Team\n^^^^^^^^^^\n\nPyGOD is a great team effort by researchers from UIC, IIT, BUAA, ASU, and CMU.\nOur core team members include:\n\n`Kay Liu (UIC) \u003chttps://kayzliu.com/\u003e`_,\n`Yingtong Dou (UIC) \u003chttp://ytongdou.com/\u003e`_,\n`Yue Zhao (CMU) \u003chttps://www.andrew.cmu.edu/user/yuezhao2/\u003e`_,\n`Xueying Ding (CMU) \u003chttps://scholar.google.com/citations?user=U9CMsh0AAAAJ\u0026hl=en\u003e`_,\n`Xiyang Hu (CMU) \u003chttps://www.andrew.cmu.edu/user/xiyanghu/\u003e`_,\n`Ruitong Zhang (BUAA) \u003chttps://github.com/pygod-team/pygod\u003e`_,\n`Kaize Ding (ASU) \u003chttps://www.public.asu.edu/~kding9/\u003e`_,\n`Canyu Chen (IIT) \u003chttps://github.com/pygod-team/pygod\u003e`_,\n\nReach out us by submitting an issue report or send an email to dev@pygod.org.\n\n----\n\nReference\n^^^^^^^^^\n\n.. [#Dou2020Enhancing] Dou, Y., Liu, Z., Sun, L., Deng, Y., Peng, H. and Yu, P.S., 2020, October. Enhancing graph neural network-based fraud detectors against camouflaged fraudsters. In Proceedings of the 29th ACM International Conference on Information \u0026 Knowledge Management (CIKM).\n\n.. [#Cai2021Structural] Cai, L., Chen, Z., Luo, C., Gui, J., Ni, J., Li, D. and Chen, H., 2021, October. Structural temporal graph neural networks for anomaly detection in dynamic graphs. In Proceedings of the 30th ACM International Conference on Information \u0026 Knowledge Management (CIKM).\n\n.. [#Xu2007Scan] Xu, X., Yuruk, N., Feng, Z. and Schweiger, T.A., 2007, August. Scan: a structural clustering algorithm for networks. In Proceedings of the 13th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD).\n\n.. [#Kipf2016Variational] Kipf, T.N. and Welling, M., 2016. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308.\n\n.. [#Li2017Radar] Li, J., Dani, H., Hu, X. and Liu, H., 2017, August. Radar: Residual Analysis for Anomaly Detection in Attributed Networks. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence (IJCAI).\n\n.. [#Peng2018Anomalous] Peng, Z., Luo, M., Li, J., Liu, H. and Zheng, Q., 2018, July. ANOMALOUS: A Joint Modeling Approach for Anomaly Detection on Attributed Networks. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI).\n\n.. [#Bandyopadhyay2019Outlier] Bandyopadhyay, S., Lokesh, N. and Murty, M.N., 2019, July. Outlier aware network embedding for attributed networks. In Proceedings of the AAAI conference on artificial intelligence (AAAI).\n\n.. [#Ding2019Deep] Ding, K., Li, J., Bhanushali, R. and Liu, H., 2019, May. Deep anomaly detection on attributed networks. In Proceedings of the SIAM International Conference on Data Mining (SDM).\n\n.. [#Bandyopadhyay2020Outlier] Bandyopadhyay, S., Vivek, S.V. and Murty, M.N., 2020, January. Outlier resistant unsupervised deep architectures for attributed network embedding. In Proceedings of the International Conference on Web Search and Data Mining (WSDM).\n\n.. [#Fan2020AnomalyDAE] Fan, H., Zhang, F. and Li, Z., 2020, May. AnomalyDAE: Dual autoencoder for anomaly detection on attributed networks. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP).\n\n.. [#Chen2020Generative] Chen, Z., Liu, B., Wang, M., Dai, P., Lv, J. and Bo, L., 2020, October. Generative adversarial attributed network anomaly detection. In Proceedings of the 29th ACM International Conference on Information \u0026 Knowledge Management (CIKM).\n\n.. [#Bandyopadhyay2020Integrating] Bandyopadhyay, S., Vishal Vivek, S. and Murty, M.N., 2020. Integrating network embedding and community outlier detection via multiclass graph description. Frontiers in Artificial Intelligence and Applications, (FAIA).\n\n.. [#Wang2021One] Wang, X., Jin, B., Du, Y., Cui, P., Tan, Y. and Yang, Y., 2021. One-class graph neural networks for anomaly detection in attributed networks. Neural computing and applications.\n\n.. [#Liu2021Anomaly] Liu, Y., Li, Z., Pan, S., Gong, C., Zhou, C. and Karypis, G., 2021. Anomaly detection on attributed networks via contrastive self-supervised learning. IEEE transactions on neural networks and learning systems (TNNLS).\n\n.. [#Yuan2021Higher] Yuan, X., Zhou, N., Yu, S., Huang, H., Chen, Z. and Xia, F., 2021, December. Higher-order Structure Based Anomaly Detection on Attributed Networks. In 2021 IEEE International Conference on Big Data (Big Data).\n\n.. [#Xu2022Contrastive] Xu, Z., Huang, X., Zhao, Y., Dong, Y., and Li, J., 2022. Contrastive Attributed Network Anomaly Detection with Data Augmentation. In Proceedings of the 26th Pacific-Asia Conference on Knowledge Discovery and Data Mining (PAKDD).\n\n.. [#Roy2024Gadnr] Roy, A., Shu, J., Li, J., Yang, C., Elshocht, O., Smeets, J. and Li, P., 2024. GAD-NR: Graph Anomaly Detection via Neighborhood Reconstruction. In Proceedings of the 17th ACM International Conference on Web Search and Data Mining (WSDM).\n\n.. [#Wang2024Card] Wang Y., Wang X., He C., Chen X., Luo Z., Duan L., Zuo J., 2024. Community-Guided Contrastive Learning with Anomaly-Aware Reconstruction for Anomaly Detection on Attributed Networks. Database Systems for Advanced Applications (DASFAA).","funding_links":[],"categories":["Python","其他_图神经网络GNN"],"sub_categories":["网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpygod-team%2Fpygod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpygod-team%2Fpygod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpygod-team%2Fpygod/lists"}