Optimizing internal warehouse delivery processes, especially enhancing the efficiency and speed of the order picking process, has a massively positive impact on business profitability, if done correctly. There are two components of the order picking process that need to be optimized in order to improve efficiency: order picking time and order sorting time. Order picking involves retrieving items from storage in the warehouse, and order sorting involves dividing the retrieved items into individual orders.
In this article we will describe the business case of how we managed to reduce average order picking time (OPT) in a warehouse by 23%. We did this by solving a storage location assignment problem (SLAP) for products in the warehouse, which led to a proportional increase of warehouse throughput and a corresponding projected increase in revenue.
The project consisted of two main parts: picking time prediction and picking time optimization. The project can be summarized as follows:
In our business case, orders are collected in bulk in a process called “collection”. There are typically several orders in one collection, and every order may have several products. The collections are generated from e-commerce customer orders, and in most cases, several collections are generated per day. The order collection process involves the following steps:
As you will see in the warehouse map below, product storage locations are grouped in rows, and every location has a dedicated identifier that consists of numbers and letters. Some locations have several levels (at different heights) and/or sub-cells. This means that several different products may be located at one cell/level/sub-cell. Locations with names starting with P are pallets, and a location named X is a refrigerator.
After a discussion with the warehouse domain expert, we identified a set of limitations and suggestions that should be considered during our modeling:
The key metrics for measuring quality of OPT prediction are:
$\text{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_{i} - x_{i}|$
$y_{i}$ = prediction
$x_{i}$ = true value
$n$ = total number of data points
The key metric for measuring improvement of OPT in a new setup is:
If we are able to learn how to predict OPT from the historical data, we can draw insights on how different factors influence it. These insights will help us understand how we can change these factors to reduce OPT. In order to do this, we performed several experiments involving different approaches to creating features, data splitting, different ML models and target value transformation. We will discuss the best performing model below and mention some of the insights we gathered from other ideas and approaches.
As an input for the OPT prediction model, we used the number of products required to be taken from particular locations. This feature is a vector of 156 entries, where each entry represents the number of products required to be taken from a particular location. For example if we have a vector of zeroes, and in the 3rd position we have 1, it means that we need to take 1 product from location A-3. Sub-cell and location level are not encoded, because the number of samples/number of features proportion will be too low, and models will fail to fit, returning a negative R^2 score.
This feature is the most valuable for the order picking optimization part of the project, because every location corresponds to one entry in the above-mentioned vector. Other hand-crafted features we tested include: number of products to pick up on different height levels, number of products to pick up from cells with a particular number of neighboring products in the same cell, number of products to pick up from cells of a particular class, and others.
Using a Random Forest model with this feature as an input, we managed to achieve MAE of 11.4 mins. This means that our model produces an error of 11.4 minutes on average when trying to predict OPT on unseen data, which corresponds to a MAPE of 0.34. This result is valid in our case. In the distribution of OPT graph below, we can see that most of the collections in our dataset were collected in less than 30 minutes (~2000 seconds).
With a precise OPT prediction model, one can use it to get insights on what influences OPT including aspects related to warehouse layout. Thus, for the second part of the solution we use the model trained to predict OPT to estimate the improvement achieved by solving the SLAP problem with different methods.
We use the same validation set that was used for measuring validation metrics in the first part of the project, but for a different purpose. First, we save validation predictions from our model for original setup features (original product storage locations). Then we solve the SLAP problem using one of the suggested approaches (change product storage locations) and generate validation predictions for a new setup. After that we compare the two predictions using the average OPT improvement metric explained in the Evaluation section. We tried 3 approaches to solving the SLAP problem:
SHAP is a game theoretic approach to explain the output of any ML model. The SHAP method assigns to each feature an importance value (named SHAP value) that represents the contribution of that feature to the final outcome of the model.
Suppose for example that we have a model f(x), and that we want to explain the prediction of the model on a specific sample x*. To do so, the SHAP method decomposes the prediction into the sum of the contributions of all the features, namely:
$f(x^{*}) = \phi_{0} + \sum_{j=1}^{M} \phi^{*}_{j}$
where 𝜙₀ is the average model’s prediction.
To compute each contribution 𝜙ⱼ, the SHAP method relies on a concept that comes from cooperative game theory known as Shapley value. Shapley value is defined as the average marginal contribution of a feature value over all possible coalitions. Implementation of computing SHAP values for tree-based models is available in a python package called shap.
As was just explained, SHAP values represent the contribution of individual features to the final outcome of the model. The idea behind the values is to show how individual features shift the predicted value from the average prediction. In our case, the feature is the number of products required to be taken from individual locations, so we have 156 features corresponding to locations on a map, and SHAP values related to them.
Below is an example visualization of SHAP values for our Random Forest model. They are ordered according to their effect on prediction. SHAP values were calculated using the TreeExplainer class provided by shap python library. In this example:
Every little dot represents an observation. The horizontal axis represents the SHAP value, while the color of the point shows us if that observation has a higher (red) or a lower (blue) value, when compared to other observations.
In this example, higher values for feature 98 have a negative impact on the prediction, while lower values have a positive impact. Formally, it means that if we need to take a product from A-3, the OPT is expected to be smaller.
The suggested algorithm using SHAP values looks like this:
Average OPT predicted in the original setup was 22.8 minutes. The best average OPT predicted in the new setup with SHAP-based sorting is 17.5 minutes. This gives us a 5.3 minute absolute improvement, and 23% relative improvement. This improvement would be proportional at scale for larger warehouses. The new storage locations satisfy all the constraints discussed with domain experts, and can be implemented in real life scenarios.
Below we compare the results of some of the different approaches we tried.
From the results, we deduced that product location proximity to the exit and to the order picking start point (in our case these are 2 different locations) influences the OPT. We also managed to identify more complex relationships using SHAP values to achieve even better efficiency improvements.
In order to gain more insight into where fast-moving and slow-moving products are located, we created visual representations for the proximity and SHAP-based sorting approaches below. Locations are framed in different colors based on the average popularity of the items located in them, where popularity was gauged on the frequency with which products were ordered during the observed period of time.
It is clear from the proximity sorting visualization that the most popular products are located in rows F and E because they are the closest to the exit from the warehouse. Since F-09 is the closest location to the exit, the fastest-moving products were located there.
The SHAP-based approach used information that the ML model implicitly learnt about the locations from which products are picked up the fastest. From the visualization, we see that this approach locates the fastest-moving products in locations close to the ends of the rows. One of the assumptions for this could be that it is difficult for a warehouse employee to walk between the rows, hence, picking items from the middle of the rows increases the order picking time.
In this business case we have demonstrated how OPT in a warehouse can be improved by ~¼ with the help of explainable AI to solve a storage location assignment problem. Such logistic process improvement leads to a significant decrease in operational costs and increased order fulfillment throughput. Similar techniques can also be used to improve order picking time in different warehouse setups.