Can machine learning transform the shipping industry?

A machine learning model running in a web interface to predict vessel detention risk

An AI predicting the risk of detentions for vessels in the Asia Pacific region.

Click here to try the AI ship detention tool shown in the screenshot above.

The problem of ship detentions

At the start of the current coronavirus outbreak you may have read about the British flagged cruise ship Diamond Princess, which was quarantined in Yokohama after some passengers tested positive for Covid-19.

The British vessel Diamond Princess
The Diamond Princess. Source: Wikipedia

In fact vessels of all types are liable to be detained if they fail an inspection by port authorities. The UK detained two vessels in January 2020: the Latvian flagged Liv Greta, detained for inadequate lifeboat and safety compliance, and the Nigerian flagged MV Jireh, for failing to meet safety and welfare standards.

The risk of detentions is a problem for shipping companies as disrupted journeys cost money. In addition there is a human cost. Nine Russian crewmen were stranded off the coast of England in February without supplies when the MV Jireh was detained.

When a company sends a container over sea, they need to choose a vessel which is less likely to be held up at a foreign port. Ship registries currently classify ships into high, medium and low risk, based on a human-defined set of rules about how many defects were found on previous inspections.

A screenshot of ship inspection records from the Tokyo MOU, showing which vessels were classified as high, medium or low risk. These risk values are manually calculated at present.
Ship inspection records for 29 January. The column on the far right shows the current categorisation of the vessel into high, medium or low risk, determined by the Tokyo MOU. This is the categorisation currently used in the industry.

Building a machine learning model to predict risk

Since machine learning has been disruptive in a number of other industries, I have tried training a machine learning model to predict vessel detentions.

Fortunately it’s possible to download information on past inspections in the Asia Pacific region from a number of sources on the internet for free. I downloaded data on 21,000 vessels for 2017, 2018 and 2019 and used Microsoft Azure ML to train a model to learn what it is that makes a vessel prone to detention.

You can tell this AI everything you know about a ship and it will give you a probability of the ship being detained.

Can the machine learning model explain detention risk?

I found that the most important factor used by the AI was the country that the inspection takes place. The next most informative indicator is the number of deficiencies that were uncovered in previous inspections at other ports. Of particular interest are the state of the ship’s watertight condition, its fire safety adherence and life saving appliances.

The machine learning model's feature importances. The most important feature is the country of inspection.
Feature importances for AI model for predicting vessel detentions in the Asia Pacific region. The bars show which aspects of a vessel’s history tend to indicate a high likelihood of detention. In fact the country of the inspection is a big factor, also the vessel’s flag, and the history of non-detention deficiencies discovered on previous inspections.

So if you wanted to assess a ship’s likelihood of detention, you would consider first the country that it’s calling at, and look at past records of any leaks, fire safety issues and life saving equipment.

How does the machine learning model perform in numbers?

To evaluate the model I have used ROC curves and Area Under the Curve (AUC) rather than accuracy, as detentions are a very rare event and ROC/AUC allow us to measure how good we are at distinguishing relatively high and low risk vessels.

In terms of the model performance, the current vessel classification system of high/medium/low gives an AUC of 0.66, whereas my model gave an AUC of 0.80. This means the model has much more predictive power than the current system.

A ROC curve showing the performance of the machine learning model vs the performance of the current manual method of determining detention risk. The machine learning model outperforms the manual model.

ROC curve for the machine learning model vs. the current vessel classifications. If you would like to know how to interpret ROC curves please see my post on AI for healthcare.

Try out the machine learning model

I have deployed the model at https://fastdatascience.com/vessels, where you can view in real time the high risk vessels currently in the port of Singapore and you can experiment by calculating the risk of a vessel.

Further improvements

A vessel inspection also involves producing a PDF of free text describing all aspects of the vessel. Unfortunately these documents aren’t publicly available, however it would be possible to also train a model to predict a vessel’s seaworthiness from this text document using natural language processing.

Value for business

Any shipping or forwarding company would be able to integrate this kind of model into their systems in order to quantify the risk of detentions on their shipments. The cost savings for a business would be enormous.

If you have a similar problem in your industry where you think AI could help, I am interested to hear from you. Please add your ideas in the comments below or contact me with your ideas.

Fast-Data-Science-Predicting-vessel-detentions

Leave a Reply

Your email address will not be published. Required fields are marked *