Views
No views yet
| File | Purpose |
|---|---|
gnn.pt | Spider-GNN backbone state_dict (141 K params, ~579 KB) |
pca.pkl | Pickled {"pca": sklearn.PCA(n=10), "scaler": StandardScaler} |
xgb.pkl | Pickled dict[target_name, list[XGBRegressor]] — 9 seeds × 5 targets |
revision="v8" when downloading (see Usage below).| Target | R² ↑ | RMSE | Unit |
|---|---|---|---|
| RSSI | 0.759 | 6.43 | dBm |
| RSRP | 0.770 | 6.36 | dBm |
| RSRQ | 0.268 | 1.70 | dB |
| SNR | 0.146 | 6.06 | dB |
| CQI | 0.195 | 2.86 | step |
| Mean R² | 0.421 | — | — |
1import pickle
2import torch
3from huggingface_hub import hf_hub_download
4
5REPO = "uts-aiot-ibc-research/graph-xgb"
6REV = "v8"
7
8gnn_pt = hf_hub_download(REPO, "gnn.pt", revision=REV)
9pca_pkl = hf_hub_download(REPO, "pca.pkl", revision=REV)
10xgb_pkl = hf_hub_download(REPO, "xgb.pkl", revision=REV)
11
12# 1. Load GNN backbone (architecture: GATv2Conv ×2, hidden=32, heads=4, in_dim=14)
13# See `apps/api/src/graph_xgb/registry/hf_loader.py` in the source repo
14# (uts-aiot-ibc-research/spider-gnn) for the full `_SpiderGNN` definition.
15state_dict = torch.load(gnn_pt, map_location="cpu", weights_only=True)
16
17# 2. Load PCA + StandardScaler
18with open(pca_pkl, "rb") as f:
19 bundle = pickle.load(f)
20pca, scaler = bundle["pca"], bundle["scaler"]
21
22# 3. Load 45 XGBoost regressors (5 targets × 9 seeds)
23with open(xgb_pkl, "rb") as f:
24 ensemble = pickle.load(f) # dict[target, list[XGBRegressor]]
25
26# Inference pipeline:
27# emb = gnn.get_embedding(x, edge_index, edge_attr) # (N, 128)
28# pca_emb = pca.transform(scaler.transform(emb)) # (N, 10)
29# X = np.concatenate([pca_emb, x_spatial], axis=1) # (N, 24)
30# for target in ["CQI", "RSSI", "RSRP", "SNR", "RSRQ"]:
31# preds = np.mean([m.predict(X) for m in ensemble[target]], axis=0)Spider-GNN backbone (frozen after training)
└─ GATv2Conv(14 → 32×4=128, edge_dim=4)
GATv2Conv(128 → 128, edge_dim=4)
LayerNorm + GELU + Dropout(0.3)
shared_mlp → 128-D embedding
per-target heads (RSSI / RSRP / RSRQ / SNR / CQI)
↑ heads are trained but unused at inference;
only the shared 128-D embedding feeds the XGBoost stage.
XGBoost stage (per target, ensemble of 9 seeds)
└─ Input: 24 D = PCA(128 → 10) + 14 D raw spatial features
Output: averaged prediction in physical units
(CQI clipped and rounded to [0, 15])1@inproceedings{spidergnn2025,
2 title = {Spider-GNN: A Graph Neural Network for Indoor 5G Signal Prediction},
3 booktitle = {BESC 2025},
4 year = {2025},
5 note = {Code and model: https://huggingface.co/uts-aiot-ibc-research/graph-xgb}
6}