欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture

• •    

基于改进时间融合Transformers的中国大豆需求预测方法

刘佳佳1,3, 秦晓婧2(), 李乾川2(), 许世卫1,4, 赵继春2, 王一罡2, 熊露1,4, 梁晓贺1,3   

  1. 1. 中国农业科学院 农业信息研究所,北京 100081,中国
    2. 北京市农林科学院 数据科学与农业经济研究所,北京 100097,中国
    3. 农业农村部区块链农业应用重点实验室,北京 100081,中国
    4. 农业农村部农业监测预警技术重点实验室,北京 100081,中国
  • 收稿日期:2025-05-21 出版日期:2025-07-28
  • 基金项目:
    北京市农林科学院青年基金(QNJJ202328); 国家重点研发计划(2022YFD1600603); 中央级公益性科研院所基本科研业务费专项(Y2025ZZ08); 北京市社会科学基金(23JYB012)
  • 作者简介:

    刘佳佳,硕士,副研究员,研究方向为农业大数据与监测预警。E-mail:

  • 通信作者:
    秦晓婧,硕士,副研究员,研究方向为农业大数据、数据治理。E-mail:
    李乾川,博士,助理研究员,研究方向为农业数据治理、农业大模型和农业人工智能应用。E-mail:

Forecasting Method for China's Soybean Demand Based on Improved Temporal Fusion Transformers

LIU Jiajia1,3, QIN Xiaojing2(), LI Qianchuan2(), XU Shiwei1,4, ZHAO Jichun2, WANG Yigang2, XIONG Lu1,4, LIANG Xiaohe1,3   

  1. 1. Institute of Agricultural Information, Chinese Academy of Agricultural Sciences, Beijing 100081, China
    2. Institute of Data Science and Agricultural Economics, Beijing Academy of Agricultural and Forestry Sciences, Beijing 100097, China
    3. Key Laboratory of Agricultural Blockchain Application, Ministry of Agriculture and Rural Affairs, Beijing 100081, China
    4. Key Laboratory of Agricultural Monitoring and Early Warning Technology, Ministry of Agriculture and Rural Affairs, Beijing 100081, China
  • Received:2025-05-21 Online:2025-07-28
  • Foundation items:Youth Fund of Beijing Academy of Agricultural and Forestry Sciences(QNJJ202328); National Key Research and Development Program Project(2022YFD1600603); Fundamental Research Funds for Central Public Welfare Research Institutes(Y2025ZZ08); Beijing Social Science Fund(23JYB012)
  • About author:

    LIU Jiajia, E-mail:

  • Corresponding author:
    QIN Xiaojing, E-mail:
    LI Qianchuan, E-mail:

摘要:

[目的/意义] 精准预测大豆需求对保障国家粮食安全、优化产业决策与应对国际贸易变局有着重要的现实意义,而利用时间融合Transformers(Temporal Fusion Transformers, TFT)模型开展中国大豆需求预测时,在特征交互层与注意力权重分配等方面仍存在一定局限。为此,亟需探索一种基于改进TFT模型的预测方法,以提升需求预测的准确性与可解释性。 [方法] 本研究将深度学习的TFT模型应用到中国大豆需求预测中,提出了一种基于多层动态特征交互(Multi-layer Dynamic Feature Interaction, MDFI)与自适应注意力权重优化(Adaptive Attention Weight Optimization, AAWO)改进的MA-TFT(Improved TFT Model Based on MDFI and AAWO)模型。对包含1980—2024年4 652个相关指标的中国大豆需求分析数据集进行数据预处理和特征工程,设计实验将MA-TFT模型分别与自回归差分移动平均模型(Autoregressive Integrated Moving Average Model, ARIMA)、长短期记忆网络(Long Short-Term Memory, LSTM)模型及TFT模型进行预测性能对比,分别进行了MDFI与AAWO模块的消融实验,同时利用SHAP(SHapley Additive exPlanations)工具可解释性分析影响中国大豆需求的关键特征变量,开展了未来10年的中国大豆需求量预测。 [结果和讨论] MA-TFT模型的均方误差(Mean Squared Error, MSE)、平均绝对百分比误差(Mean Absolute Percentage Error, MAPE)分别为0.036和5.89%,决定系数R²为0.91,均高于对比模型,均方根误差(Root Mean Square Error, RMSE)和MAPE较基准模型累计降低21.84%和3.44%,表明改进TFT的MA-TFT模型能够捕捉特征间复杂关系,提升预测性能;研究利用SHAP工具可解释性分析发现,MA-TFT模型对影响中国大豆需求关键特征变量的解释稳定性较高;预计2025、2030、2034年中国大豆需求量分别达到11 799万吨、11 033万吨和11 378万吨。 [结论] 基于改进TFT的MA-TFT模型方法为解决现有大豆需求预测方法精度不足、可解释性不强的实际问题提供了解决思路,也为其他农产品时间序列预测的方法优化与应用提供了参考和借鉴。

关键词: 时间融合Transformers(TFT), 大豆需求预测, 多层动态特征交互, 自适应注意力权重优化, 可解释性分析

Abstract:

[Objective] Accurate prediction of soybean demand is of profound practical significance for safeguarding national food security, optimizing industrial decision-making, and responding to fluctuations in international trade. Traditional soybean demand forecasting methods are plagued by inadequacies such as limited capacity to excavate data dimensionality and multivariate interactive features, insufficient ability to capture nonlinear relationships under the coupling of multi-dimensional dynamic factors, and challenges in model interpretability and domain adaptability. These limitations render them incapable of effectively supporting accurate prediction and interpretable analysis of China's soybean demand. When the temporal fusion transformers (TFT) model is applied to forecast China's soybean demand, it exhibits certain constraints in aspects like feature interaction layers and attention weight allocation. Consequently, there is an urgent need to explore a forecasting method based on the improved TFT model to enhance the accuracy and interpretability of soybean demand prediction. [Methods] Drawing on relevant domestic and international studies, this research applied the deep learning-based TFT model to China's soybean demand forecasting and proposed the MA-TFT (improved TFT model based on MDFI and AAWO) model, which was enhanced through multi-layer dynamic feature interaction (MDFI) and adaptive attention weight optimization (AAWO). Firstly, the study collected and collated a dataset for analyzing China's soybean demand, covering seven dimensions: consumption, production, trade, inventory, market, economy and policy, and international factors. This dataset, encompassing 4 652 relevant indicators spanning from 1980 to 2024, was subjected to data cleaning, transformation, augmentation, and feature engineering. The training, validation, and test sets for the model were constructed using the rolling window method. Secondly, based on the architecture of the TFT model for China's soybean demand forecasting, a multi-layer dynamic feature interaction module and an adaptive attention weight optimization strategy were designed. Additionally, the model's loss function, training strategy, and Bayesian hyperparameter tuning method were formulated, and the model performance evaluation metrics were determined. Subsequently, experiments were designed to compare the prediction performance of the MA-TFT model with that of the autoregressive integrated moving average model (ARIMA), long short-term memory (LSTM) model, and the original TFT model. Ablation experiments on the MDFI and AAWO modules were conducted separately. The SHapley Additive exPlanations (SHAP) tool was employed for interpretability analysis to identify key feature variables influencing China's soybean demand and their interaction relationships. Error analysis was performed between the predicted and actual values of China's historical soybean demand, and a comparative analysis of the predicted soybean demand in China from 2025 to 2034 was carried out. [Results and Discussions] The mean squared error (MSE) and mean absolute percentage error (MAPE) of the MA-TFT model were 0.036 and 5.89%, respectively, with a coefficient of determination R² of 0.91, all of which outperformed those of the comparative models, namely ARIMA (1,1,1), LSTM, and TFT. Compared with the benchmark TFT model, the root mean square error (RMSE) and MAPE of the MA-TFT model decreased cumulatively by 21.84% and 3.44%, respectively. These results indicated that the MA-TFT model, as an improved version of TFT, could capture complex relationships between features and enhance prediction performance and accuracy. Interpretability analysis using the SHAP tool revealed that the MA-TFT model exhibited high stability in explaining key feature variables affecting China's soybean demand. It was projected that China's soybean demand would reach 117.99 million tons, 110.33 million tons, and 113.78 million tons in 2025, 2030, and 2034, respectively. [Conclusions] The MA-TFT model, developed by improving the TFT model, provides an innovative solution to address the practical issues of insufficient accuracy and poor interpretability in existing soybean demand forecasting methods. It also offers valuable references for method optimization and application in time series forecasting of other bulk agricultural products.

Key words: Temporal Fusion Transformers (TFT), soybean demand forecast, multi-layer dynamic feature interaction, adaptive attention weight optimization, interpretability analysis

中图分类号: