The Effectiveness of AI and ML on Supply Chains Amidst a Global Pandemic



With 14+ years of experience in the software industry and with specialization in handling the massive amounts of mobile crowdsourced data on large-scale distributed systems like AWS. Sharmistha Chatterjee Shares the effectiveness of AI and ML on supply chains during a pandemic.

The onset of Covid-19 has not only impacted the world’s most prominent factories in China but also massively disrupted the entire global supply chain.

The Covid-19 pandemic has created a severe testing situation for data scientists and analytics to suitably apply AI / ML / Data science to help in the cross response.

AI and ML on Supply Chains

This would not only entail early diagnosis (drug discovery and development), but also a prediction of old and new drugs and treatments that might alleviate the disease. Furthermore, not only pharmaceutical companies but other industries see a huge benefit in their supply chain in terms of planning, forecasts, cost savings, and increased automation.

Companies are becoming extra vigilant in this crisis and shifting their attention to ensure supply chain and value networks are functioning properly.

The role of AI/ML and data science has been tremendous to minimize the Covid uncertainties and to help the supply chain industry.

  • To focus on workforce/labor planning
  • Remain cautious/alert on tier-1 supplier risk
  • Manage and utilize the extended supply stock
  • Update inventory policy and planning parameters
  • Enhance inbound materials visibility
  • Prepare for plant closures
  • Focus on production scheduling agility
  • Evaluation of alternative outbound logistics options and secure capacity
  • Conduct global scenario planning

Covid Impact on SupplyChain

AI and ML on Supply Chains

The below figure depicts data analysis as modeled by Blue Yonder, representing how COVID-19 is affecting a customer’s supply at impacted sites.

AI and ML on Supply Chains


The objective of this solution is to take feeds from the Center for Disease Control and Prevention (CDC) in real-time and mapping manufacturing and logistics sites to model responses. This helps to achieve accurate predicted arrival times of supplies, helping customers to gain time to resolution to proactively identify issues deep in the supply chain. In addition, customers can also leverage ML-based recommendations to find alternate sources of supply and integrated execution capabilities to turn recommendations into alternate supply shipments.

Overall, the goal of introducing AI / ML into the supply chain process is to ease procurement processes, delivery logistics, traceability, or storage, thereby smoothing the accessibility, availability, and quality of medicines.

The pharmaceutical companies see a remarkable leap in terms of:

  • Demand Forecasting
    To accurately predict shifts in demand and consumption, decreasing stockouts and wastage.
  • Reporting Substandard medicines
    To report substandard medicines in a timely manner.
  • Ensuring Continuous Supply
    To ensure a continuous supply and provide emergency humanitarian relief to those who are affected and in serious condition.

A global disruptive event like Covid-19 has created an awareness among many companies to invest today in a resilient supply chain that will be best positioned to weather the next event that obstructs the global flow of goods

In this blog, we list some of the common open-source Supply Chain libraries and address what kind of problems they solve.

List of Open Source Supply Chain Libraries


TensorHouse is a collection of reference machine learning and optimization models for enterprise operations: marketing, pricing, supply chain, etc that can be used for academic, industrial purposes, and research study.

The policy map can be trained using:

trainer = wsrt.train_ppo(n_iterations = 5),

where world_of_supply contains internal library implementations which we can define ‘global training policy’ of the trainer for multi-agent reinforcement learning.

AI and ML on Supply Chains
AI and ML on Supply Chains
AI and ML on Supply Chains


in-toto is built as a framework to protect the integrity of the software supply chain, by validating each step through authorized personnel ensuring the product does not tamper in transit.

Neural Combinatorial Optimization with RL

This library implementation using Tensorflow 1.15 uses Neural Network consists in an RNN or self-attentive encoder-decoder with an attention module connecting the decoder to the encoder where the model is trained by Policy Gradient. This kind of neural combinatorial optimization framework can be used to solve the traveling salesman problem (TSP) to optimize tour lengths in a permutation of cities. This kind of library finds great application in optimizing distances between warehouses, distribution centers, and retail store locations.

The following code demonstrates how to train and visualize a 2D TSP problem from scratch.

AI and ML on Supply Chains
AI and ML on Supply Chains


This library builds a simulation-optimization framework that minimizes average inventory while maintaining desired average β service level at stocking location. The framework creates an inventory profile (along with associated inventory parameters such as on-hand, inventory position, service level, etc.) across time, which considers a base stock policy with a reorder point. If inventory position <= ROP, an order of the amount (base stock level – current inventory level) is placed by the facility. 

The below code demonstrates how to evaluate the objective function for optimization to minimize on-hand inventory and heavily penalize not meeting the beta service level (demand volume based). Initially, the set of supply change nodes (configurable) needs to be initialized.

AI and ML on Supply Chains

The below figure illustrates a typical supply value chain network that the given framework optimizes.

AI and ML on Supply Chains


This library – A Deep Q-Network for the Beer Game – Deep Reinforcement Learning for Inventory Optimization optimizes the Inventory Costs such that the Individual Supply Chain Cost and Total Supply Chain Cost is reduced as much as possible. During the optimization, it tries to avoid Out of Stock option and maintain supply chain equilibrium. The following figure illustrates a typical facility unit (distributor) with its incoming and outgoing streams/channels.

AI and ML on Supply Chains
AI and ML on Supply Chains

TensorFlow Object Detection

The below video illustrates how we can leverage ML to facilitate sorting packages into different categories according to their final destination. It uses Tensorflow Object Detection API to train a deep learning model based on Faster RCNN Architecture.

When a camera is placed above the conveyor belt, it can send a snapshot of the parcel to the computer, which can be processed and ran through a Deep Learning algorithm (Faster RCNN) on the image, to automatically sort and determine the appropriate destination for the package.

Watch this Youtube link https://youtu.be/uextIyx7sO4.


This library primarily provides a tool to design and optimize all kinds of industrial supply chains from simple transportation networks up to complex multi-level manufacturing setups comprising of components, parts, products, substitutes, suppliers, manufacturers, distributors and customers.

Network Design

This library solves some of the critical Decision Optimization business problems for the Network Design phase like the Facility Location Problem (FLP). It becomes necessary for many retailers to decide where to open a new warehouse to optimize supply chain cost between plants or providers and customers or chops, or for a water distribution company to plan improvement of the distribution network, creating new tanks or new pipes.

The below code snippet demonstrates how to optimize network design with the KPI (Key Performance Indicator) for each of the costs:

  • variable plant cost
  • inbound transportation cost (from plant to distribution center)
  • outbound transportation cost (from distribution center to customer)
  • fixed distribution centers cost
  • variable distribution center cost
  • a number of newly opened distribution centers

For this below code snippet, we also applied different constraints as mentioned below:

  • capacity constraints: one on the plants and products — one on the plants and products and distribution centers
  • demand satisfaction: what is shipped to a customer is exactly the quantity they expect
  • flow on distribution centers structural constraint: what goes in from plants goes out to customers.
  • cost variables definition constraints
AI and ML on Supply Chains
AI and ML on Supply Chains

Consolidating the outputs from the previous steps:

AI and ML on Supply Chains


It is a python library for supply chain analysis, modeling, and simulation, with facilities to create workflows for Demand Planners, Buyers, Supply Chain Analysts, and BI Analysts. It helps them with Visualisation tools, allowing them to build reports and perform demand forecasts.

The following code snippet can be used to depict supply chain orders with parameters (safety stock, total_orders, quantity_on_hand, economic_order_quantity, demand_variability, reorder_level, average_orders, safety_stock and orders, etc.)

AI and ML on Supply Chains

Predicted output:

AI and ML on Supply Chains

Further, for demand forecasting problems we can also apply different types of forecasting like Exponential Smoothing

AI and ML on Supply Chains


This javascript library (OriginTrail) is dedicated to making global supply chains work together, by enabling a universal, collaborative, and trusted data exchange. Further, itis built as an open protocol for cross-organizational data sharing in supply chains, supported by blockchain.


This library is equipped with Attestation Certificate Authority (ACA) and TPM Provisioning with Trusted Computing for Supply Chain Validation capabilities.


This repository develops a technical framework for improving traceability in supply chain systems using blockchain.

Hyperledger Composer Supply Chain Network

The Hyperledger Composer implemented in this repository can be used for the supply-chain industry. This library demonstrates how Hyperledger blockchain improves transparency and traceability of the industrial supply chain.


This library acts as an “umbrella” repository for blockchain supply-chain solutions, with support for archiving, retrieval, and validations of attachments. The in-built core-services provided has API support to interact with the Ethereum smart contract.


This library deals with pharmaceutical Supply Chain logistics to help in medicine delivery. It has functionalities to provide accurate information across the entire supply chain pipeline and through real-time updates and visibility of handovers. It also provides traceability of sources and collaboration between all parties at an enhanced speed.


This Supply chain proof of concept is built in Hyperledger Fabric, with a specific chaincode exposed as a REST API.


This library serves the Automobile Supply Chain Management for transparency and auditability, with support for differential pricing, mediation between different parties, quality and compliance issues, inevitable disruptions, centralization, and fraud management


This library provides a dynamic agent-based model acclimate describing the propagation of disaster-induced production losses in the global economic network.


There are severe limitations in supply chain frameworks that struck companies to maintain complete visibility of their supply network. This library provides automated supply chain mapping as a means of maintaining the structural visibility of a company’s supply chain. Deep Learning and Natural Language Processing can be leveraged to a) automatically generate rudimentary supply chain maps, b) verify existing supply chain maps or c) augment existing maps with additional supplier information.


This library has a framework, to optimize production planning, using pulp and 4 different solvers: CBC (default), Gurobi, CPLEX, and GLPK. The following code demonstrates how to defining production variables and inventory constraints.

Define Production variables:

AI and ML on Supply Chains

Define Inventory Constraints:

AI and ML on Supply Chains

For more details on their mode of operating and response time, please refer to A Simple Framework For Solving Optimization Problems in Python.

Awesome Supply chain

This repository contains a curated list of awesome supply chain blogs, podcasts, standards, projects, and examples.

Other Supply Chain BlockChain Repositories

  • Ethereum-SupplyChain – A Supply Chain smart contract built-in to demonstrate how supply chains can improve authenticity, efficiency, and privacy between seller and buyer.
  • ichain– A blockchain-based on tender mint, making deployment, multiple networks connection, and run supply chain applications easier.
  • AuthentiFi– A blockchain-based Product Ownership Management System for anti-counterfeits in the Post Supply Chainkeras-rl

It implements some state-of-the-art deep reinforcement learning algorithms in Keras (Python) and is capable of solving complex optimization problems of the Supply Chain.

AI and ML on Supply Chains


In this blog, we have seen the impact of Covid on the supply-chain industry leading to revenue loss and lot of uncertainties. In order to combat the situation, we must make use of AI / ML frameworks to apply route optimizations, price optimization or inventory optimization, which we demonstrate with different code samples. We also refer to many other open-source libraries available that can be used for making supply chain transactions either using blockchain or for expediting supply chain analytics.

AI and ML on Supply Chains

As the above figure illustrates, along with AI / ML the most important technologies for the efficient functioning of the supply chain are IoT, cloud computing, 5G, AI, 3D printing, and robotics.

However, technology alone can’t drive the digital supply network in events like COVID-19, a trade war, an act of war or terrorism, regulatory change, labor dispute, a spike in demand for a particular product in a specific region, or supplier bankruptcy.

What is utmost at this moment of crisis is risk management, performance management, and timely proactive measures to ensure overall business continuity.


Previously published here.


Eilidh McMenemie discusses the gender gap in tech and the potential of AI to bridge it. AI offers personalised learning, mentorship, and hands-on opportunities, empowering...
Jina Melnyk, Managing Director at Corndel, highlights the rising importance of AI and machine learning skills in today's workplaces. With roles like AI engineers and...
Join Ellen Wyllie from Ipsotek on a journey through the misconceptions surrounding AI, the impact of AI in education, and the imperative need for legislation...
Explore the journey of Mitra Goswami, Senior Director of Data Science & Machine Learning at PagerDuty, in building inclusive AI products. With a background in...