A GNN-based approach for accurate trade balance forecasting and interpretable analysis

Y Yifei Huang (State Key Laboratory of Natural Medicines, China Pharmaceutical University) Z Zhiyuan He (Homogeneous, Supramolecular Catalysis, and Bio-Inspired Catalysis Group, van ’t Hoff Institute for Molecular Sciences (HIMS)) C Cheng Ding

Abstract

In this study, we developed a machine learning pipeline to predict trade balances across 229 countries, utilizing a Graph Neural Network (GNN), and compared it with several deep learning and regression-based models. The data preprocessing involved handling missing values, normalizing features, and conducting exploratory data analysis to uncover key patterns. Feature selection was performed using a Random Forest Regressor to identify the most influential predictors of trade balances. We then evaluated multiple models, including a complex Deep Neural Network (DNN), Transformer with multi-head attention, Random Forest, and a hybrid ensemble model, using various regression metrics. Among these, the GNN proved to be the most effective model, achieving an MSE of 0.06, RMSE of 0.26, MAE of 0.18, and an R² of 0.91. These results demonstrate that GNN outperforms other models in terms of accuracy, robustness, and consistency in predicting trade balances. We compared models across several key evaluation metrics and conducted a detailed comparison of residual plots to assess prediction quality and error distribution. Residual plots and ROC curves were used to validate the reliability and performance of the GNN and other models, ensuring robust and accurate predictions across the board. This study highlights the potential of machine learning techniques to improve trade balance forecasting, providing policymakers and economists with a more adaptable and precise tool for navigating complex global trade dynamics. The findings contribute to more informed economic strategies and enhanced forecasting methodologies.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 21, Issue 4
Published April 29, 2026
Pages e0346324
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (3)

Y

Yifei Huang

State Key Laboratory of Natural Medicines, China Pharmaceutical University

Z

Zhiyuan He

Homogeneous, Supramolecular Catalysis, and Bio-Inspired Catalysis Group, van ’t Hoff Institute for Molecular Sciences (HIMS)

C

Cheng Ding