Artificial Intelligence in Supply Chain Management

Artificial Intelligence in Supply Chain ManagementUtilizing data to drive operational performanceVegard FlovikBlockedUnblockFollowFollowingJun 23Supply chain management (SCM) is critical in almost every industry today.

Still, despite the importance, it hasn`t received the same amount of focus from AI startups and vendors as many other domains.

However, given the vast amounts of data collected by industrial logistics, transportation and warehousing, this is an area with a lot of potential.

Digital transformation, digitalization, Industry 4.

0, etc….

These are all terms you have probably heard or read about before.

However, behind all of these buzz words, the main goal is the use of technology and data to increase productivity and efficiency.

The connectivity and flow of information and data between devices and sensors allows for an abundance of available data.

The key enabler is then being able to use these vast amounts of available data and actually extract useful information, making it possible to reduce costs, optimize capacity, and keep downtime to a minimum.

This is where the recent buzz around machine learning and data analytics comes into play.

AI for the supply chainLike in any other industry, the current focus on digitalization is transforming also supply chain management.

Improving the efficiency of the suppy chain is of great importance for many companies.

Operating within tough profit margins, even slight improvements can have substantial impact on the bottom line profit.

Examples where data analytics and machine learning can be beneficial for supply chain management is e.


within demand forecasting and warehouse optimization.

Given the vast amounts of data collected by industrial logistics, transportation and warehousing, being able to harness these data to drive operational performance can be a gamechanger for those that do it correctly.

Case study: Predictive analytics for demand forecastingTo illustrate the use of machine learning in the supply chain, I will go through an example case study focused on demand forecasting.

The following example covers a hypothetical retailer in Norway, and includes individual stores on various locations as well as a main central warehouse, as illustrated in the below figure.

One of the challenges for such a retailer, is to optimize localized vs.

centralized warehouse storage of goods: On the one hand, substantial local storage is expensive, on the other hand, relying mostly on centralized storage and running the risk of sold out items in the stores is another factor.

Warehouse optimization is thus of great importance, and having access to accurate sales forecasts would be extremely useful information.

To limit the amount of data in the case study, the anonymized dataset includes the number of sold items for a subset of 50 items for 10 different shops during the time period from 2013–2017.

In total this adds up to a dataset of approximately 1 million rows, on the data format illustrated below:The historical sales records thus represents the data we are trying to extract useful information from in order to predict future sales.

Of course, this could ideally be complemented with other available data sources such as e.


weather data, as it is not unlikely that sales might be affected by weather conditions.

For example, if you want to predict the amount of ice cream and BBQ food sold during the following week in a grocery shop, having information on the weather forecast might be extremely useful information (especially for the example retailer in Norway, where summer weather can be unstable to say the least!).

Fortunately, the Norwegian Metrological Institute has a “WeatherAPI”, where where you can download weather data and experiment with for free if you want to have a go!Training data and target variablesIn this case, we are trying to predict the number of sold items in the 10 shops for each of the 50 (anonymized) items included in the example dataset.

The basic idea is that the historical sales records might contain some hidden patterns that our machine learning model can pick up.

And, if this is the case, the model can then utilize these patterns to make accurate predictions of future sales.

We use the historical sales records from January 2013 to September 2017 as training data for our model, and we then try to predict the number of sold items during the last quarter of 2017 (October-December).

A subset of the training data for “item 15” from store 10 is illustrated in the below figure to the left.

This exhibits a clear yearly periodicity (with highest sales during the summer months), and also a linearly increasing trend where sales increase year by year.

Our goal then, is to predict the sales during October-December 2017, as illustrated in the figure to the right.

Defining the machine learning modelHaving defined the training data and our target variables (what we are trying to predict), we can now set up a prediction model that tries to utilize the patterns hidden within the dataset to predict future sales.

Time series forecastingTime series forecasting is an important area of machine learning.

It is important because there are so many prediction problems that involve a time component.

However, while the time component adds additional information, it also makes time series problems more difficult to handle compared to many other prediction tasks.

There are several types of models that can be used for time-series forecasting.

One of the popular choices is a “Long short-term memory network”, or in short LSTM Network, which is a special kind of neural network that make predictions according to the data of previous times.

It is popular for language recognition, time series analysis and much more.

However, in my experience, simpler types of models actually provide just as accurate predictions in many cases.

Using models such as e.


random forest, gradient boosting regressor and time delay neural networks, temporal information can be included through a set of delays that are added to the input, so that the data is represented at different points in time.

I will not go into further datails here, but for an introduction to machine learning for time series forecasting you can have a look at one of my previous articles on the topic.

Prediction modelAs the main focus of this article is not to go in detail on the technical aspects, I will just briefly mention some of the implementation details.

The dataset consists of labelled data (i.


Supervised learning), and is a mix of numerical and categorical variables.

Using the “Date” variable, we can also extract a few additional useful features such as e.


day of the week, if the date is a national holiday etc.

, which adds useful information to our model compared to using the date alone.

For these kind of mixed variable types, tree based models are often a good choice.

In the following example, I thus decided to use a Random forest algorithm, as a quite simple baseline prediction model.

This is mainly because this type of model can easily handle the mix of different datatypes (numerical and categorical) and that they typically perform quite well “out of the box” without any need for extensive hyperparameter tuning.

ResultsAfter training the model, we can now check how well it performs on the test data (last quarter of 2017).

The prediction model is trained to simultaneously predict the sales for all 50 items in each of the 10 shops, but in order to easily visualize the results I have decided to here only plot the predictions for “item 15” as an example.

Starting with the left figure below, we compare the real vs.

predicted sales for store 10.

We notice that our simple baseline model does quite a good job in terms of capturing both the weekly periodicity and the characteristic drop in the number of sold units during December (Note that the y-axis is chopped to more clearly visualize the deviation between real and predicted sales).

Still, we observe that the model is not able to capture all the short term fluctuations (or noise), and neither would I expect it to, given the limited information the training data contains.

On the other hand, in the figure to the right I have plotted the real vs.

predicted sales, but this time the number of sold units is averaged over all 10 shops.

In doing this, most of the short term fluctuations (or noise) “averages out”, and we observe a much better match between the real and predicted sales.

Whether you are interested in forecasting on the level of the individual shops or the total/average sales for all shops depends on what you are trying to achieve: If you are mainy concerned about optimizing your central warehouse, predicing the total sales might provide enough information, and digging into the details of the individual shops might be a time consuming effort with little to gain.

It all comes down to clearly defining your goals and focusing on the business problem you are trying to solve rather than the technology you are using to solve it.

SummaryThe above use case example provides a brief introduction to just one of many interesting and useful applications of machine learning within the supply chain.

In the future, I believe machine learning will be used in many more ways than we are even able to imagine today.

What impact do you think it will have on the various industries?.I would love to hear your thoughts in the comments below.

Other articles:If you found this article interesting, you might also like some of my other articles:How to use machine learning for anomaly detection and condition monitoringHow (not) to use Machine Learning for time series forecasting: Avoiding the pitfallsHow to use machine learning for production optimization: Using data to improve performanceHow do you teach physics to AI systems?Can we build artificial brain networks using nanoscale magnets?.. More details

Leave a Reply