MLOps Blog

Use Cases, Algorithms, Tools, and Example Implementations of Machine Learning in Supply Chain

9 min
23rd August, 2023

We live in a time when speed is essential. The faster your company delivers the product, the faster it makes a profit. Speed is a crucial area where companies compete. 

Compared to machines, humans are slow and inconsistent. Managing the end-to-end process of a delivery system from acquiring data, managing data, understanding it and making decisions, can be difficult and tiring.

Companies need a robotic companion that can excel at routine and repetitive tasks without getting tired – AI and machine learning. 

Demand is uncertain, supply is at risk, competition is intense. Supply chain (SC) excellence often relies on the organisation’s ability to incorporate the end-to-end processes of getting materials or components, assembling them into products, and delivering them to the customers. 

AI has shown great promise in improving human decision-making processes and the subsequent productivity in business projects. It can recognise patterns, learn business phenomena, seek information, and analyse data intelligently. 

In this article, we will discuss:

  1. Potential role of AI in supply chain,
  2. Necessary algorithms,
  3. Tools and framework,
  4. Three case studies of famous companies using AI in supply chain,
  5. Conclusion.


Data Science and Machine Learning in the E-Commerce Industry: Insider Talks About Tools, Use-Cases, Problems, and More
How AI and ML Can Solve Business Problems in Tourism – Chatbots, Recommendation Systems, and Sentiment Analysis

Use cases of AI/ML in Supply Chain

Supply chain management has become data intensive. These days all the information is collected and stored in data centers and the need of warehouses, transportation equipment can be substituted.

Data is available in enormous amounts. Professionals know how important it is for SCs, and with the help of artificial intelligence (AI) they can exploit it, come up with an optimized solution and build tools that can help them make better decisions.

Predicting customer’s behavior

Customers are uncertain, and act based on emotions. And yet, success in the supply chain depends on customer data and their behavior.

In order to predict customer behaviours, many spreadsheet-based methods were proposed, but with the rise of big data they turned out to be obsolete. The main reason that spreadsheet models fail at demand forecasting is that they’re not scalable for large-scale data. They bring forth the complexities and uncertainties in supply chain management that cannot be extracted, analyzed, and addressed through simple statistical methods such as moving averages or exponential smoothing.

This inconsistent-order pattern can lead to miscommunication between your team and loss of productivity. Predictability of inconsistent-order volumes is a challenge for many companies. AI and ML give us a closer prediction of the inconsistent nature of customer behavior much earlier at optimal level during such situations.

Predictive capabilities are helping demand forecasting

Demand forecasting is a field of predictive analysis where companies anticipate the demand for products and shipments throughout the supply chain, even under uncontrollable conditions. 

Conventional methods, as discussed earlier (spreadsheet models, statistical models, moving averages and exponential smoothing) are limited due to the large number of parameters influencing the demand in SC, which makes these methods too simple and extremely inaccurate. 

In this regard, the forecasts could only provide a partial understanding of demand variations in supply chains. In addition, the unexplained demand variations could be simply considered as statistical noise, this is what makes them non-linear in nature. Thus, conventional or simple models fail to map important and non-linear features. 

Luckily, machine learning provides algorithms that can map important and non-linear features, and reduce them into variables that can help to understand the past, accurately predict future events, help them to improve decision-making processes about cash flow, risk assessment, capacity planning and workforce planning, and meet customer demands.

Some of the AI-powered demand forecasting tools are:

  • amoCRM
  • Capsule
  • ClosePlan
  • Effectmanager
  • FutureMargin
  • Pipedrive
  • Smart Demand Planner

Avoiding charge-back risks

As mentioned earlier, customers are emotional. They might rethink buying if delivery is delayed. Or purchase a product and later ask for a refund.

This eventually leads to penalties which may include shipping charges, taxes and other expenses. With integrated AI like the one Amazon uses, companies can analyse data to find the nearest distribution center and reduce delivery time. 

Such systems can analyse the cause of delay, and the cause of failure, like dispute between partners or a catastrophe linked to bad weather. 

Sensing market situations

The market is based on human emotions on any given day, and it makes the whole market very unpredictable and difficult to comprehend. 

With AI and deep learning systems we can find patterns for human behaviour from data such as weather, employment, seasons, and help companies make fine investments in storing products in warehouses and optimising the delivery system. 

This type of pattern recognition system for studying the market can help companies improve their product portfolio, and offer a better customer experience.

Improving accuracy while tracking departing and arriving orders 

The supply chain management system is interlinked with different regional distribution centers, and these centers are connected via transportation. But there are some distribution centers that are discreetly connected for transport. 

This raises concerns for businesses about being able to reach their contractual commitments on time. AI can offer real-time predictive visibility that knows the exact location of the product at any given time, for intelligent decision making and improving delivery accuracy.

Fourkites is a great example for providing real-time visibility for the supply chain. 

Genetic algorithms for improving delivery times and reducing costs

In the logistics business time and speed matters. Companies can use a route planner based on genetic algorithms to map out optimal routes for deliveries.

It is assumed that AI will set a new standard of efficiency across supply-chain, delivery and logistics processes. The system is changing quickly, creating a “new normal” in how global logistics companies manage data, run operations and serve customers, in a manner that’s automated, intelligent, and more efficient.

Improves customer experience

For a business to succeed, customers must be satisfied. One thing that can help satisfy them, is recommending the right products at the right time. Machine learning does this quite nicely.

Recommendation systems based on customer interest can be integrated in mobile or web apps, so that the homepage of the customer is personalized. 

PS: Almost all popular apps have recommendation systems.

Smart warehouses are more efficient

A smart warehouse is a fully automated facility where most work is done through autonomous robots or software. In the process, complex tasks are made simple, and operations become more cost-effective.

Alibaba and Amazon have transformed their warehouses into a utopia of efficiency through the use of automation.

Algorithms for Supply Chain

Convolution Neural Networks

Convolution Neural Networks (CNNs) are a type of algorithm that usually deals with image recognition, but it turns out that CNNs are also extremely useful for forecasting.

CNNs are best known for extracting useful patterns and features from a dataset. This makes CNNs very reliable for solving classification and regression problems. 

One advantage of CNNs is that they share parameters i.e. compared to other classification algorithms they require fewer hyperparameters and less supervision.

This is why CNN is one of the most widely used algorithms in supply chain management. Here’s a few examples of where CNNs are used:

Image Classification 

  • Image classification is used to recognise the category of a given image. It’s quite handy in the supply chain, as it can classify different products in an instance, and separate them accordingly.  

Object Detection

  • Object detection will help you to identify different objects instantly. 
  • In supply chain management, you come across a lot of products at the same time. Separating these products manually is very expensive and time-consuming. Object detection can help you to identify objects and categorize them quickly (making image classification much more precise) without any human interference. 

Image Segmentation

  • Image segmentation is another algorithm that uses CNN to create a pixel-wise mask around the object itself, thus understanding the dimension of the object. 

Autonomous mobile robots

  • Autonomous mobile robots use CNN to identify routes and navigate to assigned areas in the warehouse. These types of automated robots reduce error in warehouse management, and they also reduce human involvement in the warehouse, which eventually reduces risk of accidents. 
  • These robots use image classification, object detection and image segmentation to navigate across the warehouse, find the appropriate assigned designation for the object and know the dimension of the object, as well to avoid the obstacles in the way. 
  • Some companies like IAM Robotics, GreyOrange, and Bleum offer mobile robotics picking solutions that can increase the level of productivity.


  • As mentioned before the ability of CNN lies in the fact that it can extract useful patterns and features or representations, making them very efficient in forecasting sales and future demands. 

Recurrent Neural Network

Recurrent Neural Network (RNN) is a neural network used for processing sequential data which includes, text, sentences, speech or videos, or anything that has a sequence. 

RNN works by evaluating the prior information of the input and predicts the posterior or next information. 

RNNs are useful in predicting contextual information like a finishing an incomplete sentence or a voice sequence. 

Nature Language Processing

Natural Language processing (NLP) deals with:

Sentiment Analysis – every company needs feedback from the customer, this usually comes from the review section for each product. Going through each and every review manually and assigning into good, bad and anything in between can be a tedious job. Through sentiment analysis, companies can separate good and bad products based on the review and the ratings the customer provides. This helps to improve user experience.

Chatbots – chatbots are another way to improve user experience. Customers can talk to a robot about issues or feedback they have, and NLP is what helps the robots understand them.


As mentioned earlier, RNN is used for processing sequential data, so it’s quite useful in demand and sales forecasting.

One of the key architectures for forecasting is Long Short Term Memory (LSTM). LSTM is an architecture that has been adopted for time series forecasting. The power of forecasting improves when a good feature extraction algorithm like CNN is added on top of it.

Ensemble methods

Ensemble methods combine two or more methods to achieve a given result. Since the supply chain has a lot to do with understanding data, one method might not provide enough information or extract enough patterns to make any decision. 

A supply chain with several supply points, a number of warehouses, and customers from different parts of the world results in a lot of products which would make the demand forecasting a high-dimensional problem. 

To address this issue, data scientists applied a clustering technique, called bipartite graph clustering, to analyze the data and the different patterns that emerge for different products. For instance, creating an ensemble model with moving average models and a Bayesian belief network data scientist could now improve the forecasting accuracy. 

You can read more about it in this paper: Predictive big data analytics for supply chain demand forecasting: methods, applications, and research opportunities

The authors in this paper concluded that the ensemble method yielded best accuracy with minimum prediction error. 

Representation Learning

Representation Learning is another important method in machine learning. Representation learning is used to extract patterns and features to:

  1. Create real-life scenarios through generative models,
  2. Understand the data,
  3. Reduce dimensionality.

Representation learning uses a VAE autoencoder, where a CNN architecture is used to compress the data such that it contains latent variables or principle variables. Using these variables, we can understand the behaviour of the data, and use it to create real-life simulations that can prevent companies from undergoing massive financial losses.

Deep Reinforcement Learning

Supply chain has a lot of components right with managing inputs from raw materials, to manufacturing, warehousing, and distribution to customers. 

Companies have to do their best to carry out these tasks efficiently and optimally, while keeping the cost as low as possible. Optimization is the key.

A lot of time and effort has been put into building effective supply chain optimization models, but due to their size and complexity, they can be difficult to build and manage. With advances in machine learning, particularly reinforcement learning, we can train a machine learning model to make these decisions for us, and in many cases, do so better than traditional approaches.


7 Applications of Reinforcement Learning in Finance and Trading
How to Manage a Deep Reinforcement Learning Research Team – Part 1

Suitable libraries and framework

Data visualisation and analysis

Data visualization holds an important part in any ML project, also in the supply chain. But since the supply chain deals with both geospatial and time series data visualization, finding the correct library becomes vital.

Spatial data analysis

  • Folium
    • Folium is a powerful Python library that helps you create several types of Leaflet maps. The fact that Folium results are interactive makes this library very useful for dashboard building. To get an idea, just zoom/click around on the next map to get an impression. 

  • Geoplot
    • Geoplot is an extension to matplotlib for geospatial visualisation. 
    • One of the key features of geoplot is its compatibility with matplotlib, which makes it easier to work with. 

  • NetworkX
    • NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.
    • NetworkX provides:
      • tools for the study of the structure and dynamics of social, biological, and infrastructure networks;
      • a standard programming interface and graph implementation that is suitable for many applications;
      • a rapid development environment for collaborative, multidisciplinary projects;
      • the ability to painlessly work with large nonstandard data sets.

Time Series analysis

  • Matplotlib
    • Matplotlib is one of the most widely used visualization libraries, for creating charts and plots, in the python community. It has a lot of functions, each beneficial to their own needs. In time series analysis, matplotlib offers a few major functions that are very handy. They are:
      • Line Plots.
      • Histograms and Density Plots.
      • Box and Whisker Plots.
      • Heat Maps.
      • Lag Plots or Scatter Plots.
      • Autocorrelation Plots.
Time Series analysis

  • Seaborn
    • Seaborn is another tool that is widely used for visualisation because of the color palette and the interactions it provides through various shades and designs.
  • Plotly
    • Plotly provides an additional function that the above libraries do not. It has a live interactive design with various functions like select, zoom in and out, etc. 


Neptune’s Integrations with visualization libraries

Machine Learning

Demand forecasting

    • ARIMA stands for AutoRegressive Integrated Moving Average. It is a class of models used to understand different standard temporal structures in time series data.
    • ARIMA is very popularly used for time series analysis, including demand forecasting.


  • Sklearn
    • Sklearn provides a lot of different functions to cluster your data. One of the most frequently used clustering algorithms is K-means. With kmeans, a set of N data points are grouped into K clusters with the mean of each cluster becoming its identifying location.

Deep Learning

Natural Language Processing

  • Huggingface’s Transformers
    • Transformers is a state-of-the-art python framework that works with both pytorch and tensorflow. 
    • Transformers provides a variety of pretrained models for:
      • Text classification for sentiment analysis
      • Question-answering for chatbots
      • Text summarization
      • Text translation
      • text generation

Computer Vision

  • Pytorch
    • PyTorch is a scientific computing framework with wide support for machine learning algorithms. The Lua based scripting language provides a wide range of algorithms for deep learning and uses the scripting language LuaJIT, and an underlying C implementation.
    • It is easy to implement and work with. 
    • You can create your own custom CNN model or you can apply transfer learning as well. 
    • Pytorch has a wide and active community, helping and supporting fellow coders through its forum.
  • Tensorflow
    • Tensorflow or tf is developed by Google. It provides good education support from the Google machine learning community and it is used to build simple and complex neural networks. 
    • Similar to pytorch, tensorflow provides a wide range of mathematical algorithms to build a neural network from scratch. 
    • Tensorflow also has Keras, which is a deep learning framework. It is one of most widely used deep learning frameworks. 
    • Keras is simple and easy compared to both pytorch and tensorflow.
  • OpenCV
    • OpenCV is a vision library that is used to analyse and manipulate both images and videos. Mostly used for real-time applications
    • It is compatible with both pytorch and tensorflow. 


Neptune’s Integrations With PyTorch, and TensorFlow/Keras

Reinforcement Learning

A multi-echelon inventory system is one that relies heavily on layers of suppliers distributed across multiple distribution centers (DC), and based on outsourced manufacturing. For example, Nike’s distribution network consists of 7 regional distribution centers (RDCs) and more than 300,000 DCs; and these DCs serve end-customers.

Supply chain reinforcement learning
Source: Multi-Echelon Supply Chain Schematic (image by author from Hubbs et al.)

We can build a deep reinforcement learning model using Ray and or-gym to optimize a multi-echelon inventory management model.

  • Ray
    • Ray is an open source framework that provides a simple, universal API for building distributed applications. 
    • Ray is packaged with RLlib, a scalable reinforcement learning library, and Tune, a scalable hyperparameter tuning library.
    • RLib supports deep learning framework, including PyTorch, PyTorch Lightning, TensorFlow, and Keras.
  • Or-gym
    • OR-Gym, an open-source library for developing reinforcement learning algorithms to address operations research problems.

Three use cases where AI is implemented in Supply Chain management 

1. Amazon Intelligent Revenue and Supply Chain (IRAS) Management

Accenture’s Intelligent Revenue and Supply Chain (IRAS) platform, developed by Accenture, integrates insights and findings generated by ML and AI models into its business and technical ecosystem. 

It’s purpose is to improve the overall supply chain management system. IRAS also takes care of the optimization of the forecasting and various other models, making sure that the whole system is optimal and cost-efficient. 

Amazon IRAS
IRAS objectives and their components | Source:  Amazon Blog

2. Rolls Royce redefines safety measures to transport its cargo with AI

Rolls Royce, legendary british automobile manufacturer, partnered with Intel to design an intelligent AI system that can make commercial shipping faster and safer. They claim that this technology will have the capabilities to independently manage navigation, obstacle detection and communications, developing a new system of autonomous ships.

In a statement they said: “This collaboration can help us to support ship owners in the automation of their navigation and operations, reducing the opportunity for human error and allowing crews to focus on more valuable tasks.” – Rolls Royce

3. UPS ORIAN (On-road Integrated Optimization and Navigation)

UPS is a Multinational package delivery and supply chain company management company. UPS claims to deliver thousands upon thousands of deliveries each day, and in each business day the UPS driver makes an average of about 100 deliveries. 

To make sure that packages are delivered on time and with ease, UPS offers the most optimized navigation system called On-Road Integrated Optimization and Navigation (ORIAN). It ensures that the UPS drivers use the most optimized delivery routes in regard to distance, fuel and time.

According to the company “ORION uses highly advanced algorithms to gather and process large amounts of data so that they can optimize routes for the drivers. This helps UPS to deliver and pick-up packages in a much more efficient way. The system relies on online map data, to calculate distance and travel time devising the most cost-effective routes.”  – ORION


AI is growing fast, across all industries, and it’s already proven to be a beneficial tool in supply chain management. Without AI and ML companies like Amazon, Nike, UPS, or Walmart wouldn’t be as fast as they are. AI not only provides agility, efficiency, and customer satisfaction, but it also provides safety in warehouses through autonomous vehicles, making the workflow ultra smooth and error-free.

The tools, frameworks and algorithms that we discussed offer us a way to understand the world from a consumer’s perspective, and to build intelligent systems (including hybrid) that forecast demands, failures, sentiments, provide safety and save lots of money.

In addition to all that we discussed, I’d like you to try out this supply chain simulation. If you’re new to the supply chain, this will give you an understanding of how supply chain management works. 

Hope you enjoyed this article, thanks for reading! 

Was the article useful?

Thank you for your feedback!