Unmanned retail cabinet commodity expiration date management method based on machine learning model
By applying machine learning models in unmanned retail cabinets to identify and manage expiration risky commodities, the problem of ineffective identification and removal of expiration goods in the existing technology has been solved, and efficient inventory management and operational costs have been achieved.
Patent Information
- Application Number
- CN202411871687.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing unmanned retail cabinet technology cannot effectively identify the production date of shelves, resulting in difficulty in removing the expiration goods in time, increasing operating costs and customer complaint risks.
Using a machine learning model-based method, through data characteristics such as historical sales volume, historical inventory volume, commodity shelf life and replenishment cycle, we estimate the expiration risk probability of shelf products, identify high expiration risk products, formulate an accurate inventory list, and optimize inventory management.
It has improved the inventory efficiency and removal rate of expiration goods, reduced the customer's expired complaint rate and operating costs, and achieved optimization of inventory management and improvement of brand image.
Smart Images

Figure CN119809522A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned retail cabinets, and in particular to a method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model. Background Art
[0002] Unmanned retail cabinets (hereinafter referred to as shelves) are vending machines that only need to be placed in a fixed place and can be sold after sufficient goods are added. Customers scan the code to open the door, select the goods, close the door and leave to complete the entire shopping process. The payment platform (WeChat, Alipay) will automatically complete the order deduction and close the loop of the order.
[0003] The total sales of an order involves the identification of the product sku and quantity, which is achieved by performing OCR image analysis on the video recorded during the opening and closing of the door. Due to the limitation of video clarity, current technology cannot identify the production date of each product. However, due to the replenishment cycle, the same product on the same shelf may have multiple batches (with different production dates). For products that are about to expire, it is necessary to conduct an inventory and remove them from the shelves to prevent customers from mistakenly purchasing expired products, which will cause the company to incur compensation losses and a decline in brand reputation. To this end, a method is needed to manage the expiration dates of shelf products.
[0004] On the one hand, the probability of near-expiry products can be reduced by increasing the frequency of shelf inventory checks, but this method is very time-consuming and labor-intensive; products can also be removed from shelves early, such as 14 days before expiration, but this method will increase product losses and increase operating costs; on the other hand, reducing the frequency of shelf inventory checks can save time for other tasks (such as replenishing more shelves and making more inter-shelf transfers). For each shelf, not all SKUs have a high near-expiry risk. For example, the near-expiry risk of new products that have just been replenished is very low. Ideally, only high-risk near-expiry SKUs need to be counted.
[0005] The current mainstream method of managing expiration dates is to accurately identify the expiration dates of shelf merchandise using RFID (Radio Frequency Identification) tags. Although this method can accurately identify the expiration date of each unit of merchandise, it requires additional costs to manufacture RFID tags and the corresponding manpower to attach the tags to each shelf merchandise, which in turn leads to an increase in operating costs.
[0006] In order to efficiently control the shelf life of goods under controlled costs, the present invention proposes a method for identifying high-risk near-expiry goods on shelves based on machine learning models. The inventory sku range is narrowed by model recognition, and only high-risk shelf goods are counted, thereby optimizing the shelf life management without increasing existing costs. Summary of the invention
[0007] In view of the problems existing in the prior art, the present invention provides a method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model.
[0008] In order to achieve the above object, the present invention provides a method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model, comprising the following steps:
[0009] Step S1: Data preparation: Collect historical shelf commodity inventory data and related features from the database, and perform data cleaning and feature engineering;
[0010] Step S2: Use the cleaned data to train the machine learning model;
[0011] Step S3: Input the current feature information of the shelf goods into the model trained in step S2, perform reasoning to identify high-risk near-expiry goods, and issue a near-expiry inventory list based on the reasoning results, perform near-expiry inventory, and store the inventory results in the database for the next model training.
[0012] Preferably, in step S1, the relevant features include historical sales volume, historical inventory volume, product shelf life, and replenishment cycle.
[0013] Preferably, in step S1, the specific steps of data preparation include:
[0014] Step S11, select the actual inventory data of the previous n days (such as 30 days), if the actual inventory result is that there is a risk of expiration, the result label is 1, otherwise the result label is 0;
[0015] Step S12: based on the audit results, remove false reported data;
[0016] Step S13: compress the historical feature data, use the time series model to fit the historical sales data, and use the fitted time series model parameters as machine learning model input, which is collectively referred to as data features in subsequent steps;
[0017] Step S14: stratify and sample the data set processed by S13 according to the result labels to form a training set and a test set, such as 80% for the training set and 20% for the test set.
[0018] Preferably, in step S2, the trained machine learning model includes XGboost, lightGBM, and a neural network.
[0019] Preferably, the specific steps of training the machine learning model in step S2 include:
[0020] Step S21, selecting a candidate machine learning model;
[0021] Step S22, initializing the model parameters respectively;
[0022] Step S23, calculating the objective function such as MSE (Mean Squared Error) based on historical data;
[0023] Step S24, iteratively updating model parameters;
[0024] Step S25: obtain the trained machine learning model, compare the performance of the candidate models on the test set, and use the optimal candidate model for inference.
[0025] Preferably, the specific steps of selecting a candidate machine learning model in step S21 are: building a model candidate pool, selecting XGboost, lightGBM, and a neural network and putting them into the model candidate pool.
[0026] Preferably, the specific steps of respectively initializing the model parameters in step S22 include:
[0027] Step S220: Initialize the model parameters every day, perform step S221 regularly (such as training the model for the first time every month), and perform step S222 at other times;
[0028] S221, sequentially taking the models in the model candidate pool of step S21, and randomly generating parameter values of the models;
[0029] S222. Take the models in the model candidate pool of step S21 in order and read the pre-trained model parameter values.
[0030] Preferably, the specific steps of calculating the objective function based on historical data in step S23 include: randomly sorting the shelf commodities counted last time, assigning a unique id to the shelf commodity combination, and defining its model input data as X1, ..., X n , where X i =(x i,1 ,…,x i,m ) is the data feature of the i-th shelf product combination, x i,j is the jth feature of the i-th shelf product combination, and the corresponding inventory result label y i =1 When the shelf goods are about to expire, y i = 0 When the shelf goods are not about to expire, input them into the kth model and calculate f k (X1,…,X n ), where f k (·) is the model function, and the calculation result is the probability of predicting the risk of expiration. Given a predefined threshold ∈, define the prediction value of the i-th shelf product combination When f k (X1,…,X n )≥∈, otherwise Then calculate the corresponding objective function
[0031] Preferably, the specific steps of iteratively updating the model parameters in step S24 include:
[0032] Step S241: Call the python package XGboost for training, and use "binary:logistic" as the objective function;
[0033] Step S242: Call the Python package lightgbm for training, and use "binary:logistic" as the objective function;
[0034] Step S243: fix the neural network depth D layers, and the number of neurons in the i-th layer is m i , where the input of the i-th layer is A i , then the prediction result is calculated by iterative forward propagation, that is, A i =σ(W i A i-1 +b i ), where W i is the weight matrix of the i-th layer, b i is the bias of the i-th layer, σ(·) is the activation function, and the commonly used activation function is and Relu(σ(x)=max(0,x)) function; W i The weight matrix is updated via back-propagation,
[0035] W i ←W i -α δ i ·A i-1 ,b i ←b i -α δ i
[0036] in δ i =( δ i+1 ·W i+1 )⊙D(Z i ), where ⊙ is the element-wise product, δ i is the error of the i-th layer, W i+1 is the weight of the i+1th layer, D(Z i ) is the derivative of the activation function of the i-th layer (when using the sigmoid function D(X) = σ(x)(1-σ(x)), when using the Relu function D(X) = 1, when X>0 other D(X) = 0), Z i =W i A i-1 +b i; Predefine a tolerance value (tolerance) T, when W i and b i If the difference between the values before and after the update is less than T, the iterative update is stopped.
[0037] Step S244: traverse the model hyperparameter combinations, and perform model training for each group of hyperparameters, where XGboost uses step S241 for model training, lightgbm uses step S242 for model training, and the neural network uses step S243 for model training, and calculates the corresponding objective function, and records the hyperparameter combination that generates the optimal objective function (such as minimizing MSE) as the parameter setting for the subsequent pre-training model.
[0038] Preferably, the specific steps of using the optimal candidate model for reasoning in step S25 include:
[0039] The model candidate pool is traversed. For the traversed models, the objective function of the test set is calculated using the model trained in step S24 and recorded. The model that produces the best objective function is selected as the final model, and the model is used for reasoning.
[0040] The technical solution of the present invention has the following beneficial effects:
[0041] The present invention estimates the near-expiry risk probability of shelf commodities based on data features such as historical sales volume, historical inventory volume, commodity shelf life, replenishment cycle, and quantifies near-expiry risk monitoring indicators; formulates a list of shelf commodities that need to be counted based on the near-expiry risk probability, accurately counts shelf commodities with high near-expiry risk, and improves inventory efficiency; while controlling inventory costs, increases the removal rate of shelf commodities with high near-expiry risk and reduces customer expiration complaints; the amount of inventory tasks issued can be dynamically adjusted according to the importance and intensity of other current tasks to maximize the value of inventory efficiency; the model training and reasoning processes can be automated, with low maintenance costs.
[0042] The present invention can improve prediction accuracy: by using a machine learning model to analyze historical sales data and inventory characteristics, the present invention can more accurately predict the risk of near-expiry of goods and reduce the probability of selling expired goods.
[0043] The present invention can reduce operating costs: compared with traditional high-frequency physical inventory counting, the present invention reduces the need for manual inventory counting through an intelligent method, thereby reducing labor costs and time costs.
[0044] The present invention can optimize inventory management: by accurately identifying commodities with high risk of expiring, the present invention helps managers to more effectively control inventory and commodity circulation, thereby reducing excess inventory and commodity loss.
[0045] The present invention can improve customer satisfaction: reduce the sales of expired goods, improve customers' shopping experience, and enhance customers' trust and satisfaction with the brand.
[0046] The present invention can enhance brand image: by ensuring the freshness of goods on the shelves, the present invention helps to enhance the brand image and market competitiveness of the enterprise.
[0047] The present invention can realize automation and intelligence: the present invention realizes the automation of model training and reasoning process, reduces manual intervention, and improves management efficiency and response speed.
[0048] The present invention can continuously learn and optimize: as time goes by and data accumulates, the model can continuously learn and optimize, adapt to changes in the market and consumer behavior, and continuously improve the accuracy of predictions.
[0049] The present invention is flexible and scalable: the method of the present invention can be easily extended to different retail scenarios and commodity categories, and has good versatility and adaptability.
[0050] The present invention can reduce food waste: by timely identifying and managing near-expiry commodities, the present invention helps to reduce food waste and is in line with the goal of sustainable development. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of the process of the present invention;
[0052] Figure 2 Schematic diagram of the model training process of the present invention. DETAILED DESCRIPTION
[0053] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0054] Reference Figure 1 to Figure 2 The present invention provides a method for managing the expiration date of goods in an unmanned retail cabinet based on a machine learning model, comprising the following steps:
[0055] Step S1: Data preparation: Collect historical shelf inventory data and related features from the database. The related features include historical sales volume, historical inventory volume, product shelf life, and replenishment cycle to provide the model with the original information required for training; and perform data cleaning and feature engineering to ensure the quality and availability of the data and improve the efficiency and accuracy of model training; through data cleaning, remove invalid, erroneous or incomplete data; feature engineering can extract features that are more helpful for model prediction and enhance the model's prediction ability; the data after cleaning and feature engineering provides a clean and structured data set for subsequent model training.
[0056] Step S2: Use the cleaned data to train the machine learning model; use the cleaned and feature-engineered data in step S1 to train the machine learning model, such as XGboost, lightGBM, neural network, etc., so that the model can learn the patterns and relationships in the data; the trained model can identify the key factors affecting the risk of commodity expiration; the model can accurately classify and predict the newly input data and identify commodities with high risk of expiration; through training, the predictive ability of the model is improved to provide support for subsequent reasoning and decision-making.
[0057] Step S3: Input the current feature information of the shelf goods into the model trained in step S2, perform reasoning to identify goods with high near-expiry risk, and issue a near-expiry inventory list based on the reasoning results, perform near-expiry inventory, and store the inventory results in the database for the next model training; wherein the model reasoning can quickly identify which goods are at risk of near-expiry, thereby improving the pertinence and efficiency of the inventory; reducing unnecessary inventory work, saving manpower and time costs, and reducing the risks caused by the sale of expired goods; the feedback of the inventory results can be used to optimize the model, so that the model can continuously learn and adapt to new data, and improve the accuracy of the prediction; through continuous model training and optimization, continuous improvement and automation of product expiration management can be achieved.
[0058] Furthermore, in step S1, the specific steps of data preparation include:
[0059] Step S11, select the actual inventory data of the previous n days (such as 30 days). If the actual inventory result shows that there is an expiration risk, the result label is 1, otherwise the result label is 0; the actual inventory data of the last n days (for example, 30 days) are selected from the database to ensure that the model can be trained based on the latest sales and inventory information to improve the timeliness and accuracy of the prediction; by marking the risk of expiring goods (the result label is 1) and the risk of not expiring goods (the result label is 0), a clear classification target is provided for the model.
[0060] Step S12: based on the audit results, eliminate false reported data; identify and eliminate erroneous or untrue reported data in the data set to ensure the quality and reliability of the data set.
[0061] Step S13: compress the historical feature data, use the time series model to fit the historical sales data, use the time series model to fit the historical sales data, convert the complex time series data into more concise model parameters, reduce the dimension of the data, and improve the efficiency of data processing; the fitted time series model parameters are used as machine learning model input, and the model input is collectively referred to as data features in subsequent steps;
[0062] Step S14: The data set processed by S13 is stratified and sampled according to the result labels to form a training set and a test set, such as 80% for the training set and 20% for the test set, to ensure that the model has access to balanced data during the training and testing stages to avoid sample bias; the model performance is evaluated through an independent test set to provide a reliable estimate of the model's generalization ability.
[0063] Furthermore, in step S2, the specific steps of training the machine learning model include:
[0064] Step S21, select candidate machine learning models, build a model candidate pool, select XGboost, lightGBM, and neural network into the model candidate pool; select potential models from a variety of available machine learning algorithms as candidate models.
[0065] Step S22, initializing the model parameters respectively;
[0066] Step S23: Calculate the objective function based on historical data, such as MSE (Mean Squared Error), to evaluate the accuracy of model prediction.
[0067] Step S24, iteratively update model parameters; continuously update model parameters through an iterative process to optimize the objective function, gradually improve the model's predictive ability, and enable the model to better fit the training data; by continuously adjusting parameters, the model can learn complex patterns and relationships in the data.
[0068] Step S25: obtain the trained machine learning model, compare the results of the candidate models on the test set, and use the optimal candidate model for inference; ensure that the selected model not only performs well on the training data, but also maintains high accuracy on unseen data; the optimal model can more reliably predict high-risk commodities near expiration, and improve the prediction effect and practicality of the entire system.
[0069] Furthermore, in step S22, the specific steps of respectively initializing the model parameters include:
[0070] Step S220: Initialize the model parameters every day to ensure that the model can adapt to the latest data changes, and maintain the timeliness and accuracy of the model by updating the model parameters every day; perform step S221 regularly (such as the first training of the model every month), and perform step S222 at other times;
[0071] S221, sequentially taking the models in the model candidate pool of step S21, and randomly generating parameter values of the models;
[0072] S222, sequentially obtain the models in the model candidate pool of step S21, and read the pre-trained model parameter values;
[0073] Utilize the knowledge gained from previous training to speed up the convergence of the model and improve training efficiency; pre-trained parameters can serve as a good starting point to help the model adapt to new data more quickly and reduce training time; pre-trained model parameters can speed up daily model training, but when the data feature changes are very different from the pre-trained data characteristics, the model trained with pre-trained parameters is prone to fall into a poor local optimal solution (local optimal), so the model needs to be retrained regularly.
[0074] Through these detailed model parameter initialization steps, the unmanned retail cabinet product expiration date management method can improve the efficiency and effectiveness of model training while keeping the model up to date; this method helps the model maintain high performance in a constantly changing data environment and can quickly adapt to new data patterns, thereby improving the prediction accuracy and practicality of the entire system.
[0075] Furthermore, in step S23, the specific steps of calculating the objective function based on historical data include: randomly sorting the shelf commodities counted last time, assigning a unique id to the shelf commodity combination, and defining the model input data as X1, ..., X n , where X i =(x i,1 ,…,x i,m ) is the data feature of the i-th shelf product combination, x i,j is the jth feature of the i-th shelf product combination, and the corresponding inventory result label y i =1 When the shelf goods are about to expire, y i = 0 When the shelf goods are not about to expire, input them into the kth model and calculate f k (X1,…,X n ), where f k (·) is the model function, and the calculation result is the probability of predicting the risk of expiration. Given a predefined threshold ∈, define the prediction value of the i-th shelf product combination When f k (X1,…,X n )≥∈, otherwise Then calculate the corresponding objective function By calculating the objective function, we can clarify the performance of the model on the training data and provide direct feedback for the optimization of the model; the pre-defined thresholds help to convert probabilistic predictions into clear classification decisions and improve the operability of the model in practical applications.
[0076] Furthermore, in step S24, the specific steps of iteratively updating the model parameters include:
[0077] The XGboost model uses S241 to iterate model parameters, the lightGBM model uses S242 to iterate model parameters, the neural network uses S243 to iterate model parameters, and the pre-trained model uses S244;
[0078] Step S241: calling the python package XGboost for training, using the objective function "binary:logistic"; using the efficiency and scalability of XGBoost to improve the performance of the model on the binary classification problem; using the "binary:logistic" objective function, optimizing the model to predict the probability output in the binary classification problem;
[0079] Step S242: Call the python package lightgbm for training, and use "binary:logistic" as the objective function; use the fast training speed and low memory consumption of LightGBM to improve the efficiency of model training; also use the "binary:logistic" objective function to optimize the model to adapt to the binary classification problem.
[0080] Step S243: fix the neural network depth D layers, and the number of neurons in the i-th layer is m i , where the input of the i-th layer is A i , then the prediction result is calculated by iterative forward propagation, that is, A i =σ(W i A i-1 +b i ), where W i is the weight matrix of the i-th layer, b i is the bias of the i-th layer, σ(·) is the activation function, and the commonly used activation function is and Relu(σ(x)=max(0,x)) function; W i The weight matrix is updated via back-propagation,
[0081] W i ←W i -α δ i ·A i-1 ,b i ←b i -α δ i
[0082] in δ i =( δ i+1 ·W i+1 )⊙D(Z i ), where ⊙ is the element-wise product, δ i is the error of the i-th layer, W i+1is the weight of the i+1th layer, D(Z i ) is the derivative of the activation function of the i-th layer (when using the sigmoid function D(X) = σ(x)(1-σ(x)), when using the Relu function D(X) = 1, when X>0 other D(X) = 0), Z i =W i A i-1 +b i ; Predefine a tolerance value (tolerance) T, when W i and b i If the difference between the values before and after the update is less than T, the iterative update is stopped; the prediction results are calculated through forward propagation, and nonlinearity is introduced using activation functions (such as sigmoid or ReLU) to enhance the expressiveness of the model; the weight matrix is updated through back propagation, and the model parameters are optimized to reduce the prediction error; the tolerance value T is introduced as the stopping condition, and the iteration is stopped when the value change before and after the update is less than T to avoid overfitting.
[0083] Step S244: traverse the model hyperparameter combinations, and perform model training for each group of hyperparameters, where XGboost uses step S241 for model training, lightgbm uses step S242 for model training, and the neural network uses step S243 for model training, and calculates the corresponding objective function, and records the hyperparameter combination that generates the optimal objective function (such as minimizing MSE) as the parameter setting for the subsequent pre-training model.
[0084] Furthermore, the specific steps of using the optimal candidate model for reasoning in step S25 include:
[0085] Traverse the model candidate pool, and for the traversed models, use the model trained in step S24 to calculate the objective function of the test set and record it, select the model that produces the best objective function as the final model, and use this model for reasoning; selecting the optimal model can improve the accuracy of predicting the risk of shelf goods approaching expiration and reduce the sales risk of expired goods. By evaluating the model performance on the test set, ensure that the model has good generalization ability and can adapt to new data; selecting the optimal model helps optimize resource allocation, focusing more attention and resources on the best performing model, and improving overall operational efficiency; by evaluating and selecting the optimal model, it provides direction for future model improvement and optimization, which helps to continuously improve the performance of the system.
[0086] It can be seen from the above embodiments that the present invention estimates the near-expiry risk probability of shelf goods based on data features such as historical sales volume, historical inventory volume, product shelf life, replenishment cycle, and quantifies the near-expiry risk monitoring indicators; formulates a list of shelf goods that need to be counted based on the near-expiry risk probability, accurately counts shelf goods with high near-expiry risk, and improves inventory efficiency; while controlling inventory costs, increases the removal rate of shelf goods with high near-expiry risk and reduces customer expiration complaints; the amount of inventory tasks issued can be dynamically adjusted according to the importance and intensity of other current tasks to maximize the value of inventory efficiency; the model training and reasoning processes can be automated, with low maintenance costs.
[0087] The present invention can improve prediction accuracy: by using a machine learning model to analyze historical sales data and inventory characteristics, the present invention can more accurately predict the risk of near-expiry of goods and reduce the probability of selling expired goods.
[0088] The present invention can reduce operating costs: compared with traditional high-frequency physical inventory counting, the present invention reduces the need for manual inventory counting through an intelligent method, thereby reducing labor costs and time costs.
[0089] The present invention can optimize inventory management: by accurately identifying commodities with high risk of expiring, the present invention helps managers to more effectively control inventory and commodity circulation, thereby reducing excess inventory and commodity loss.
[0090] The present invention can improve customer satisfaction: reduce the sales of expired goods, improve customers' shopping experience, and enhance customers' trust and satisfaction with the brand.
[0091] The present invention can enhance brand image: by ensuring the freshness of goods on the shelves, the present invention helps to enhance the brand image and market competitiveness of the enterprise.
[0092] The present invention can realize automation and intelligence: the present invention realizes the automation of model training and reasoning process, reduces manual intervention, and improves management efficiency and response speed.
[0093] The present invention can continuously learn and optimize: as time goes by and data accumulates, the model can continuously learn and optimize, adapt to changes in the market and consumer behavior, and continuously improve the accuracy of predictions.
[0094] The present invention is flexible and scalable: the method of the present invention can be easily extended to different retail scenarios and commodity categories, and has good versatility and adaptability.
[0095] The present invention can reduce food waste: by timely identifying and managing near-expiry commodities, the present invention helps to reduce food waste and is in line with the goal of sustainable development.
[0096] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model, characterized in that: The steps include: Step S1: Data preparation: Collect historical shelf commodity inventory data and related features from the database, and perform data cleaning and feature engineering; Step S2: Use the cleaned data to train the machine learning model; Step S3: Input the current feature information of the shelf goods into the model trained in step S2, perform reasoning to identify high-risk near-expiry goods, and issue a near-expiry inventory list based on the reasoning results, perform near-expiry inventory, and store the inventory results in the database for the next model training.
2. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 1, characterized in that: In step S1, the relevant features include historical sales volume, historical inventory volume, product shelf life, and replenishment cycle.
3. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 1, characterized in that: The specific steps of data preparation in step S1 include: Step S11: Select the actual inventory data of the previous n days. If the actual inventory result shows that there is a risk of expiration, the result label is 1, otherwise the result label is 0; Step S12: based on the audit results, remove false reported data; Step S13: compress the historical feature data, use the time series model to fit the historical sales data, and use the fitted time series model parameters as machine learning model input, which is collectively referred to as data features in subsequent steps; Step S14: stratify and sample the data set processed by S13 according to the result labels to form a training set and a test set.
4. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 1, characterized in that: In step S2, the training machine learning models include XGboost, lightGBM, and neural network.
5. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 4 is characterized in that: The specific steps of training the machine learning model in step S2 include: Step S21, selecting a candidate machine learning model; Step S22, initializing the model parameters respectively; Step S23, calculating the objective function based on historical data; Step S24, iteratively updating model parameters; Step S25: obtain the trained machine learning model, compare the performance of the candidate models on the test set, and use the optimal candidate model for inference.
6. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 5, characterized in that: The specific steps of selecting the candidate machine learning model in step S21 are: building a model candidate pool, selecting XGboost, lightGBM, and neural network into the model candidate pool.
7. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 5, characterized in that: The specific steps of respectively initializing the model parameters in step S22 include: Step S220: Initialize the model parameters every day, perform step S221 regularly (such as training the model for the first time every month), and perform step S222 at other times; S221, sequentially taking the models in the model candidate pool of step S21, and randomly generating parameter values of the models; S222. Take the models in the model candidate pool of step S21 in order and read the pre-trained model parameter values.
8. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 5, characterized in that: In step S23, the specific steps of calculating the objective function based on historical data include: randomly sorting the shelf commodities counted last time, assigning a unique id to the shelf commodity combination, and defining the model input data as X1,…,X n , where X i =(x i,1 ,…,x i,m ) is the data feature of the i-th shelf product combination, x i,j is the jth feature of the i-th shelf product combination, and the corresponding inventory result label y i =1 When the shelf goods are about to expire, y i = 0 When the shelf goods are not about to expire, input them into the kth model and calculate f k (X1,…,X n ), where f k (·) is the model function, and the calculation result is the probability of predicting the risk of expiration. Given a predefined threshold ∈, define the prediction value of the i-th shelf product combination When f k (X1,…,X n )≥∈, otherwise Then calculate the corresponding objective function 9. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 5, characterized in that: The specific steps of iteratively updating the model parameters in step S24 include: Step S241: Call the python package XGboost for training, and use "binary:logistic" as the objective function; Step S242: Call the Python package lightgbm for training, and use "binary:logistic" as the objective function; Step S243: fix the neural network depth D layers, and the number of neurons in the i-th layer is m i , where the input of the i-th layer is A i , then the prediction result is calculated by iterative forward propagation, that is, A i =σ(W i A i-1 +b i ), where W i is the weight matrix of the i-th layer, b i is the bias of the i-th layer, σ(·) is the activation function, and the commonly used activation function is and Relu(σ(x)=max(0,x)) function; W i The weight matrix is updated via back-propagation, W i ←W i -a δ i ·A i-1 ,b i ←b i -a δ i in δ i =( δ i+1 ·W i+1 )⊙D(Z i ), where ⊙ is the element-wise product, δ i is the error of the i-th layer, W i+1 is the weight of the i+1th layer, D(Z i ) is the derivative of the activation function of the i-th layer (when using the sigmoid function D(X) = σ(x)(1-σ(x)), when using the Relu function D(X) = 1, when X>0 other D(X) = 0), Z i =W i A i-1 +b i ; Predefine a tolerance value T, when W i and b i If the difference between the values before and after the update is less than T, the iterative update is stopped. Step S244: traverse the model hyperparameter combinations, and perform model training for each group of hyperparameters, where XGboost uses step S241 for model training, lightgbm uses step S242 for model training, and the neural network uses step S243 for model training, and calculates the corresponding objective function, and records the hyperparameter combination that generates the optimal objective function as the parameter setting for the subsequent pre-training model.
10. The method for managing the expiration date of goods in unmanned retail cabinets based on a machine learning model according to claim 5, characterized in that: The specific steps of using the optimal candidate model for reasoning in step S25 include: The model candidate pool is traversed. For the traversed models, the objective function of the test set is calculated using the model trained in step S24 and recorded. The model that produces the best objective function is selected as the final model, and the model is used for reasoning.
Citation Information
Patent Citations
Merchandise inventory multi-dimensional management method and system based on machine learning
CN117314307A
Predictive Model Data Stream Prioritization
US20230123322A1
Management of food supply chain
WO2024177951A1
Cited By
Medical instrument purchase-sale-stock collaborative management system and method
CN120450581A
Goods on-time early warning method and system based on supply chain management system
CN120563086A
Inventory management method and system for critical insurance risk commodities
CN121258376A