# A Deep Learning-Based Inventory Management and Demand Prediction Optimization Method for Anomaly Detection

Authors: Chuning Deng; Yongji Liu
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

The rapid development of emerging technologies such as machine learning and data mining promotes a lot of smart applications, e.g., Internet of things (IoT). The supply chain management and communication are a key research direction in the IoT environment, while the inventory management (IM) has increasingly become a core part of the whole life cycle management process of the supply chain. However, the current situations of a long supply chain life cycle, complex supply chain management, and frequently changing user demands all lead to a sharp rise in logistics and communication cost. Hence, as the core part of the supply chain, effective and predictable IM becomes particularly important. In this way, this work intends to reduce the cost during the life cycle of the supply chain by optimizing the IM process. Specifically, the IM process is firstly formulated as a mathematical model, in which the objective is to jointly minimize the logistic cost and maximize the profit. On this basis, a deep inventory management (DIM) method is proposed to address this model by using the long short-term memory (LSTM) theory of deep learning (DL). In particular, DIM transforms the time series problem into a supervised learning one and it is trained using the back propagation pattern, such that the training process can be finished efficiently. The experimental results show that the average inventory demand prediction accuracy of DIM exceeds about 80%, which can reduce the inventory cost by about 25% compared with the other state-of-the-art methods and detect the anomaly inventory actions quickly.


---

## Body

## 1. Introduction

The emergence of artificial intelligence, big data, data mining, and other technologies, as well as the rapid development of computer hardware performance, has exerted a profound influence on the performance of the supply chain technology [1]. For example, the efficiency of the whole supply chain life cycle (e.g., technical support and product delivery) can be optimized based on big data analysis technology [2], while potential customers of products can be dug out to improve profits based on data mining technology [3]. The traditional supply chain process usually only involves procurement, inventory, production, and distribution. Nowadays, with the rapid development of the information technology, the customers who were originally excluded from the supply chain management process have now become particularly important. In this way, the whole life cycle management process of the supply chain becomes longer and longer, which involves the procedures of manufacturing, supply, storage, transportation, distribution, and retail [4]. During each procedure, the activities of operation, control, and optimization are all required. Besides, the collaboration among these procedures is also required. More importantly, since the customers are included in the supply chain management process, their frequently changing demands would increase the uncertainty of key product provision in supply chain management [5], which not only aggravate the complexity of supply chain management but also greatly increase the overall cost.Inventory management (IM) [6], as the key part of supply chain management, plays a very important role in reducing the overall cost of supply chain management. Generally, too much or too little inventory can have a bad result. For example, excessive inventory can result in the oversupply situation, since the amount of stored products has exceeded the market demands greatly. In this case, the corresponding inventory cost would also be high, because most products will have to be stored for a long time, which will then lead to the situations of slow or insufficient resource turnover of enterprises [7]. In addition, too little inventory may cause the insufficient coverage situation of customer demands, which will then gradually lead to the shortage of products and the reduction of customer trust and even the profit [8]. Therefore, the inventory management is becoming more and more important for supply chain management, since effective IM will both reduce the cost and increase the profit. Based on this consideration, more and more attention is paid to the research area of inventory management and optimization.Generally, the performance and function of IM are largely affected by the prediction accuracy of the future customer demands [9], since most of the IM decisions are made according to the predicted results. The bad prediction results can reduce the sales volume of products, while the good prediction results can naturally improve the number of products sold. In this way, most researches would like to improve the customer demand prediction accuracy to achieve a better performance of IM. In fact, the customer demand prediction accuracy can be improved by deeply analyzing the customers’ demand for products. However, how to accurately obtain the customers’ demand for product becomes a hot topic in the supply chain and inventory management fields.Most traditional enterprises analyze the potential demand of customers by studying their historical order data on the basis of some traditional statistical analysis and data mining technologies; for example, reference [10] adopted the data mining technology to discover the relationship between customer needs and the market trends. This can indeed obtain some efficient information, but it is also and usually unable to adapt to the rapidly changing customer demands, thus leading to a low demand prediction accuracy [11]. To solve this awkward situation, some other related studies tried to adapt to the actual supply and demand ratio by using the strategy of single-point inventory and bulk order. For instance, the single-point inventory and bulk order strategy was used by the reference [12] to achieve a reliable inventory management. Despite this, this single-point inventory means a centralized processing method, which always suffers from the performance bottleneck. Hence, some researchers also begin to study the distributed and dynamic scheduling strategy to optimize the inventory management process which includes the inventory replenishment and distribution [13]. Nevertheless, the diversity of products and the dynamic nature of customer requirements both increase the uncertainty of inventory management and provision, making the existing methods no longer applicable.The rapid development of artificial intelligence (AI) technology and the computer hardware capabilities allows us to make many decision-making parts of the supply chain management process intelligent, which includes the inventory management. Intelligent inventory decision-making can adapt to the changes of environment and customer demands, so as to cope with the continuous and long-lasting customer demands [14]. Based on this consideration, this paper proposes a deep inventory management (DIM) method using the long short-term memory (LSTM) theory of deep learning (DL) [15]. DIM intends to predict customers’ demands, according to which the intelligent decisions for inventory management can be made. Usually, the key to the application of LSTM lies in the comprehensibility of the learning model and the accuracy of the prediction. Although most research show that the LSTM-based neural network can offer a high prediction accuracy, the incomprehensibility of its prediction behavior hinders its application in solving the inventory management problem efficiently [16]. In this regard, the proposed DIM method firstly introduces the state unit before the hidden layer, thus to save more long-term information and gradient information, so as to alleviate the problem of gradient disappearance to some extent. After that, DIM converts the prediction results from the LSTM training model to a corresponding product popularity rating indicator, which will then be used to guide and optimize the inventory management.The main contributions of this paper are summarized as follows:(i)
This work formulates the supply chain and inventory management problem into a novel multiobjective optimization model which comprehensively considers multiple factors of inventory management. In particular, the objective mainly includes cost minimization and profit maximization(ii)
Based on the formulated model, this work proposes the deep inventory management method DIM to address the challenges faced by inventory management. Particularly, by using the LSTM theory, DIM offers intelligent decision-making ability for the inventory management(iii)
The experimental results indicate that the proposed DIM method can effectively predict the customer demand trends with the prediction accuracy exceeding about 80% and reduce the overall cost by about 25%The rest of this work is organized as follows: Section2 mainly discusses the relevant research work in recent years to show the main stream of the research direction of IM. Section 3 presents the constructed mathematical model of inventory management in this work. Section 4 explains the corresponding inventory management and optimization algorithm proposed in this work. Section 5 discusses the experimental results with deep and detailed analysis given. Section 6 makes a summary.


## 2. Related Work

The related work of supply chain and inventory management is separated into two categories which are the traditional inventory management methods and the intelligent inventory management methods, as follows.


### 2.1. Traditional Inventory Management

The main purpose of inventory management is to store a certain amount of physical resources for a company or enterprise, which can then be transformed into profits via effective product sale or other operations [17]. As explained, the inventory management is a core part of the supply chain management process, which is now becoming a vital focus of many enterprises and companies.Generally, the performance of the inventory management can be affected by a lot of factors. Since it is one key part of the supply chain management, a great deal of researches have been proposed to optimize the efficiency of the inventory management process to finally promote the performance of the supply chain. For example, reference [18] would like to optimize the process of inventory management by using the performance management technology to promote the activities of the whole supply chain management. Specifically, this work classified irregular demands into three kinds which are erratic, slow moving, and lumpy ones. Then, three corresponding periodic review policies were proposed to maintain the lowest holding inventory. The results indicated that this work was very effective especially for dealing with the erratic inventory demands. Despite this, this work did not take the dynamic changing environment into consideration, which may not be applicable.In order to show a clear direction of the inventory management, reference [19] discussed the challenges of IM by dividing the corresponding challenges into five categories, that is, the technology, the organization, the finance, the management, and the information involved in the process of inventory management. In particular, such classification was made based on the decision variable, the demand type, the quality deterioration function, and the method of settlement used, such that the classification could not only provide the detailed description about IM but also show a gap to be developed. Similarly, reference [20] also explored the potential challenges of IM by dividing the whole process into multiple different aspects which included the safety inventory, the procurement efficiency, the demand prediction, and the training and interaction. Such two kinds of classification both promote the development of inventory management, but the difference is that [20] studied each aspect deeply and provided optimization directions for each of them.Compared with the above research work that intended to review inventory management, many other work were more inclined to study the technical aspects of inventory management. For example, reference [12] focused more on addressing the unnecessary out-of-stock and the oversupply issues that happened during the process of inventory management. In order to address these issues, this work proposed to optimize both the transport and inventory, such that the strategies of the single inventory and bulk order were jointly taken into consideration. In this way, the market supply-demand ratio could be dynamically adapted. But the drawback still existed, that is, it would take a long time distributing the products from the warehouse to the retailer, when there was a shortage of products at the retail level. As for reference [13], it tried to optimize the entire inventory management process via introducing a novel inventory replenishment and distribution model. Specifically, this work first analyzed the characteristics of the existing distributed inventory model, and then, it combined the advantages of cloud computing and the distributed inventory model to finally build the hierarchy-control distributed inventory model. By simulation and calculation, the results indicated that the proposed distributed inventory model was correct and effective. However, it should be noted that both references [12, 13] did not consider the uncertainty of the market, which may cause great loss especially when the oversupply situations happen.In order to prevent such incidents from happening, references [21, 22] tried to build a safety inventory and start the research from the perspective of reducing the loss caused by the uncertainty of customer demands. For [21], it focused on optimizing the deficiency of traditional inventory management methods and forecasting the demands for all kinds of emergency supplies using the Euclidean algorithm. For [22], it developed an automated inventory system based on the passive radio frequency ID. Compared with the manual system, the product delivery time was reduced from 15.45 minutes to 2.92 minutes on average. However, the two references were different, which was mainly reflected by the fact that the safety inventory in [21] mainly considered the number of customers, customer satisfaction, delivery reliability, and supply reliability, while the safety inventory in [22] mainly considered the product usage frequency, service quality level, and sales situation. Therefore, the former realized a safety inventory from the view of customers, while the latter realized a safety inventory from the perspective of products. Nevertheless, none of them are totally intelligent, which means that the human intervention will be required more or less, and then, the inventory error would occur with a high probability when the amount of product becomes extremely large.


### 2.2. Intelligent Inventory Management

The turning point of the development from traditional inventory to intelligent inventory is about the prediction technology of customer demands. Generally speaking, there are many prediction methods and they can be divided into two categories. The first one mainly relies on static mathematical statistical analysis methods, while the second one mainly relies on the machine learning methods [23].The traditional static mathematical analysis-based methods (e.g., statistics and data mining) rely heavily on the quality of history data (e.g., product order). Hence, high-quality data would lead to a more accurate prediction accuracy than low-quality data. Usually, the mathematical analysis is executed and applied on these history data for the purpose of digging out the potential pattern and trends about the market needs. Such needs are actually proportional to the customer demands, based on which we can optimize the inventory management process. For example, reference [10] tried to predict the customer demands mainly by studying their historical order data. Specifically, this work first searched the corresponding product order information on the web. Then, the data mining technology was applied to dig the potential customer demands in the future and finally to establish one simple but concise inventory policy. The results indicated that by using the history sales data, this work could reduce the total cost of inventory more efficiently. As explained, the quality of the data is of vital importance. However, the collected data from the web usually has very low quality and needs a lot of extra procedures before putting them into use.Similarly, another work, that is, reference [24], also used the data mining technology to address the inventory management problem. In particular, this work focused more on studying the correlation among the historical data. Based on the intercorrelation discovered, a more complete analysis was carried out to improve the prediction accuracy and this work claimed to reduce both the cost and energy consumption for enterprises. Despite this, mainly relying on static mathematical statistics leads to an awkward situation that the prediction accuracy achieved by these methods is not very high. Another factor greatly influencing the achieved prediction accuracy is the data quality. However, it is generally known that the open-source data quality cannot be guaranteed and their format may not satisfy the corresponding requirements, such that the robustness and scalability of inventory management cannot be guaranteed neither.Compared to the above work using the statistical methods, the second kind of research work on intelligent inventory has higher intelligence, since they mainly rely on the well-known machine learning models and methods (e.g., deep learning and reinforcement learning methods). The general workflow for most work using the machine learning method is that they first establish and train a learning model. It is noted that the learning model should be trained by a large number of historical dataset to generate a common knowledge system. After that, the customer demand prediction can be carried out based on this trained model. The more mature this model is, the higher the accuracy of the prediction results is.For instance, reference [25] adopted the artificial neural network (ANN) to deal with the process of inventory management. The intermediate process of inventory was modeled as the ANN’s hidden layer. After that, the learning model was continuously trained to approximate a solution with the optimal prediction accuracy. Despite the case that this work claimed to have achieve better results, there are also some limitations for this work, for example, it assumed that the demand changes regularly, while such changes were uncertain in the real world. Another limitation was that this work did not take enough consideration on the impact factors of the safety stock, which resulted in the situation that the actual safety stock was inadequate.Reference [26] also adopted ANN as the technology to establish a learning model for inventory management. The difference between [25, 26] was that the latter constructed an additional set of knowledge discovery system to convert the results obtained from the learning model into more accurate knowledge, so as to guide the process of inventory management. Specifically, we can discover that the inventory management of [26] was actually handled by a cloud-based customer relationship management framework. This work claimed that the proposed framework could help the enterprises about future plans of their inventory based on the past history of paid invoice data. Meanwhile, the JSON script language was used to conduct the experiments, which indirectly increased the burden, since it needed to be parsed before putting into useIn addition, reference [27] relied on using the back propagation neural network (BPNN) technology to construct an inventory management and learning model. Then, a simple and practical inventory strategy was calculated based on the training model. Different from the above linear prediction, this work presented the nonlinear prediction due to the uncertainty and diversity of the market needs. To fulfill such objective, the step size of BPNN was set to be variable, based on which the prediction accuracy would be more precise and the investment risk would be reduced. The drawback of back propagation is also very obvious, that is, it cannot evolve automatically. In this regard, reference [28] adopted the technology of reinforcement learning together with a heuristic strategy to finally address the multilayer inventory management and optimization problem. On one hand, the reinforcement learning was used to build the inventory management model under a global view. On the other hand, under the guidance of the RL model, the efficient and rapid inventory decision process could be realized via using a local heuristic strategy. The experimental results indicated that this work could improve the performance of profitability, adaptability, and solution time.


### 2.3. Discuss

The rapid development of information technology, the dynamic nature of customer demand, and the complexity of business have now far exceeded the application scope of traditional inventory management methods. Therefore, the demand prediction-driven methods are born, which mainly depend on the mathematical statistics and machine learning technologies. However, the mathematical statistics relies heavily on the quantity and quality of historical data, which leads to the situation that they often fail to keep pace with the rapid change of today’s customer demands. In this way, the prediction accuracy is reduced. On the other hand, the machine learning-based methods can improve the prediction accuracy for inventory management greatly based on continuous learning. However, the corresponding research is still in the early stage and there is still much room to improve the accuracy of demand prediction for inventory management. Under these conditions, the inventory management method DIM is proposed in this work to adapt the changes of the environment and customer demands by dynamically adjusting the prediction scope and accuracy, so as to reduce the overall inventory management cost and increasing the profit.


## 2.1. Traditional Inventory Management

The main purpose of inventory management is to store a certain amount of physical resources for a company or enterprise, which can then be transformed into profits via effective product sale or other operations [17]. As explained, the inventory management is a core part of the supply chain management process, which is now becoming a vital focus of many enterprises and companies.Generally, the performance of the inventory management can be affected by a lot of factors. Since it is one key part of the supply chain management, a great deal of researches have been proposed to optimize the efficiency of the inventory management process to finally promote the performance of the supply chain. For example, reference [18] would like to optimize the process of inventory management by using the performance management technology to promote the activities of the whole supply chain management. Specifically, this work classified irregular demands into three kinds which are erratic, slow moving, and lumpy ones. Then, three corresponding periodic review policies were proposed to maintain the lowest holding inventory. The results indicated that this work was very effective especially for dealing with the erratic inventory demands. Despite this, this work did not take the dynamic changing environment into consideration, which may not be applicable.In order to show a clear direction of the inventory management, reference [19] discussed the challenges of IM by dividing the corresponding challenges into five categories, that is, the technology, the organization, the finance, the management, and the information involved in the process of inventory management. In particular, such classification was made based on the decision variable, the demand type, the quality deterioration function, and the method of settlement used, such that the classification could not only provide the detailed description about IM but also show a gap to be developed. Similarly, reference [20] also explored the potential challenges of IM by dividing the whole process into multiple different aspects which included the safety inventory, the procurement efficiency, the demand prediction, and the training and interaction. Such two kinds of classification both promote the development of inventory management, but the difference is that [20] studied each aspect deeply and provided optimization directions for each of them.Compared with the above research work that intended to review inventory management, many other work were more inclined to study the technical aspects of inventory management. For example, reference [12] focused more on addressing the unnecessary out-of-stock and the oversupply issues that happened during the process of inventory management. In order to address these issues, this work proposed to optimize both the transport and inventory, such that the strategies of the single inventory and bulk order were jointly taken into consideration. In this way, the market supply-demand ratio could be dynamically adapted. But the drawback still existed, that is, it would take a long time distributing the products from the warehouse to the retailer, when there was a shortage of products at the retail level. As for reference [13], it tried to optimize the entire inventory management process via introducing a novel inventory replenishment and distribution model. Specifically, this work first analyzed the characteristics of the existing distributed inventory model, and then, it combined the advantages of cloud computing and the distributed inventory model to finally build the hierarchy-control distributed inventory model. By simulation and calculation, the results indicated that the proposed distributed inventory model was correct and effective. However, it should be noted that both references [12, 13] did not consider the uncertainty of the market, which may cause great loss especially when the oversupply situations happen.In order to prevent such incidents from happening, references [21, 22] tried to build a safety inventory and start the research from the perspective of reducing the loss caused by the uncertainty of customer demands. For [21], it focused on optimizing the deficiency of traditional inventory management methods and forecasting the demands for all kinds of emergency supplies using the Euclidean algorithm. For [22], it developed an automated inventory system based on the passive radio frequency ID. Compared with the manual system, the product delivery time was reduced from 15.45 minutes to 2.92 minutes on average. However, the two references were different, which was mainly reflected by the fact that the safety inventory in [21] mainly considered the number of customers, customer satisfaction, delivery reliability, and supply reliability, while the safety inventory in [22] mainly considered the product usage frequency, service quality level, and sales situation. Therefore, the former realized a safety inventory from the view of customers, while the latter realized a safety inventory from the perspective of products. Nevertheless, none of them are totally intelligent, which means that the human intervention will be required more or less, and then, the inventory error would occur with a high probability when the amount of product becomes extremely large.


## 2.2. Intelligent Inventory Management

The turning point of the development from traditional inventory to intelligent inventory is about the prediction technology of customer demands. Generally speaking, there are many prediction methods and they can be divided into two categories. The first one mainly relies on static mathematical statistical analysis methods, while the second one mainly relies on the machine learning methods [23].The traditional static mathematical analysis-based methods (e.g., statistics and data mining) rely heavily on the quality of history data (e.g., product order). Hence, high-quality data would lead to a more accurate prediction accuracy than low-quality data. Usually, the mathematical analysis is executed and applied on these history data for the purpose of digging out the potential pattern and trends about the market needs. Such needs are actually proportional to the customer demands, based on which we can optimize the inventory management process. For example, reference [10] tried to predict the customer demands mainly by studying their historical order data. Specifically, this work first searched the corresponding product order information on the web. Then, the data mining technology was applied to dig the potential customer demands in the future and finally to establish one simple but concise inventory policy. The results indicated that by using the history sales data, this work could reduce the total cost of inventory more efficiently. As explained, the quality of the data is of vital importance. However, the collected data from the web usually has very low quality and needs a lot of extra procedures before putting them into use.Similarly, another work, that is, reference [24], also used the data mining technology to address the inventory management problem. In particular, this work focused more on studying the correlation among the historical data. Based on the intercorrelation discovered, a more complete analysis was carried out to improve the prediction accuracy and this work claimed to reduce both the cost and energy consumption for enterprises. Despite this, mainly relying on static mathematical statistics leads to an awkward situation that the prediction accuracy achieved by these methods is not very high. Another factor greatly influencing the achieved prediction accuracy is the data quality. However, it is generally known that the open-source data quality cannot be guaranteed and their format may not satisfy the corresponding requirements, such that the robustness and scalability of inventory management cannot be guaranteed neither.Compared to the above work using the statistical methods, the second kind of research work on intelligent inventory has higher intelligence, since they mainly rely on the well-known machine learning models and methods (e.g., deep learning and reinforcement learning methods). The general workflow for most work using the machine learning method is that they first establish and train a learning model. It is noted that the learning model should be trained by a large number of historical dataset to generate a common knowledge system. After that, the customer demand prediction can be carried out based on this trained model. The more mature this model is, the higher the accuracy of the prediction results is.For instance, reference [25] adopted the artificial neural network (ANN) to deal with the process of inventory management. The intermediate process of inventory was modeled as the ANN’s hidden layer. After that, the learning model was continuously trained to approximate a solution with the optimal prediction accuracy. Despite the case that this work claimed to have achieve better results, there are also some limitations for this work, for example, it assumed that the demand changes regularly, while such changes were uncertain in the real world. Another limitation was that this work did not take enough consideration on the impact factors of the safety stock, which resulted in the situation that the actual safety stock was inadequate.Reference [26] also adopted ANN as the technology to establish a learning model for inventory management. The difference between [25, 26] was that the latter constructed an additional set of knowledge discovery system to convert the results obtained from the learning model into more accurate knowledge, so as to guide the process of inventory management. Specifically, we can discover that the inventory management of [26] was actually handled by a cloud-based customer relationship management framework. This work claimed that the proposed framework could help the enterprises about future plans of their inventory based on the past history of paid invoice data. Meanwhile, the JSON script language was used to conduct the experiments, which indirectly increased the burden, since it needed to be parsed before putting into useIn addition, reference [27] relied on using the back propagation neural network (BPNN) technology to construct an inventory management and learning model. Then, a simple and practical inventory strategy was calculated based on the training model. Different from the above linear prediction, this work presented the nonlinear prediction due to the uncertainty and diversity of the market needs. To fulfill such objective, the step size of BPNN was set to be variable, based on which the prediction accuracy would be more precise and the investment risk would be reduced. The drawback of back propagation is also very obvious, that is, it cannot evolve automatically. In this regard, reference [28] adopted the technology of reinforcement learning together with a heuristic strategy to finally address the multilayer inventory management and optimization problem. On one hand, the reinforcement learning was used to build the inventory management model under a global view. On the other hand, under the guidance of the RL model, the efficient and rapid inventory decision process could be realized via using a local heuristic strategy. The experimental results indicated that this work could improve the performance of profitability, adaptability, and solution time.


## 2.3. Discuss

The rapid development of information technology, the dynamic nature of customer demand, and the complexity of business have now far exceeded the application scope of traditional inventory management methods. Therefore, the demand prediction-driven methods are born, which mainly depend on the mathematical statistics and machine learning technologies. However, the mathematical statistics relies heavily on the quantity and quality of historical data, which leads to the situation that they often fail to keep pace with the rapid change of today’s customer demands. In this way, the prediction accuracy is reduced. On the other hand, the machine learning-based methods can improve the prediction accuracy for inventory management greatly based on continuous learning. However, the corresponding research is still in the early stage and there is still much room to improve the accuracy of demand prediction for inventory management. Under these conditions, the inventory management method DIM is proposed in this work to adapt the changes of the environment and customer demands by dynamically adjusting the prediction scope and accuracy, so as to reduce the overall inventory management cost and increasing the profit.


## 3. Problem Model and Objective

This section mainly focuses on building the inventory management and optimization model, which includes the inventory management problem, the objective, and the constraints.


### 3.1. Supply Chain Inventory Model

Firstly, this work assumes that the whole supply chain logistics and warehousing system is composed ofn inventory nodes and m external supplier nodes. Then, given any warehousing node p∈1,n (p is an integer discrete variable), the inventory amount of this node at time t is denoted by Ipt, while the market demanding amount is denoted by dpt. Apparently, when the demanding amount exceeds the inventory amount, product supplement will be required. Now, using upt to indicate the supplement amount of products at time t for the warehousing node p, then, upt may be supplied by multiple provision nodes at different times (e.g., t′). Hence, it is expanded as follows:
(1)upt=∑q=1,q≠pm+nλqpupt′Xpq,∀t′<t,where Xpq∈0,1 means whether node p demands the product from node q (q∈1,m+nand≠p) and λqp means the ratio between the amount of products demanded by p and the overall requirement of node p.Based on the above definitions, we can build the relationship among the three notations (i.e.,Ipt, dpt, and upt), as follows:
(2)Ipt+1=Ipt−dpt+upt=Ipt−dpt+∑q=1,q≠pm+nλqpupt′Xpq.According to the calculation of equation (2), it is easy to observe that the values of dpt and upt have a great impact on the amount of current inventory. Since dpt indicates the market demanding amount of products and upt indicates the supplement amount of products for warehouse node p, we can now abstract them as the input and output the node p, respectively. Specifically, upt is the input of p and dpt is the output of p. Since the input is already formulated in equation (1), we now formulate the output price for node p. Assuming that the output price is denoted by pricedpt, then, we have
(3)pricedpt=∑iwixi,∀i>0,where i means the category of output products, wi means the value of product i, and xi means the number of product i.


### 3.2. Objective and Constraints

For the inventory management, the more products we sell (i.e.,dpt), the more profits we gain (i.e., pricedpt). However, we should also guarantee the product update speed in the warehouse node, since the faster we update, the lower the inventory cost per unit of products. Jointly taking the two factors into consideration, we establish the following two-objective optimization model on the basis of equations (1)–(3):
(4)Maximize:f1t,f2ts.t.f1t=uptf2t=pricedpt,where f1t indicates the input condition of warehousing node p. The more products imported per time unit, the faster the updating speed of warehousing node p. f2t indicates the price condition of exported products. The higher the price, the higher the profit.In particular, as explained,upt is the input and dpt is the output amount of products of warehouse node p. Apparently, the larger value of dpt, the higher the prices, that is,
(5)f1t∝dpt.On the other hand, the higher value ofdpt also means that more products are sold out, such that more products should be supplemented as well, which is equivalent to the value of upt. From such deduction, we also have
(6)f2t∝dpt.Combining equations (5) and (6), we can conclude that the two objective functions f1t and f2t are not on the opposite, such that we do not need to make a tradeoff between them. In addition, the implementation of equation (4) must also satisfy the following constraints:
(7)∑qλqp=1,∀1≠p,λqp≢λpq,∑qXpq<m+n,∀q≠p,dpt≤Ipt+upt,∀t>0,Ipt≥0,∀t>0,where the first constraint means that the overall amount of products demanded by node p from all the other nodes cannot exceed the original requirement of p; the second constraint means that the supply and demand ratio between any two nodes may not be constant; the third constraint means that the product supply nodes are within the range of the already known m product providers and the other n-1 warehousing nodes; the fourth constraint means that the output amount of products on node p cannot exceed the sum amount of input and current inventory; the last constraint means that the inventory amount of products on node p at time t cannot be negative at any time.


## 3.1. Supply Chain Inventory Model

Firstly, this work assumes that the whole supply chain logistics and warehousing system is composed ofn inventory nodes and m external supplier nodes. Then, given any warehousing node p∈1,n (p is an integer discrete variable), the inventory amount of this node at time t is denoted by Ipt, while the market demanding amount is denoted by dpt. Apparently, when the demanding amount exceeds the inventory amount, product supplement will be required. Now, using upt to indicate the supplement amount of products at time t for the warehousing node p, then, upt may be supplied by multiple provision nodes at different times (e.g., t′). Hence, it is expanded as follows:
(1)upt=∑q=1,q≠pm+nλqpupt′Xpq,∀t′<t,where Xpq∈0,1 means whether node p demands the product from node q (q∈1,m+nand≠p) and λqp means the ratio between the amount of products demanded by p and the overall requirement of node p.Based on the above definitions, we can build the relationship among the three notations (i.e.,Ipt, dpt, and upt), as follows:
(2)Ipt+1=Ipt−dpt+upt=Ipt−dpt+∑q=1,q≠pm+nλqpupt′Xpq.According to the calculation of equation (2), it is easy to observe that the values of dpt and upt have a great impact on the amount of current inventory. Since dpt indicates the market demanding amount of products and upt indicates the supplement amount of products for warehouse node p, we can now abstract them as the input and output the node p, respectively. Specifically, upt is the input of p and dpt is the output of p. Since the input is already formulated in equation (1), we now formulate the output price for node p. Assuming that the output price is denoted by pricedpt, then, we have
(3)pricedpt=∑iwixi,∀i>0,where i means the category of output products, wi means the value of product i, and xi means the number of product i.


## 3.2. Objective and Constraints

For the inventory management, the more products we sell (i.e.,dpt), the more profits we gain (i.e., pricedpt). However, we should also guarantee the product update speed in the warehouse node, since the faster we update, the lower the inventory cost per unit of products. Jointly taking the two factors into consideration, we establish the following two-objective optimization model on the basis of equations (1)–(3):
(4)Maximize:f1t,f2ts.t.f1t=uptf2t=pricedpt,where f1t indicates the input condition of warehousing node p. The more products imported per time unit, the faster the updating speed of warehousing node p. f2t indicates the price condition of exported products. The higher the price, the higher the profit.In particular, as explained,upt is the input and dpt is the output amount of products of warehouse node p. Apparently, the larger value of dpt, the higher the prices, that is,
(5)f1t∝dpt.On the other hand, the higher value ofdpt also means that more products are sold out, such that more products should be supplemented as well, which is equivalent to the value of upt. From such deduction, we also have
(6)f2t∝dpt.Combining equations (5) and (6), we can conclude that the two objective functions f1t and f2t are not on the opposite, such that we do not need to make a tradeoff between them. In addition, the implementation of equation (4) must also satisfy the following constraints:
(7)∑qλqp=1,∀1≠p,λqp≢λpq,∑qXpq<m+n,∀q≠p,dpt≤Ipt+upt,∀t>0,Ipt≥0,∀t>0,where the first constraint means that the overall amount of products demanded by node p from all the other nodes cannot exceed the original requirement of p; the second constraint means that the supply and demand ratio between any two nodes may not be constant; the third constraint means that the product supply nodes are within the range of the already known m product providers and the other n-1 warehousing nodes; the fourth constraint means that the output amount of products on node p cannot exceed the sum amount of input and current inventory; the last constraint means that the inventory amount of products on node p at time t cannot be negative at any time.


## 4. Deep Inventory Management Algorithm Design

As known, the LSTM is a kind of the deep learning technology, which makes predictions toward different metrics according to the time series data. Nowadays, the customer demands usually change greatly at different stages of time with a high frequency, which leads to the situation that the product inventory should be managed accordingly to satisfy such changes. Based on this kind of characteristic, we can regard the corresponding generated data as some kind of time series data. Hence, in this work, we propose the deep learning-based inventory management method DIM which greatly leverages the characteristics of LSTM (i.e., time series and back propagation-based prediction) to optimize the inventory management process. The system framework of DIM is shown in Figure1, which consists of several modules including the data collection module, the data preprocessing module, the training module, and the prediction module. The main functions of these modules are explained as follows:
(i)
Data collection module: it is used to collect the historical order data which are raw, disordered, and massive. Despite this, this module is the foundation of the other modules(ii)
Data preprocessing module: it is used to handle the raw and disordered data, for example, cleaning the useless data and extracting the effective data features for the following training(iii)
LSTM module: it is used to create a learning model based on the input data and to finally output a value for future demand prediction(iv)
Prediction module: it is used to calculate the demanding level of any product in the market based on both the learning model and the product popularityFigure 1
The system framework and workflow of DIM.In this work, the prediction accuracy of DIM is mainly evaluated by the popularity of products, which is first defined as follows:Definition 1.
Product popularity means the popular trend and importance of the product in the current market. In this work, it is calculated based on the product demand frequency and value per time unit. Given the type of product and denoting it byi, then, the corresponding product popularity can be calculated as follows:
(8)Popi=fi×wi−wi,minwi,max−wi,where wi,min and wi,max indicate the lower and upper value bounds of the ith type of products, respectively; wi−wi,min/wi,max−wi is used as the standard operation to reduce the influence on product popularity calculation, which is caused by the price gap between different products.Generally, the higher the value ofPopi, the more popular the ith kind of product, which means that this product is frequently demanded by customers, such that more customers may demand such kind of product in the future. Based on Definition 1, we next elaborate the main procedures of DIM.


### 4.1. Training Data Collection

The training data are very important for product popularity prediction. Hence, we need to collect the data as much as possible and as high quality as possible. On one hand, we can obtain a lot of historical order data from the open-source websites. On the other hand, we can also regularly collect the product order information from the online shops. These information can be directly used to reflect the distribution of the customer needs in a certain extent. However, the deeper relationship between these information and the more customer demands should be explored. From the perspective of inventory management, the product order has a lot of attributes, among which nine of them are mainly used in this work for product popularity prediction. Specifically, the nine attributes are the order date, the current popularity of the product, the name of the product, the type of the product, the weight of the product, the number of the product, the price of the product, the brand of the product, and the origin of the product. Despite this, we should be aware that there may be a lot of useless data. In this way, a simple criterion is defined to filter out these useless data, that is, if we cannot extract the required nine attributes from the data, then, we discard the data. Hence, after such operation, all the data left behind can meet our requirements. Now, for each piece of the collected data, the first thing that we should do is to extract the values of the above nine attributes. After that, we can easily describe the current distribution of the customer demands according to these obtained information. More importantly, we need to predict the future distribution of customer demands based on these obtained information. In order to fulfill this target, we define the product popularity into 8 levels which are shown in Figure2. The higher the level, the more popular the product is. Hence, for the proposed model and mechanism, given any input (i.e., the product), the output is the service level (i.e., the popularity) that this product would have in the future. Reviewing the details in Figure 2, we should also note that, the corresponding learning model associated with the proposed mechanism should be trained well before being used to predict the future customer demands.Figure 2
Illustration diagram of product order attributes and prediction results.


### 4.2. Data Preprocessing

According to the actual situation, the value of the same attribute in terms of different products may differ quite a lot, which then may lead to the unfair comparison between the achieved prediction result and the actual situation. In this regard, it is necessary to carry out further data preprocessing before training the model and predicting the results. On this basis, it becomes convenient to compare different indicators. On the other hand, the prediction of customer demands will be more accurate. Starting from this point, this work selects the min-max operation [29] to standardize and normalize these attributes of the product. Then, the value of these attributes will be mapped into the same scope of [0,1]. The specific preprocessing equation is shown in (9):
(9)v=wi−wi,minwi−wi,max,vmin<v<vmax,1,v=vmax,0,v=vmin,where vmin=minv1,v2,v3,⋯, means the minimum value among all the data in terms of the same attribute, vmax=maxv1,v2,v3,⋯, means the maximum value among all the data in terms of the same attribute, and v is the data after mapping.


### 4.3. Prediction Model Establishment and Training

The proposed DIM method adopts LSTM to build the prediction model. Compared with the RNN model, DIM introduces a state unit on the basis of the hidden layer for the purpose of retaining more long-term information. Accordingly, such operation will also retain more gradient information. In this way, LSTM-based DIM can alleviate the problem of gradient disappearance to a certain extent compared to RNN. The prediction structure of DIM is shown in Figure3, where (1) the input parameters will be trained using the back propagation method, (2) the time series problem of LSTM will be transformed into a supervised learning problem via the hidden layer, and (3) the output of the previous layer will be used as the input of the next layer, so as to iteratively complete the training process.Figure 3
Prediction structure of DIM.Observing Figure3, we can see that the proposed prediction model is composed of three inputs which are the vector of product order V=v1,v2,v3,⋯,, the state unit vector C=c1,c2,c3,⋯,, and the hidden layer vector H=h1,h2,h3,⋯,. Hence, we need to firstly initialize all the vectors and the corresponding weight matrixes. On this basis, we train the prediction model of DIM. As shown in Figure 4, we mainly focus on the calculation of the forgetting gate Ft, the input gate It, the output gate Ot, and final output prediction value.Figure 4
Illustration of training model.First of all, the forgetting gateFt is mainly used to control the number of states of ct which remained in ct−1. The input gate It is mainly used to control the number of states of ct that should be maintained by the input vt at time t. The output gate is mainly used to control the number of output ht with the state of ct. Based on these, the forgetting gate is calculated as follows:
(10)Ft=σWf·ht−1,vt+bf,where Wf is the weight matrix of the forgetting gate, ht−1,vt indicates the connection between ht−1 and vt, bf indicates the offset item of the forgetting gate, and σ is a function with the value in the scope of [0,1].Typically, the weight matrix for prediction model training is of vital importance. For the calculation of the input gateIt, the weight matrix should also be used. Denoting the weight matrix by Wi, then, the calculation of It is as follows:
(11)It=σWi·ht−1,vt+bi.Similarly,Wi and bi indicate the corresponding weight matrix and offset item of It, respectively, as shown in (11). Since the structure form of the output gate is the same with those of the forgetting gate and the input gate, now given the weight matrix Wo and the offset item bo for Ot, it follows that
(12)Ot=σWo·ht−1,vt+bo.The final output result of DIM is jointly determined by the output gate and the unit state, such that we have(13)Ht=Ot∘tanhCt,where the notation ∘ indicates the operator of matrix multiplication.


### 4.4. Prediction-Based Inventory Management

As explained and shown in Figure2, the final output of the proposed DIM should be mapped to the 8 kinds of product popularity levels which are then leveraged to further predict the product demands in the future. According to equation (13), the final output of DIM based on LSTM is denoted by Ht and we expand it as follows:
(14)Ht=ht1,ht2,ht3,⋯,,where hti is the output function of product i and it is calculated as follows:
(15)hti=hti−minHtmaxHt−minHt×8.Based on equation (15), given any product, the output value of this model is constrained in the set 1,2,3,4,5,6,7,8. As explained, the higher this value, the more popular the product. Hence, we can arrange the inventory allocation and warehousing in advance according to the popularity value of different products. Then, assuming that there are k groups of data in total, the whole objective function can be formulated as follows:
(16)Maximize:∑i=1Kwi·xis.t.4,5,6,7.Now, with the formulated objective, the overall working process of the proposed DIM can be described in several steps, that is, (1) we need to calculate the current product popularity and collect the history data, which are then regarded as the input of the predicting model; (2) with the predicted product popularity, we should first check if the amount of the product with the highest popularity is enough or not in the warehouse node. If it is enough, then, repeatedly check the product with the second highest popularity until all the popular products are guaranteed; and 3) if the popular products are not enough, then, we should try to store enough products in the nearest warehouse. It is noted that the nearest warehouse node may not have enough room to store the popular products; in this case, another warehouse with available room should be used instead. The corresponding flowchart of the above working process of DIM is presented in Figure5.Figure 5
Flowcharts of DIM.


## 4.1. Training Data Collection

The training data are very important for product popularity prediction. Hence, we need to collect the data as much as possible and as high quality as possible. On one hand, we can obtain a lot of historical order data from the open-source websites. On the other hand, we can also regularly collect the product order information from the online shops. These information can be directly used to reflect the distribution of the customer needs in a certain extent. However, the deeper relationship between these information and the more customer demands should be explored. From the perspective of inventory management, the product order has a lot of attributes, among which nine of them are mainly used in this work for product popularity prediction. Specifically, the nine attributes are the order date, the current popularity of the product, the name of the product, the type of the product, the weight of the product, the number of the product, the price of the product, the brand of the product, and the origin of the product. Despite this, we should be aware that there may be a lot of useless data. In this way, a simple criterion is defined to filter out these useless data, that is, if we cannot extract the required nine attributes from the data, then, we discard the data. Hence, after such operation, all the data left behind can meet our requirements. Now, for each piece of the collected data, the first thing that we should do is to extract the values of the above nine attributes. After that, we can easily describe the current distribution of the customer demands according to these obtained information. More importantly, we need to predict the future distribution of customer demands based on these obtained information. In order to fulfill this target, we define the product popularity into 8 levels which are shown in Figure2. The higher the level, the more popular the product is. Hence, for the proposed model and mechanism, given any input (i.e., the product), the output is the service level (i.e., the popularity) that this product would have in the future. Reviewing the details in Figure 2, we should also note that, the corresponding learning model associated with the proposed mechanism should be trained well before being used to predict the future customer demands.Figure 2
Illustration diagram of product order attributes and prediction results.


## 4.2. Data Preprocessing

According to the actual situation, the value of the same attribute in terms of different products may differ quite a lot, which then may lead to the unfair comparison between the achieved prediction result and the actual situation. In this regard, it is necessary to carry out further data preprocessing before training the model and predicting the results. On this basis, it becomes convenient to compare different indicators. On the other hand, the prediction of customer demands will be more accurate. Starting from this point, this work selects the min-max operation [29] to standardize and normalize these attributes of the product. Then, the value of these attributes will be mapped into the same scope of [0,1]. The specific preprocessing equation is shown in (9):
(9)v=wi−wi,minwi−wi,max,vmin<v<vmax,1,v=vmax,0,v=vmin,where vmin=minv1,v2,v3,⋯, means the minimum value among all the data in terms of the same attribute, vmax=maxv1,v2,v3,⋯, means the maximum value among all the data in terms of the same attribute, and v is the data after mapping.


## 4.3. Prediction Model Establishment and Training

The proposed DIM method adopts LSTM to build the prediction model. Compared with the RNN model, DIM introduces a state unit on the basis of the hidden layer for the purpose of retaining more long-term information. Accordingly, such operation will also retain more gradient information. In this way, LSTM-based DIM can alleviate the problem of gradient disappearance to a certain extent compared to RNN. The prediction structure of DIM is shown in Figure3, where (1) the input parameters will be trained using the back propagation method, (2) the time series problem of LSTM will be transformed into a supervised learning problem via the hidden layer, and (3) the output of the previous layer will be used as the input of the next layer, so as to iteratively complete the training process.Figure 3
Prediction structure of DIM.Observing Figure3, we can see that the proposed prediction model is composed of three inputs which are the vector of product order V=v1,v2,v3,⋯,, the state unit vector C=c1,c2,c3,⋯,, and the hidden layer vector H=h1,h2,h3,⋯,. Hence, we need to firstly initialize all the vectors and the corresponding weight matrixes. On this basis, we train the prediction model of DIM. As shown in Figure 4, we mainly focus on the calculation of the forgetting gate Ft, the input gate It, the output gate Ot, and final output prediction value.Figure 4
Illustration of training model.First of all, the forgetting gateFt is mainly used to control the number of states of ct which remained in ct−1. The input gate It is mainly used to control the number of states of ct that should be maintained by the input vt at time t. The output gate is mainly used to control the number of output ht with the state of ct. Based on these, the forgetting gate is calculated as follows:
(10)Ft=σWf·ht−1,vt+bf,where Wf is the weight matrix of the forgetting gate, ht−1,vt indicates the connection between ht−1 and vt, bf indicates the offset item of the forgetting gate, and σ is a function with the value in the scope of [0,1].Typically, the weight matrix for prediction model training is of vital importance. For the calculation of the input gateIt, the weight matrix should also be used. Denoting the weight matrix by Wi, then, the calculation of It is as follows:
(11)It=σWi·ht−1,vt+bi.Similarly,Wi and bi indicate the corresponding weight matrix and offset item of It, respectively, as shown in (11). Since the structure form of the output gate is the same with those of the forgetting gate and the input gate, now given the weight matrix Wo and the offset item bo for Ot, it follows that
(12)Ot=σWo·ht−1,vt+bo.The final output result of DIM is jointly determined by the output gate and the unit state, such that we have(13)Ht=Ot∘tanhCt,where the notation ∘ indicates the operator of matrix multiplication.


## 4.4. Prediction-Based Inventory Management

As explained and shown in Figure2, the final output of the proposed DIM should be mapped to the 8 kinds of product popularity levels which are then leveraged to further predict the product demands in the future. According to equation (13), the final output of DIM based on LSTM is denoted by Ht and we expand it as follows:
(14)Ht=ht1,ht2,ht3,⋯,,where hti is the output function of product i and it is calculated as follows:
(15)hti=hti−minHtmaxHt−minHt×8.Based on equation (15), given any product, the output value of this model is constrained in the set 1,2,3,4,5,6,7,8. As explained, the higher this value, the more popular the product. Hence, we can arrange the inventory allocation and warehousing in advance according to the popularity value of different products. Then, assuming that there are k groups of data in total, the whole objective function can be formulated as follows:
(16)Maximize:∑i=1Kwi·xis.t.4,5,6,7.Now, with the formulated objective, the overall working process of the proposed DIM can be described in several steps, that is, (1) we need to calculate the current product popularity and collect the history data, which are then regarded as the input of the predicting model; (2) with the predicted product popularity, we should first check if the amount of the product with the highest popularity is enough or not in the warehouse node. If it is enough, then, repeatedly check the product with the second highest popularity until all the popular products are guaranteed; and 3) if the popular products are not enough, then, we should try to store enough products in the nearest warehouse. It is noted that the nearest warehouse node may not have enough room to store the popular products; in this case, another warehouse with available room should be used instead. The corresponding flowchart of the above working process of DIM is presented in Figure5.Figure 5
Flowcharts of DIM.


## 5. Performance Evaluation

In this section, the proposed algorithm are tested and evaluated following the steps of the parameter setup, the benchmark algorithms and metrics, and the experimental results.


### 5.1. Setup

In the experiment, we consider four inventory nodes and two external supplier nodes, that is,n=4 and m=2. The distribution structure is shown in Figure 6, where external supplier node 1 provides products for inventory nodes 1 and 3, while external supplier node 2 provides products for inventory nodes 2 and 4. In addition, the adjacent nodes can also supply products for each other, such that the pairs include 1,2,1,3,2,4,3,4. Each arrow in Figure 6 has two attributes denoted by <λi,j,wi,j>, where λi,j is the ratio between the amount of products demanded by node j from node i and the amount of all demanding products, while wi,j is the corresponding price.Figure 6
Connection structure of inventory nodes and supplier nodes.In order to train the LSTM model and verify the effectiveness of the proposed mechanism, we use the crawler software to obtain the product order data of 25 weeks from the Taobao websites, which exceeds 100 thousand records. However, due to the chaos of the raw data, we select 10 thousand high-quality records as the dataset, where 8 thousand records are uniformly distributed in the first 20 weeks and 2 thousand records are uniformly distributed in the last 5 weeks. In particular, among the 10 thousand records, there are around 100 kinds of products. As explained, each record has nine product attributes, that is, date, popularity, name, type, weight, number, price, brand, and original, and we should note that the attribute of popularity is actually calculated in this work and attached to the obtained order data as one attribute. Moreover, the first 8 thousand records of data in the first 20 weeks are used to train the product popularity prediction model and the remaining 2 thousand records of data in the last 5 weeks are used as the test data for simulation and performance evaluation.The experimental environment and the proposed algorithm are implemented by using the JAVA language on the basis of the Microsoft Windows 10 (64 bits) OS, Intel(R) Core(TM) i5-7400 CPU @3.00 GHz, 16 GB.


### 5.2. Benchmarks and Metrics

There are three kinds of evaluation metrics according to the objective shown in equation (4), as follows:
(i)
The profit is evaluated by the value earned after the inventory sales and calculated according to equation (16)(ii)
The cost is mainly evaluated by the update cycle of the inventory. For any item, the longer the inventory time, the higher the cost. The corresponding calculation is expressed as1/K∑i=1K∣tiend−tistart∣, where tistart means the time that product i enters the inventory and tiend means the time that product i leaves the inventory(iii)
The prediction accuracy is expressed by the average absolute error, that is, the average of the absolute values between the predicted values and the observed values. The corresponding calculation is expressed as1/K∑i=1K∣hi−hi^∣, where hi is the prediction value and hi^ is the actual observation valueThe following three benchmarks are used for comparison in order to evaluate the performance of DIM.(i)
benchmark1 [10]: it mainly uses the data mining technology to implement the customer demand prediction for inventory management(ii)
benchmark2 [26]: it mainly uses the neural network to realize the customer demand prediction for inventory management(iii)
benchmark3 [30]: it mainly uses the random strategy to fulfill the inventory management


### 5.3. Results

As explained, 10 thousand records of data uniformly distributed in 25 weeks are used for the experiment. In particular, the data in the first 20 weeks are used for training, while the data in the last 5 weeks are used for evaluating the performance of profit, cost, prediction accuracy, and unsatisfied demand proportion. The specific results are shown in Figures7–11.Figure 7
Results of the inventory sale profit.Figure 8
Results of the cost on inventory time.Figure 9
Results of prediction accuracy.Figure 10
Results of the percentage between the prediction accuracy and the unsatisfied demands.Figure 11
Details of the prediction accuracy each day in the remaining five weeks.Firstly, the results of profit achieved by the four algorithms on inventory sales are shown in Figure7. Obviously, the sale profit increases over time for the four algorithms in Figure 7, because the longer the time, the more products will be sold in general and the profit naturally increases. In addition, by comparing the four algorithms, we can observe that the DIM method achieves the highest profit. The second higher one is benchmark1 and the third higher one is benchmark2, while the last one is benchmark3. There are several reasons behind this phenomenon: (1) the benchmark3 randomly satisfies the inventory management, that is, when the warehouse node is running out, the manager will replenish products for this warehouse randomly. In this way, the replenished products may not be those required in the near future, which indirectly hinders the sale of products and then leads to the reduce of profit; (2) benchmark2 mainly adopts the data statistical analysis and mining methods to address the inventory management, which relies heavily on data quantity and quality, such that the self-adaptability of benchmark2 is lost. Despite this, compared with benchmark3, benchmark2 still has benefits, since it executes simple principles when choosing which products to store; (3) compared with benchmark2, DIM and benchmark1 both use the machine learning method to predict the customer demands, which can not only dynamically adapt the actual environment but also offer better inventory management decisions. Hence, we can see that the performance of DIM and benchmark1 exceed that of benchmark2 and benchmark3; and (4) as for DIM and benchmark1, the latter only has the hidden layer as the intermediate state, while the former introduces a state layer on the basis of the hidden layer, which can keep more long-term information. Hence, DIM achieves higher prediction accuracy, which is the main cause leading to higher profit. Nevertheless, we should be aware that the profit gained by the four algorithms will gradually tend to stable condition. That is because the popular products are usually sold quickly and the unpopular products may not be sold. Then, the longer the inventory time, the more unpopular products will be left. Despite the fact that the total profit is still increasing, we can see that the increasing trend of profit is going to be stable.Secondly, the cost results of inventory management are shown in Figure8, where we can easily see that DIM has the lowest cost and benchmark3 has the highest cost. The cost performance of benchmark1 and benchmark2 is in the middle, where benchmark1 outperforms benchmark2. As explained, the inventory cost is mainly measured by the time a product is being stored in the warehouse node. Because the longer time spent in the warehouse, the higher the inventory cost of this product. By optimizing the inventory management process, the products stored in the warehouse can be sold at a fast speed, which in turn decreases the inventory cost. At the same time, the gained profit is also increased.For the four algorithms, they all have the ability to reduce the average inventory time of products in a certain extent. Hence, their performance will increase against the inventory time. However, DIM still achieves the best performance, since its inventory cost increases the slowest. The main reasons are because the prediction accuracy of customer demands of DIM is the highest as indicated in Figure9, where DIM has the highest prediction accuracy of customer demands; benchmark1 is in the second place; benchmark2 is in the third place, while benchmark3 has the lowest prediction accuracy. Due to such high prediction accuracy, DIM can reduce the inventory cost by (1) about 16.44% compared to the performance of benchmark1, (2) about 33.57% compared to the performance of benchmark2, and (3) about 48.9% compared to the performance of benchmark3. Thus, DIM reduces approximately 25% of the inventory cost on average. Despite this, it is noted that the inventory cost will increase continuously. According to the definition of the inventory cost, it is proportional to the gap between the time that products enter the inventory and the time that products leave the inventory. Hence, the longer the inventory time, the longer the gap between the time that one product enters and leaves the inventory.Thirdly, DIM is claimed to have the highest prediction accuracy in the above results and we now present the prediction results in Figure9, where the specific prediction accuracies of DIM, benchmark1, benchmark2, and benchmark3 are 82.33%, 75.8%, 66.4%, and 45.5%, respectively. At the same time, we also calculate the prediction accuracy of each day in the last five weeks and the average prediction accuracy of each week is calculated and summarized in Table 1. Via comparison, we can discover that the average result in Table 1 accords with the results in Figure 9 with the deviation smaller than 1%, which reflects the correctness of the proposed algorithm to a certain extent. Besides, according to the results in Table 1, we further calculate the standard deviations of the prediction accuracy of different algorithms to analyze the dispersion degree of these results. Specifically, the dispersion degree of DIM is about 0.433; benchmark1 is about 0.92; benchmark2 is about 2.099, and benchmark3 is about 5.89. Such phenomenon indicates that the prediction accuracy of DIM is the most stable in different time periods, while the prediction accuracy of benchmark3 shows the largest fluctuation. The more stable the prediction accuracy is, the better the robustness and adaptability of DIM. Hence, DIM outperforms the other three methods in this regard.Table 1
Distribution of prediction accuracy using the testing data in the remaining five weeks.
Time (week)DIMbenchmark1benchmark2benchmark3181.9776.2187659.6331253.02354282.2574.3515761.4378857.20488382.3674.927165.1442360.70123481.974.2543462.9654746.05241581.2573.8546963.5443449.24474Finally, on the basis of the prediction accuracy results, we also calculate the proportion of customer demands that cannot be satisfied. The corresponding results are shown in Figure10. Since the prediction accuracy results are already explained in Figure 9, we now focus on the opposite aspect, that is, the proportion of unsatisfied customer requirements. As can be seen in Figure 10, although DIM has a good prediction accuracy (i.e., 82.33%), it cannot fully meet the needs of all customers especially when the supply shortage happens. On the other hand, for either algorithm, it is noted that the sum of demand prediction accuracy and the proportion of unsatisfied customer demand cannot be equivalent to 100%, because these two indicators are actually calculated in completely different ways. Nevertheless, the proportion of unsatisfied customer demands of DIM is only about 7.63% which is far less than the other three algorithms. Therefore, DIM still has some advantages.Reviewing the results in Table1, we present the average prediction accuracy using one week as the unit. However, the statistical results of each day in terms of the prediction accuracy should be discussed, since it is a key metric in this work. In this way, the details of this metric are calculated and shown in Figure 11, where we can see the results against 35 days (5 weeks∗7 days/each week). Apparently, the proposed DIM remains very stable, while the performance of benchmark3 fluctuates greatly. The mean values of the four methods are 81, 74, 63, 53, respectively. Such phenomenon means that the proposed DIM can adapt to different situations, while benchmark3 cannot. The performance of benchmark2 is slightly better than that of benchmark3, but far less than that of the proposed approach. As for benchmark1, we can see that it also has very stable performance. Despite this, its prediction accuracy is lower than that of DIM in almost each day. One exception is the fourth day, where benchmark1 has higher prediction accuracy than DIM. Nevertheless, it is noted that the gap is not large. Overall, the proposed DIM is superior to the other three benchmarks.


## 5.1. Setup

In the experiment, we consider four inventory nodes and two external supplier nodes, that is,n=4 and m=2. The distribution structure is shown in Figure 6, where external supplier node 1 provides products for inventory nodes 1 and 3, while external supplier node 2 provides products for inventory nodes 2 and 4. In addition, the adjacent nodes can also supply products for each other, such that the pairs include 1,2,1,3,2,4,3,4. Each arrow in Figure 6 has two attributes denoted by <λi,j,wi,j>, where λi,j is the ratio between the amount of products demanded by node j from node i and the amount of all demanding products, while wi,j is the corresponding price.Figure 6
Connection structure of inventory nodes and supplier nodes.In order to train the LSTM model and verify the effectiveness of the proposed mechanism, we use the crawler software to obtain the product order data of 25 weeks from the Taobao websites, which exceeds 100 thousand records. However, due to the chaos of the raw data, we select 10 thousand high-quality records as the dataset, where 8 thousand records are uniformly distributed in the first 20 weeks and 2 thousand records are uniformly distributed in the last 5 weeks. In particular, among the 10 thousand records, there are around 100 kinds of products. As explained, each record has nine product attributes, that is, date, popularity, name, type, weight, number, price, brand, and original, and we should note that the attribute of popularity is actually calculated in this work and attached to the obtained order data as one attribute. Moreover, the first 8 thousand records of data in the first 20 weeks are used to train the product popularity prediction model and the remaining 2 thousand records of data in the last 5 weeks are used as the test data for simulation and performance evaluation.The experimental environment and the proposed algorithm are implemented by using the JAVA language on the basis of the Microsoft Windows 10 (64 bits) OS, Intel(R) Core(TM) i5-7400 CPU @3.00 GHz, 16 GB.


## 5.2. Benchmarks and Metrics

There are three kinds of evaluation metrics according to the objective shown in equation (4), as follows:
(i)
The profit is evaluated by the value earned after the inventory sales and calculated according to equation (16)(ii)
The cost is mainly evaluated by the update cycle of the inventory. For any item, the longer the inventory time, the higher the cost. The corresponding calculation is expressed as1/K∑i=1K∣tiend−tistart∣, where tistart means the time that product i enters the inventory and tiend means the time that product i leaves the inventory(iii)
The prediction accuracy is expressed by the average absolute error, that is, the average of the absolute values between the predicted values and the observed values. The corresponding calculation is expressed as1/K∑i=1K∣hi−hi^∣, where hi is the prediction value and hi^ is the actual observation valueThe following three benchmarks are used for comparison in order to evaluate the performance of DIM.(i)
benchmark1 [10]: it mainly uses the data mining technology to implement the customer demand prediction for inventory management(ii)
benchmark2 [26]: it mainly uses the neural network to realize the customer demand prediction for inventory management(iii)
benchmark3 [30]: it mainly uses the random strategy to fulfill the inventory management


## 5.3. Results

As explained, 10 thousand records of data uniformly distributed in 25 weeks are used for the experiment. In particular, the data in the first 20 weeks are used for training, while the data in the last 5 weeks are used for evaluating the performance of profit, cost, prediction accuracy, and unsatisfied demand proportion. The specific results are shown in Figures7–11.Figure 7
Results of the inventory sale profit.Figure 8
Results of the cost on inventory time.Figure 9
Results of prediction accuracy.Figure 10
Results of the percentage between the prediction accuracy and the unsatisfied demands.Figure 11
Details of the prediction accuracy each day in the remaining five weeks.Firstly, the results of profit achieved by the four algorithms on inventory sales are shown in Figure7. Obviously, the sale profit increases over time for the four algorithms in Figure 7, because the longer the time, the more products will be sold in general and the profit naturally increases. In addition, by comparing the four algorithms, we can observe that the DIM method achieves the highest profit. The second higher one is benchmark1 and the third higher one is benchmark2, while the last one is benchmark3. There are several reasons behind this phenomenon: (1) the benchmark3 randomly satisfies the inventory management, that is, when the warehouse node is running out, the manager will replenish products for this warehouse randomly. In this way, the replenished products may not be those required in the near future, which indirectly hinders the sale of products and then leads to the reduce of profit; (2) benchmark2 mainly adopts the data statistical analysis and mining methods to address the inventory management, which relies heavily on data quantity and quality, such that the self-adaptability of benchmark2 is lost. Despite this, compared with benchmark3, benchmark2 still has benefits, since it executes simple principles when choosing which products to store; (3) compared with benchmark2, DIM and benchmark1 both use the machine learning method to predict the customer demands, which can not only dynamically adapt the actual environment but also offer better inventory management decisions. Hence, we can see that the performance of DIM and benchmark1 exceed that of benchmark2 and benchmark3; and (4) as for DIM and benchmark1, the latter only has the hidden layer as the intermediate state, while the former introduces a state layer on the basis of the hidden layer, which can keep more long-term information. Hence, DIM achieves higher prediction accuracy, which is the main cause leading to higher profit. Nevertheless, we should be aware that the profit gained by the four algorithms will gradually tend to stable condition. That is because the popular products are usually sold quickly and the unpopular products may not be sold. Then, the longer the inventory time, the more unpopular products will be left. Despite the fact that the total profit is still increasing, we can see that the increasing trend of profit is going to be stable.Secondly, the cost results of inventory management are shown in Figure8, where we can easily see that DIM has the lowest cost and benchmark3 has the highest cost. The cost performance of benchmark1 and benchmark2 is in the middle, where benchmark1 outperforms benchmark2. As explained, the inventory cost is mainly measured by the time a product is being stored in the warehouse node. Because the longer time spent in the warehouse, the higher the inventory cost of this product. By optimizing the inventory management process, the products stored in the warehouse can be sold at a fast speed, which in turn decreases the inventory cost. At the same time, the gained profit is also increased.For the four algorithms, they all have the ability to reduce the average inventory time of products in a certain extent. Hence, their performance will increase against the inventory time. However, DIM still achieves the best performance, since its inventory cost increases the slowest. The main reasons are because the prediction accuracy of customer demands of DIM is the highest as indicated in Figure9, where DIM has the highest prediction accuracy of customer demands; benchmark1 is in the second place; benchmark2 is in the third place, while benchmark3 has the lowest prediction accuracy. Due to such high prediction accuracy, DIM can reduce the inventory cost by (1) about 16.44% compared to the performance of benchmark1, (2) about 33.57% compared to the performance of benchmark2, and (3) about 48.9% compared to the performance of benchmark3. Thus, DIM reduces approximately 25% of the inventory cost on average. Despite this, it is noted that the inventory cost will increase continuously. According to the definition of the inventory cost, it is proportional to the gap between the time that products enter the inventory and the time that products leave the inventory. Hence, the longer the inventory time, the longer the gap between the time that one product enters and leaves the inventory.Thirdly, DIM is claimed to have the highest prediction accuracy in the above results and we now present the prediction results in Figure9, where the specific prediction accuracies of DIM, benchmark1, benchmark2, and benchmark3 are 82.33%, 75.8%, 66.4%, and 45.5%, respectively. At the same time, we also calculate the prediction accuracy of each day in the last five weeks and the average prediction accuracy of each week is calculated and summarized in Table 1. Via comparison, we can discover that the average result in Table 1 accords with the results in Figure 9 with the deviation smaller than 1%, which reflects the correctness of the proposed algorithm to a certain extent. Besides, according to the results in Table 1, we further calculate the standard deviations of the prediction accuracy of different algorithms to analyze the dispersion degree of these results. Specifically, the dispersion degree of DIM is about 0.433; benchmark1 is about 0.92; benchmark2 is about 2.099, and benchmark3 is about 5.89. Such phenomenon indicates that the prediction accuracy of DIM is the most stable in different time periods, while the prediction accuracy of benchmark3 shows the largest fluctuation. The more stable the prediction accuracy is, the better the robustness and adaptability of DIM. Hence, DIM outperforms the other three methods in this regard.Table 1
Distribution of prediction accuracy using the testing data in the remaining five weeks.
Time (week)DIMbenchmark1benchmark2benchmark3181.9776.2187659.6331253.02354282.2574.3515761.4378857.20488382.3674.927165.1442360.70123481.974.2543462.9654746.05241581.2573.8546963.5443449.24474Finally, on the basis of the prediction accuracy results, we also calculate the proportion of customer demands that cannot be satisfied. The corresponding results are shown in Figure10. Since the prediction accuracy results are already explained in Figure 9, we now focus on the opposite aspect, that is, the proportion of unsatisfied customer requirements. As can be seen in Figure 10, although DIM has a good prediction accuracy (i.e., 82.33%), it cannot fully meet the needs of all customers especially when the supply shortage happens. On the other hand, for either algorithm, it is noted that the sum of demand prediction accuracy and the proportion of unsatisfied customer demand cannot be equivalent to 100%, because these two indicators are actually calculated in completely different ways. Nevertheless, the proportion of unsatisfied customer demands of DIM is only about 7.63% which is far less than the other three algorithms. Therefore, DIM still has some advantages.Reviewing the results in Table1, we present the average prediction accuracy using one week as the unit. However, the statistical results of each day in terms of the prediction accuracy should be discussed, since it is a key metric in this work. In this way, the details of this metric are calculated and shown in Figure 11, where we can see the results against 35 days (5 weeks∗7 days/each week). Apparently, the proposed DIM remains very stable, while the performance of benchmark3 fluctuates greatly. The mean values of the four methods are 81, 74, 63, 53, respectively. Such phenomenon means that the proposed DIM can adapt to different situations, while benchmark3 cannot. The performance of benchmark2 is slightly better than that of benchmark3, but far less than that of the proposed approach. As for benchmark1, we can see that it also has very stable performance. Despite this, its prediction accuracy is lower than that of DIM in almost each day. One exception is the fourth day, where benchmark1 has higher prediction accuracy than DIM. Nevertheless, it is noted that the gap is not large. Overall, the proposed DIM is superior to the other three benchmarks.


## 6. Conclusion

The current situations of long supply chain life cycle, complex inventory management process, and frequently changing customer demands all lead to the rapid rise of logistics cost. In this regard, this work firstly formulates the inventory management process as a mathematical model with the goals of minimizing the cost and maximizing the profit. On this basis, DIM is proposed, which offers effective inventory management by using the LSTM theory. In particular, the time series and back propagation pattern are jointly leveraged by DIM to achieve high prediction accuracy which then will be used to optimize the inventory management process. The experimental results show that the average prediction accuracy of DIM is more than 80% and the overall cost can be reduced by about 25%. Future research directions include large-scale logistics, warehousing, and distribution problems in inventory management.



---

*Source: 9969357-2021-10-11.xml*