ChainSight-AI is a Graph Neural Network (GNN) and Social Network Analysis (SNA) framework designed to model supply chain ecosystems as heterogeneous graphs. By combining time-series node metrics with multi-relational graph attention mechanisms, ChainSight-AI predicts product demand, forecasts factory issue events, and automatically pinpoints critical supply chain bottlenecks ("weakest links").
- Heterogeneous Graph Representation: Models 41 products connected across 4 distinct supply chain relationship layers (
by_plant,by_storage,by_group,by_sub_group). - Temporal GAT Architecture: Fuses a GRU temporal encoder with multi-head HeteroConv Graph Attention Networks to capture spatiotemporal dependencies.
- Dual Prediction Tasks:
- Regression: Next-day sales order weight forecasting.
- Classification: Next-day factory issue event prediction (binary).
- Risk Propagation & Bottleneck Extraction: Extracts multi-head attention weights to rank critical inter-product dependencies and visualize supply chain risk maps.
- Benchmark Baseline: Includes fully-scaled Multi-Layer Perceptron (MLP) baselines demonstrating GAT superiority.
SNAProject/
├── Raw Dataset/ # Raw supply chain nodes, edges, and temporal metrics
│ ├── Edges/ # Edges across plants, groups, sub-groups, storage
│ ├── Nodes/ # Product definitions and group mappings
│ └── Temporal Data/ # 221 days of daily unit & weight time-series
├── PreProcessing/ # Pipeline scripts for dataset preparation
│ ├── preprocess.py # Assembles feature tensors and edge arrays
│ ├── mismatch.py # Column consistency diagnostics
│ ├── hetero.py # PyG HeteroData structure builder
│ ├── CreateSamples.ipynb # Sliding-window sample generator (7-day history → 1-day forecast)
│ └── traintestsplit.ipynb # Chronological 70/15/15 train/val/test splitter
├── GATCls.ipynb # Temporal GAT Classification & Attention Weight Extractor
├── GATReg.ipynb # Temporal GAT Regression
├── MLPCls.ipynb # Baseline MLP Classifier
├── MLPReg.ipynb # Baseline MLP Regressor
├── RiskImportanceGraph.ipynb # Supply chain risk map visualization
├── GAT_Risk_Importance_Map.csv# Extracted edge importance rankings
└── Risk_Propagation_Map.png # Rendered risk network visualization
| Task | Metric | Baseline MLP | ChainSight GAT | Improvement |
|---|---|---|---|---|
| Classification (Factory Issue) | F1-Score | 0.8663 | 0.9049 | +4.46% |
| Classification (Factory Issue) | Accuracy | 0.8574 | 0.8891 | +3.70% |
| Regression (Sales Order Weight) | RMSE | 18.2090 | 16.2003 | -11.03% (Lower error) |
| Regression (Sales Order Weight) | MSE | 331.5661 | 262.4504 | -20.85% (Lower error) |
- Python 3.10+
- PyTorch
- PyTorch Geometric (
torch_geometric) - scikit-learn, pandas, numpy, matplotlib, networkx
-
Preprocess raw data:
python PreProcessing/preprocess.py
-
Generate sliding-window samples & split datasets: Run
PreProcessing/CreateSamples.ipynbandPreProcessing/traintestsplit.ipynb. -
Train Temporal GAT Model: Execute
GATCls.ipynborGATReg.ipynb. -
Extract & Visualize Supply Chain Risk Map: Run
RiskImportanceGraph.ipynbto generateRisk_Propagation_Map.png.