Nothing Special   »   [go: up one dir, main page]

demand_forecast (1)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Demand Forecasting for Supply Chain Management using

Deep Learning
Project Seminar Report submitted in partial fulfillment of the academic
requirement for the award of the degree of
BACHELOR OF ENGINEERING
In
ELECTRONICS AND COMMUNICATION ENGINEERING

By

S.Uma Maheshwar 1602-21-735-054


A.Vignesh 1602-21-735-059
V.Chanikya 1602-21-735-009

Under the guidance of


Dr.Uma Mahesh Babu M.Tech, Ph.D.
Assistant Professor, E.C.E

Department of Electronics and Communication Engineering


Vasavi College of Engineering (Autonomous)
ACCREDITED BY NAAC WITH 'A++' GRADE
IBRAHIMBAGH, HYDERABAD-500031
2024-2025

i
Department of Electronics and Communication Engineering
Vasavi College of Engineering (Autonomous)
ACCREDITED BY NAAC WITH 'A++' GRADE
IBRAHIMBAGH, HYDERABAD-500031
Date:

CERTIFICATE

This is to certify that the project seminar report titled “Demand Forecasting for
Supply Chain Management using Deep Learning ” submitted by
S.Uma Maheshwar 1602-21-735-054

A.Vignesh 1602-21-735-059

V.Chanikya 1602-21-735-009

students of Electronics and Communication Engineering Department, Vasavi College of


Engineering in partial fulfillment of the requirement for the award of the degree of Bachelor
of Engineering in Electronics and Communication Engineering is a record of the bonafide
work carried out by them during the academic year 2024-2025. The result embodied in this
project report has not been submitted to any other university or institute for the award of any
degree

Internal Guide Head of the Department


Uma Mahesh Babu ,M.Tech., Ph.D. Dr .E.SREENIVASA RAO,M.Tech,Ph.D.
Assistant Professor Professor and HOD
E.C.E Department E.C.E Department

External Examiner
ii
DECLARATION

This is to state that the work presented in this thesis titled “Demand Forecasting for
Supply Chain Management using Deep Learning.” is a record of work done by us in the
Department of Electronics and Communication Engineering, Vasavi College of Engineering,
Hyderabad. No part of the thesis is copied from books/journals/internet and wherever the portion is
taken, the same has been duly referred in the text. The report is based on the project work done
entirely by us and not copied from any other source. I hereby declare that the matter embedded in
this thesis has not been submitted by me in full or partial thereof for the award of any
degree/diploma of any other institution or university previously.

Signature of the students

S.Uma Maheshwar 1602-21-735-054

A.Vignesh 1602-21-735-059

V.Chanikya 1602-21-735-009

iii
ACKNOWLEDGEMENTS

This satisfaction and euphoria that accompany the successful completion of any task would be
incomplete without the mentioning of the people whose constant guidance and encouragement
made it possible. We take pleasure in presenting before you, our project, which is result of
studied blend of both research and knowledge.

It is our privilege to express our earnest gratitude and venerable regards to our internal guide
Uma Maheshbabu , Assistant professor, E.C.E. Department, Vasavi College of Engineering,
Ibrahimbagh, for abounding and able guidance during the preparation and execution of the
project work. We are grateful for her cooperation and her valuable suggestions.

We record with pleasure our deep sense of gratitude to Dr. E. SREENIVASA RAO, Head of
the Department, E.C.E. for his simulating guidance and profuse assistance we have received,
which helped throughout the project.

We also thank our Project coordinators, Dr. E.Sreenivasa Rao, Professor & Head,
Department of ECE and, Dr.A.Srilakshmi, Associate Professor, Department of ECE,
Mr.G.Srinivas Rao, Assistant Professor, Department of ECE for their continuous guidance
and valuable suggestions throughout our project.

Our sincere thanks to the Principal and Management, Vasavi College of Engineering,
Hyderabad for providing all the facilities in carrying out the project successfully.

Also we acknowledge with thanks for the support extended by all the staff members and
technical staff in shaping up our project. We are thankful to one and all who co-operated us
during the course of our project work.

S.Uma Maheshwar 1602-21-735-054

A.Vignesh 1602-21-735-059

V.Chanikya 1602-21-735-009

iv
ABSTRACT

The evolution of Supply Chain Management (SCM) into its modern iteration, Supply Chain
Management 4.0, has introduced advanced technologies like Artificial Intelligence (AI) and
Machine Learning (ML) to tackle long-standing challenges. Among these challenges,
demand forecasting remains crucial to maintaining a balance between supply and demand,
optimizing inventory, and enhancing decision-making. This study explores the application of
Deep Learning methods—specifically, Auto-Regressive Integrated Moving Average
(ARIMA) and Long Short-Term Memory (LSTM)—for demand forecasting in a smart
supply chain environment.

Using a historical dataset from 2011–2017, sourced from Kaggle, this research
involves a comprehensive comparative analysis of ARIMA and LSTM models. The study
evaluates these models on various metrics, including Mean Squared Error (MSE), Root Mean
Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error
(MAPE), to determine their effectiveness in forecasting demand. ARIMA, a statistical
method widely used for linear time-series data, and LSTM, a neural network capable of
capturing complex non-linear relationships, were tested under the same conditions to ensure
a fair comparison.

The findings reveal that the LSTM model outperformed ARIMA in terms of
accuracy, with lower error rates across all metrics. This superior performance underscores the
suitability of LSTM for handling the inherent complexities and uncertainties in supply chain
data, such as seasonal fluctuations and the "Bullwhip effect." By leveraging the memory
retention and computational advantages of LSTM, the proposed system demonstrates a
significant potential to enhance forecasting accuracy, enabling proactive decision-making
and better resource allocation within the supply chain.

This study highlights the pivotal role of AI-driven demand forecasting in


transforming traditional supply chains into intelligent, data-driven systems. It also provides a
foundation for future work, suggesting hybrid models that combine the strengths of ARIMA
and LSTM for even greater predictive capabilities. These advancements hold promise for
improving supply chain resilience, reducing costs, and ensuring higher customer satisfaction
in dynamic market conditions.

v
LIST OF CONTENTS

Contents Page No.

1. Introduction 7 - 9

2. Literature Survey 10 - 12

3. Theoretical Analysis 13 - 16

4. Experimental Investigation 17 - 22

5. Experimental Results 23 - 24

6. Discussion of Results 25 - 26

7. Summary & Conclusion 27

8. References 28

vi
vii
CH-1. INTRODUCTION
1.1 Introduction:
This chapter introduces the motivation behind the project, which is focused on improving the
accuracy and efficiency of demand forecasting in Supply Chain Management (SCM) by
utilizing advanced Deep Learning methods. Traditional forecasting approaches like ARIMA
often struggle with non-linear data patterns, leading to inefficiencies such as the "Bullwhip
effect" and inaccurate inventory planning..

1.2 Aim:
The aim of this project is to create a robust forecasting algorithm that leverages Long Short-
Term Memory (LSTM) networks, known for their ability to capture complex patterns in
sequential data. By comparing LSTM with ARIMA, the project seeks to demonstrate the
potential of Deep Learning in enhancing forecasting accuracy and optimizing SCM
processes.

1.3 Motivation:
In recent years, demand forecasting has become a vital aspect of Supply Chain Management
(SCM), significantly influencing industries such as retail, e-commerce, and manufacturing.
Accurate demand forecasting ensures optimized inventory levels, cost reduction, and
enhanced customer satisfaction, which are critical for decision-making and operational
efficiency.
However, traditional forecasting methods, such as ARIMA, often face limitations, including
difficulty in capturing non-linear patterns, handling demand volatility, and mitigating the
"Bullwhip effect." These challenges result in forecasting inaccuracies, leading to
overstocking, stockouts, and inefficiencies across the supply chain.

1
1.4 Approach:
This demand forecasting project is implemented through the following systematic steps:
Step 1: Data collection and pre-processing. Historical demand data from a public dataset
(e.g., Kaggle) is used. Missing values are handled, and features are normalized to prepare the
dataset for time-series modeling.
Step 2: Implementation of ARIMA. The dataset is analyzed to identify key parameters (p, d,
q), and the ARIMA model is built for linear time-series forecasting. This step serves as a
benchmark for evaluating advanced models.
Step 3: Implementation of LSTM. An LSTM-based neural network is constructed to model
non-linear patterns in the dataset. The network is trained on historical demand data,
leveraging its ability to handle long-term dependencies and sequence data effectively.
Step 4: Performance evaluation and comparison. Both models are evaluated using metrics
like Mean Squared Error (MSE), Mean Absolute Error (MAE), and Mean Absolute
Percentage Error (MAPE). Their results are compared to assess accuracy and robustness.
Step 5: Visualization and analysis. The forecasted values from ARIMA and LSTM are
compared against actual demand data using visual and statistical methods to identify the
superior model.

1.5 Discussion:
The demand forecasting system proposed in this project involves the application of two
advanced methods—ARIMA and Long Short-Term Memory (LSTM)—to analyze and
predict demand trends. The models were implemented systematically, with each step
contributing to improving the system's accuracy and robustness.
For the ARIMA model, the dataset was pre-processed and decomposed into components,
such as trend, seasonality, and noise. This decomposition allows the ARIMA method to
create linear forecasting equations by identifying patterns in historical data. However,
ARIMA's assumption of linearity limits its ability to model complex, non-linear relationships
in demand data, leading to potential inaccuracies in dynamic supply chain environments.
In contrast, the LSTM model leverages its neural network architecture to address the
challenges of non-linearity. It uses memory cells and gates (input, forget, and output gates) to
retain important information from historical data and filter out irrelevant details. This

2
mechanism ensures that LSTM can model long-term dependencies and intricate patterns in
sequential data, making it more suitable for demand forecasting in SCM.
The models were evaluated on their ability to predict both low-frequency trends (general
demand fluctuations over time) and high-frequency variations (short-term demand spikes).
LSTM demonstrated superior performance in capturing these nuances due to its flexibility
and capacity for detailed data representation.
From the ARIMA and LSTM implementations, fused predictions were generated by
combining insights from both models. This combination aimed to leverage ARIMA's strength
in identifying linear trends and LSTM's ability to handle complex, non-linear relationships.
The evaluation showed that LSTM consistently produced lower error rates across metrics
such as MSE, RMSE, and MAPE, highlighting its effectiveness in providing accurate
forecasts.
The project's methodology also involved the visualization of predicted and actual demand
data to validate model outputs. This analysis underscored the enhanced accuracy of LSTM in
representing smooth demand trends and capturing sudden shifts, compared to the relatively
rigid predictions generated by ARIMA.
The final system demonstrates an efficient demand forecasting framework capable of
addressing the challenges faced by traditional methods, thereby enabling smarter, data-driven
decisions in Supply Chain Management 4.0. The use of advanced models like LSTM marks a
significant step forward in improving forecasting accuracy and operational efficiency in
modern supply chains.

1.7 Objectives:
The primary objective of this project is to improve the accuracy and robustness of demand
forecasting for Supply Chain Management by addressing key performance metrics, ensuring
efficient and reliable predictions. The specific goals include:

1. Improvement in Accuracy Metrics


o Mean Squared Error (MSE): Minimize the squared differences between actual
and predicted demand values to enhance prediction precision.
o Mean Absolute Error (MAE): Reduce the absolute differences to improve
overall forecasting reliability.

o Mean Absolute Percentage Error (MAPE): Lower percentage error rates for a
more accurate representation of demand fluctuations.

3
2. Reduction of Forecasting Errors in Complex Patterns
o Leverage LSTM’s advanced capabilities to model non-linear, dynamic
patterns in sequential data.
o Address ARIMA's limitations by effectively handling demand volatility and
irregularities in time-series data.

3. Enhancement of Decision-Making in SCM


o Provide more reliable data to optimize inventory management, reduce lead
times, and minimize the "Bullwhip effect."
o Facilitate proactive decision-making, ensuring improved coordination across
supply chain stakeholders.

These objectives align with the broader goal of transforming traditional supply chain systems
into smarter, more collaborative networks using advanced AI-driven demand forecasting
techniques.

1.8 Conclusion:
This chapter provides an overview of the foundation of the project, highlighting its
motivation, objectives, and approach. The primary motivation behind the project is to
improve the accuracy of demand forecasting within Supply Chain Management (SCM) by
addressing the challenges of demand volatility and forecasting errors.

The project aims to enhance forecasting accuracy by utilizing advanced techniques


such as ARIMA and Long Short-Term Memory (LSTM) networks, which offer better
performance over traditional models. These methods are designed to capture complex, non-
linear patterns in time-series data, ensuring that supply chains can predict demand more
accurately and efficiently.

The approach taken in the project involves a systematic application of both ARIMA
for linear forecasting and LSTM for non-linear data modeling. The results of this comparison
show that LSTM outperforms ARIMA in terms of accuracy, providing a more reliable
foundation for decision-making in SCM.

Overall, this project contributes to the development of a robust demand forecasting


system that enhances supply chain operations by offering accurate, data-driven insights. This
system can significantly improve decision-making processes, optimize inventory, and reduce
the "Bullwhip effect," leading to more efficient and responsive supply chain management.
.

4
CH-2. LITERATURE SURVEY

Demand forecasting in Supply Chain Management (SCM) is essential for optimizing


inventory, minimizing costs, and enhancing decision-making. Traditional statistical
methods like ARIMA have been widely used for time-series forecasting but are
limited in handling non-linear patterns and fluctuations in demand. These methods are
effective in stable environments but struggle with complex, dynamic demand
behaviors [J. Feizabadi, “Machine learning demand forecasting and supply chain
performance,” International Journal of Logistics Research and Applications, vol. 25,
no. 2, pp. 119–142, Feb. 2022, doi: 10.1080/13675567.2020.1803246.]

To overcome these limitations, Machine Learning (ML) techniques such as Support


Vector Machines (SVM) and Random Forests have been explored for demand
forecasting. These methods can capture non-linear relationships and handle high-
dimensional data more effectively than traditional methods [ K. Zekhnini, A. Cherrafi, I.
Bouhaddou, Y. Benghabrit, and J. A. GarzaReyes, “Supply chain management 4.0: a
literature review and research framework,” BIJ, vol. 28, no. 2, pp. 465–501, Sep. 2020, doi:
10.1108/BIJ-04-2020-0156.]

With the rise of Big Data, Deep Learning (DL) techniques have emerged as a
powerful tool for forecasting demand in SCM. Specifically, Long Short-Term
Memory (LSTM) networks have gained attention due to their ability to handle
sequential data and capture long-term dependencies. LSTM models have shown
superior performance in time-series forecasting compared to ARIMA and other ML
methods, particularly in fields like energy consumption prediction, stock price
forecasting, and urban traffic control [(PaperH. Younis, B. Sundarakani, and M.
Alsharairi, “Applications of artificial intelligence and machine learning within supply
chains:systematic review and future research directions,” JM2, Aug. 2021, doi:
10.1108/JM2-12-2020-0322.].

5
In addition, hybrid models combining traditional methods like ARIMA with
advanced deep learning techniques such as LSTM have been proposed to leverage the
strengths of both approaches. These hybrid models have demonstrated better accuracy
by combining ARIMA's strength in linear forecasting with LSTM’s ability to capture
non-linear relationships and dependencies .
Despite these advancements, challenges like data quality, demand volatility, and
model scalability continue to pose obstacles in applying demand forecasting models
effectively in large-scale supply chains. The complexity of real-world demand
patterns, influenced by external factors like market trends and economic conditions,
further complicates forecasting efforts. [O. Terrada, B. Cherradi, A. Raihani, and O.
Bouattane, “A novel medical diagnosis support system for predicting patients with
atherosclerosis diseases 2022, doi: 10.1016/j.imu.2020.100483..].

CH-3. THEORETICAL ANALYSIS

This section presents the theoretical framework behind the demand forecasting system, focusing on
the methodologies used—Auto-Regressive Integrated Moving Average (ARIMA) and Long Short-
Term Memory (LSTM)—and the underlying principles that enable them to forecast demand in supply
chain management effectively.

1. ARIMA (Auto-Regressive Integrated Moving Average)

ARIMA is a widely used statistical method for time-series forecasting. It assumes that future values
in a time-series are linear combinations of past values and past forecast errors. ARIMA is defined by
three main parameters: (p, d, q), where:
 p is the number of lag observations included in the model (Auto-Regressive part).
 d is the number of times the raw observations are differenced to make the series stationary

6
(Differencing part).
 q is the size of the moving average window, which accounts for past forecast errors.
The theoretical concept behind ARIMA is that past behavior (lagged observations) influences future
behavior, and errors from past predictions help improve future forecasts. The ARIMA model operates
by first transforming non-stationary time-series data into stationary data through differencing,
ensuring that trends and seasonality are effectively modeled. Once the data is stationary, it is used to
generate predictions based on its past values and errors.

However, ARIMA has its limitations when dealing with non-linear data, high-frequency fluctuations,
and complex patterns that do not follow a simple linear structure. This is where more advanced
techniques, like LSTM, are beneficial.

2. Long Short-Term Memory (LSTM)

LSTM is a type of Recurrent Neural Network (RNN) specifically designed to address the
shortcomings of traditional RNNs, particularly the vanishing gradient problem that limits the ability
of RNNs to capture long-term dependencies in sequential data. LSTM achieves this by incorporating
a memory cell that stores information over long periods, allowing the model to selectively retain or
forget information.

LSTM consists of three main gates:


 Input Gate: Controls how much of the new information from the input should be stored in the
memory cell.
 Forget Gate: Decides what information should be discarded from the memory.
 Output Gate: Determines how much of the stored information should be output to the next
time step.

The theoretical foundation of LSTM lies in its ability to capture both short-term and long-term
dependencies within sequential data. For demand forecasting, LSTM’s ability to retain information
over long sequences makes it suitable for predicting future demand based on past trends, seasonal
patterns, and irregular fluctuations.

7
4. Comparison Between ARIMA and LSTM

 Handling of Linear vs. Non-linear Data:


ARIMA is well-suited for forecasting linear trends and stationary time series but struggles
with non-linear relationships in data. On the other hand, LSTM excels at capturing non-linear
dependencies, making it ideal for complex time-series data like demand forecasting in supply
chains, where patterns are often non-linear and dynamic.
 Long-Term Memory:
ARIMA cannot effectively handle long-term dependencies because it is based on the
assumption of stationarity and focuses on recent observations. In contrast, LSTM retains
information over extended periods through its memory cells, allowing it to consider both
recent and distant past data for more accurate predictions.
 Seasonality and Trends:
ARIMA can model seasonality and trends effectively by using differencing and
autoregression, but it may struggle with irregular patterns. LSTM, however, can naturally
learn and adapt to various types of data fluctuations, including irregular demand patterns that
may occur in real-world supply chains.

5. Hybrid Approach (ARIMA + LSTM)

A hybrid model combines the strengths of ARIMA and LSTM to overcome their individual
limitations. ARIMA can first be used to capture the linear trend and seasonality in the data, while
LSTM can then be applied to model non-linear relationships and handle complex fluctuations in the
demand data. This combined approach can potentially improve forecasting accuracy by utilizing the
best features of both methods.

6. Evaluation Metrics

The performance of both ARIMA and LSTM models is evaluated using several metrics:
 Mean Squared Error (MSE): Measures the average of the squared differences between the
actual and predicted values. Lower MSE indicates better model performance.
 Mean Absolute Error (MAE): Represents the average of the absolute differences between the
predicted and actual values. A lower MAE means better prediction accuracy.
 Mean Absolute Percentage Error (MAPE): Measures the accuracy of the forecast as a

8
percentage, with a lower MAPE signifying a more accurate model.
These metrics are essential for assessing the effectiveness of the models and determining their
suitability for real-world demand forecasting tasks in SCM.

7. Limitations of the Approach

While both ARIMA and LSTM have demonstrated strong performance in forecasting, they do have
limitations:
 ARIMA: Struggles with non-stationary data and non-linear trends. It also requires the manual
identification of optimal parameters, which can be computationally expensive and time-
consuming.
 LSTM: Requires large amounts of data for effective training and is computationally intensive.
It also may suffer from overfitting if not properly regularized.

9
The above flowchart shows the steps in what way we perform

1. Data Collection

o Collect historical demand data (e.g., from Kaggle or company databases).

10
o Ensure the data includes relevant features (e.g., sales, seasonality, promotions)

2. Data Preprocessing

o Handle missing values (interpolation or removal).


o Normalize or standardize the data to ensure consistency.
o Split data into training and testing sets (e.g., 80% training, 20% testing).

3. ARIMA Model Implementation

o Stationarity Check: Ensure the data is stationary (using tests like the
Augmented Dickey-Fuller test).
o Modeling: Build ARIMA model by selecting appropriate values for p, d, and
q.
o Model Training: Fit ARIMA model to the training data.
o Prediction: Forecast demand using ARIMA for the test set.

4. LSTM Model Implementation

o Data Transformation: Reshape the data into sequences for LSTM input.
o Model Building: Design the LSTM network (layers, neurons, activation
functions, etc.).
o Model Training: Train the LSTM model using the training data.
o Prediction: Forecast demand using LSTM for the test set.

5. Hybrid Model (Optional)

o Combine ARIMA and LSTM predictions using a weighted average or other


fusion methods.

6. Model Evaluation

11
o Evaluate both ARIMA and LSTM models using performance metrics like
MSE, MAE, and MAPE.
o Compare predictions with actual values from the test set.

7. Visualization
o Visualize actual vs. predicted demand using line plots or bar charts to
compare model accuracy.

8. Decision Making

o Use the model with the best accuracy for forecasting future demand in supply
chain operations.

12
CH-4. EXPERIMENTAL INVESTIGATION

import os
for dirname,_,filenames in os.walk('/kaggle/input'):
for filename in filenames:
print (os.path.join(dirname,filename))

import pandas as pd # Data handling and managing


import numpy as np # Handiling linear Algera
import seaborn as sn
import matplotlib.pyplot as plt
!pip install --upgrade scikit-learn
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
%matplotlib inline

df = pd.read_csv('../input/productdemandforecasting/Historical Product Demand.csv',


parse_dates=['Date'])
df.head(100) # Getting the first 100 rows to view the records
#df.shape

df.dropna(axis=0, inplace=True) #Remove all the rows with null values


df.reset_index(drop=True)
df.sort_values('Date')[1:20]

df['Order_Demand']=df['Order_Demand'].str.replace('(',"")
df['Order_Demand']=df['Order_Demand'].str.replace(')',"")
df.head(100)
#Since the "()" has been removed , Now i Will change the data type.

df['Order_Demand'] = df['Order_Demand'].astype('int64')

df_o = df[:10000]
Conversion of date column from object to datetime datatype

df['Date'] = pd.to_datetime(df['Date'])
df['Year'] = df['Date'].dt.year
Making seperate dataframe for visualisation

df2 = df[['Year', 'Warehouse', 'Order_Demand']].groupby(['Year', 'Warehouse'],


as_index=False).count()
Timeseries Visualisation

13
df=df.groupby('Date')['Order_Demand'].sum().reset_index()
#Step-02: Indexing the Date Column as for further procssing.
df = df.set_index('Date')
df.index #Lets check the index
#Step-03:#Averages daily sales value for the month, and we are using the start of each month
as the timestamp.
monthly_avg_sales = df['Order_Demand'].resample('MS').mean()
#In case there are Null values, they can be imputed using bfill.
monthly_avg_sales = monthly_avg_sales.fillna(monthly_avg_sales.bfill())
#Visualizing time series.

monthly_avg_sales.plot(figsize=(20,10))
plt.show()

#Using Time Series for Decomposition.


from pylab import rcParams
import statsmodels.api as sm
rcParams['figure.figsize'] = 20, 10
decomposition = sm.tsa.seasonal_decompose(monthly_avg_sales, model='additive')
fig = decomposition.plot()
plt.show()

df2 = df2.pivot(index='Year', columns='Warehouse', values='Order_Demand')


from matplotlib import rcParams
df2.index = df2.index.map(int) # let's change the index values of df2 to type integer for
plotting
df2.plot(kind='area', stacked=False, figsize=(20, 10))

plt.title('Order_Demand Trend')
plt.ylabel('Number of Order_Demand')
plt.xlabel('Years')
plt.show()

encoder = OneHotEncoder(sparse=False)
categorical_cols = ["Product_Category", "Warehouse"]
categorical_data = df_o[categorical_cols]
encoder.fit(categorical_data)
OneHotEncoder(sparse=False)
encoded_data = encoder.transform(categorical_data)
# pip install --upgrade scikit-learn
processed_data = pd.concat([df_o[["Date", "Order_Demand", "Product_Code"]],
pd.DataFrame(encoded_data, columns=encoder.get_feature_names(categorical_cols))],
axis=1)

X = timeseries_df[:-1] # Features (past demand sequences)


y = timeseries_df[1:] # Targets (future demand values)

14
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
X_train = np.array(X_train)
y_train = np.array(y_train)
import datetime

df_o['date_day'] = df_o['Date'].dt.day
df_o['date_month'] = df_o['Date'].dt.month
df_o['date_year'] = df_o['Date'].dt.year

import pandas as pd
import math

# Assuming your DataFrame is named 'df'

# Extract day, month, and year


day = df_o['date_day']
month = df_o['date_month']
year = df_o['date_year']

# Normalize month and day (0-1 range)


max_day = 31 # Adjust if your date format uses a different max day value
max_month = 12 # Adjust if your date format uses a different max month value

normalized_month = (month - 1) / (max_month - 1) # Normalize month (0-1)


normalized_day = day / max_day # Normalize day (0-1)
# month_sin = pd.Series(math.sin(normalized_month * 2 * math.pi))
month_sin = pd.Series(np.sin(normalized_month * 2 * np.pi))
month_cos = pd.Series(np.cos(normalized_month * 2 * np.pi))
day_sin = pd.Series(np.sin(normalized_day * 2 * np.pi))
day_cos = pd.Series(np.cos(normalized_day * 2 * np.pi))

# Optional: Cyclical encoding for year (experiment to see if it improves performance)


year_sin = np.sin(year / 2024 * 2 * np.pi) # Adjust max year if needed
year_cos = np.cos(year / 2024 * 2 * np.pi) # Adjust max year if needed
from tensorflow.keras import Sequential
from tensorflow.keras.layers import LSTM, Dense
model = Sequential()
model.add(LSTM(50, activation='relu', return_sequences=True,
input_shape=(X_train.shape[1], 1))) # Adjust units (50) as needed
model.add(LSTM(50, activation='relu')) # Adjust units (50) as needed
model.add(Dense(1)) # Output layer for demand prediction

# , return_sequences=True, input_shape=(X_train.shape[1], 1)
model.compile(loss="mse", optimizer="adam",metrics = ['accuracy'])
X_train[0]

15
CH-5. EXPERIMENTAL RESULTS

16
CH-6. DISCUSSION OF RESULTS
In this study, the performance of ARIMA and LSTM models for demand forecasting
was evaluated using monthly housing data. The results showed that the LSTM model
provided more reliable predictions with lower error values compared to the ARIMA
model.
 MSE and MAPE: The Mean Squared Error (MSE) for ARIMA was 1.67, while for
LSTM it was 1.12, indicating better accuracy with LSTM. The MAPE values were
also lower for LSTM, further confirming its superiority in handling the demand
forecasting task.
 Training and Accuracy: Both models were trained multiple times on the dataset to
ensure realistic and reliable results. Despite ARIMA’s effectiveness in capturing
linear patterns, LSTM outperformed ARIMA in this experiment, as it handled the
non-linear and complex demand patterns more effectively.
 Practical Implications: The LSTM model’s ability to forecast demand more
accurately will help supply chain stakeholders, including retailers and manufacturers,
balance supply and demand more efficiently. This can lead to optimized decision-
making and improved forecasting accuracy across industries.
 Generic Model: The approach used in this study is designed to be adaptable and can
be applied to various industries, regardless of their economic environment. The
proposed model, based on Agent-oriented and Process-oriented frameworks, is
flexible and can be applied to any company for better demand prediction.
 Conclusion: Given its superior performance in terms of accuracy, LSTM is deemed
more efficient for demand forecasting, helping mitigate issues like the Bullwhip
effect and enhancing key performance metrics across the supply chain.

17
CH-7. CONCLUSION

In this model, we addressed a key issue in Supply Chain Management (SCM) related to
decision-making, demand fluctuations, and uncertainty in information flow, particularly
focusing on the "Bullwhip effect." Accurate demand forecasts are essential to improve key
performance indicators (KPIs) within the supply chain, enabling companies to reduce waste,
minimize delays, and enhance profitability. Additionally, better data sharing and
collaborative forecasting can help mitigate forecasting errors caused by negative or
fluctuating data.

We applied two Deep Learning models, ARIMA and LSTM, for demand forecasting using a
dataset sourced from Kaggle. The dataset was chosen because it aligns well with the agent-
oriented and process-oriented model of SCM. Our experiments demonstrated that LSTM
outperformed ARIMA in providing more accurate and realistic predictions due to its ability
to better retain and transmit information over time through its "cell state," which allows it to
model long-term dependencies effectively.

The primary aim of our approach is to balance supply and demand in SCM by leveraging
intelligent AI-based forecasting systems. The results suggest that LSTM is a better model for
maintaining this balance, especially in the context of the dynamic and complex nature of
modern supply chains.

As a potential improvement, we propose developing a hybrid model combining ARIMA


and LSTM to further enhance the accuracy and robustness of the forecasting system. This
hybrid approach could potentially leverage the strengths of both methods, improving
predictions and helping optimize supply chain operations even further.

18
CH-8. REFERENCES

 An Improved Demand Forecasting Model Using Deep Learning Approach and


Proposed Decision Integration Strategy for Supply Chain Zeynep Hilal Kilimci , A.
Okay Akyuz ,Mitat Uysal,Selim Akyokus , M. Ozan Uysal,Berna Atak Bulbul
WILEY NOV 2020
 Demand Forecasting Model using Deep Learning Methods for Supply Chain
Management 4.0 Article in International Journal of Advanced Computer Science and
Applications · May 2022
 M. El Khaili, L. Terrada, H. Ouajji, and A. Daaif, “Towards a Green Supply Chain
Based on Smart Urban Traffic Using Deep Learning Approach,” Stat., optim. inf.
comput., vol. 10, no. 1, pp. 25–44, Feb. 2022, doi: 10.19139/soic-2310-5070-1203.
 Z. Dou, Y. Sun, Y. Zhang, T. Wang, C. Wu, and S. Fan, “Regional Manufacturing
Industry Demand Forecasting: A Deep Learning Approach,” Applied Sciences, vol.
11, no. 13, p. 6199, Jul. 2021, doi: 10.3390/app11136199.
 G. H. Alraddadi and M. T. B. Othman, “Development of an Efficient Electricity
Consumption Prediction Model using Machine Learning Techniques,” IJACSA, vol.
13, no. 1, 2022, doi: 10.14569/IJACSA.2022.0130147

19

You might also like