Predicting routes for vehicles: how we made that happen (Mobile Telematics + Big Data)

Damoov - Track Smart & Drive Safe
Damoov blog
Published in
5 min readSep 17, 2020

Nowadays, machine learning has become an integral part of any modern business solution. The sphere of transport logistics and transportation is no exception. Today, we would like to tell you how we create unique mobile telematics solutions that help build, optimize and even predict routes for trucks at Damoov.

When we discussed this task with the customer, an important issue was the choice of criteria for the success of the project. How do I know that we have completed the task? What accuracy should the resulting model have and why exactly? We have divided our task into the following steps:

  1. MVP — it is a relatively cheap test of our hypotheses, it is a model that can already bring value. We try to train the model on the available data and find a certain baseline — the minimum accuracy of the model (in our case, it was 65%). We will always try to improve this accuracy as long as it is cost-effective and makes sense.
  2. Industrial model — after we have reached the desired level of model quality (in our case, it was 80%), we pass the industrial model to the Telematics SDK. The difference between the MVP and the industrial model is that the MVP model cannot be completed. And the accuracy of any model degrades over time, and it needs to be further trained.
  3. Model support — therefore, for an industrial solution, we implement one of two support options: either we support it independently, constantly re-training the model (and increasing its accuracy), or we implement a cycle of re-training the model directly inside the software itself. Support from a live team is, of course, more expensive. But the downside of automatic retraining is that it can’t account for sudden changes in the nature of data.

Our main goal was to optimize the operation of cargo terminals. To avoid downtime or delays in terminal operations, we need to be able to predict the potential number of drivers who will arrive at a given terminal. To solve this problem, we needed to know the possible routes of drivers for each specific time period.

This is where S2 cells come into play. S2 cells are a mathematical mechanism that helps computers translate the spherical three-dimensional shape of the Earth (3D) into two-dimensional geometry (2D). You can think of them as small geographical particles. This mechanism helps to determine the distance to cargo terminals more accurately.

S2 cells on the Earth’s surface
S2 cells covering the center of San-Francisco

So let’s say we used the resources available to us and got the travel time data successfully. Unfortunately, this is not enough. Each driver has an individual set of unique routes: some like “long routes” consisting of a dozen cities, some prefer short, 3–4-hour trips. Moreover, each city has its own most popular routes.

We used a combination of graph theory and probability theory to solve these problems.

Let’s take a look at the following example.

Driver oriented probability graph

Here is an example of a driver-oriented probability graph. This driver only has 3 cities in their history, and for each of those cities, the probability of our driver arriving in this city is calculated based on historical data about the driver’s trips. As you can see from the picture, the most likely arrival city is city6, but in order to predict possible routes, we will need to create an oriented probability graph of possible routes from city6.

Oriented probability graph of routes from city6 depending on the average travel time

Oriented probability graph of routes from city6 depending on the average travel time

As you can see in the picture above, we have many options for routes from city6. We also have information about how long the driver has already been on the road. Based on this, we can create a table of estimated routes for each time interval. It should be noted that we are only interested in routes with a probability of more than 60 percent.

As a result, we were able to determine the potential routes of our driver for no less than 12 hours ahead. The driver data used for these calculations comes from our mobile telematics SDK, which can turn any smartphone into a fully functioning GPS-tracker.

Thus, the implementation of our project included the following steps:

1. Collecting data for our model. We received some of the data from the customer (coordinates of the truck tracker), and generated some of the data ourselves (marking cities using S2 cells).

2. Machine learning model that makes predictions based on available data with specified accuracy.

3. Support for the model, implemented either as a permanent modification of the model by the DS team or as a built-in periodic retraining function within the program itself. The support model is selected depending on the nature of the data and the business tasks that the model solves.

This solution will make it possible to organize the operation of cargo terminals in a much more efficient way, which will ultimately lead to higher business profitability. So we got сlear evidence that Data Science and Machine Learning are not just trendy technologies, but tools that help you quickly and accurately solve real business problems — especially when it comes to mobile telematics systems.

Useful links

  1. Company website: https://damoov.com
  2. Zenroad page: https://damoov.com/telematics-app
  3. Telematics SDK: https://damoov.com/telematics-sdk
  4. Telematics API: https://damoov.co/api-services
  5. Developer portal: https://docs.telematicssdk.com
  6. Datahub: https://userdatahub.com/
  7. Github: https://github.com/Mobile-Telematics

--

--

Damoov - Track Smart & Drive Safe
Damoov blog

Revolutionize your product with our telematics. Integrate into any mobile apps. Track, manage, enhance safety & performance. Experience the untapped potential