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

Smart Agriculture

• •    

基于优化神经网络时间序列模型的蔬菜价格预测方法

侯颖1,3, 孙坦2,3(), 崔运鹏1,3(), 王晓东4, 赵安平4, 王婷1,3, 王增飞4, 杨唯佳4, 谷钢5   

  1. 1. 中国农业科学院农业信息研究所,北京 100081,中国
    2. 中国农业科学院,北京 100081,中国
    3. 农业农村部农业大数据重点实验室,北京 100081,中国
    4. 北京市数字农业农村促进中心,北京 101117,中国
    5. 浪潮软件科技有限公司,北京 100094,中国
  • 收稿日期:2024-10-11 出版日期:2025-05-22
  • 基金项目:
    “十四五”国家重点研发计划课题(2023YFD1600305); 北京市智慧农业创新团队项目(BAIC10-2025)
  • 作者简介:

    侯 颖,硕士,研究方向为农业大数据挖掘、自然语言处理。E-mail:

  • 通信作者:
    孙 坦,研究员,研究方向为数字信息描述与组织。E-mail:
    崔运鹏,研究员,研究方向为农业大数据挖掘分析、自然语言处理。E-mail:

Vegetable Price Prediction Based on Optimized Neural Network Time Series Models

HOU Ying1,3, SUN Tan2,3(), CUI Yunpeng1,3(), WANG Xiaodong4, ZHAO Anping4, WANG Ting1,3, WANG Zengfei4, YANG Weijia4, GU Gang5   

  1. 1. Agricultural Information Institute, Chinese Academy of Agricultural Sciences, Beijing 100081, China
    2. Chinese Academy of Agricultural Sciences, Beijing 100081, China
    3. Key Laboratory of Agricultural Big Data, Ministry of Agriculture and Rural Affairs, Beijing 100081, China
    4. Beijing Digital Agriculture Rural Promotion Center, Beijing 101117, China
    5. Inspur Software Technology Co. , Beijing 100094, China
  • Received:2024-10-11 Online:2025-05-22
  • Foundation items:National Key Research and Development Program of China(2023YFD1600305); Beijing Smart Agriculture Innovation Consortium Project(BAIC10-2025)
  • About author:

    HOU Ying, E-mail:

  • Corresponding author:
    SUN Tan, E-mail:
    CUI Yunpeng, E-mail:

摘要:

[目的/意义] 蔬菜价格预测难度较大,在其时间序列中受到天气、物流、季节、供需、政策等多种因素影响,数据具有非线性和非平稳特性。 [方法] 以胡萝卜、白萝卜、茄子和结球生菜4种常见蔬菜价格为研究对象,提出一种基于神经网络结构的时序模型价格预测方法。引入自动调参优化算法对PatchTST、iTransformer、SOFTS、TiDE、Time-LLM这5种基于神经网络结构的时序预测模型进行超参数调优,并将传统自回归积分移动平均模型(Autoregressive Integrated Moving Average, ARIMA)作为基准模型,对比了基于神经网络时序模型的预测性能,最终选择性能最优模型预测蔬菜价格。通过平均绝对误差(Mean Absolute Error, MAE)、平均绝对百分比误差(Mean Absolute Percentage Error, MAPE)、均方误差(Mean Square Error, MSE)多维度指标分析了各模型的价格预测准确度。 [结果和讨论] 基于神经网络结构的时序预测模型在蔬菜价格预测中具有较好的拟合效果,而引入的自动调参优化算法在价格预测任务中成为提高模型表现的关键。具体来说,模型经过自动调参优化算法后,胡萝卜、白萝卜和茄子日价预测在MSE指标上至少分别降低了76.3%,94.7%和74.8%;周价预测至少分别降低85.6%,93.6%和64.0%,表现出较好的准确性。 [结论] 自动调参优化算法有效地提升了模型预测性能,可以较为准确地预测蔬菜价格走势,为蔬菜价格预测问题提供了高效的解决方案。

关键词: 农产品价格, 蔬菜价格, 时间序列, 神经网络, 价格预测, 价格波动

Abstract:

[Objective] Vegetables are a vital component of the human diet, serving not only as a cornerstone of nutritional well-being but also as a significant source of income for agricultural producers. The price volatility of vegetables has profound implications for both farmers and consumers. Fluctuating prices directly impact farmers' earnings and pose challenges to market stability and consumer purchasing behaviors. These fluctuations are driven by a multitude of complex and interrelated factors, including supply and demand, seasonal cycles, climatic conditions, logistical efficiency, government policies, consumer preferences, and suppliers' trading strategies. As a result, vegetable prices tend to exhibit nonlinear and non-stationary patterns, which significantly complicate efforts to produce accurate price forecasts. Addressing these forecasting challenges holds considerable practical and theoretical value, as improved prediction models can support more stable agricultural markets, secure farmers' incomes, reduce cost-of-living volatility for consumers, and inform more precise and effective government regulatory strategies. [Methods] The study investigated the application of neural network-based time series forecasting models for the prediction of vegetable prices. In particular, a selection of state-of-the-art neural network architectures was evaluated for their effectiveness in modeling the complex dynamics of vegetable pricing. The selected models for the research included PatchTST and iTransformer, both of which were built upon the Transformer architecture, as well as SOFTS and TiDE, which leveraged multi-layer perceptron (MLP) structures. In addition, Time-LLM, a model based on a large language model architecture, was incorporated to assess its adaptability to temporal data characterized by irregularity and noise. To enhance the predictive performance and robustness of these models, an automatic hyperparameter optimization algorithm was employed. This algorithm systematically adjusted key hyperparameters such as learning rate, batch size, early stopping, and random seed. It utilized probabilistic modeling techniques to construct performance-informed distributions for guiding the selection of more effective hyperparameter configurations. Through iterative updates informed by prior evaluation data, the optimization algorithm increased the search efficiency in high-dimensional parameter spaces, while simultaneously minimizing computational costs. The training and validation process allocated 80 percent of the data to the training set and 20 percent to the validation set, and employed the mean absolute error (MAE) as the primary loss function. In addition to the neural network models, the study incorporated a traditional statistical model, the autoregressive integrated moving average (ARIMA), as a baseline model for performance comparison. The predictive accuracy of all models was assessed using three widely recognized error metrics: MAE, mean absolute percentage error (MAPE), and mean squared error (MSE). The model that achieved the most favorable performance across these metrics was selected for final vegetable price forecasting. [Results and Discussions] The experimental design of the study focused on four high-demand, commonly consumed vegetables: carrots, white radishes, eggplants, and iceberg lettuce. Both daily and weekly price forecasting tasks were conducted for each type of vegetable. The empirical results demonstrated that the neural network-based time series models provided strong fitting capabilities and produced accurate forecasts for vegetable prices. The integration of automatic hyperparameter tuning significantly improved the performance of these models. In particular, after tuning, the MSE for daily price prediction decreased by at least 76.3% for carrots, 94.7% for white radishes, and 74.8% for eggplants. Similarly, for weekly price predictions, the MSE reductions were at least 85.6%, 93.6%, and 64.0%, respectively, for the same three vegetables. These findings confirm the substantial contribution of the hyperparameter optimization process to enhancing model effectiveness. Further analysis revealed that neural network models performed better on vegetables with relatively stable price trends, indicating that the underlying consistency in data patterns benefited predictive modeling. On the other hand, Time-LLM exhibited stronger performance in weekly price forecasts involving more erratic and volatile price movements. It's robustness in handling time series data with high degrees of randomness suggests that model architecture selection should be closely aligned with the specific characteristics of the target data. Ultimately, the study identified the best-performing model for each vegetable and each prediction frequency. The results demonstrated the generalizability of the proposed approach, as well as its effectiveness across diverse datasets. By aligning model architecture with data attributes and integrating targeted hyperparameter optimization, the research achieved reliable and accurate forecasts. [Conclusions] The study verified the utility of neural network-based time series models for forecasting vegetable prices. The integration of automatic hyperparameter optimization techniques notably improved predictive accuracy, thereby enhancing the practical utility of these models in real-world agricultural settings. The findings provide technical support for intelligent agricultural price forecasting and serve as a methodological reference for predicting prices of other agricultural commodities. Future research may further improve model performance by integrating multi-source heterogeneous data. In addition, the application potential of more advanced deep learning models can be further explored in the field of price prediction.

Key words: agricultural product prices, vegetable prices, time series, neural networks, price prediction, price fluctuation

中图分类号: