Skip to content

Conversation

@irtiza1999
Copy link

@irtiza1999 irtiza1999 commented Aug 9, 2025

📦 Pull Request Template

Thank you for your contribution! Please complete the checklist and provide relevant details below to help us review your PR effectively.


📋 Summary

This PR integrates GNNFingers (A Fingerprinting Framework for Verifying Ownerships of Graph Neural Networks) into the PyGIP framework, providing comprehensive model ownership verification capabilities for Graph Neural Networks. The implementation has been reorganized into a dedicated examples/ folder for better project structure and easier review.

🧪 Related Issues


✅ Checklist

  • My code follows the project's coding style
  • I have tested the changes and verified that they work
  • I have added necessary documentation (if applicable)
  • I have linked related issues above (if any)
  • The PR is made from a feature branch, not main

🧠 Additional Context (Optional)

Key Features Added

  • GNNFingers Defense Framework: Complete integration of the fingerprinting-based ownership verification system
  • Multi-Task Support: Node classification, graph classification, link prediction, and graph matching
  • PyGIP Dataset Adapter: Seamless integration with existing PyGIP datasets (Cora, PROTEINS, etc.)
  • Comprehensive Testing Suite: Full command-line interface with training, testing, and verification capabilities
  • Model Piracy Detection: Production-ready single model verification system
  • Automatic Fallbacks: Intelligent error handling and dataset/model adaptation

Major Components

  • Core Defense Implementation: models/defense/gnn_fingers_defense.py
  • GNN Model Architectures: models/defense/gnn_fingers_models.py
  • Dataset Integration: datasets/gnn_fingers_datasets.py, datasets/gnnfingers_adapter.py
  • Utility Functions: utils/gnn_fingers_utils.py
  • Examples and Experiments: examples/ folder with comprehensive test scripts

Technical Details

  • Fingerprint Construction: Graph-based fingerprints for each task type
  • Universal Verification: Binary classifier (Univerifier) for ownership detection
  • Joint Optimization: Alternating training algorithm for fingerprints and verifier
  • Robust Attack Resistance: Handles fine-tuning, distillation, and obfuscation attacks

Performance Metrics

Task Type Dataset Model Architecture AUC Accuracy
Node Classification Cora GCN 0.88 0.90
Node Classification Cora Graphsage 0.89 0.85
Node Classification Citeseer GCN 0.97 0.90
Node Classification Citeseer Graphsage 0.86 0.85
Link Prediction Cora GCN 0.69 0.70
Link Prediction Cora Graphsage 0.87 0.85
Link Prediction Citeseer GCN 0.52 0.55
Link Prediction Citeseer Graphsage 0.61 0.75
Graph Matching AIDS GCNMean 0.40 0.50
Graph Matching AIDS GCNDiff 0.48 0.50
Graph Matching AIDS SimGNN 0.22 0.50
Graph Matching PROTEINS GCNMean 0.46 0.50
Graph Matching PROTEINS GCNDiff 0.42 0.50
Graph Matching PROTEINS SimGNN 0.44 0.50
Graph Classification PROTEINS GCNMean 1.00 1.00
Graph Classification PROTEINS GCNDiff 1.00 1.00
Graph Classification PROTEINS GraphsageMean 1.00 1.00
Graph Classification PROTEINS GraphsageDiff 1.00 1.00
Graph Classification AIDS GCNMean 1.00 0.95
Graph Classification AIDS GCNDiff 1.00 1.00
Graph Classification AIDS GraphsageMean 1.00 1.00
Graph Classification AIDS GraphsageDiff 1.00 1.00

🧪 Testing and Examples

Examples Folder Structure

examples/
├── run_gnnfingers_experiments.py    # Main experiment runner
├── adapter_demo.py                   # GNNFingers adapter demonstration
├── test_adapter.py                   # Adapter functionality testing
├── test_examples_setup.py           # Setup verification script
└── README.md                         # Comprehensive documentation

Core Functionality Tests

Setup Verification

# Test that examples folder is properly configured
python examples/test_examples_setup.py

Dataset Adapter Tests

# Test PyGIP dataset adaptation functionality
python examples/test_adapter.py

Adapter Demo

# Run the complete adapter demonstration
python examples/adapter_demo.py

Individual Experiment Commands

Quick experiment (32 fingerprints, 50 epochs) - recommended for testing

python examples/run_gnnfingers_experiments.py --task node_classification --dataset Cora --model GCN --quick

Full experiment (64 fingerprints, 100 epochs) - production quality

python examples/run_gnnfingers_experiments.py --task graph_classification --dataset PROTEINS --model GCNMean

Batch Operation Commands

Run all 22 experiments in quick mode (testing)

python examples/run_gnnfingers_experiments.py --all --quick

Run all 22 experiments in full mode (production)

python examples/run_gnnfingers_experiments.py --all --full

Specific Task Examples

Node Classification

python examples/run_gnnfingers_experiments.py --task node_classification --dataset Cora --model GCN --quick
python examples/run_gnnfingers_experiments.py --task node_classification --dataset Citeseer --model Graphsage --quick

Graph Classification

python examples/run_gnnfingers_experiments.py --task graph_classification --dataset PROTEINS --model GCNMean --quick
python examples/run_gnnfingers_experiments.py --task graph_classification --dataset AIDS --model GraphsageDiff --quick

Link Prediction

python examples/run_gnnfingers_experiments.py --task link_prediction --dataset Cora --model GCN --quick
python examples/run_gnnfingers_experiments.py --task link_prediction --dataset Citeseer --model Graphsage --quick

Graph Matching

python examples/run_gnnfingers_experiments.py --task graph_matching --dataset AIDS --model GCNMean --quick
python examples/run_gnnfingers_experiments.py --task graph_matching --dataset PROTEINS --model SimGNN --quick

@irtiza1999 irtiza1999 force-pushed the feat/gnnfingers-implementation branch from 8b16258 to d992e64 Compare August 22, 2025 10:12
Sparshkhare1306 pushed a commit to Sparshkhare1306/PyGIP-backup that referenced this pull request Oct 1, 2025
Add script to generate LaTeX tables from CSV data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant