Demand Forecasting Model using Deep Learning Methods for Supply Chain Management 4.0

—In the context of Supply Chain Management 4.0, costumers’ demand forecasting has a crucial role within an industry in order to maintain the balance between the demand and supply, thus improve the decision making. Throughout the Supply Chain (SC), a large amount of data is generated. Artificial Intelligence (AI) can consume this data in order to allow each actor in the SC to gain in performance but also to better know and understand the customer. This study is carried out in order to improve the performance of the demand forecasting system of the SC based on Deep Learning methods, including Auto-Regressive Integrated Moving Average (ARIMA) and Long Short-Term Memory (LSTM) using historical transaction record of a company. The experimental results enable to select the most efficient method that could provide better accuracy than the tested methods.


I. INTRODUCTION
Demand forecasting is one of the crucial challenges of demand planning in the Supply Chain Management that uses historical demands or sales data to predict future costumers' demands and support decision making [1]. It aims to enhance the logistics performance by optimizing stocks' value, minimizing costs and increasing sales to warrant the customers' satisfaction [2]. The Smart Supply Chain or Supply Chain Management 4.0 (SCM 4.0) is a new paradigm introduced to solve this complexity by the integration of Artificial Intelligence (AI) [3]. AI has been implemented in several stages along the Supply Chain (SC) and showed a huge potential to impact the upstream or the downstream of the SC, to find smart solution to complex problems and deploy the massive amount of data generated at each stage [4].
Artificial Intelligence (AI) and Machine learning (ML) techniques are widely used in several fields. Deep learning (DL) is one of its most used methods, which is deployed mostly for time series problems, for instance: Urban Traffic Control [5], Production and Energy [6] [7], tasks scheduling and e-commerce [8], Smart Cities [9], Healthcare [10], Trading and Stock Price Predictions [11] [12].
The aim of our research emphasizes the role of AI in the Supply Chain by developing a smart demand forecasting system based on Deep Learning methods to make the SC smart, collaborative and communicative [13].
Many studies have applied multiple types of Neural-Network models, such as Artificial Neural Networks (ANN) and Recurrent Neural Networks (RNN), in different areas, such as inventory management and distribution. However, few studies address the issue of demand forecasting in this context. At the same time, the current trend in methods for calculating forecasts, in many fields of activity, is towards Machine Learning approaches. They demonstrate that these models can dominate statistical methods such as linear regression and Auto-Regressive Integrated Moving Average (ARIMA). As statistical methods are theoretically linear models, they do not cope well with uncertainty and fluctuations in demand. However, few researchers use Long Short-Term Memory (LSTM) in demand forecasting [14] knowing that LSTM has shown relevant forecasting result in many fields. This paper is structured as follows: Section II "Related work" incorporates demand forecasting of logistics and Supply Chain Management 4.0 in general, we also give an overview on the AI deployed in SCM field. In Section III, we describe the methodology adopted in our forecasting system, more precisely, the proposed models related to LSTM and ARIMA. In this part, we explain all the process and steps followed to define the proposed model. Section IV details an experiment with the proposed method used for comparison between LSTM and other Forecast time series method, such as, ARIMA. Then, we analyze and compare the results obtained in order to validate the most efficient DL method in terms of accuracy and performance. Finally, Section V, conclude the article with a brief overview on our future research perspectives.

A. Supply Chain Management 4.0: Outlooks
The SCM's principle is to ensure full cooperation and coordination between all the stockholders by developing consistent interactions, collaboration and coordination to achieve overall performance until the final customer [15]. The concept of Supply Chain emerged to warrant products' availability to customers by creating values throughout the whole process. Nevertheless, the SC has always been dealing with several issues such as uncertainty in forecasting and planning, as each stage in the SC requires a high-level accuracy in order to control inventory changes and to avoid (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 13, No. 5, 2022 705 | P a g e www.ijacsa.thesai.org over-stocks and stock-outs. In the literature, this phenomenon is called "Bullwhip effect" [2]. The classic forecasting methods, implemented in many industries, have reached their limits. They are not able to deal with fluctuations in demand or take into account of the complexity of increasingly connected SC networks. Consequently, companies should migrate to intelligent systems and move towards a Smart Supply Chain Management.
According to the literature SCM 4.0 is defined as the interaction between advanced digital technologies and SCM, such as; Big Data, Artificial Intelligence, Cloud Computing, and Blockchain. Researchers have addressed the sustainability challenge through SCM4.0 and showed the impact of digital transformation technologies on SC sustainability to warrant better customers' experiences. Researchers proposed also a SCM4.0 Framework to define the main key topics of this field and the components for its development [3] as shown in Fig. 1.

B. Supply Chain Management 4.0: Challenges
SCM is facing many challenges, such as, demand forecast uncertainty. The latter has a significant effect on planning systems, uncertain demand leads to regular updating of system parameters and regular changing of targets [16]. It can be presented as the range in which the actual demand will continue. The forecast will very rarely be accurate. However, it gives a good idea of the actual demand. Thus, by adding this confidence interval to the forecast, we obtain more accurate information on the likely value of demands. This confidence interval will then be modelled on the product history in order to match reality as closely as possible. Moreover, this error is due to two effects: the quantity or the delay inconsistency. However, both cases have the same consequences: excess stock or shortage. In addition, these consequences can become even more serious when they are amplified by the "Bullwhip effect" [17]. This effect, illustrated in Fig. 2, describes the phenomenon whereby a small variation in demand at customer level will tend to increase throughout the Supply Chain, consequently, their operation inefficiency.  Thus, an intelligent demand forecasting system based on AI is the only solution to deal with the demand variation and then minimize the Bullwhip effect. This phenomenon is due to the Lead-time between the order and the delivery of goods, and Forecast changes that might occur. Each order has to adapt not only to fluctuations in demand during the current period, but also to changes in the level of predicted demand in the lead-time [18].
There are various AI methods used in demand prediction techniques in the literature. Deep Learning shows better performance and results in terms of forecasting comparing to other methods. Although the forecasting based only on the historical data of manufacturing demand is achievable, the accuracy of the prediction results is considerably lower than when taking into account multiple factors [19]. Researchers set up strategies of the exponential forecasting framework for sales forecasting in order to optimize manufacturing planning and inventory [20]. Therefore, our aim is to forecast future demands based on historical data coming from past manufacturer orders and retailers' demands based on customers' requirements, just enough time in advance to compensate for manufacturer Lead-times.
In the literature, researchers used several ML and DL methods to develop the accuracy of demand forecasting. The results of this study shows that LSTM method is more efficient compared to the tested methods with regards to performance measures [21]. Zixin et al. used LSTM, and Grey Model (GM) models in order to predict the future values based on historical data and the total industrial value. The Statistical Yearbook of GD was selected to represent the demand of the manufacturing industry. Other indicators are from this statistical yearbook from 2005 to 2020. The experiment shows that LSTM has excellent results in the previous comparative experiments. The GM model is the classic model in the field of Auto-regression. Nevertheless, www.ijacsa.thesai.org it does not give accurate results, which is significantly lower than the forecasting results given by LSTM considering multiple factors [19]. A study conducted by Raizada et al. is based on a comparative analysis of several Supervised Machine Learning algorithms, such as, Support Vector Machine (SVM), Random Forest Regression, K-NN Algorithm and Extra Tree Regression to build a forecasting model for future sales of 45 retail outlets of Walmart store in India. The study shows that that Extra Tree Regression Technique is the most efficient model to predict the sales for the selected dataset; however the predictions obtained from the algorithm may vary based on the variance in training data [22]. Jiaxing et al. compared the performance of classical forecasting models and the latest developing forecasting technologies for perishable products and non-perishable items of a large grocery retailer. The Authors made a comparison in terms of performance and accuracy between many algorithms, such as: ARIMA, SVM, RNN and LSTM. The study shows that SVM, RNN and LSTM have a high predictive performance to for perishable products, whereas ARIMA is outstanding in the runtime and LSTM is the most efficient method to deal with non-perishable items due to its advanced prediction performance [23].
There are several ways to apply demand forecasting. In general, the forecasts fluctuations depends on the model used.
Using multiple forecasting models could also highlight differences in forecasts. These differences may indicate the need for more research or better data input.
According to the findings, we assume that LSTM and ARIMA are the most efficient Deep Learning methods to warrant a high accuracy level for demand forecasting in the Supply Chain and to deal with its fluctuation to defeat the bullwhip effect.

A. Conceptual Framework Description
This paper points out that existing research can provide a rich literature for demand forecasting models in manufacturing, to which we can refer for the selection of the prediction model in this research work.
Furthermore, although RNN algorithms are easier to fit complex non-linear relationships, their accuracy is inherently affected by many factors, such as: vanishing Gradient problem. Therefore, Long Short-Term Memory (LSTM) networks are suitable for demand forecasting in manufacturing, and they are the best to deal with vanishing Gradient problem. To verify the accuracy of the LSTM network, various prediction models are used as comparison models [24]. The selected methods will be used according to the SCM Business Process Model Notation (BPMN) [25] illustrated in Fig. 3. To build our generic model we referred to Supply Chain Operations Reference (SCOR) model and we used BPMN as a tool for modelling. We consider a SC BPM where each process is modelled by a separate pool and process chain as follows: Supplier, Manufacturer, Retailer and Customer. The interactions between the four Agents is managed and submitted to several flows and probabilities. The Agents cooperation, collaboration and coordination are Crucial in the making-decision process, as efforts will only succeed if internal coordination, information exchange and material flow are effective.

B. Methods and Materials
In this sub-section, we give a brief description forecasting models used in our study.
1) ARIMA: Auto-Regressive Moving Average (ARIMA) models include three main procedures: Auto-Regression, Integration and Moving Average [26]. ARIMA can perform modeling of several kinds of time series. However, ARIMA's limitation is that it assumes that the given time series is linear [21]. This model will be used in our study to be compared with LSTM to evaluate the efficiency of our proposed forecasting system.
In this process, the parameters of the Auto-Regressive Moving Average (ARIMA) model shown in Equation (1) are determined as (p) and (q), respectively. An ARIMA model is defined as (p, d, q).
• p: number of Auto-Regressive terms.
• q: number of lagged forecast errors in the prediction equation (MA).
• h(t) : represents the output value at time t.
• c(t) : represents the cell state (memory) at time t.
• i(t) : represents the Input Gate.
• o(t) : represents the Output Gate.
Based on x(t) and h(t-1) the Forget Gate f(t) can decide what information will be preserved in the cell state using as inputs using Sigmoid activation . The Input Gate i(t) uses the input values x(t) and h(t-1) to compute the value of the cell c(t). While the Output Gate o(t) determines the output value h(t) using h(t-1), x(t) and Sigmoid activation , whereas, tanh activation function is used to compute the value of c(t-1) and multiplies it to get h(t-1).
The LSTM cell can be mathematically modelled as follows: Such that tanh and are activation functions. By the evoked iteration and Compute the LSTM output using Equation (2)-(6), with the x(t) Input, the model can compute the future value of the Output o(t).

C. Research Framework
The aim of our research is to select an accurate model for demand forecasting based on the selected Dataset. We deploy the evoked DL methods to select the best time series forecasting model to deal with demand forecasting issues and uncertainty. The proposed methodology is summarized in Fig. 5. The flowchart emphasizes the main steps of our method from the Data collection up to the Output predicted value.
The five main steps of our methodology are detailed in the following sub-sections.

1) Data collection and pre-processing:
In this research, we use a dataset from Kaggle's competition (https://www. kaggle.com/code/devswaroop/forecastproductsdemand/data) which is suits our proposed generic model. Data collection is a crucial step because the quality and volume of data. It's a success factor of the predictive system. In this case, the data used in this study will be the risk factors of Supply Chain components. This will yield us a table of different Features. The more data we collect, the more accuracy we can get while avoiding over-fitting effect [28].
The inputs selection should be in concordance with the system's objective and problem that we need to solve. In our study, we aim to implement a LSTM based forecasting system to predict demand quantities of a specific product based on past values and compare them with the results obtained through ARIMA. The dataset used in our experiment contains demand quantities of several products from 2011 to 2017. Consequently, the neural network's output is the estimated demand and the previous demand quantities with the month' classification implemented as inputs in the input layer. We load our data into a suitable place for pre-processing before using it on our DL models (see Table I).  We split the dataset into two subsets: training set (80%) and Test set (20%). Since the dataset was monthly demand data, 1-month-ahead (one-step-ahead), forecasting was performed. Fig. 6 illustrates the time-series evolution of product demand per month.
To prepare the dataset for the training model, we followed the following steps for missing value processing and convert the original data days into months: • Remove the missing value: remove lines of missing values from the analysis sample.
• Average interpolation: observe the average instead of the missing values.
• High frequency data: refers to time-series data collected at an extremely fine scale. It could be accurately collected at an efficient rate for analysis.   2) Evaluation criteria: To measure the performance of the proposed method, we used Mean Squared Error (MSE), Root Mean Square Error (RMSE), Mean Absolute Error (MAE) and Mean Absolute Percentage Error (MAPE) The LSTM and ARIMA were implemented and trained using Scikit-learn package and Keras in Python. For evaluation, we use MSE, RMSE, MAE and MAPE models defined as follows: In Equations (7)-(10), y t indicates the real value, whereas ̂ is the predicted value, and n is the number of forecast periods. The model with the lowest standard value obtained using the above metrics should be selected as the most suitable and efficient model for the dataset.

IV. RESULT AND DISCUSSION
In this section, we provide results of our experiment based on the selected dataset. 1,2] values for the demand data forecasting, and Correlogram test of each of these models were performed apart. Table II indicates the results of several parameters and performance metrics comparison between models. According to the obtained results, the model with a lower error rate is selected as the model with a higher performance level. In this regard, ARIMA (2,2,2) is the model with the lowest MAPE value, thus, it could provide the most accurate forecast among ARIMA models that we performed.   Analysis of Fig. 8 and 9 shows that monthly demands values obtained from real data and estimated studies have veering structure and the deviation is not excessive. The efficiency of the model could be seen more clearly in the graph, than the similarity of breakpoint directions and the approximation of the data. The model used here produces values that are very close to the real data with an error of 0.75 MAPE. This situation suggests that the model used in this experiment was compliant.

B. LSTM Model Findings
In the second experiment, LSTM was trained with the dataset, using Python with KERAS. We run the LSTM model on the monthly demands of the products listed between 2011 and 2017, as done in the ARIMA model. We tried different epoch numbers in the training process, thus, we examined the error values results. The error rates obtained from epoch numbers according to the training combinations performed are indicated in Fig. 10. According to the obtained results, LSTM model has managed to provide reliable results with the used data. It produced a lower error value compared to the ARIMA model with Epoch 500 with MSE and MAPE.

C. ARIMA versus LSTM
The time series data used in this experiment is monthly data. The Demand forecasting was performed using different models: ARIMA and LSTM.
Our aim is to train the models to select the best that can provide better accuracy for the used dataset and to compare the models' performance.
In Table III, we indicate the MSE values of ARIMA and LSTM calculated as 1.67 and 1.12 respectively. Considering the MSE and MAPE values, we assume that LSTM is the model suitable to the used dataset and could provide better results in terms of products demand prediction.
In this study, a forecasting was carried out for monthly housing data demand with the selected dataset using the DL methods evoked previously. The data in question was not only computed by being processed in the program just once, but the model was trained multiple times until realistic and reliable values were obtained. According to Table III, the error values that depict the performance metrics, for each method are considerably low. The forecasting accuracy in demand for retailers and manufacturer, with regards to a more balanced supply and demand, will provide reliable information and visibility on the future demand, thus help the Supply Chain stockholders in the making-decision process. The aim is to transform the traditional SCM into Smart Supply Chain Management. In addition, the method and dataset used in our experiment is matching the generic model that we proposed and might be applied by any company despite its size and environment anywhere in the world, because it does not consider a specific situation in the economic environment where the forecasting is made. In this respect, we proposed a generic model which is "oriented-Agent" [29] and also "oriented-process" based on SCOR and using BPMN as a modelling tool. Many different methods could be deployed for forecasting and it may be possible to provide different results from each method [30]. In this purpose, we used two methods in our study and the results obtained from each method were compared in terms of their proximity to the real values. According to the performance metrics of the forecasting models, we deduce that LSTM is more efficient and could provide better results. The demand forecasting is a crucial step in the upstream Supply Chain; it aims to control the Bullwhip effect and also to enhance the Key Performance throughout the Supply Chain from the supplier up to the final customer [31]. In this paper, we focused on one of the main Supply Chain issues related to decision-making, fluctuation and uncertainty of information flow and demand; we have focused on the "Bullwhip effect" phenomenon in order to propose advanced solutions to reduce it. Accurate forecasts are mandatory to improve the performance key indicators of the Supply Chain. Providing a wider range of data, information sharing and collaborative forecasting are crucial in order to enable the supply chain to increase profitability and minimize waste or delays. Similarly, negative data could also lead to downward changes in the statistical forecasts, which could lead to downward changes in forecasting.
In our case study, we deployed two Deep Learning models ARIMA and LSTM, to build our demand forecasting system and to deal with regression problems. We used a dataset collected from Kaggle whose Features correspond best to the generic model of Supply Chain that we proposed which is "Agent-oriented" and "process-oriented". Our experiment and training have shown that multi-layer LSTM gives estimated values closer to reality than those obtained by ARIMA. In particular, LSTM models perform better because they allow better persistence of information compared to classical RNNs and ARIMA, due to the information transmission over time by the hidden state called the "cell state". The aim of our approach is to maintain the balance between the supply and demand in the Supply Chain, thus, incorporate intelligent predicting system using AI, which is a crucial component of Supply Chain Management 4.0.
As perspective of this study, we will propose a Hybrid forecasting model based on ARIMA and LSTM to enhance the performance of our predicting system and improve the accuracy of the results.