Fast moving consumer goods sales volume prediction method, system and equipment based on deep learning, and medium
By applying deep learning LSTM algorithm in fast-moving consumer goods sales forecasting, the problem of low prediction accuracy in the existing technology is solved, and sales forecasts with higher accuracy are achieved, which supports fast-moving consumer goods companies to respond to market changes more effectively.
Patent Information
- Application Number
- CN202510073583.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-13
AI Technical Summary
The accuracy of fast-moving consumer goods sales forecast in the prior art is low, making it difficult to meet the strategic adjustment needs of fast-moving consumer goods enterprises in a complex and changing market environment.
The LSTM algorithm based on deep learning is used to establish a fast-moving consumer goods sales prediction model, and the prediction accuracy is improved through data preprocessing, model training and evaluation.
It significantly improves the accuracy of fast-moving consumer goods sales forecasts, helping fast-moving consumer goods companies to more accurately adjust their production and sales strategies and respond to market changes.
Smart Images

Figure CN119991191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fast-moving consumer goods sales forecasting, and specifically to a fast-moving consumer goods sales forecasting method, system, device and medium based on deep learning. Background Art
[0002] With the rapid development of economy and the rapid advancement of modernization, the market size of FMCG industry is continuously expanding and maintaining a steady growth trend. The sales volume of FMCG is affected by many factors and has the characteristics of uncertainty and diversification. The sales volume forecast of FMCG can provide strong support for the production planning and warehousing and transportation of related enterprises, thus promoting enterprises to make rapid strategic adjustments in a complex and changing market environment.
[0003] At present, there are few studies on the sales forecasting of fast-moving consumer goods. The relevant studies are also based on the traditional linear regression method and traditional machine learning method to establish prediction models to predict the sales of fast-moving consumer goods. The existing prediction models have the defect of low sales forecasting accuracy.
[0004] Therefore, how to improve the accuracy of fast-moving consumer goods sales forecast results so that fast-moving consumer goods companies can quickly adjust their business strategies based on the forecast results is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The technical task of the present invention is to provide a fast-moving consumer goods sales forecasting method, system, device and medium based on deep learning to solve the problem of how to improve the accuracy of fast-moving consumer goods sales forecasting results and facilitate fast-moving consumer goods companies to quickly adjust their business strategies according to the forecast results.
[0006] The technical task of the present invention is achieved in the following way: a method for predicting the sales volume of fast-moving consumer goods based on deep learning, the method is as follows:
[0007] Collect sales data of fast-moving consumer goods: Collect sales data of representative products of fast-moving consumer goods companies;
[0008] Data preprocessing: Perform data redundancy processing, data missing processing, abnormal data processing and data normalization processing on the collected fast-moving consumer goods sales data to obtain the preprocessed fast-moving consumer goods sales data;
[0009] Select the LSTM algorithm in deep learning to establish a fast-moving consumer goods sales forecasting model and set the network structure;
[0010] Training prediction models;
[0011] Evaluate prediction models;
[0012] Use the established fast-moving consumer goods sales forecasting model to forecast the sales of fast-moving consumer goods.
[0013] As a preferred embodiment, data redundancy processing refers to deleting duplicate data in the fast-moving consumer goods sales data;
[0014] Missing data processing refers to filling in the FMCG sales data of the missing time period by taking the mean;
[0015] Abnormal data processing is to remove the data whose sales volume obviously exceeds the maximum limit in any time period and fill it by averaging;
[0016] Normalization is a scaling operation performed on the data in order to limit the input data within a set range, and the scaling range is [0,1] or [-1,1]. Normalization eliminates the dimensional differences between data units, making it easier to analyze data of different magnitudes at the same time, which is beneficial to improving the convergence speed of the prediction model. The Min-Max method is used to normalize the input data of the fast-moving consumer goods sales prediction model, and the processed data is normalized to [0,1].
[0017] As a preferred method, the LSTM algorithm in deep learning is selected to establish a prediction model as follows:
[0018] The sales data of fast-moving consumer goods is a kind of data with time series characteristics. The deep neural network LSTM (Long Short-Term Memory Network) itself has the function of long-term memory. Three special gate structures, namely input gate, forget gate and output gate, are added to the memory unit module structure of the hidden layer. The deep neural network LSTM controls the transmission process of time series data in the network through the gate control unit, and selectively transmits effective information to the next part of the network.
[0019] Among them, the deep neural network LSTM can effectively save the input memory information of previous time steps in the process of processing information transmission with time series feature data.
[0020] As a preferred embodiment, the network structure is set as follows:
[0021] The activation function uses the Sigmoid function, which is a nonlinear activation function. The Sigmoid function normalizes the value range of real numbers to between 0 and 1.
[0022] The optimization algorithm of model parameters adopts Adam optimization algorithm. Adam algorithm makes full use of the first-order moment mean and second-order moment mean of gradient to perform exponential smoothing calculation on adaptive learning rate parameters, and incorporates momentum factors into the update process. Adam optimization algorithm is suitable for the optimization operation process of a large amount of data and parameters, which is conducive to solving the sparse gradient problem.
[0023] The loss function uses the MSE function to determine the error of the fast-moving consumer goods sales prediction model.
[0024] As a preference, the training prediction model is specifically as follows:
[0025] Preprocess the historical FMCG sales time series data and divide it into training set and test set: use the processed FMCG sales data of the most recent year as feature input parameters, and use the first 80% of the FMCG sales data as the training set, and the last 20% of the FMCG sales data as the test set;
[0026] Initialize the parameters of the fast-moving consumer goods sales prediction model: design the number of network structure layers, number of neuron nodes, incentive function, loss function, optimization algorithm and other basic parameters of the fast-moving consumer goods sales prediction model, and establish the basic LSTM network structure;
[0027] Use the training set data to train the network structure: input the normalized data in the training set into the input layer of the LSTM network structure in turn, and calculate the input vector and output vector of the hidden layer input gate, the input vector and output vector of the forget gate, the input vector of the memory unit and the unit state at that moment, and the input vector and output vector of the output gate in turn;
[0028] Obtain the network output value through forward propagation: cyclically train the output results of the hidden layer to finally obtain the predicted value, calculate the loss function based on the predicted value and the true value, and use BPTT back propagation to update the network weights;
[0029] Save the training model: Repeat the training process of the network structure until the loss function is less than the set value or the maximum number of iterations is reached, end the training of the fast-moving consumer goods sales prediction model and save the fast-moving consumer goods sales prediction model;
[0030] Sales forecasting through the test set: Input the data of the test set into the trained FMCG sales forecasting model, and judge the prediction accuracy based on the prediction results. If the prediction results are close to the true values, it proves that the established FMCG sales forecasting model has high accuracy. Otherwise, reset the parameters to train the FMCG sales forecasting model until a FMCG sales forecasting model with high prediction accuracy is obtained.
[0031] Preferably, the evaluation indicators of the fast-moving consumer goods sales forecasting model include: mean absolute percentage error MAPE, mean square error MSE, mean absolute error MAE, root mean square error RMSE and determination coefficient R 2 ;
[0032] Among them, the mean absolute percentage error MAPE, mean square error MSE, mean absolute error MAE and root mean square error RMSE all reflect the error value between the predicted value and the true value. The smaller the value of the indicator, the more accurate the prediction effect of the fast-moving consumer goods sales forecasting model;
[0033] Coefficient of determination R 2 Indicates the correlation between the predicted value and the true value, R 2 The larger the value, the higher the determination coefficient R 2 The better the predictive performance of the model.
[0034] A fast-moving consumer goods sales forecasting system based on deep learning, the system comprising:
[0035] The data collection module is used to collect sales data of representative products of fast-moving consumer goods companies;
[0036] The data preprocessing module is used to process the collected fast-moving consumer goods sales data in terms of data redundancy, data missingness, abnormal data, and data normalization to obtain the preprocessed fast-moving consumer goods sales data;
[0037] Model building and network setting module, which is used to select the LSTM algorithm in deep learning to build a fast-moving consumer goods sales forecasting model and set the network structure;
[0038] Model training module, used to train prediction models;
[0039] Model evaluation module, used to evaluate the prediction model;
[0040] The forecasting module is used to forecast the sales volume of fast-moving consumer goods using the established fast-moving consumer goods sales forecasting model.
[0041] Preferably, the model building and network setting module includes:
[0042] The network structure selection submodule is used to adopt the deep neural network LSTM (Long Short-Term Memory Network) which has the function of long-term memory. Three special gate structures, namely input gate, forget gate and output gate, are added to the memory unit module structure of the hidden layer. The deep neural network LSTM controls the transmission process of time series data in the network through the gate control unit, and selectively transmits effective information to the next part of the network. Among them, the deep neural network LSTM can effectively save the input memory information of the previous time steps in the process of processing information transmission with time series feature data;
[0043] The network structure setting submodule is used to select the activation function, optimization algorithm and loss function;
[0044] Among them, the activation function uses the Sigmoid function, which is a nonlinear activation function. The Sigmoid function normalizes the value range of real numbers to between 0 and 1;
[0045] The optimization algorithm of model parameters adopts Adam optimization algorithm. Adam algorithm makes full use of the first-order moment mean and second-order moment mean of gradient to perform exponential smoothing calculation on adaptive learning rate parameters, and incorporates momentum factors into the update process. Adam optimization algorithm is suitable for the optimization operation process of a large amount of data and parameters, which is conducive to solving the sparse gradient problem.
[0046] The loss function uses the MSE function to determine the error of the fast-moving consumer goods sales forecasting model;
[0047] The model training module includes:
[0048] The preprocessing submodule is used to preprocess the historical FMCG sales time series data and divide it into a training set and a test set: the processed FMCG sales data for the most recent year is used as the feature input parameter, and the first 80% of the FMCG sales data is used as the training set, and the last 20% of the FMCG sales data is used as the test set;
[0049] The parameter initialization submodule is used to design the network structure layers, number of neuron nodes, excitation function, loss function, optimization algorithm and other basic parameters of the fast-moving consumer goods sales prediction model, and establish the basic LSTM network structure;
[0050] The training submodule of the network structure is used to sequentially input the normalized data in the training set into the input layer of the LSTM network structure, and sequentially calculate the input vector and output vector of the hidden layer input gate, the input vector and output vector of the forget gate, the input vector of the memory unit and the unit state at that moment, and the input vector and output vector of the output gate;
[0051] The network output value acquisition submodule is used to cyclically train the output results of the hidden layer, and finally obtain the predicted value. The loss function is calculated based on the predicted value and the true value, and the BPTT back propagation is used to update the network weights.
[0052] The training model saving submodule is used to repeat the training process of the network structure until the loss function is less than the set value or the maximum number of iterations is reached, and the training of the fast-moving consumer goods sales prediction model is terminated and the fast-moving consumer goods sales prediction model is saved;
[0053] The test set test submodule is used to input the test set data into the trained FMCG sales prediction model, and judge the prediction accuracy based on the prediction results. If the prediction results are close to the true value, it proves that the established FMCG sales prediction model has high accuracy. Otherwise, the parameters are reset to train the FMCG sales prediction model until a FMCG sales prediction model with high prediction accuracy is obtained.
[0054] An electronic device comprising: a memory and at least one processor;
[0055] Wherein, the memory stores a computer program;
[0056] The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the fast-moving consumer goods sales prediction method based on deep learning as described above.
[0057] A computer-readable storage medium having a computer program stored therein, wherein the computer program can be executed by a processor to implement the fast-moving consumer goods sales prediction method based on deep learning as described above.
[0058] The fast-moving consumer goods sales forecasting method, system, device and medium based on deep learning of the present invention have the following advantages:
[0059] (1) The present invention uses the LSTM algorithm in deep learning to establish a fast-moving consumer goods sales forecasting model, which solves the problem of low accuracy in existing fast-moving consumer goods sales forecasting methods, improves the accuracy of fast-moving consumer goods sales forecasting results, and facilitates fast-moving consumer goods companies to quickly adjust their strategies based on the forecast results;
[0060] (ii) The present invention uses a fast-moving consumer goods sales prediction model based on the LSTM deep neural network, which uses historical fast-moving consumer goods sales data as prediction feature parameters and adopts a deep learning algorithm to predict fast-moving consumer goods sales, greatly improving the prediction accuracy of fast-moving consumer goods sales;
[0061] (III) Predicting the sales volume of fast-moving consumer goods in the future by using the prediction model established by the present invention, and adjusting the production and sales strategies in a timely manner according to the sales volume prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The present invention is further described below in conjunction with the accompanying drawings.
[0063] Attached Figure 1 A flowchart for training a fast-moving consumer goods sales prediction model;
[0064] Attached Figure 2 This is a comparison chart of the LSTM model prediction data, GRU model prediction data, and actual sales quantity data for fast-moving consumer goods. DETAILED DESCRIPTION
[0065] The fast-moving consumer goods sales prediction method, system, device and medium based on deep learning of the present invention are described in detail below with reference to the drawings and specific embodiments of the specification.
[0066] Embodiment 1:
[0067] This embodiment provides a method for predicting sales volume of fast-moving consumer goods based on deep learning, and the method is specifically as follows:
[0068] S1. Collect sales data of fast-moving consumer goods: Collect sales data of representative products of fast-moving consumer goods enterprises;
[0069] S2. Data preprocessing: Perform data redundancy processing, data missing processing, abnormal data processing and data normalization processing on the collected fast-moving consumer goods sales data to obtain the preprocessed fast-moving consumer goods sales data;
[0070] S3. Select the LSTM algorithm in deep learning to establish a fast-moving consumer goods sales prediction model and set the network structure;
[0071] S4, training prediction model;
[0072] S5. Evaluate the prediction model;
[0073] S6. Use the established fast-moving consumer goods sales forecasting model to forecast the sales of fast-moving consumer goods.
[0074] The data redundancy processing in step S2 of this embodiment refers to deleting duplicate data in the acquired fast-moving consumer goods sales data.
[0075] The missing data processing in step S2 of this embodiment refers to filling the fast-moving consumer goods sales data of the missing time period by calculating the average.
[0076] The abnormal data processing in step S2 of this embodiment is to eliminate the data whose sales volume obviously exceeds the maximum limit range in any time period and fill it by averaging.
[0077] The normalization processing in step S2 of this embodiment is a scaling operation performed on the data in order to limit the input data within a set range, and the scaling range is [0, 1] or [-1, 1]; the normalization processing eliminates the dimensional differences between data units, facilitates the simultaneous analysis of data of different magnitudes, and is beneficial to improving the convergence speed of the prediction model; and the Min-Max method is used to normalize the input data of the fast-moving consumer goods sales prediction model, and the processed data is standardized to [0, 1].
[0078] In step S3 of this embodiment, the LSTM algorithm in deep learning is selected to establish a prediction model as follows:
[0079] The sales data of fast-moving consumer goods is a kind of data with time series characteristics. The deep neural network LSTM (Long Short-Term Memory Network) itself has the function of long-term memory. Three special gate structures, namely input gate, forget gate and output gate, are added to the memory unit module structure of the hidden layer. The deep neural network LSTM controls the transmission process of time series data in the network through the gate control unit, and selectively transmits effective information to the next part of the network.
[0080] Among them, the deep neural network LSTM can effectively save the input memory information of previous time steps in the process of processing information transmission with time series feature data.
[0081] The network structure set in step S3 of this embodiment is as follows:
[0082] The activation function uses the Sigmoid function, which is a nonlinear activation function. The Sigmoid function normalizes the value range of real numbers to between 0 and 1.
[0083] The optimization algorithm of model parameters adopts Adam optimization algorithm. Adam algorithm makes full use of the first-order moment mean and second-order moment mean of gradient to perform exponential smoothing calculation on adaptive learning rate parameters, and incorporates momentum factors into the update process. Adam optimization algorithm is suitable for the optimization operation process of a large amount of data and parameters, which is conducive to solving the sparse gradient problem.
[0084] The loss function uses the MSE function to determine the error of the fast-moving consumer goods sales prediction model.
[0085] As attached Figure 1 As shown, the training prediction model in step S4 of this embodiment is specifically as follows:
[0086] S401, preprocess the historical fast-moving consumer goods sales time series data and divide them into a training set and a test set: use the processed fast-moving consumer goods sales data of the most recent year as feature input parameters, and use the first 80% of the fast-moving consumer goods sales data as the training set, and the last 20% of the fast-moving consumer goods sales data as the test set;
[0087] S402, initializing various parameters of the fast-moving consumer goods sales prediction model: designing the number of network structure layers, the number of neuron nodes, the excitation function, the loss function, the optimization algorithm and other basic parameters of the fast-moving consumer goods sales prediction model, and establishing a basic LSTM network structure;
[0088] S403, training the network structure using the training set data: input the normalized data in the training set into the LSTM network structure input layer in sequence, and calculate the input vector and output vector of the hidden layer input gate, the input vector and output vector of the forget gate, the input vector of the memory unit and the unit state at that moment, and the input vector and output vector of the output gate in sequence;
[0089] S404, obtaining the network output value through forward propagation: cyclically training the output result of the hidden layer, finally obtaining the predicted value, calculating the loss function according to the predicted value and the true value, and using BPTT back propagation to update the network weights;
[0090] S405, saving the training model: repeating the training process of the network structure until the loss function is less than the set value or the maximum number of iterations is reached, ending the training of the fast-moving consumer goods sales prediction model and saving the fast-moving consumer goods sales prediction model;
[0091] S406. Sales forecasting through the test set: Input the data of the test set into the trained FMCG sales forecasting model, and judge the prediction accuracy based on the prediction result. If the prediction result is close to the true value, it proves that the established FMCG sales forecasting model has high accuracy. Otherwise, reset the parameters to train the FMCG sales forecasting model until a FMCG sales forecasting model with high prediction accuracy is obtained.
[0092] In step S5 of this embodiment, in order to facilitate the comparison of the prediction ability of the fast-moving consumer goods sales prediction model based on the LSTM deep neural network, this embodiment establishes a GRU prediction model with the same parameter configuration to predict the sales of fast-moving consumer goods, and uses five commonly used model evaluation indicators to demonstrate the prediction accuracy of the model.
[0093] The evaluation indicators of the fast-moving consumer goods sales forecasting model include: mean absolute percentage error (MAPE), mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), and determination coefficient (R). 2 ;
[0094] Among them, the mean absolute percentage error MAPE, mean square error MSE, mean absolute error MAE and root mean square error RMSE all reflect the error value between the predicted value and the true value. The smaller the value of the indicator, the more accurate the prediction effect of the fast-moving consumer goods sales forecasting model;
[0095] Coefficient of determination R 2 Indicates the correlation between the predicted value and the true value, R 2 The larger the value, the higher the determination coefficient R 2 The better the predictive performance of the model.
[0096] The model evaluation comparison of the LSTM prediction model and the GRU prediction model for fast-moving consumer goods is shown in the following table:
[0097] MODEL MAPE MSE MAE RMSE <![CDATA[R 2 ]]> GRU 17.082079% 3039.663550 53.548469 60.152789 0.695419 LSTM 15.221096% 1503.575159 23.958511 36.775961 0.937334
[0098] By comparing the model evaluation indicators in the table, the fast-moving consumer goods sales prediction model based on the LSTM deep neural network established in this embodiment has good prediction ability.
[0099] Embodiment 2:
[0100] This embodiment provides a fast-moving consumer goods sales forecasting system based on deep learning, the system comprising:
[0101] The data collection module is used to collect sales data of representative products of fast-moving consumer goods companies;
[0102] The data preprocessing module is used to process the collected fast-moving consumer goods sales data in terms of data redundancy, data missingness, abnormal data, and data normalization to obtain the preprocessed fast-moving consumer goods sales data;
[0103] Model building and network setting module, which is used to select the LSTM algorithm in deep learning to build a fast-moving consumer goods sales forecasting model and set the network structure;
[0104] Model training module, used to train prediction models;
[0105] Model evaluation module, used to evaluate the prediction model;
[0106] The forecasting module is used to forecast the sales volume of fast-moving consumer goods using the established fast-moving consumer goods sales forecasting model.
[0107] The model building and network setting modules in this embodiment include:
[0108] The network structure selection submodule is used to adopt the deep neural network LSTM (Long Short-Term Memory Network) which has the function of long-term memory. Three special gate structures, namely input gate, forget gate and output gate, are added to the memory unit module structure of the hidden layer. The deep neural network LSTM controls the transmission process of time series data in the network through the gate control unit, and selectively transmits effective information to the next part of the network. Among them, the deep neural network LSTM can effectively save the input memory information of the previous time steps in the process of processing information transmission with time series feature data;
[0109] The network structure setting submodule is used to select the activation function, optimization algorithm and loss function;
[0110] Among them, the activation function uses the Sigmoid function, which is a nonlinear activation function. The Sigmoid function normalizes the value range of real numbers to between 0 and 1;
[0111] The optimization algorithm of model parameters adopts Adam optimization algorithm. Adam algorithm makes full use of the first-order moment mean and second-order moment mean of gradient to perform exponential smoothing calculation on adaptive learning rate parameters, and incorporates momentum factors into the update process. Adam optimization algorithm is suitable for the optimization operation process of a large amount of data and parameters, which is conducive to solving the sparse gradient problem.
[0112] The loss function uses the MSE function to determine the error of the fast-moving consumer goods sales prediction model.
[0113] The model training module in this embodiment includes:
[0114] The preprocessing submodule is used to preprocess the historical FMCG sales time series data and divide it into a training set and a test set: the processed FMCG sales data for the most recent year is used as the feature input parameter, and the first 80% of the FMCG sales data is used as the training set, and the last 20% of the FMCG sales data is used as the test set;
[0115] The parameter initialization submodule is used to design the network structure layers, number of neuron nodes, excitation function, loss function, optimization algorithm and other basic parameters of the fast-moving consumer goods sales prediction model, and establish the basic LSTM network structure;
[0116] The training submodule of the network structure is used to sequentially input the normalized data in the training set into the input layer of the LSTM network structure, and sequentially calculate the input vector and output vector of the hidden layer input gate, the input vector and output vector of the forget gate, the input vector of the memory unit and the unit state at that moment, and the input vector and output vector of the output gate;
[0117] The network output value acquisition submodule is used to cyclically train the output results of the hidden layer, and finally obtain the predicted value. The loss function is calculated based on the predicted value and the true value, and the BPTT back propagation is used to update the network weights.
[0118] The training model saving submodule is used to repeat the training process of the network structure until the loss function is less than the set value or the maximum number of iterations is reached, and the training of the fast-moving consumer goods sales prediction model is terminated and the fast-moving consumer goods sales prediction model is saved;
[0119] The test set test submodule is used to input the test set data into the trained FMCG sales prediction model, and judge the prediction accuracy based on the prediction results. If the prediction results are close to the true value, it proves that the established FMCG sales prediction model has high accuracy. Otherwise, the parameters are reset to train the FMCG sales prediction model until a FMCG sales prediction model with high prediction accuracy is obtained.
[0120] Embodiment 3:
[0121] This embodiment also provides an electronic device, including: a memory and a processor;
[0122] Wherein, the memory stores computer-executable instructions;
[0123] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the fast-moving consumer goods sales prediction method based on deep learning in any embodiment of the present invention.
[0124] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor may be a microprocessor or any conventional processor, etc.
[0125] The memory can be used to store computer programs and / or modules. The processor realizes various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can also include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, at least one disk storage period, a flash memory device, or other volatile solid-state storage devices.
[0126] Embodiment 4:
[0127] This embodiment also provides a computer-readable storage medium, which stores a plurality of instructions, which are loaded by a processor, so that the processor executes the fast-moving consumer goods sales forecasting method based on deep learning in any embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0128] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0129] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0130] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0131] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting sales of fast-moving consumer goods based on deep learning, characterized in that: The method is as follows: Collect sales data of fast-moving consumer goods: Collect sales data of representative products of fast-moving consumer goods companies; Data preprocessing: Perform data redundancy processing, data missing processing, abnormal data processing and data normalization processing on the collected fast-moving consumer goods sales data to obtain the preprocessed fast-moving consumer goods sales data; Select the LSTM algorithm in deep learning to establish a fast-moving consumer goods sales forecasting model and set the network structure; Training prediction models; Evaluate prediction models; Use the established fast-moving consumer goods sales forecasting model to forecast 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: Data redundancy processing refers to deleting duplicate data in the sales data of fast-moving consumer goods; Missing data processing refers to filling in the FMCG sales data of the missing time period by taking the mean; Abnormal data processing is to remove the data whose sales volume obviously exceeds the maximum limit in any time period and fill it by averaging; Normalization is a scaling operation performed on the data in order to limit the input data within a set range, and the scaling range is [0,1] or [-1,1]. Normalization eliminates the dimensional differences between data units, making it easier to analyze data of different magnitudes at the same time, which is beneficial to improving the convergence speed of the prediction model. The Min-Max method is used to normalize the input data of the fast-moving consumer goods sales prediction model, and the processed data is normalized to [0,1].
3. The method for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 1, characterized in that: The LSTM algorithm in deep learning is selected to establish a prediction model as follows: The sales data of fast-moving consumer goods is a kind of data with time series characteristics. The deep neural network LSTM itself has the function of long-term memory. Three special gate structures, namely input gate, forget gate and output gate, are added to the memory unit module structure of the hidden layer. The deep neural network LSTM controls the transmission process of time series data in the network through the gate control unit and selectively transmits effective information to the next part of the network. Among them, the deep neural network LSTM can effectively save the input memory information of previous time steps in the process of processing information transmission with time series feature data.
4. The method for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 1, characterized in that: Set up the network structure as follows: The activation function uses the Sigmoid function, which is a nonlinear activation function. The Sigmoid function normalizes the value range of real numbers to between 0 and 1. The optimization algorithm of model parameters adopts Adam optimization algorithm. Adam algorithm makes full use of the first-order moment mean and second-order moment mean of gradient to perform exponential smoothing calculation on adaptive learning rate parameters, and incorporates momentum factors into the update process. The loss function uses the MSE function to determine the error of the fast-moving consumer goods sales prediction model.
5. The method for predicting sales volume of fast-moving consumer goods based on deep learning according to claim 1, characterized in that: The training prediction model is as follows: Preprocess the historical FMCG sales time series data and divide it into training set and test set: use the processed FMCG sales data of the most recent year as feature input parameters, and use the first 80% of the FMCG sales data as the training set, and the last 20% of the FMCG sales data as the test set; Initialize the parameters of the fast-moving consumer goods sales prediction model: design the number of network structure layers, number of neuron nodes, incentive function, loss function, optimization algorithm and other basic parameters of the fast-moving consumer goods sales prediction model, and establish the basic LSTM network structure; Use the training set data to train the network structure: input the normalized data in the training set into the input layer of the LSTM network structure in turn, and calculate the input vector and output vector of the hidden layer input gate, the input vector and output vector of the forget gate, the input vector of the memory unit and the unit state at that moment, and the input vector and output vector of the output gate in turn; Obtain the network output value through forward propagation: cyclically train the output results of the hidden layer to finally obtain the predicted value, calculate the loss function based on the predicted value and the true value, and use BPTT back propagation to update the network weights; Save the training model: Repeat the training process of the network structure until the loss function is less than the set value or the maximum number of iterations is reached, end the training of the fast-moving consumer goods sales prediction model and save the fast-moving consumer goods sales prediction model; Sales forecasting through the test set: Input the data of the test set into the trained FMCG sales forecasting model, and judge the prediction accuracy based on the prediction results. If the prediction results are close to the true values, it proves that the established FMCG sales forecasting model has high accuracy. Otherwise, reset the parameters to train the FMCG sales forecasting model until a FMCG sales forecasting model with high prediction accuracy is obtained.
6. The method for predicting sales volume of fast-moving consumer goods based on deep learning according to any one of claims 1 to 5, characterized in that: The evaluation indicators of the fast-moving consumer goods sales forecasting model include: mean absolute percentage error (MAPE), mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), and determination coefficient (R). 2 ; Among them, the mean absolute percentage error MAPE, mean square error MSE, mean absolute error MAE and root mean square error RMSE all reflect the error value between the predicted value and the true value. The smaller the value of the indicator, the more accurate the prediction effect of the fast-moving consumer goods sales forecasting model; Coefficient of determination R 2 Indicates the correlation between the predicted value and the true value, R 2 The larger the value, the higher the determination coefficient R 2 The better the predictive performance of the model.
7. A fast-moving consumer goods sales forecasting system based on deep learning, characterized in that: The system includes: The data collection module is used to collect sales data of representative products of fast-moving consumer goods companies; The data preprocessing module is used to process the collected fast-moving consumer goods sales data in terms of data redundancy, data missingness, abnormal data, and data normalization to obtain the preprocessed fast-moving consumer goods sales data; Model building and network setting module, which is used to select the LSTM algorithm in deep learning to build a fast-moving consumer goods sales forecasting model and set the network structure; Model training module, used to train prediction models; Model evaluation module, used to evaluate the prediction model; The forecasting module is used to forecast the sales volume of fast-moving consumer goods using the established fast-moving consumer goods sales forecasting model.
8. The fast-moving consumer goods sales forecasting system based on deep learning according to claim 7, characterized in that: The model building and network setting modules include: The network structure selection submodule is used to use the long-term memory function of the deep neural network LSTM itself, and add three special gate structures, namely the input gate, the forget gate and the output gate, to the memory unit module structure of the hidden layer. The deep neural network LSTM controls the transmission process of the time series data in the network through the gate control unit, and selectively transmits the effective information to the next part of the network. Among them, the deep neural network LSTM can effectively save the input memory information of the previous time steps in the process of processing the information transmission of the time series feature data; The network structure setting submodule is used to select the activation function, optimization algorithm and loss function; Among them, the activation function uses the Sigmoid function, which is a nonlinear activation function. The Sigmoid function normalizes the value range of real numbers to between 0 and 1; The optimization algorithm of model parameters adopts Adam optimization algorithm. Adam algorithm makes full use of the first-order moment mean and second-order moment mean of gradient to perform exponential smoothing calculation on adaptive learning rate parameters, and incorporates momentum factors into the update process. The loss function uses the MSE function to determine the error of the fast-moving consumer goods sales forecasting model; The model training module includes: The preprocessing submodule is used to preprocess the historical FMCG sales time series data and divide it into a training set and a test set: the processed FMCG sales data for the most recent year is used as the feature input parameter, and the first 80% of the FMCG sales data is used as the training set, and the last 20% of the FMCG sales data is used as the test set; The parameter initialization submodule is used to design the network structure layers, number of neuron nodes, excitation function, loss function, optimization algorithm and other basic parameters of the fast-moving consumer goods sales prediction model, and establish the basic LSTM network structure; The training submodule of the network structure is used to sequentially input the normalized data in the training set into the input layer of the LSTM network structure, and sequentially calculate the input vector and output vector of the hidden layer input gate, the input vector and output vector of the forget gate, the input vector of the memory unit and the unit state at that moment, and the input vector and output vector of the output gate; The network output value acquisition submodule is used to cyclically train the output results of the hidden layer, and finally obtain the predicted value. The loss function is calculated based on the predicted value and the true value, and the BPTT back propagation is used to update the network weights. The training model saving submodule is used to repeat the training process of the network structure until the loss function is less than the set value or the maximum number of iterations is reached, and the training of the fast-moving consumer goods sales prediction model is terminated and the fast-moving consumer goods sales prediction model is saved; The test set test submodule is used to input the test set data into the trained FMCG sales prediction model, and judge the prediction accuracy based on the prediction results. If the prediction results are close to the true value, it proves that the established FMCG sales prediction model has high accuracy. Otherwise, the parameters are reset to train the FMCG sales prediction model until a FMCG sales prediction model with high prediction accuracy is obtained.
9. An electronic device, characterized in that: include: memory and at least one processor; Wherein, the memory stores a computer program; The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the fast-moving consumer goods sales prediction method based on deep learning as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the fast-moving consumer goods sales forecasting method based on deep learning as described in any one of claims 1 to 6.