This project performs node classification on the large-scale Amazon product co-purchasing network using Graph Neural Networks (GNNs). Two powerful models — GCN and GraphSAGE — are implemented and compared using the ogbn-products dataset from the Open Graph Benchmark (OGB).
- ⚡ Built using PyTorch Geometric (PyG)
- 🧱 Supports both GCN and GraphSAGE architectures
- 🧪 Evaluated using accuracy and F1-score on train/val/test splits
- 📊 Confusion matrix visualization for model analysis
- ✅ Fully reproducible with clear modular code
- Name: ogbn-products
- Source: Open Graph Benchmark
- Description: An Amazon product network where nodes represent products, and edges indicate that two products are frequently bought together. The task is to predict product category.
- 2 layers of
GCNConv - ReLU activation between layers
- 2 layers of
SAGEConv - ReLU activation between layers
- Accuracy
- F1-score (macro)
- Confusion Matrix
- Results compared across:
- Training Set
- Validation Set
- Test Set
- Clone the repository:
git clone https://github.com/Sayed-Hossein-Hosseini/amazon-node-classification.git- Install required libraries:
pip install torch torchvision torchaudio
pip install torch-geometric ogb
pip install seaborn matplotlib scikit-learn- Run the notebook:
jupyter notebook Node_Classification_in_the_Amazon_Product_Graph.ipynb- Implement attention-based GNNs (e.g., GAT)
- Apply link prediction on same graph
- Use full-batch training with distributed support
- Convert model to TorchScript for deployment
Contributions are welcome! Feel free to open issues or submit pull requests to improve this project.
This project is licensed under the MIT License.
Created by Sayyed Hossein Hosseini DolatAbadi Feel free to connect or reach out via GitHub.