Using machine learning to predict vessel time of arrival with Amazon SageMaker

According to the International Chamber of Shipping, 90% of world commerce happens at sea. Vessels are transporting every possible kind of commodity, including raw materials and semi-finished and finished goods, making ocean transportation a key component of the global supply chain. Manufacturers, retailers, and the end consumer are reliant on hundreds of thousands of ships carrying freight across the globe, delivering their precious cargo at the port of discharge after navigating for days or weeks.

As soon as a vessel arrives at its port of call, off-loading operations begin. Bulk cargo, containers, and vehicles are discharged, depending on the kind of vessel. Complex landside operations are triggered by cargo off-loading, involving multiple actors. Terminal operators, trucking companies, railways, customs, and logistic service providers work together to make sure that goods are delivered according to a specific SLA to the consignee in the most efficient way.

Business problem

Shipping companies publicly advertise their vessels’ estimated time of arrival (ETA) in port, and downstream supply chain activities are planned accordingly. However, delays often occur, and the ETA might differ from the vessel’s actual time of arrival (ATA), for instance due to technical or weather-related issues. This impacts the entire supply chain, in many instances reducing productivity and increasing waste and inefficiencies.

Predicting the exact time a vessel arrives in a port and starts off-loading operations poses remarkable challenges. Today, a majority of companies rely on experience and improvisation to respectively guess ATA and cope with its fluctuations. Very few providers are leveraging machine learning (ML) techniques to scientifically predict ETA and help companies create better planning for their supply chain. In this post, we’ll show how to use Amazon SageMaker, a fully managed service that provides every developer and data scientist with the ability to build, train, and deploy ML models quickly, to predict the arrival time of vessels.

Study

Vessel ETA prediction is a very complex problem. It involves a huge number of variables and a lot of uncertainty. So when you decide to apply a technique like ML on a problem like that, it’s crucial to have a baseline (such as an expert user or a rule-based engine) to compare the performance and understand if your model is good enough.

This work is a study of the challenge of accurately predicting the vessel ETA. It’s not a complete solution, but it can be seen as a reference for you to implement your own sound and complete model, based on your data and expertise. The solution includes the following high-level steps:

  1. Reduce the problem to a single vessel voyage (when the vessel departs from one given port and gets to another).
  2. Explore a temporal dataset.
  3. Identify the spatiotemporal aspects in the checkpoints sent by each vessel.
  4. From a given checkpoint, predict the ETA in days for the vessel to reach the destination port (inside a given vessel voyage).

The following image shows multiple vessel voyages of the same vessel in different colors. A shipping is composed of multiple voyages.

Methodology

Vesseltracker, an AWS customer focused on maritime transportation intelligence, shared with us a sample of the historical data they collect from vessels (checkpoints) and ports (port calls) every day. The checkpoints contain the main characteristics of each vessel, plus their current geoposition, speed, direction, draught, and more. The port calls are the dates and times of each vessel’s arrival or departure.

Because we had to train a ML model to predict continuous values, we decided to experiment with some regression algorithms like XGBoost, Random Forest, and MLP. At the end of the experiments (including hyperparameter optimization), we opted for the Random Forest Regressor, given it gave us a better performance.

To train a regressor, we had to transform the data and prepare one feature to be the label, in this case, the number of days (float) that the vessel takes to get to the destination port.

For feature engineering, it’s important to highlight the following steps:

  1. Identify each vessel voyage in the temporal dataset. Join with the port calls to mark the departure and the arrival checkpoints.
  2. Compute backward from the destination port to the departure port the accumulated time per checkpoint.
  3. Apply any geo-hashing mechanism to encode the GPS (latitude, longitude) and transform it into a useful feature.
  4. Compute the great-circle distance between each sequential pair of geopositions from checkpoints.
  5. Because the vessel changes the speed over time, we need to compute a new feature (called efficiency) that helps the model ponder the vessel displacement (speed and performance) before computing the remaining time.
  6. Use the historical data of all voyages and the great-circle distance between each checkpoint to create an in-memory graph that shows us all the paths and distances between each segment (checkpoints).

With this graph, you can compute the distance between the current position of the vessel and the destination port. This process resulted in a new feature called accum_dist, or accumulated distance. As the feature importance analysis shows, because this feature has a high linear correlation with the target, it has a higher importance to the model.

Amazon SageMaker

We chose Amazon SageMaker to manage the entire pipeline of our study. SageMaker is a fully managed service that provides every developer and data scientist with the ability to build, train, and deploy ML models quickly. SageMaker removes the heavy lifting from each step of the ML process to make it easier to develop high-quality models.

Traditional ML development is a complex, expensive, and iterative process made even harder because there are no integrated tools for the entire ML workflow. You need to stitch together tools and workflows, which is time consuming and error prone. SageMaker solves this challenge by providing all the components used for ML in a single toolset so models get to production faster with much less effort and at lower cost.

Dataset

The following tables show samples of the data we used to create the dataset. The port calls (shown in the first table) are expressed by a few attributes from the vessel, the port identification, and timestamps of the arrival and departure events of a given vessel.imoarrival_datedeparture_dateport002019-01-072019-01-08GUAM102019-01-112019-01-12NAHA202019-01-122019-01-17NAHA

Then we have the vessel checkpoints. A checkpoint is a message sent by each vessel at a frequency X (in this case, approximately 1 day) that contains information about the vessel itself and its current status. By joining both tables, we enrich the checkpoints with information about the vessel departure and arrival, which is crucial to enclose all the other checkpoints sent between these two events. The following table is an example of vessel checkpoint data. You can click on the table for an enlarged view.

In the next table, both tables are joined and cleaned, with the geolocation encoded and the accumulated time and distance calculated. This view is for one particular vessel, which shows all the checkpoints that belong to one given vessel voyage. You can click on the table for an enlarged view.

Finally, we have the dataset used to train our model. The first column is the label or the target value our model tries to create a regression. The rest of the columns are the features the decision tree uses during training. You can click on the table for an enlarged view.

Model and results

After preparing the data, it’s time to train our model. We used a technique called k-fold cross validation to create six different combinations of training and validation data (approximately 80% and 20%) to explore the variation of the data as much as possible. With the native support for Scikit-learn on SageMaker, we only had to create a Python script with the training code and share it to a SageMaker Estimator, prepared with the SageMaker Python library. See the following code:model = RandomForestRegressor( n_estimators=est, verbose=0, n_jobs=4, criterion='mse', max_leaf_nodes=1500, max_depth=depth, random_state=0 )

After training our model, we used a metric called R2 to evaluate the model performance. R2 measures the proportion of the variance in the dependent variable that is predictable from the independent variables. A poor model has a low R2 and a useful model has an R2 as close as possible to 1.0 (or 100%).

In this case, we expected a model that predicted values with a high level of correlation with the testing data. With this combination of data preparation, algorithm selection, and hyperparameters optimization and cross validation, our model achieved an R2 score of 0.9473.

This result isn’t bad, but it doesn’t mean that we can’t improve the solution. We can minimize the accumulated error by the model by adding important features to the dataset. These features can help the model better understand all the low-level nuances and conditions from each checkpoint that can cause a delay. Some examples include weather conditions from the geolocation of the vessel, port conditions, accidents, extraordinary events, seasonality, and holidays in the port countries.

Then we have the feature importance (shown in the following graph). It’s a measurement of how strong or important a given feature from the dataset is for the prediction itself. Each feature has a different importance, and we want to keep only those features that are impactful for the model in the dataset.

The graph shows that accumulated distance is the most important feature (which is expected, given the high correlation with the target), followed by efficiency (an artificial feature we created to ponder the impact of the vessel displacement over time). In third place, we have destination port, closer to the encoded geoposition.

You can download the notebooks created for this experiment, to see all the details of the implementation. Click on the links bellow to get them:

You will need Amazon SageMaker to run these notebooks so create a SageMaker Studio Domain in your AWS Account, upload the notebooks to your new environment and run your own experiments!

Summary

The use of ML in predicting vessel time of arrival can substantially increase the accuracy of land-side operations planning and implementation, in comparison to traditional, manual estimation methodologies that are used widely across the industry. We’re working with and shipping companies to improve the accuracy of our model, as well as on add other relevant features. If your company is interested in learning more about our model and how it can be consumed, please reach out to our Head of World Wide Technology for Transportation and Logistics, Michele Sancricca, at msancric@amazon.com.


About the Authors


Samir Araújo is an AI/ML Solutions Architect at AWS. He helps customers creating AI/ML solutions for solving their business challenges, using the AWS platform. He has been working on several AI/ML projects related to Computer Vision, Natural Language Processing, Forecasting, ML at the edge, etc. He likes playing with hardware and automation projects in his free time and he has a particular interest for robotics.


Michele Sancricca is the AWS Worldwide Head of Technology for Transportation and Logistics. Previously, he worked as Head of Supply Chain Products for Amazon Global Mile and led the Digital Transformation Division of Mediterranean Shipping Company. A retired Lieutenant Commander, Michele spent 12 years in the Italian Navy as Telecommunication Officer and Commanding Officer.

Science Explains What Happens To Your Soul After Death

Science Explains What Happens To Your Soul After Death

“I believe that consciousness, or its immediate precursor proto-consciousness, has been in the universe all along, perhaps from the big bang.” ~ Dr. Stuart Hameroff, MD

There are few things that fit the bill of fascinating, thought-provoking, and frightening. Death is one such thing.

Since the dawn of mankind, human beings have pondered the question “What happens after we die?” When you stop and think it, you quickly realize there are only two possible answers: something or nothing.

Of course, religion adds some nuance to the abovementioned question, but that’s pretty much it. Either something happens, or nothing happens. Either we are matter to be disposed of and recycled – or we aren’t.

Which one is it?

Well, if you were to ask Dr. Stuart Hameroff, something happens – and it involves consciousness.

SCIENTISTS REVEAL WHAT HAPPENS TO YOUR SOUL AFTER DEATH

What is consciousness?

The word ‘consciousness’ is defined by the Oxford English Dictionary as:

– the state of being awake and aware of one’s surroundings.

– the awareness of perception of something by a person.

– the fact of awareness by the mind of itself and the world.

Predictably, consciousness – like death – is heavily debated. Some believe that consciousness is the direct result of brain activity. Others think that outside forces, e.g., the ‘Universe,’ ‘God’ – and internal elements, e.g., the ‘Spirit,’ ‘Lifeforce,’ ‘Mind,’ etc., contributes to our state of being.

spirituality

THE ORCH-OR THEORY

Dr. Hameroff oversees the Center of Consciousness Studies at the University of Arizona and has spent the last 50-plus years exploring consciousness as it relates to the field of quantum mechanics.

Quantum mechanics is “a fundamental theory in physics which describes nature at the smallest scales of energy levels of atoms and subatomic particles.”

To explain just how essential quantum mechanics is to the perception of reality – and to Hameroff’s theory– let’s quickly talk about where it all began: The “Double-Slit Experiment.”

(We’ll get back to Orch-OR in a bit!)

THE DOUBLE-SLIT EXPERIMENT

Every quantum physicist is baffled by the double-slit experiment. And they have good reason to be –it defies natural law.

Here’s all you need to know about the experiment:

– Light particles called photons pass through two slits (hence the name).

– Photons, as researchers predict, form an ordered pattern on a wall. (To help you visualize this, imagine two vertical lines filled with little ‘pellet protons’ shooting onto a screen.)

–  When an observational device (a detector) is set up to detect which protons go through which slit, no pattern emerges (no more vertically-aligned pellet protons).

– In other words, human observation (via a technical apparatus) alters the pattern.

– The predicted energy pattern, as should be decided by natural law, instead produces no pattern whatsoever.

Anil Ananthaswamy of New Scientist – in a piece called “Classic quantum experiment could conceal theory of everything” explains the experiment and potential ramifications:

Our classical view of the world suggests that photons of light should pass through one slit or the other, and thus create two parallel bands on the screen behind. But instead, the light spreads out onto alternating bands of light and dark … (the) iconic physics experiment may be hiding more than we ever realized about the nature of reality.”

“QUANTUM CONSCIOUSNESS”

What do the human mind and the Universe have in common?

The answer: two things.

(1) We know relatively little about them.

(2) Quantum vibrations are found in both.

Read that again. It’s important.

While the phrase “correlation does not imply causation” is played on a loop within the scientific community (for a good reason, BTW), there is no denying the relationship between the human mind and universe.

But what is that relationship, exactly?

Back to ‘Orch-OR’

In 1996, Dr. Hameroff and Roger Penrose, mathematician and physicist, proposed the orchestrated objective reduction theory of consciousness, or the ‘Orch-OR’ theory.

According the Orch-OR theory, consciousness derives itself from tiny protein structures within the brain called microtubules.

On a physiological level, microtubules are described as the cell’s “conveyor belts,” transporting cellular resources and materials. Microtubules are also involved in cell division and the structuring of cells.

Microtubules also contain quantum energy.

“The origin of consciousness reflects our place in the universe, the nature of our existence. Did consciousness evolve from complex computations among brain neurons, as most scientists assert? Or has consciousness, in some sense, been here all along, as spiritual approaches maintain?”

Hameroff and Penrose answer their own rhetorical question:

“… our theory accommodates both these views, suggesting consciousness derives from quantum vibrations in microtubules, protein polymers inside brain neurons, which both govern neuronal and synaptic function, and connect brain processes to self-organizing processes in the fine scale, ‘proto-conscious’ quantum structure of reality.”

Bear in mind that the duo published their findings over twenty years ago. Since then, numerous technological advances (e.g., brain imaging and observational apparatuses) have taken place which appears to support Hameroff and Penrose’s theory.

Arch-OR and Death

The law of conservation of energy, resoundingly accepted by scientists, states that “energy can neither be created nor destroyed.”

Energy, however, can change forms.

The energy within us must change forms. It’s the ‘law.’

In closing:

Quantum energy is the fundamental building block of the universe.

Quantum energy is found within us.

Are we creations of the Universe?

Do we simply ‘go home’ after shedding our bodily form, as Hamerof and Penrose seem to suggest?

What are Subliminal Messages?

What Are Subliminal Messages?

A subliminal message is any piece of information which we receive without us consciously perceiving it. This information can come in any format; from video, to images, and of course, subliminal audio. You can make an audio message subliminal in a few different ways, but the most use a technique to simply to record a set of verbal suggestions and move them to a higher sound frequency.

This means that the verbal commands will be just out of range of your regular, CONSCIOUS hearing limit. How does it work?

The key to subliminal messaging is that you do not consciously hear the statement, but your subconscious mind is capable of picking it up, and storing it in your mind as normal. The your mind is like an iceberg – your conscious mind is the 10% on the surface, but the more powerful, larger area of the mind is the subconscious part, and it is capable of picking up information you are not always consciously aware of.

It takes in this subliminal information and stores it within your mind, and with enough exposure you can make changes to your belief systems, ways of thinking, habits, and much more.

Why use subliminals? You might be thinking “what’s the point in subliminals?” or “why bother making the messages inaudible?”. Well, this is because a regular statement and a subliminal suggestion have different effects on your mind. If, for example, you repeat affirmations to yourself or use an album with audible suggestions then you may be so set in your ways that your conscious mind will reject the suggestions. For example, if you have self esteem issues and someone tells you “you are confident” this will probably get instantly dismissed as your conscious mind “knows” the statement to be false. Much like everyday where I tell youI believe in you but if you don’t believe in you, then what I say doesn’t impact you.

With subconscious programming the barrier of your conscious mind is bypassed and it is therefore possible to make changes which you would not be able to if the information was sent via regular conscious development / learning methods. Let’s also talk about some myths or misconceptions about subliminal messages as well.

1. It is instant: 

One of main ways subliminal messaging is portrayed is as an instant fix. This, sadly, is not the case. While there will be a few lucky people who experience a benefit very soon after listening, they are in the minority. Subliminal messaging works better in the longer term, when the messages really start to build in your mind. Generally early experiences may range from you feeling more energized and focused to experiencing a clarity of mind and a burst of motivation. However, in the longer term you should experience a larger shift in your perception and beliefs and a solid, lasting change in your behaviour.

Of course it also depends on the type of album you are using. If it is a personal development type of album addressing a deep personal issue then it will likely be a gradual change.

Albums with more instant results are ones such as albums in our relaxation range, or ones like positive attitude – these albums are meant to focus you straight away and give you a boost there and then – i.e. help you to relax, or help you to think more positive.

2. You lose control:

Some people are worried that they will lose control, or could even be made to do things against their will. Nothing could be further from the truth.

Unlike traditional hypnosis for example you will stay conscious and in full control throughout the experience, you can never be made to do something you don’t want to do. You actually keep full control at all times – i.e. if you do not fully want the change and are not focusing on it happening then it won’t.

You should not try to use the albums on other people, but this is mainly a legal requirement as using subliminal messages on other people is deemed to be manipulative – but the truth is that if you do not want the change, or you don’t want to do something then you can’t be made to do it. It will only ever help, or give you a boost towards goals you do want to achieve.

3. You enter a trance:

Unlike hypnosis you will NOT enter a trance at all. You will be fully conscious while listening. This means you can listen on the move, while studying, exercising etc – you can fit the album into your day as you prefer. 

I recommend not listening to relaxation albums while driving however; as even though you will not enter a trance there are suggestions to help you relax and calm your mind.

4. They are illegal:

This is an exaggeration. The only instance they are not allowed is within advertising or to manipulate others without their knowledge. For personal use subliminal messages are completely legal. The key is that you have to be aware that subliminal messages are being used and consent to them – but if you are using them on yourself, to overcome problems and help you achieve goals then there is no problem at all.

5. They are dangerous:

Although it is true that they are banned from within advertising due to the potential to manipulate people against their will, the label of them being “dangerous” is irrelevant when positive messages are used for personal use.

You will never be in any danger from reputable subliminal albums, they will only ever produce a positive result.

6. The can contain negative messages:

In relation to the point above, reputable albums only contain positive statements. Most have strict quality control over the messages used. Most of them will also give you the message they use on each album page to make sure they are a good fit for you.

Some people are still skeptical, wondering “perhaps they contain messages like ‘buy more subliminals’ or just ‘I love subliminals’?”. I have never heard of any company doing this to be honest. Even if they were to be used we don’t think it would produce the desired effect.

If an immoral company did include these types of messages yet the album still did not achieve its primary purpose then it is unlikely that you would buy more subliminals – you still have control and the ability to think logically that the album didn’t work for you.

7. They require no further effort:

This is a double edged sword, it is one of the things which attracts people to subliminal messaging, but at the same time it is an exaggeration, and not strictly true.

The bottom line is that if you ONLY use a subliminal album, i.e. without taking any conscious action or working towards your goal – then you will not get a very positive result. Subliminal albums are simply meant as an aid – a tool to help you reach your goal, but not do it all for you.

Subliminal messages work in several ways, but primarily they align your mind to your goals – to make you focused, committed, and more motivated, to make sure you stay on track and go all out to achieve success. If you do not put in this primary level of effort to work towards a change to start with then the subliminal messages will only have a limited effect.

I hope you have found these truths interesting; there are actually a lot of benefits of using subliminal messages if they are used correctly… The REAL BENEFITS of Subliminal Messaging.

So, now you know the truth about subliminal messaging – I hear you asking “so if it can’t make me do something, if I have to want the change and put in effort too anyway, what is the point?” If you want something entirely effortless then perhaps this is not the right method for you -as with any form of development you must put in some effort to make it work. If you use subliminal messages with an open mind, and use them to support your goals rather than expecting them to achieve them for you then you will receive some fantastic benefits and advantages.

Ultimately sending subliminal suggestions into your subconscious mind will rewrite your self beliefs, ways of thinking, and even patterns of behaviour. In this way you can make changes in your life and even overcome deeper issues you have held for years. This is because the messages bypass your conscious mind, and therefore avoid any “logical” resistance, limiting beliefs, or negative thoughts which would otherwise hold you back.

You can change in ways which would not be possible with conscious methods of personal development alone. More specifically, subliminal messaging can:

Increase Your Focus – it will help you give you an enhanced level of concentration and clarity of thought, giving you that extra attention to detail in everything you do.

Boost your willpower and give you strength of mind to push on.

It will help to strengthen your persistence and determination. You will bounce back and grow even more hungry for success and determined to succeed upon encountering setbacks.

 o Fire up your motivation, and give you a burning desire to succeed.

It can help you really go that one step further and go all out for success. You can keep a higher level of motivation and stay committed after the initial excitement of a new project and continue on, no matter what.

Help you to change long held negative self beliefs.

As the affirmations build in your mind, they will slowly enter your reality and change the way you think about things, and the way you think about yourself, and boost your self belief.

Change long held limiting behaviour patterns.

Perhaps the ultimate benefit in the long term is that with consistent use the messages will spill over into your conscious reality and really help you to change actual patterns of behaviour and bad habits. All of these factors add up to give you the best chance of success when pursuing your goal – just that extra boost to align your mind and focus you on achieving your goal can be the difference between success and failure.

 5 Tips for Success With Subliminal Messages Here are some more specific tips to success with subliminal messages:

1. Set a clear goal.

Make it clear in your mind exactly what you want to achieve – what success would mean and how you want the album to change you. Being clear in your mind from the outset will set the path, and help you to define and measure your success. A clear goal is a solid foundation to start from – even write it down if you have to.

2. Expect Success.

This can be difficult, especially if you are new to subliminal messaging. At the very least you should “suspend your disbelief” and keep an open mind about the possibilities. If, however, you can really focus your mind and “expect success” – expect it to work, to give you the exact result you want, then you will get great results.

3. Develop Consistency.

Listen in the same ways, and listen every day. A consistent approach will lead you to success – it will make sure your mind receives the messages regularly and that they build up over time.

4. Visualize.

View yourself in the future as the new you – having achieved the result you want. A little visualization will go a long way when combined with your subliminal audio. It will help align your mind to the result you want, and even trick yourself a little into imagining it is already true.

Your visualization should go beyond just a still image – make a movie, see yourself behaving in the future in different scenarios, notice how people react to you, and importantly how you feel inside. Remember: “Whatever the mind can conceive and believe it can achieve”.

5. Create A Total Immersion.

Ultimately we recommend immersing yourself in the albums as much as you can. The people who have most success with our subliminal messages are those which are serious about wanting to change their lives and who use the albums as much as they can, and in all different areas of their lives – while relaxing, studying, exercising, taking the album with them out walking or on a bus journey, even playing the album or using the silent tracks while they sleep.

Everyone is different, so however you use the albums must be a good fit to your lifestyle, but if you can see the albums frequently, and play them as part of your regular life then you will get the best result.

I use my subliminals when I take my timeouts in a day and use many different ones from relaxation to energizing my day or helping my focus and concentration when I am trying to learn something but you can get them for anything and in my opinion, used correctly.

They really work and are a great aid in helping to achieve goals especially if you have trouble getting started, they can sometimes just be enough to set you on your way and help get past barriers that you struggle with. Take it seriously and you will get a benefit.

School Bus Initiative

The focus of our last quarter has been working with local groups to improve bus networks. We believe that it is vital to provide transportation options for children living in rural areas. Thanks to our donors we were able to fund 50 buses and 200 cars that transport children to schools all around the globe.

Create your website with WordPress.com
Get started