Welcome to Smart Agriculture 中文

Smart Agriculture

   

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:

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

CLC Number: