Loading...
Loading...
Contributors:
Dataset URI:
10.5281/zenodo.23354361# CD-STHGT **Causal Decoupled Spatiotemporal Heterogeneous Graph Transformer forMulti-Step Prediction of Industrial Innovation Capability** Reference implementation and dataset for the paper*Multi-Step Prediction Model and Algorithm for Industrial InnovationCapability Integrating Spatiotemporal Heterogeneous Graph Transformer andCausal Decoupling Representation Learning*. [](https://www.python.org/)[](https://pytorch.org/)[](https://pytorch-geometric.readthedocs.io/)[](LICENSE) --- ## Overview CD-STHGT forecasts the innovation capability of Chinese provincial-subindustrynodes one through seven years ahead by combining three ideas: - **Dual-timescale heterogeneous graphs**: slow structural relations (geographic adjacency, industrial-chain coupling, technological similarity) are blended with fast shock graphs (talent mobility, patent citation) via a cycle-aware node gate driven by macro policy themes.- **Ternary causal disentanglement**: node embeddings are projected to causal, environmental and style factors with an HSIC independence penalty; a combined back-door and front-door adjustment produces causal predictions that generalise under distribution shift.- **Causal trajectory rollout and CD-Shapley**: a recurrent cell evolves the causal factor along the forecast horizon, a trajectory consistency term stabilises long-horizon rollouts, and a counterfactual Shapley procedure with do-operator interventions attributes the forecast to each driver. | Model | RMSE@1 | RMSE@5 | RMSE@7 | MAPE@5 (%) ||--------------|-------:|-------:|-------:|-----------:|| Informer | 0.198 | 0.312 | 0.389 | 10.7 || iTransformer | 0.187 | 0.294 | 0.362 | 10.1 || HGT | 0.183 | 0.281 | 0.346 | 9.6 || CaST | 0.176 | 0.272 | 0.338 | 9.4 || DVGNN | 0.168 | 0.258 | 0.325 | 8.9 || **CD-STHGT** | **0.141** | **0.217** | **0.268** | **7.2** | Against the strongest baseline (DVGNN), CD-STHGT reduces RMSE by 16.0 %,15.9 % and 17.6 % at horizons 1, 5 and 7 respectively. --- ## Repository contents This repository ships as two archives: - **`cdsthgt-code.zip`** - PyTorch 2.1 and PyTorch Geometric 2.5 implementation. Model, baselines, attribution, evaluation, figure and table generators. End-to-end pipeline. - **`cdsthgt-dataset.zip`** - longitudinal panel on 31 provincial administrative regions, 5 high-technology subindustries and 19 years (2005 to 2023), together with five heterogeneous graph relations, 326 policy documents, LDA topics, keyword dictionaries and auxiliary materials. --- ## Quick start ### 1. Install ```bashgit clone <this-repo-url>.git cdsthgt && cd cdsthgtpython -m venv .venv && source .venv/bin/activatepip install -r requirements.txt``` Dependencies (also in `requirements.txt`): - `torch >= 2.1`- `torch_geometric >= 2.5`- `numpy`, `pandas`, `scipy`, `scikit-learn`- `statsmodels` (ARIMA baseline)- `xgboost` (XGBoost baseline)- `matplotlib` (figures), `pyyaml` (config), `openpyxl` (results export) ### 2. Place the dataset Download `cdsthgt-dataset.zip`, extract and symlink or copy into `./data/`: ```bashunzip cdsthgt-dataset.zipmv cdsthgt-dataset/panel/provincial_subindustry_panel_2005_2023.csv \ data/panel_main_2005_2023.csvcp -r cdsthgt-dataset/heterogeneous_relations data/cp -r cdsthgt-dataset/policy_corpus data/``` Alternatively edit `configs/cdsthgt.yaml` to point `data.panel_csv`,`data.relations_dir` and `data.policy_dir` at your chosen locations. ### 3. Run End-to-end pipeline: ```bashpython scripts/run_all.py``` Produces every table and figure under `experiments/results/`. On a singleRTX 4090 the full run (5 seeds for CD-STHGT, 3 seeds for the ten baselines,200 epochs) finishes in roughly 11 hours. Stage-by-stage: ```bash# CD-STHGT, five seeds, 200 epochspython scripts/train_cdsthgt.py \ --config configs/cdsthgt.yaml \ --output experiments/results/cdsthgt_table7.json # Ten baselines, three seeds, 50 epochs eachpython scripts/train_baselines.py \ --config configs/cdsthgt.yaml \ --epochs 50 --seeds 0 1 2 \ --baselines ARIMA XGBoost LSTM Informer iTransformer \ STGCN GraphWaveNet HGT CaST DVGNN \ --output experiments/results/baselines_table7.json # Tables 7 through 14python scripts/aggregate_results.py # CD-Shapley attribution at the 2020 forecast originpython scripts/run_attribution.py --origin 2020 --n_permutations 64 # Figures 3 and 7 through 14python scripts/generate_figures.py``` --- ## Project structure ```cdsthgt/├── README.md (this file)├── requirements.txt├── LICENSE├── configs/│ └── cdsthgt.yaml Model and training hyperparameters├── data/ Place dataset here (see Section 2)├── src/│ ├── data/ Panel loader, dual-timescale graph│ │ builder, policy mediator,│ │ rolling-origin protocol│ ├── models/│ │ ├── cdsthgt.py CD-STHGT main model│ │ ├── dthg_module.py Meta-path attention,│ │ │ cycle-aware gated fusion│ │ ├── disentangle.py Ternary disentanglement,│ │ │ back-door and front-door adjustment│ │ └── baselines/│ │ └── all_baselines.py Ten baselines│ ├── attribution/│ │ └── cd_shapley.py Counterfactual Shapley│ ├── evaluation/│ │ └── metrics.py Evaluation metrics│ └── utils/│ └── seed.py Reproducibility helpers├── scripts/│ ├── train_cdsthgt.py Train the main model│ ├── train_baselines.py Train the ten baselines│ ├── aggregate_results.py Reproduce Tables 7 through 14│ ├── run_attribution.py CD-Shapley attribution│ ├── generate_figures.py Reproduce Figures 3, 7 through 14│ └── run_all.py Full end-to-end pipeline└── results/ ├── tables/ Reference tables (CSV) └── figures/ Reference figures (PNG)``` --- ## Dataset Full specification in `cdsthgt-dataset/README.md`. Summary: - 31 provincial administrative regions, 5 high-technology subindustries, 19 years (2005 through 2023) - 2,945 node-year observations.- 14 input features over five dimensions (innovation input, innovation output, innovation collaboration, economic environment, digital foundation) plus the composite innovation capability score on a 4.2 through 100 scale.- Five heterogeneous graph relations (geographic adjacency, industrial-chain coupling, technological similarity, talent mobility, patent citation), the slow ones as yearly weighted adjacency matrices and the fast ones as dated quarterly events.- 326 central-government policy documents with LDA topic intensities and topic-subindustry similarities.- Supplementary materials: IPC-to-subindustry concordance, inventor disambiguation dictionary, recruitment-platform flow panel, keyword dictionary, stopword list, three central-government policy events, provincial centroid coordinates and contiguity pairs. Primary sources: *China High-Technology Industry Statistical Yearbook*,*China Science and Technology Statistical Yearbook*, *China IndustrialStatistical Yearbook*, the CNIPA patent database, the *White Paper onChina's Digital Economy* of the China Academy of Information andCommunications Technology, and the State Council / MIIT / NDRC / MOSTpolicy archives. --- ## Model architecture ### Dual-timescale heterogeneous graph Transformer Meta-path aware multi-head attention over seven meta-paths plus twocomposite paths (Equation 2 of the paper). The cycle-aware gated fusion(Equation 3) uses a node-wise gate g[v, t] computed from the slow and fastweighted degree of v combined with the annual topic-intensity embedding. ```alpha[u, v, r, k] = softmax_u( ( W_Q^{r,k} h_v )^T ( W_K^{r,k} h_u ) / sqrt(d_k) * mu[r, k] )g[v, t] = sigmoid( w_g^T [ s^slow[v] s^fast[v] p[t] ] + b_g )A_slow^fuse[t] = diag(g[t]) * A^slow[t]A_fast^fuse[t] = diag(1 - g[t]) * A^fast[t]``` ### Ternary causal disentanglement Each node embedding h is projected to: - **z^c** = Encoder_c(h), the causal factor- **z^e** = Quantizer(h), the environmental factor on a 16-entry codebook- **z^s** = Encoder_s(h), the style factor An HSIC term enforces independence between z^c and z^e. The front-door andback-door adjustment (Equations 5 and 6) produces the causal prediction`P_causal = eta * P_back + (1 - eta) * P_front` with eta = 0.5. ### Causal trajectory rollout A gated recurrent cell rolls z^c forward one step at a time; the adjustmentreads out a prediction at each step. The composite loss is ```L = L_pred + 0.3 * L_traj + 0.01 * L_HSIC + 0.1 * L_rec``` where L_traj penalises the squared difference of successive z^c states. ### CD-Shapley attribution Permutation sampling with do-interventions on each feature; the baseline isthe zero vector in standardized feature space (the training-period mean).The time-dependent effect curve Phi_i(t) is produced by rollingone-feature-at-a-time counterfactuals through the input window. --- ## Reproducibility Random seeds are controlled by `src/utils/seed.py` and set under`training.seeds` in the YAML configuration. Standard deviations reported inthe paper's Table 7 come from the five seeds in the default configuration. Rolling-origin protocol (same as the paper): three forecast origins(2018, 2019, 2020), four horizons (1, 3, 5, 7 years), input window ofT = 5 years, slow-graph window of 3 years, fast-graph quarter window of 1,diffusion coefficient beta = 0.5. --- ## Baselines Ten baselines, all implemented to the same training budget as CD-STHGT:ARIMA (statsmodels), XGBoost (xgboost), LSTM, Informer, iTransformer,STGCN, GraphWaveNet, HGT, CaST, DVGNN. Full definitions in`src/models/baselines/all_baselines.py`. --- ## Figures and tables Reference versions live under `results/`. Running `python scripts/run_all.py`regenerates them under `experiments/results/`: - **Figure 3**: fast-graph gating weight 1 - mean(g) across 2005 through 2023.- **Figure 7**: spatiotemporal heatmap of innovation capability across the 31 provinces by year.- **Figure 8**: horizon-wise RMSE comparison across the ten baselines and CD-STHGT.- **Figure 9**: ablation study (one-at-a-time module removal).- **Figure 10**: causal fidelity on five semi-synthetic benchmarks, SHAP versus CD-Shapley.- **Figure 11**: time-dependent causal effect curves for the five dominant drivers.- **Figure 12**: regional effect ordering across east, central and west.- **Figure 13**: robustness under six perturbation scenarios.- **Figure 14**: scenario simulation attributions. Tables cover comparative accuracy (Table 7), ablation (Table 8), causalfidelity on semi-synthetic benchmarks (Table 10), external policy shockreplay (Table 11), perturbation robustness (Table 12), interval predictionquality (Table 13) and scenario attribution (Table 14). --- ## Citation If you use this code or dataset in your research, please cite: ```bibtex@article{cdsthgt2026, title = {Multi-Step Prediction Model and Algorithm for Industrial Innovation Capability Integrating Spatiotemporal Heterogeneous Graph Transformer and Causal Decoupling Representation Learning}, year = {2026}}``` --- ## Licence MIT License. See [`LICENSE`](LICENSE) for the full text.
Keyword(s):
MeSH Term(s):
Grants and Funding:
No Grants or Funding Data Available
Associated Publication(s):
No Associated Publication Data Available
Supplementary Data:
No Supplementary Data Available
Related Dataset(s):
No Related Dataset Data Available
The National Library of Medicine (NLM) provides information about biomedical datasets. Inclusion on an NLM Web page does not imply endorsement of, or agreement with, the contents by NLM or the National Institutes of Health. Learn more: NLM Web Policies (nih.gov)