A comprehensive web platform for Graph Neural Network research and applications. This platform provides a modular, extensible framework for exploring GNN models across multiple domains and tasks with complete backend implementations for all major GNN tasks.
The GNN Platform is a sophisticated web interface that enables researchers and practitioners to experiment with Graph Neural Networks across a wide range of applications. Built with a modular architecture, it supports 12+ different GNN purposes and 20+ popular GNN models with production-ready backend implementations.
The platform supports the following GNN applications with complete backend implementations:
- Node Classification - Classify nodes into different categories
- Node Regression - Predict continuous values for nodes
- Edge Classification - Classify edges into different types
- Link Prediction - Predict missing or future edges
- Graph Classification - Classify entire graphs into categories
- Graph Regression - Predict continuous values for entire graphs
- Community Detection - Discover communities and clusters in graphs
- Anomaly Detection - Detect anomalous nodes, edges, or subgraphs
- Graph Generation - Generate new graphs with desired properties
- Graph Embedding Visualization - Learn low-dimensional graph representations
- Dynamic Graph Learning - Handle temporal and evolving graphs
- Graph Convolutional Network (GCN): Semi-supervised learning with graph convolutions
- Graph Attention Network (GAT): Attention-based graph neural network
- GraphSAGE: Inductive representation learning on large graphs
- Graph Isomorphism Network (GIN): Maximally powerful GNN for graph classification
- Chebyshev Graph Convolutional Network: Spectral graph convolution
- Simple Graph Convolution (SGC): Fast and interpretable graph convolution
- Variational Graph Autoencoder (VGAE): Probabilistic graph generation
- GraphVAE: Variational autoencoder for graph generation
- GraphRNN: Recurrent neural networks for graph generation
- GraphGAN: Generative adversarial networks for graph generation
- TemporalGCN/TemporalGAT: Temporal graph neural networks
- TemporalGraphSAGE/TemporalGIN: Temporal inductive learning
- RecurrentGNN: Recurrent graph neural networks
- TemporalTransformer: Transformer-based temporal modeling
- All 12 GNN Tasks: Fully implemented with PyTorch Geometric
- Production-Ready: Comprehensive training, evaluation, and prediction
- Advanced Capabilities: Embedding visualization, dynamic learning, graph generation
- Robust Training: Early stopping, checkpointing, GPU/CPU support
- GNN Purposes Overview: Visual cards showcasing different GNN applications
- Model Explorer: Browse supported GNN models with detailed information
- Research Impact: Learn about GNN applications in various fields
- Quick Start Guide: Step-by-step instructions for getting started
- Parameter Configuration: Intuitive forms for setting model parameters
- Training Controls: Start, monitor, and control GNN training
- Real-time Feedback: Live updates on training progress and results
- Visualization: Interactive plots and graph visualizations
- Result Analysis: Comprehensive analysis of training results
- Performance Metrics: Loss curves, convergence analysis, and accuracy measures
- Comparison Tools: Compare different GNN models and configurations
- Export Capabilities: Download results, plots, and model parameters
- Modular Architecture: Extensible design with purpose-specific modules
- Hyperparameter Tuning: Automated optimization with grid search and Bayesian optimization
- Dataset Management: Built-in support for popular graph datasets
- Model Sharing: Export trained models and share experiments
- Educational Resources: Comprehensive documentation and tutorials
- Graph Embedding Visualization: 6 dimensionality reduction methods (t-SNE, UMAP, PCA, MDS, Isomap, Kernel PCA)
- Interactive Plots: 2D/3D scatter plots with Plotly
- Clustering Analysis: K-means, DBSCAN, Spectral clustering with quality metrics
- Training Curves: Real-time loss and metric visualization
- Graph Structure: Network visualization and analysis
- Framework: FastAPI with Jinja2 templates
- Styling: Custom CSS with Bootstrap 5 integration
- JavaScript: Vanilla JS with modern ES6+ features
- Icons: Font Awesome for comprehensive iconography
- Charts: Chart.js for interactive visualizations
- Deep Learning: PyTorch + PyTorch Geometric
- Machine Learning: Scikit-learn for traditional algorithms
- Visualization: Matplotlib, Seaborn, Plotly, UMAP
- Data Processing: NumPy, Pandas, NetworkX
- API Framework: FastAPI with WebSocket support
- Python 3.8+
- PyTorch 1.9.0+
- PyTorch Geometric 2.0.0+
- FastAPI, Uvicorn
- Additional dependencies for visualization
-
Clone the repository:
git clone <repository-url> cd graph-neural-network
-
Install dependencies:
pip install -r requirements.txt
-
Start the platform:
# Start frontend python run_frontend.py # Start backend (in separate terminal) python run_backend.py
-
Access the application:
- Frontend: http://localhost:5000
- Backend API: http://localhost:8001
For detailed installation instructions, see INSTALL.md.
- Explore the Dashboard: Visit the main page to see GNN purposes and supported models
- Choose an Application: Select from node tasks, edge tasks, graph tasks, or specialized applications
- Select a Model: Pick the GNN architecture that suits your needs
- Configure Parameters: Set model parameters and training configuration
- Start Training: Launch GNN training and monitor progress
- Analyze Results: View interactive visualizations and performance metrics
from node_tasks.classification.nodes_classification import run_node_classification_experiment
config = {
'model_name': 'gat',
'dataset_name': 'cora',
'hidden_channels': 64,
'learning_rate': 0.01,
'epochs': 200
}
results = run_node_classification_experiment(config)
from graph_embedding_visualization.graph_embedding_visualization import run_embedding_visualization_experiment
config = {
'model_name': 'gcn',
'dataset_name': 'cora',
'embedding_dim': 32,
'learning_rate': 0.01,
'epochs': 200
}
results = run_embedding_visualization_experiment(config)
- Dashboard (
/
): Overview of GNN applications and models - Applications: Dropdown menu with all GNN tasks
- Experiment Pages: Training interface for each model
- Results Pages: Analysis and visualization
All models in our platform expect data in PyTorch Geometric Data format:
x
: Node features tensor (num_nodes × num_features)edge_index
: Edge connectivity tensor (2 × num_edges)edge_attr
: Edge features tensor (num_edges × num_edge_features) - optionaly
: Target values tensor (num_nodes/num_edges/num_graphs × num_targets)train_mask
,val_mask
,test_mask
: Boolean masks for data splitting - optional
from utils.data_utils import csv_to_pytorch_geometric
# Convert CSV files to PyTorch Geometric format
data = csv_to_pytorch_geometric(
edges_file="edges.csv", # Required: source, target, [edge_features]
nodes_file="nodes.csv", # Optional: node_id, [node_features], [target]
node_features=["feature1", "feature2"], # Optional: column names for node features
edge_features=["weight", "type"], # Optional: column names for edge features
target_column="label", # Optional: column name for target values
task_type="node_classification" # Required: task type
)
import networkx as nx
from utils.data_utils import networkx_to_pytorch_geometric
# Convert NetworkX graph to PyTorch Geometric format
data = networkx_to_pytorch_geometric(
graph=graph,
node_features={"feature1": "attr1", "feature2": "attr2"}, # Optional
edge_features={"weight": "weight", "type": "type"}, # Optional
target_attribute="label" # Optional
)
import numpy as np
from utils.data_utils import adjacency_matrix_to_pytorch_geometric
# Convert adjacency matrix to PyTorch Geometric format
data = adjacency_matrix_to_pytorch_geometric(
adjacency_matrix=adj_matrix,
node_features=node_features,
targets=targets
)
from utils.data_utils import load_and_preprocess_data
# One-step preprocessing
data = load_and_preprocess_data(
data_path="data/edges.csv",
data_format="csv",
task_type="node_classification",
preprocessing_steps=[
"normalize_features",
"encode_categorical",
"split_data",
"validate"
],
nodes_file="data/nodes.csv",
node_features=["feature1", "feature2"],
target_column="label"
)
from utils.data_utils import validate_graph_data, get_data_info
# Validate data for specific task
is_valid = validate_graph_data(data, task_type="node_classification")
# Get comprehensive data information
info = get_data_info(data)
print(f"Nodes: {info['num_nodes']}, Edges: {info['num_edges']}")
print(f"Node features: {info['num_node_features']}")
print(f"Classes: {info['num_classes']}")
Task | Required | Optional | Data Splitting |
---|---|---|---|
Node Classification/Regression | Node features (x ), Node targets (y ) |
Edge features (edge_attr ) |
Node-level masks |
Edge Classification/Link Prediction | Node features (x ) |
Edge features (edge_attr ), Edge targets (y ) |
Edge-level masks |
Graph Classification/Regression | Node features (x ), Graph targets (y ) |
Edge features (edge_attr ) |
Graph-level splitting |
Community Detection | Node features (x ) |
Edge features (edge_attr ) |
No targets needed |
Anomaly Detection | Node features (x ) |
Edge features (edge_attr ) |
No targets needed |
- Data Preprocessing Guide: Comprehensive preprocessing documentation
- Preprocessing Examples: Practical examples with different formats
- Preprocessing Tests: Test suite for preprocessing utilities
API_BASE_URL
: Backend API URL (default: http://localhost:8001)
Each GNN task has its own configuration system:
- Model Parameters: Architecture-specific settings
- Training Parameters: Learning rate, epochs, optimization
- Dataset Parameters: Data preprocessing and augmentation
- Evaluation Parameters: Metrics and validation strategies
POST /api/train/{purpose_name}/{model_id}
: Submit training requestsGET /api/status/{experiment_id}
: Get training statusGET /api/results/{experiment_id}
: Retrieve results
GET /api/models/{purpose_name}
: List available modelsGET /api/parameters/{purpose_name}/{model_id}
: Get model parametersPOST /api/predict/{purpose_name}/{model_id}
: Make predictions
training_progress
: Real-time training updatesexperiment_complete
: Training completion notificationerror_occurred
: Error handling and reporting
- Backend Overview: Complete backend implementation guide with all 12 GNN tasks
- Task-Specific Docs: Detailed documentation for each GNN task
- API Reference: Backend API documentation
- Node Classification - Multi-class classification for nodes
- Node Regression - Continuous value prediction for nodes
- Edge Classification - Classifying edge types
- Link Prediction - Predicting missing edges
- Graph Classification - Classifying entire graphs
- Graph Regression - Predicting graph-level properties
- Community Detection - Detecting communities in graphs
- Anomaly Detection - Detecting anomalous nodes/edges
- Graph Generation - Generating new graphs
- Graph Embedding Visualization - Learning and visualizing graph embeddings
- Dynamic Graph Learning - Learning from evolving graphs
- Intuitive Interface: Clean, modern design with clear navigation
- Educational Focus: Comprehensive explanations and examples
- Interactive Learning: Hands-on exploration of GNN concepts
- Professional Presentation: Research-grade visualization and analysis
- Responsive Design: Works across all device sizes
- Keyboard Navigation: Full keyboard accessibility
- Clear Typography: Readable fonts and proper contrast
- Loading States: Clear feedback during operations
- Community detection in social networks
- Influence prediction and recommendation systems
- Anomaly detection in social graphs
- Protein-protein interaction networks
- Drug discovery and molecular property prediction
- Gene regulatory network analysis
- Scene graph understanding
- Object relationship modeling
- Image segmentation with graph structures
- Knowledge graph completion
- Document classification with citation networks
- Semantic role labeling
- User-item interaction modeling
- Collaborative filtering with graph structures
- Multi-modal recommendation
We welcome contributions! Please see our contributing guidelines for:
- Adding new GNN models
- Implementing new tasks
- Improving documentation
- Bug reports and feature requests
This project is licensed under the MIT License - see the LICENSE file for details.
- PyTorch Geometric team for the excellent GNN library
- FastAPI team for the modern web framework
- The GNN research community for inspiring this work
For questions, issues, or contributions:
- Check the documentation in the
docs/
directory - Review the troubleshooting sections
- Submit issues through the platform
Status: ✅ Production Ready - All 12 GNN tasks fully implemented with comprehensive backend support, advanced visualization capabilities, and web interface integration.