Can machine learning transform the shipping industry?

· Thomas Wood
Can machine learning transform the shipping industry?

Elevate Your Team with NLP Specialists

Unleash the potential of your NLP projects with the right talent. Post your job with us and attract candidates who are as passionate about natural language processing.

Hire NLP Experts

We built a machine learning model to predict which shipping vessels are likely to be held in detention. The model made it into the shortlist of the Singapore Ocean of Opportunities AI Track, an internationally renowned event where competing companies aim to build AI solutions for the shipping industry. So what can machine learning deliver for 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. This is an example of how AI can transform shipping.

The problem of ship detentions in the industry

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.

Fast Data Science - London

Need a business solution?

NLP, ML and data science leader since 2016 - get in touch for an NLP consulting session.
A goldmine for machine learning in the shipping industry: 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.

A goldmine for machine learning in the shipping industry: 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 for the shipping industry

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

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 shipping industry 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 deployed the model at a temporary URL, where it was possible to 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 of machine learning for the shipping industry

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.

Elevate Your Team with NLP Specialists

Unleash the potential of your NLP projects with the right talent. Post your job with us and attract candidates who are as passionate about natural language processing.

Hire NLP Experts

Fast Data Science presenting Harmony at AICamp
Data science

Fast Data Science presenting Harmony at AICamp

Upcoming Tech Talk: at the AICamp AI Meetup (London): AI, Generative AI, LLMs Are you interested in how AI is transforming the field of social sciences?

NLP in Healthcare: Revolutionizing Patient Care & Operations
Data scienceNatural language processing

NLP in Healthcare: Revolutionizing Patient Care & Operations

How NLP Enhances Healthcare Delivery and Operations (+ 8 NLP Strategies and 8 Applications) Natural Language Processing (NLP) in healthcare is just what the industry needs.

Retrieval-augmented generation (RAG) and natural language processing
Data scienceNatural language processing

Retrieval-augmented generation (RAG) and natural language processing

Natural language processing (NLP) is revolutionising how businesses interact with information. But large language models, or LLMs (also known as generative models or GenAI) can sometimes struggle with factual accuracy and keeping up with real-time information.

What we can do for you

Transform Unstructured Data into Actionable Insights

Contact us