APPLE: An AI-based pricing system at LOGIVAN

Published by: LOGIVAN Published on: 05/12/2019


Lots of things come with fixed prices. For example, Burger King’s large French fries cost $2.39 everywhere in America. Or EyesPhone. For details, you can see the table below.


Seems legit. Or not.

Evaluation, simply pricing, is difficult. It involves a lot of skills, actions, and experience to get the right price. Therefore, people are always curious about the price, i.e. the upcoming phone, food at restaurants, or even people themselves.

Who doesn’t love eyesPhone?

Who doesn’t love eyesPhone?

Pricing in logistics

At LOGIVAN, we get dozens of thousands of booking requests per month. The first thing to do is to give each of them a price. We tried the simplest taxi-based formula as following

Final price = goods_weight * price_per_km * distance

It didn’t work. There are more than 9999 factors that may affect the price. For example, truck type, time, cargo types, fuel price, toll fee, etc. Therefore, getting a reasonable price is the most difficult task in logistics, and is the top reason for failing the deal.

APPLE: Auto Pricing Project for LOGIVAN: code E

One of the top priorities at LOGIVAN is to build an automated pricing system.

First, to make sure that we are not going to find a needle in a haystack, we built a POC model (which then became APPLE v1) to be sure that the price in logistics is model-able. The result seems promising: MAPE (mean absolute percentage error) is less than 11%. MAE (mean absolute error) is less than 300 (the mean value of all orders is 4000). We are confident that building an automated pricing system for truck delivery services is indeed possible.

We would also like to share some interesting facts:

· The price is calculated from several dozens of original features and then transformed into 200+ features to feed into the model.

· When we compared our model with AutoML, the rising star of Google, the result indicated that APPLE outperformed it clearly.

Features used to build the pricing model.

Features used to build the pricing model.

The APPLE v2

We deployed the model on product for two weeks and monitored its performance. Not bad, we can say. But there were several aspects we needed to consider:

  • Flexibility. How the model can quickly adapt to changes in the market, business, etc.
  • Feedback mechanism. Most of AI systems retrain the model by a fixed-period. But if we found a wrong case (wrong price), how can we quickly fix it?. How can operators feedback to APPLE more actively?

To satisfy the aforementioned requirements, APPLE-v2 has incorporated the following changes:

  • Flexibility. APPLE can quickly adapt to the change in fuel, market status, or LOGIVAN business by using a multi-stage architecture.

Design of APPLE to make it quickly adapt to market and business changes

Design of APPLE to make it quickly adapt to market and business changes

  • The model is based on an incremental learning algorithm, so we don’t have to re-train it. We designed a feedback-oriented and continuous training process for APPLE to utilize this feature: directly feedback mechanism and training data pool.
  • We also re-coded APPLE using pyTorch, leading to a huge improvement in speed.
  • We invented a custom loss function, which performed extremely well with the pricing problem. We are ready for patenting this function.

Continuous learning mechanism for APPLE

Continuous learning mechanism for APPLE

Early results from APPLE v2 are very promising. APPLE v2 clearly outperformed the previous one in many aspects:

 Accuracy: the MAPE was reduced to 8%, the mean error of negative cases is less than 1%. This can guarantee the profit for drivers.

– Productivity: User now can directly feedback to the model. APPLE can keep live-training without re-deploying the component models.

– Performance: APPLE can handle thousands of requests per minute. The APPLE is hosted on an AWS t2.large machine together with other LOGIVAN AI services.

Future work: an AI bot that works as a negotiator

In the near future, we will also take into consideration drivers’ and customers’ profiles. More specifically, we would expect that the model can understand truck owners’ driving habits, years of experience, permanent address, and other personal details to propose an appropriate price. Similarly, customers’ information such as shipping habits will also be used as training data. By knowing more about the shipment itself, as well as understanding the preferences of the truck’s owner and the customer, our model will offer a price that would make everybody happy. The data science team at LOGIVAN is currently focusing on this part of the project and would expect to integrate it into our product by 2020.


Shipment valuation is indeed a very interesting problem that requires resources and intense research. LOGIVAN is proud to be one of the pioneers in Vietnam to apply statistical analysis and artificial intelligence to provide the best available solution in the market. Being fast, accurate, flexible, and scalable, APPLE is a very promising start in tackling one of the toughest problems in the logistics industry.

This blog was written by Hiep NX, a data scientist at LGV, and edited by me, Vu Anh, the lead of LGV data science team. I hope you guys will be in love with our AI-based services, i.e., REEL, APPLE. See you guys in next posts.

LOGIVAN Newsletter

You will be updated latest news from LOGIVAN through your email