[Paper Review] PyGOD: A Python Library for Graph Outlier Detection
PyGOD is the first comprehensive open-source Python library for graph outlier detection, offering a unified API to support node-, edge-, subgraph-, and graph-level anomaly detection using state-of-the-art GNN-based methods. It enables scalable outlier detection via mini-batch and sampling, and ensures code reliability through automated testing, continuous integration, and high test coverage under a permissive BSD license.
PyGOD is an open-source Python library for detecting outliers in graph data. As the first comprehensive library of its kind, PyGOD supports a wide array of leading graph-based methods for outlier detection under an easy-to-use, well-documented API designed for use by both researchers and practitioners. PyGOD provides modularized components of the different detectors implemented so that users can easily customize each detector for their purposes. To ease the construction of detection workflows, PyGOD offers numerous commonly used utility functions. To scale computation to large graphs, PyGOD supports functionalities for deep models such as sampling and mini-batch processing. PyGOD uses best practices in fostering code reliability and maintainability, including unit testing, continuous integration, and code coverage. To facilitate accessibility, PyGOD is released under a BSD 2-Clause license at https://pygod.org and at the Python Package Index (PyPI).
Motivation & Objective
- To address the lack of a dedicated, comprehensive library for graph outlier detection in Python, despite existing tools for tabular and time-series data.
- To unify diverse graph outlier detection methods—spanning node, edge, subgraph, and graph-level detection—under a single, consistent API.
- To enhance scalability for large graphs by implementing mini-batch and sampling support in key models.
- To ensure high code quality and maintainability through automated testing, continuous integration, code coverage, and adherence to PEP8 standards.
- To improve accessibility and community collaboration via detailed documentation, Jupyter notebooks, and open-source hosting on GitHub.
Proposed method
- PyGOD is built on PyTorch and PyTorch Geometric (PyG), leveraging their optimized graph data handling and GNN implementations.
- All models inherit from a common base class with a scikit-learn-inspired API, including fit, decision_function, predict, and predict_proba methods.
- Each model implements a process_graph abstract method to extract task-specific graph features (e.g., adjacency matrix, node/edge attributes) from PyG data objects.
- Scalability is achieved through mini-batch training and sampling support in selected models, enabling efficient processing of large-scale graphs.
- The library includes utility functions for outlier injection (structure and attribute-based) and evaluation metrics (e.g., recall@k, precision@k) for benchmarking.
- Code quality is enforced via GitHub Actions for cross-platform testing, 90%+ test coverage via Coveralls, and PEP8-compliant coding standards.
Experimental results
Research questions
- RQ1How can a unified, scalable, and maintainable Python library be designed to support diverse graph outlier detection methods?
- RQ2To what extent can mini-batch and sampling techniques improve the scalability of graph outlier detection models on large graphs?
- RQ3Can a consistent API design across multiple GNN-based outlier detection models enhance usability for both researchers and practitioners?
- RQ4How effective is the integration of automated testing, continuous integration, and code coverage in maintaining a high-quality open-source library?
- RQ5What role can standardized evaluation utilities and outlier injection tools play in enabling reproducible benchmarking of graph outlier detection models?
Key findings
- PyGOD supports over ten leading graph outlier detection algorithms across node, edge, subgraph, and graph levels, with varying supervision settings.
- The library enables scalable inference on large graphs through mini-batch and sampling support in models such as DOMINANT, DONE, and OCGNN.
- Code quality is maintained with 90%+ test coverage, automated cross-platform testing via GitHub Actions, and PEP8 compliance.
- The unified API design allows seamless model switching and integration with existing PyG data pipelines, improving usability.
- The library includes built-in evaluation metrics like recall@k and precision@k, and utility functions for injecting synthetic outliers in both structural and attribute spaces.
- PyGOD is released under a permissive BSD license on GitHub and PyPI, ensuring broad accessibility and community contribution.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.