At Kickstart AI, we're passionate about using AI to solve real-world problems. Our recent collaboration with Ampère, a logistics and delivery startup founded by bol, presented an opportunity to do just that.
In this post, I'll walk you through our journey of creating parcel volume predictions, a challenge that sits at the heart of Ampère’s logistics planning.
We'll explore how a relatively straightforward data science approach, when neatly integrated and automated, can solve a real-world problem.
Ampère is a logistics provider for purchases made on bol. bol is a marketplace, and other companies sell on the platform. One of Ampère's services is to pick up parcels from partner shops that sell on bol and deliver them to customers, or forward them to other carriers.
Imagine you're planning the routes for picking up the parcels, but you don't know the size of the packages you're picking up. That's exactly the challenge Ampère faces every day.
Why? Because Ampère doesn't know what's inside these parcels. They just know they need to pick up a number of parcels at a specific place - and it could be anything from a single book to a mattress. This is because, technically, Ampère doesn't need to know what's inside a parcel to pick it up. But, once they plan a route, they do need to know whether or not it will fit in their van. The volume per partner can be high, so having a solid estimate is crucial for effective planning.
Currently, Ampère follows a manual process to set estimates for parcel volumes. They set a rough number for planning, based on their knowledge and experience, "30 litres is about right for this partner."
This approach leads to two main problems:
1. Operational inefficiencies: These estimates are set manually and not updated often. This causes problems at both extremes. Sometimes, vans are too full due to underprediction. Other times, they are half-empty due to overprediction. Underprediction causes the need for driving back and forth, which is expensive. Overprediction leads to low utilisation of van capacity, which is costly as well.
2. Time-consuming manual updates: It takes a lot of time to fill in all these values. Ampère serves around 1400 partners and is expanding, so they have to make an educated guess for all those partners. And it's not like these shops just sell one item. Also, what they sell often changes over time. So in order to do it right, they need to be updated frequently.
As Ampère scales, these issues become more pronounced.
Figure 1: The manually set values are conservative and even when applying a margin of 50%, on top of the scanned volumes to account for stacking inefficiency (see True volume (estimated) in the figure above), we see that the manually set values are significantly higher on average
The Kickstart AI way of working is as follows: we align on the use case with a partner, then we organise a "challenge". This is basically a structured hackathon that runs for 2-3 weeks. During this time, our engineers and those of our partner companies, work together on a technical solution for the use case. Then, Kickstart AI and the partner company’s engineers finalise the solution and move it into production.
The Ampère challenge was clear: how can we better estimate partner parcel volumes? We needed an automated system for all partners that would adjust over time.
We divided the challenge into three “work packages”. This would ensure a complete end-to-end solution by the end of the challenge.
The work packages:
1. Evaluation procedure: If we could make a better prediction, how would this translate to a better route? The team implemented a procedure to link any new prediction model to the route planning business process. This allowed measuring beyond machine learning metrics like RMSE. It measured what was relevant to the business. It also allowed getting a clear view of the additional benefits of increasing model complexity.
2. Volume prediction with dimension scanner data: Once Ampère has picked up the parcels, they do scan the dimensions of each parcel. So they measure them at some point, but in their current workflow it’s too late. So we worked to use this data to predict parcel volumes based on historical metrics. The team tried multiple approaches, ranging from using rolling averages, to machine learning models that utilised various features such as time of week and partner information.
3. Volume prediction with bol data: This work package imagined a perfect world where there was an automated data sharing between bol and Ampère. We asked, if bol gave us the actual sales data, could we come up with something better? The team worked on linking the two data landscapes, and derived parcel estimates based on product dimensions. Note: even if you know the product dimensions, it’s not trivial to define the package dimensions, as the product is usually inside a product package, which is again packed into the actual shipment box.
Figure 2: Predicting parcel volumes even if you know product dimensions is challenging. Products are packed in packaging, then shipped in a box. The outer layers are generally unknown so need to be approximated
At the end of the challenge, we found that as Ampères operations increased, the volume would restrict planning more and more. We estimated that with a better estimation, we’d get a 6-8% gain in efficiency. We also saw that a relatively simple data model would yield the most benefits.
Based on the challenge insights, we further productionized a method we call Quantile-Assured Volume Estimation (QAVE). Here's how it works:
1. Historical data analysis: For each partner, we look at the last 30 days and ask, "What was the daily average volume of the scanned parcels?"
2. Distribution modelling: We subsequently model those daily average volumes with a log-normal distribution. We chose the log-normal distribution because of its non-negative values, right-skewed distribution, and because we observed the best fit from testing.
3. Predictive quantiles: We take the 95th percentile of this distribution. This gives us some theoretical guarantees (under some assumptions) - we know that only on 5% of the days we will actually observe a higher value than this.
4. Stacking inefficiency factor: We introduce a fixed factor of 1.5 to account for inefficiencies in stacking. In effect, this means we predict that each parcel will take up 50% more than its own volume.
The whole data pipeline is on Google Cloud Platform (GCP). We use SciPy to fit the distributions on a partner level. The parameters are stored, and a FastAPI endpoint serves any quantile from that distribution for any partner upon request. The FastAPI endpoint is called from the prediction service, which is a kind of algorithm gateway inside the Ampère infrastructure. From there it’s integrated into the planning software.
Dashboards in Grafana and Looker Studio analyse efficiency and business impact. They check latency, coverage, and more.
Here's a chart that shows our modelled value including margin (green line) vs. the actual scanned volumes (blue line) and the current, manual set value (red) for one partner:
Figure 3: An example of the average parcel volume for a partner. In blue, the observed, scanned net volume of the parcels. In yellow, the predicted p95 from the lognormal distribution. In green, that prediction was multiplied by 1.5 to account for stacking inefficiencies. The manual value (in red) is now much higher than the observed net volumes for this partner.
Our approach yielded promising results:
Using the 1.5 stacking inefficiency factor, we were already able to reduce the planned volume by roughly 10%. That's a significant reduction in the volume to plan with. But, the 1.5 factor for stacking inefficiencies is quite large. So, we aim to reduce it to better reflect reality and lower slack in the process.
However, we're taking a cautious approach to implementation and plan to gradually reduce this factor over time to get more efficient in the planning. This balanced approach helps us build trust with planners while still improving efficiency.
Our approach to implementation with Ampère has been highly collaborative:
We worked once per week in the office with them. And then worked remotely from the Kickstart AI office two days a week. We worked closely with their tech lead, who owned their infrastructure and a newly setup team that will maintain and further develop QAVE. Since we were in the office, it was easy to align with the people responsible for different parts of the process. This close collaboration allowed us to integrate seamlessly with Ampère's team and systems.
That's one of the cool things about Kickstart AI: It's not a classic consulting customer relationship, but more of a partner relationship. We're one team.
The team has currently launched the solution in one of the depots of Ampère and will roll it out to the other depots soon. We are already seeing a 10% drop in planned total volume.
It's exciting to see how a relatively straightforward data science approach, when neatly integrated and automated, can solve a significant part of a complex real-world problem.
We're always very enthusiastic to try all these new methods. Then you go to the company and see that they're currently doing it by hand. How can we quickly solve the issue of those numbers not being updated? This project showed, with basic data science, that if you integrate and automate it reliably, it can solve a big part of the problem.
While our current solution focuses on historical data and dimension scans, we're already exploring ways to enhance our predictions, for example:
1. Integration with bol product data: If we include info about the products being sold, we could predict volumes even more accurately before parcels are picked up.
2. Machine learning for stacking efficiency: Instead of using a fixed factor for stacking inefficiency, we could develop an ML model that learns optimal packing strategies over time.
These future developments could push our efficiency gains even further, potentially doubling our current impact.
This project shows what we strive for at Kickstart AI: using AI to solve real-world problems and create impact. By automating and optimising Ampère's parcel volume predictions, we are improving efficiency. We are also making logistics more sustainable by helping reduce unnecessary trips and optimise vehicle use.
As we continue to refine and expand this solution, we're looking forward to seeing the real-world impact on Ampère's operations. The shift from manual estimating to data driven values has been exciting. Stay tuned for updates as we roll out this solution and gather more data on its performance.