Fast moving consumer goods sales volume prediction method and device based on deep learning
The LSTM algorithm based on deep learning has established a fast-moving consumer goods sales forecast model, which has solved the problem of low accuracy in the existing technology of fast-moving consumer goods sales forecasting, and achieved higher-precision sales forecasting, which supports enterprises to adjust their strategies more effectively in complex market environments.
Patent Information
- Application Number
- CN202411329596.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-06-03
AI Technical Summary
The method of fast-moving consumer goods sales forecasting in the prior art is relatively low in accuracy, and it is difficult to meet the strategic adjustment needs of enterprises in complex and changing market environments.
A deep learning-based method is adopted to establish a fast-moving consumer goods sales prediction model using the LSTM algorithm, and improve the accuracy of the prediction results through data preprocessing, model training and testing evaluation.
It significantly improves the accuracy of fast-moving consumer goods sales forecasts, helping companies predict sales more accurately, and thus make strategic adjustments more quickly when the market environment changes.
Smart Images

Figure CN120087999A_ABST
Abstract
Description
Technical Field
[0001] The present invention discloses a fast-moving consumer goods sales volume prediction method and device based on deep learning, which relates to the technical field of data analysis and prediction. Background Art
[0002] With the rapid development of China's social economy and the rapid advancement of the modernization level, the market scale of China's fast-moving consumer goods industry is continuously expanding and maintaining a steady growth trend. The sales volume of fast-moving consumer goods is affected by various factors and has the characteristics of uncertainty and diversification. The sales volume prediction of fast-moving consumer goods can provide strong support for the production planning and warehousing and transportation of relevant enterprises, so as to promote enterprises to quickly make strategic adjustments in the complex and changeable market environment. At present, there is little research on the sales volume prediction of fast-moving consumer goods, and no relatively accurate prediction model has been established for the sales volume prediction of fast-moving consumer goods. Summary of the Invention
[0003] Aiming at the problems of the prior art, the present invention provides a fast-moving consumer goods sales volume prediction method and device based on deep learning, which solves the problem of low accuracy of the existing fast-moving consumer goods sales volume prediction method, improves the accuracy of the fast-moving consumer goods sales volume prediction result, and facilitates fast-moving consumer goods enterprises to quickly make strategic adjustments according to the prediction result.
[0004] The specific solution proposed by the present invention is as follows:
[0005] The present invention provides a fast-moving consumer goods sales volume prediction method based on deep learning, including:
[0006] Step 1: Select the sales volume data of representative products of a fast-moving consumer goods company within a preset time period;
[0007] Step 2: Perform preprocessing on the sales volume data and form a feature data set. The preprocessing includes data redundancy processing, missing data processing, abnormal data processing, and data normalization processing;
[0008] Step 3: Select the LSTM algorithm in deep learning to establish a prediction model, set the activation function and loss function of the prediction model, and set the network structure of the prediction model. The network structure includes an input layer, a hidden layer, and an output layer. A gating unit is introduced into the hidden layer. The gating unit includes an input gate, a forget gate, and an output gate, and the gating unit is used to control the transmission process of the sales volume data in the network structure;
[0009] Step 4: Train the prediction model: input the feature data of the sales volume data into the input layer of the network structure of the prediction model, calculate through the hidden layer, and then output the predicted value through the output layer. Calculate the loss value using the loss function, and use the time series backpropagation algorithm to update the weights of the network structure. Repeat the training process until the gradient error reaches the set value or reaches the maximum number of training iterations, and end the training of the prediction model;
[0010] Step 5: Test and evaluate the prediction model. If it passes the test and evaluation, use the established prediction model for fast-moving consumer goods sales to predict the sales volume of fast-moving consumer goods.
[0011] Furthermore, in step 2 of the method for predicting fast-moving consumer goods sales based on deep learning, duplicate data in the sales volume data is deleted through data redundancy processing; the sales volume data for the missing time period is filled by using the method of calculating the mean through missing data processing; data with sales volume significantly exceeding the maximum limit range within a certain time period is removed and filled by using the method of calculating the mean through abnormal data processing; the sales volume data is restricted within the scaling range through normalization processing, and the scaling range is [0, 1] or [-1, 1].
[0012] Furthermore, in step 3 of the method for predicting fast-moving consumer goods sales based on deep learning, the activation function and loss function of the prediction model are set, including: using the Sigmoid function as the activation function, and normalizing the value range of real numbers between 0 and 1 through the Sigmoid function.
[0013] Use the MSE function as the loss function to judge the error of the prediction model.
[0014] Furthermore, in step 5 of the method for predicting fast-moving consumer goods sales based on deep learning, it specifically includes:
[0015] Select model evaluation indicators to evaluate the prediction model. The model evaluation indicators include the mean absolute percentage error MAPE, mean square error MSE, mean absolute error MAE, root mean square error RMSE, and determination coefficient R 2 ,
[0016] Establish a control prediction model with the same parameter configuration.
[0017] Use the prediction model and the control prediction model to predict the sales volume data respectively, calculate the model evaluation indicators, and judge whether the prediction model passes the test and evaluation according to the calculation results of the model evaluation indicators. If the model evaluation indicators of the prediction model are all better than those of the control prediction model, it passes the test and evaluation; otherwise, retrain the prediction model.
[0018] The present invention also provides a device for predicting fast-moving consumer goods sales based on deep learning, including a collection module, a data preprocessing module, a model management module, and a prediction module.
[0019] The collection module selects the sales volume data of representative products of fast-moving consumer goods companies within a preset time period.
[0020] The data preprocessing module preprocesses the sales volume data and forms a feature data set. The preprocessing includes data redundancy processing, missing data processing, abnormal data processing, and data normalization processing;
[0021] The model management module selects the LSTM algorithm in deep learning to establish a prediction model, sets the activation function and loss function of the prediction model, and sets the network structure of the prediction model. The network structure includes an input layer, a hidden layer, and an output layer. A gating unit is introduced in the hidden layer. The gating unit includes an input gate, a forget gate, and an output gate, and the gating unit is used to control the transmission process of the sales volume data in the network structure;
[0022] The model management module trains the prediction model: inputs the feature data of the sales volume data into the input layer of the network structure of the prediction model, calculates through the hidden layer, and then outputs the predicted value through the output layer. Calculates the loss value using the loss function, and uses the time series backpropagation algorithm to update the weights of the network structure. Repeats the training process until the gradient error reaches the set value or reaches the maximum number of training iterations, and ends the training of the prediction model;
[0023] The model management module tests and evaluates the prediction model. If it passes the test and evaluation, the prediction module uses the established prediction model of the fast-moving consumer goods sales volume to predict the fast-moving consumer goods sales volume.
[0024] Furthermore, the data preprocessing module of the fast-moving consumer goods sales volume prediction device based on deep learning deletes duplicate data in the sales volume data through data redundancy processing; fills in the sales volume data of the missing time period by using the method of calculating the mean through missing data processing; eliminates the data with the sales volume significantly exceeding the maximum limit range within a certain time period through abnormal data processing and fills it in by using the method of calculating the mean; limits the sales volume data within the scaling range through normalization processing, and the scaling range is [0,1] or [-1,1].
[0025] Furthermore, the model management module of the fast-moving consumer goods sales volume prediction device based on deep learning sets the activation function and loss function of the prediction model, including: using the Sigmoid function as the activation function, and normalizing the value range of real numbers between 0 and 1 through the Sigmoid function,
[0026] using the MSE function as the loss function to judge the error of the prediction model.
[0027] Furthermore, the model management module of the fast-moving consumer goods sales volume prediction device based on deep learning tests and evaluates the prediction model, specifically including:
[0028] Select model evaluation metrics to evaluate the prediction model. The model evaluation metrics include Mean Absolute Percentage Error (MAPE), Mean Squared Error (MSE), Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and Coefficient of Determination R 2 ,
[0029] Establish a control prediction model with the same parameter configuration.
[0030] Use the prediction model and the control prediction model to predict the sales volume data respectively, calculate the model evaluation metrics, and judge whether the prediction model passes the test evaluation according to the calculation results of the model evaluation metrics. If the model evaluation metrics of the prediction model are all better than those of the control prediction model, it passes the test evaluation; otherwise, retrain the prediction model.
[0031] The beneficial effects of the present invention are as follows:
[0032] Based on the LSTM deep neural network, the present invention establishes a fast-moving consumer goods sales volume prediction model and also conducts test evaluation on the model, greatly improving the accuracy of the fast-moving consumer goods sales volume prediction model, solving the problem of low accuracy of the existing fast-moving consumer goods sales volume prediction method, improving the accuracy of the fast-moving consumer goods sales volume prediction result, and facilitating fast-moving consumer goods enterprises to quickly make strategic adjustments according to the prediction result. Description of the Drawings
[0033] Figure 1 It is a schematic diagram of the method flow of the present invention. Detailed Embodiments
[0034] The present invention will be further described below in conjunction with the drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the specific embodiments given are not intended to limit the present invention.
[0035] Embodiment 1
[0036] The present invention provides a fast-moving consumer goods sales volume prediction method based on deep learning, including:
[0037] Step 1: Select the sales volume data of representative products of a fast-moving consumer goods company within a preset time period. For example, select the sales volume data of representative products of a fast-moving consumer goods company in the recent two years.
[0038] Step 2: Preprocess the sales volume data and form a feature data set. The preprocessing includes data redundancy processing, missing data processing, abnormal data processing, and data normalization processing.
[0039] Among them, duplicate data in the sales volume data can be deleted through data redundancy processing; for missing data processing, the sales volume data in the missing time period can be filled by using the method of calculating the average value; for abnormal data processing, the data with sales volume significantly exceeding the maximum limit range within a certain time period can be excluded and filled by using the method of calculating the average value; through normalization processing, the sales volume data can be restricted within the scaling range through scaling operations, and the scaling range is [0, 1] or [-1, 1]. Normalization processing can eliminate the dimensional difference between data units, facilitate the simultaneous analysis of data of different magnitudes, and is conducive to improving the convergence speed of the prediction model. For example, the Min-Max method can be used to normalize the input data of the prediction model and standardize the processed data into the range of [0, 1].
[0040] Step 3: Select the LSTM algorithm in deep learning to establish a prediction model, set the activation function and loss function of the prediction model, and set the network structure of the prediction model. The network structure includes an input layer, a hidden layer, and an output layer. Among them, a gating unit is introduced in the hidden layer, and the gating unit includes an input gate, a forget gate, and an output gate, and the gating unit is used to control the transmission process of the sales volume data in the network structure.
[0041] Among them, the Sigmoid function can be used as the activation function. The Sigmoid function is a non-linear activation function, and the main function of the Sigmoid function is to standardize the value range of real numbers between 0 and 1.
[0042] The MSE function can be used as the loss function to judge the error of the prediction model.
[0043] The optimization algorithm for model parameters can adopt the Adam optimization algorithm. The Adam algorithm makes full use of the first-order moment mean and second-order moment mean of the gradient, performs exponential smoothing calculation on the adaptive learning rate parameter, and incorporates the momentum factor into the update process. This algorithm is applicable to the optimization operation process of a large amount of data and parameters, and is conducive to solving problems such as sparse gradients.
[0044] Step 4: Train the prediction model: Input the feature data of the sales volume data into the input layer of the network structure of the prediction model, calculate through the hidden layer, and then output the predicted value through the output layer. Use the loss function to calculate the loss value, and adopt the time series backpropagation algorithm to update the weights of the network structure. Repeat the training process until the gradient error reaches the set value or reaches the maximum number of training iterations, and end the training of the prediction model.
[0045] Among them, the training parameters can be set according to the number of network structure layers, the number of neuron nodes, the activation function, the loss function, the optimization algorithm, and other basic parameters of the prediction model. During training, the first 80% of the fast-moving consumer goods sales volume data is used as the training set, and the last 20% of the fast-moving consumer goods sales volume data is used as the test set.
[0046] The preprocessed fast-moving consumer goods sales data is used as features and input into the input layer of the LSTM network structure. The input vectors and output vectors of the input gate, the input vectors and output vectors of the forget gate, the input vector of the memory cell, the cell state at this moment, and the input vectors and output vectors of the output gate of the hidden layer are calculated in sequence. The output results of the hidden layer are trained iteratively. Finally, the predicted values are obtained. The loss function is calculated based on the predicted values and the true values, and the backpropagation algorithm BPTT (Backpropagation Through Time) is used to update the weights of the network. The training process is repeated until the gradient error reaches the set value or the maximum number of iterations is reached, and then the training of the prediction model is ended and it is saved.
[0047] Step 5: Test and evaluate the prediction model. First, the data of the test set can be input into the trained prediction model, and the prediction accuracy is judged according to the prediction results. If the prediction results are good, the evaluation continues; otherwise, the parameters are reset to train the prediction model until a prediction model with higher prediction accuracy is obtained.
[0048] To facilitate the comparison of the prediction capabilities of the fast-moving consumer goods sales prediction model based on the LSTM deep neural network, the present invention establishes a GRU control prediction model with the same parameter configuration for the prediction of fast-moving consumer goods sales. GRU is the Gated Recurrent Unit neural network, and five model evaluation indicators are selected to show the prediction accuracy of the model.
[0049] The model evaluation indicators include: Mean Absolute Percentage Error (MAPE), Mean Squared Error (MSE), Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and Coefficient of Determination R 2 . The first four error indicators all reflect the error values between the predicted values and the actual values. The smaller the value of the indicator, the more accurate the prediction effect of the model. The last indicator represents the correlation degree between the predicted values and the true values. The larger the R 2 value, the better the prediction performance of the prediction model.
[0050] The model evaluation comparison between the fast-moving consumer goods LSTM prediction model and the GRU control prediction model is shown in Table 1.
[0051] MODEL MAPE MSE MAE RMSE <![CDATA[R 2 > GRU prediction model 17.082079% 3039.663550 53.548469 60.152789 0.695419 LSTM prediction model 15.221096% 1503.575159 23.958511 36.775961 0.937334
[0052] Through the comparison of the model evaluation indicators in the table, the indicators of the prediction model of the LSTM deep neural network of the present invention are all better than those of the GRU control prediction model, and the test evaluation is passed this time.
[0053] After passing the test evaluation, fast-moving consumer goods enterprises can use the prediction model established by the present invention to predict the sales volume of fast-moving consumer goods in the future for a period of time, and adjust the production and sales strategies in a timely manner according to the sales volume prediction results.
[0054] Example 2
[0055] The present invention also provides a fast-moving consumer goods sales volume prediction device based on deep learning, which includes a collection module, a data preprocessing module, a model management module, and a prediction module.
[0056] The collection module selects the sales volume data of representative products of fast-moving consumer goods companies within a preset time period.
[0057] The data preprocessing module performs preprocessing on the sales volume data and forms a feature data set. The preprocessing includes data redundancy processing, missing data processing, abnormal data processing, and data normalization processing.
[0058] The model management module selects the LSTM algorithm in deep learning to establish a prediction model, sets the activation function and loss function of the prediction model, and sets the network structure of the prediction model. The network structure includes an input layer, a hidden layer, and an output layer. A gating unit is introduced in the hidden layer. The gating unit includes an input gate, a forget gate, and an output gate, and the gating unit is used to control the transmission process of the sales volume data in the network structure.
[0059] The model management module trains the prediction model: inputs the feature data of the sales volume data into the input layer of the network structure of the prediction model, calculates through the hidden layer, and then outputs the predicted value through the output layer. Calculates the loss value using the loss function, and uses the time series backpropagation algorithm to update the weights of the network structure. Repeats the training process until the gradient error reaches the set value or reaches the maximum number of training iterations, and ends the training of the prediction model.
[0060] The model management module conducts test evaluation on the prediction model. If it passes the test evaluation, the prediction module uses the established prediction model of the fast-moving consumer goods sales volume to predict the fast-moving consumer goods sales volume.
[0061] For the content such as information interaction and execution process among the above-mentioned modules, since it is based on the same concept as the method embodiment of the present invention, the specific content can be referred to the description in the method embodiment of the present invention, and will not be elaborated here.
[0062] Similarly, the advantages of the device of the present invention are:
[0063] Based on the LSTM deep neural network, a prediction model for the fast-moving consumer goods sales volume is established, and the model is also tested and evaluated, which greatly improves the accuracy of the prediction model for the fast-moving consumer goods sales volume, solves the problem of low accuracy of the existing fast-moving consumer goods sales volume prediction method, improves the accuracy of the fast-moving consumer goods sales volume prediction result, and facilitates fast-moving consumer goods enterprises to quickly make strategic adjustments according to the prediction result.
[0064] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as required. The system structures described in the above-mentioned embodiments can be physical structures or logical structures. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities separately, or some components in multiple independent devices may be jointly implemented.
[0065] The above-mentioned embodiments are only preferred embodiments cited to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for predicting sales of fast-moving consumer goods based on deep learning, characterized by include: Step 1: Select the sales data of representative products of fast-moving consumer goods companies within a preset time period; Step 2: Preprocess the sales data and form a feature data set. The preprocessing includes data redundancy processing, missing data processing, abnormal data processing, and data normalization processing; Step 3: Select the LSTM algorithm in deep learning to establish a prediction model, set the activation function and loss function of the prediction model, and set the network structure of the prediction model. The network structure includes an input layer, a hidden layer, and an output layer. A gate control unit is introduced into the hidden layer. The gate control unit includes an input gate, a forget gate, and an output gate. The gate control unit is used to control the transmission process of sales data in the network structure; Step 4: Train the prediction model: Input the characteristic data of sales data into the input layer of the prediction model network structure, calculate it through the hidden layer, and then output the prediction value through the output layer. Use the loss function to calculate the loss value, and use the time series back propagation algorithm to update the weight of the network structure. Repeat the training process until the gradient error reaches the set value or reaches the maximum number of training iterations, and then end the training of the prediction model. Step 5: Test and evaluate the prediction model. After the test and evaluation, use the established prediction model for fast-moving consumer goods sales to predict the sales of fast-moving consumer goods.
2. The method for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 1, characterized in that In step 2, duplicate data in the sales data is deleted through data redundancy processing; the sales data of the missing time period is filled by the averaging method through missing data processing; the data with sales obviously exceeding the maximum limit range in a certain time period is eliminated through abnormal data processing and filled by the averaging method; the sales data is limited to the scaling range by scaling operation through normalization processing, and the scaling range is [0,1] or [-1,1].
3. The method for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 1 is characterized in that In step 3, the activation function and loss function of the prediction model are set, including: using the Sigmoid function as the activation function, and normalizing the value range of real numbers to between 0 and 1 through the Sigmoid function, The MSE function is used as the loss function to determine the error of the prediction model.
4. The method for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 1, characterized in that Step 5 specifically includes: The model evaluation indicators are selected to evaluate the prediction model. The model evaluation indicators include mean absolute percentage error (MAPE), mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE) and determination coefficient (R). 2 , Establish a control prediction model with the same parameter configuration. The prediction model and the control prediction model are used to predict sales data respectively, and the model evaluation index is calculated. According to the calculation results of the model evaluation index, it is judged whether the prediction model passes the test evaluation. If the model evaluation index of the prediction model is better than that of the control prediction model, it passes the test evaluation, otherwise the prediction model is retrained.
5. A fast-moving consumer goods sales prediction device based on deep learning, characterized by It includes acquisition module, data preprocessing module, model management module and prediction module. The collection module selects the sales data of representative products of fast-moving consumer goods companies within a preset time period; The data preprocessing module preprocesses the sales data and forms a feature data set. The preprocessing includes data redundancy processing, missing data processing, abnormal data processing, and data normalization processing; The model management module selects the LSTM algorithm in deep learning to establish a prediction model, sets the activation function and loss function of the prediction model, and sets the network structure of the prediction model. The network structure includes an input layer, a hidden layer, and an output layer. A gate control unit is introduced into the hidden layer. The gate control unit includes an input gate, a forget gate, and an output gate. The gate control unit is used to control the transmission process of sales data in the network structure. The model management module trains the prediction model: the characteristic data of the sales data is input into the input layer of the prediction model's network structure, calculated by the hidden layer, and then outputs the prediction value through the output layer. The loss value is calculated using the loss function, and the time series back propagation algorithm is used to update the weights of the network structure. The training process is repeated until the gradient error reaches the set value or the maximum number of training iterations is reached, and the prediction model training is terminated; The model management module tests and evaluates the prediction model. After the test and evaluation, the prediction module uses the established prediction model for the sales of fast-moving consumer goods to predict the sales of fast-moving consumer goods.
6. The device for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 5, characterized in that The data preprocessing module deletes duplicate data in the sales data through data redundancy processing; fills in the sales data of the missing time period by using the averaging method through missing data processing; eliminates the data whose sales obviously exceed the maximum limit range in a certain time period through abnormal data processing and fills it by using the averaging method; and limits the sales data to the scaling range by scaling operation through normalization processing, and the scaling range is [0,1] or [-1,1].
7. The device for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 5, characterized in that The model management module sets the activation function and loss function of the prediction model, including: using the Sigmoid function as the activation function, and using the Sigmoid function to normalize the value range of real numbers to between 0 and 1. The MSE function is used as the loss function to determine the error of the prediction model.
8. The device for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 5 is characterized in that the model The management module tests and evaluates the prediction model, including: The model evaluation indicators are selected to evaluate the prediction model. The model evaluation indicators include mean absolute percentage error (MAPE), mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE) and determination coefficient (R). 2 , Establish a control prediction model with the same parameter configuration. The prediction model and the control prediction model are used to predict sales data respectively, and the model evaluation index is calculated. According to the calculation results of the model evaluation index, it is judged whether the prediction model passes the test evaluation. If the model evaluation index of the prediction model is better than that of the control prediction model, it passes the test evaluation, otherwise the prediction model is retrained.