18. 03. 2022

Multivariate Out-of-Stock Forecast in Large CPG Retailer

Large retailers are expecting real-time visualization, and accurate feedback from their supply chains to optimize margins and increase efficiency. A previously manual process such as ensuring proper inventory levels, delivery dates, and costs throughout each stage of the supply chain can now be an automated process.

With the integration of deep learning models using the data CPG retailers already have, we can give your data the ability to notify you when stock levels are running low with enough lead time to order more. Through the integration of a scalable cloud-based model, we can predict out-of-stocks with up to 80% accuracy, 2 days out, and request backup orders to ensure that stock levels are adequate. Current out-of-stocks contribute up to 10% of lost sales margins. This process can greatly reduce these losses leading to large and quantifiable benefits.  

This article shows a recent Proof-of-Concept that was delivered from a large Canadian retailer.


This large Canadian consumer packaged goods retailer has over 2000 stores across Canada and wanted to create a real-time visualization of its supply chain network across the country. The second stage of the project incorporated the company’s current data and inventory system in a deep learning model that would notify the business when it predicted a product going out-of-stock. This would allow adequate time to quickly request backup shipments if a product was identified as likely to be out-of-stock.

The client’s most important criteria were speed and efficiency because business managers wanted to see various parts of the supply chain at any point in time, e.g., the region or store with specific business metrics.

The client’s current inventory system did have some quirks that needed to be understood and accounted for prior to building a deep learning model. The SAP system that operated at the store level may not always be correct in volumes and historic values so how do you create backups and measure the proper quantities of items in stock?

Adastra's Solution

The client’s previous attempts to complete this project failed because the programs they were running were incapable of providing the response time required to analyze large quantities of data that were being collected. Due to the scale of the project, the additional horsepower would be necessary to have real-time visualization and analytic capabilities.

In the current program, data was stored in a flat-file format which needed to be consolidated and translated into a graphical format. A Spark run time environment was leveraged as a scalable computational back-end for the graph-based calculations, in addition to the supply chain network graph visualization.

A customized dashboard was built on the front-end to visualize the data at each stage of the supply chain. which could also be used or linked with an email to provide notifications to business managers about predicted out-of-stocks.

The predictive model inputs included supply chain fulfillment metrics, store-level and distribution center stock details, article information, and demand to determine ordering requirements. This environment went through multiple stages of optimization and tuning to ensure a 5-second response time for the business managers.


Adastra understands the importance of working with the client’s teams rather than independently so that they can see the progress and provide input throughout the project. We developed a customized solution for our customer on their own internal platform to modernize their supply chain and revolutionize the tools business managers had at their fingertips.

As a long-standing partner, Adastra was able to use our knowledge of the client’s business to develop an innovative solution… Not only from a data science perspective but from an end-to-end business perspective. Special requests were also accommodated such as producing the Spark GraphX solution ahead of schedule for the department to use as a promotional piece during an internal conference.

The client now has the ability to predict out-of-stocks by up to 80%, 2 days in advance. The order management team now has a reasonable amount of time to take action and request backup orders to ensure that stock levels are adequate.

Want to learn more about our AI Services and how we can help you modernize your organization? Book a free consultation today!

Book a Free Consultation

Thank you

We will contact you as soon as possible.