Due to the short shelf life of vegetable products, a significant portion of the inventory cannot be resold the following day. To facilitate more informed procurement decisions in superstores and minimize vegetable wastage, this study proposes a hybrid prediction model based on CNN-LSTM-Transformer for enhancing the accuracy of forecasting vegetable sales volumes. Firstly, an LSTM model is incorporated to account for the recurring and seasonal variations in vegetable sales. Secondly, a CNN model is introduced to address the limitations of LSTM in capturing spatial data components. The convolutional and pooling layers of CNN help establish spatial relationships among different feature values in the dataset. Finally, a Transformer model is integrated to tackle the issue of long-term dependencies, which LSTM alone struggles to resolve. The Transformer model employs a parallel attention mechanism, eliminating temporal dependencies and effectively addressing LSTM's long-term dependency challenge. This integration also accelerates model training. The evaluation metric employed in this paper is RMSE (Root Mean Square Error). The three-year sales volume of 11 vegetable types is predicted using seasonal ARIMA, XGBoost, LSTM, CNN-LSTM, and CNN-LSTM-Transformer models. The results indicate that the CNN-LSTM-Transformer model achieves the lowest RMSE at 0.0758, followed by ARIMA at 0.0792, CNN-LSTM at 0.0830, XGBoost at 0.0858, and LSTM at 0.0913. These findings demonstrate that the CNN-LSTM-Transformer model exhibits superior accuracy in forecasting vegetable sales volumes, yielding more precise predictions. This accurate forecasting not only aids superstores in reducing waste and enhancing profitability but also assists government authorities in rationalizing vegetable subsidy policies and optimizing the vegetable production and marketing system.
Read full abstract