12 years of hard work
can all boil down to just 47 seconds in the pool.
Heroes will be made and dreams broken.
But there can only be one winner.
Every successful business starts with a great idea.
Today, moving from concept to reality is easier than ever before.
Join us as we travel around the world
and meet developers, architects, and innovators
to learn how they're building on the AWS Cloud.
Welcome to 'This is My Architecture'.
I am here in Australia, at the Gold Coast Aquatic Center.
It's six in the morning,
and the Australian National swim team, known as The Dolphins,
are here training.
It's your turn to shine.
With their passionate and dedication to this sport,
it's no wonder they rank among the very best in the world.
But for the swimming coaches and analysts,
there's one aspect of swimming competition that takes more planning than the rest.
selecting their relay teams.
And Swimming Australia have an impressive new app for this.
Hi, Jess.
Would you mind telling me, why is it so hard to pick the relay teams?
Wouldn't you just pick the four fastest swimmers?
We definitely go for the fastest swimmers.
But there's all different orders that you can swim in, obviously.
So we have to consider a lot of different variables in a relay
to make sure that yes, the four faster swimmers are in the race,
but also that they're swimming in the best order to maximize their skills.
What prompted you to consider adding more technology
in order to help improve the performance of the team?
Yeah, I'm really curious about always finding ways to improve
and how we can be better
and maximizing performance for each of the individual swimmers.
And bringing technology and data in,
it was going to give us greater insight.
Our performance analysts, when they're analyzing a race,
we look at things like start time, time to 15,
time to change over.
So how long it takes from the swimmer to touch the wall
to the ones who leave the blocks,
how quickly they can do a turn, and even how they pace the race.
So how quickly do they swim the front half of the race
compared to the back half of the race?
So all of that information goes into the data lake and into the databases
that are queried by the relay app.
It just gave us the ability to dive into so many more different options
and give us so much greater insight and depth
of thinking in what we were doing, really.
Thank you, Jess.
Let's find out more about that system.
Hi, Ellie, let's dive into the architecture.
How does this whole thing work?
So the Relay application has three main parts.
One is the data extraction, transformation and storage.
The second is machine learning model training and deployment.
And the third is the web application that coaches use to interact with the data.
Easy.
So let's start from the beginning.
How are you ingesting the data into the cloud?
So we have multiple sources that give us race results and athlete information.
We use AWS Glue
to load the data from sources and write it into an S3 bucket called Landing.
Okay, so once you have this competition and athlete information in the cloud,
what happens next?
Why do you have three buckets there?
So the data that we receive from the sources is in XML and JSON format,
which is not optimal for querying.
So we can work this data and store it in an optimized structure in our data lake.
And then we transform this data
and store the curated views that can be consumed by the model training
in the curated bucket.
Okay, so I can see that this swimming information
is actually flowing through many components in the architecture.
How does that actually happen?
We use AWS Glue to do the conversion and transformation.
And we use Step Functions to orchestrate this data pipeline,
which gives us like a single place to monitor all data pipeline,
and we handle our failure and retry logic in the Step Function as well.
Good, so the outcome of this initial part of the architecture
is arriving at this curated bucket that has the data in the right structure
to start the machine learning process, right?
Correct.
So this data is being used in two places.
One is the Aurora database,
which is backing our web application,
and also for training the machine learning model,
we're using Athena.
Because our data scientists could have read the data directly from S3,
but they prefer the SQL interface, which is what Athena gives us.
And then we allowed the data scientists to use this data,
train the model and deploy the model into SageMaker.
That makes a lot of sense.
So this model the way I understand, it is trying to predict or to guess,
the best possible relay order.
How is that kind of intelligence being consumed by the coaches' application?
So this model is deployed in SageMaker,
it gives us like the API endpoint.
So now when the coaches use the user interface,
they select the team, and they request the relay order.
This initiates a request from the interface to the API Gateway,
which in turn calls AWS Lambda,
which then calls the model for that inference,
which returns the best relay order,
and that data is returned back to the user interface.
This makes a lot of sense.
Thank you for sharing this architecture with me.
At best, the task of analyzing all the athletes' times
is difficult and tedious for any human.
But what about a machine?
Hi, Jess.
Hey, how are you doing?
Look, I just learned how the system is built.
But how does it actually look like when you use it?
Basically, when we're using it,
it's showing us who's the best swimmers are that we should choose
and what order to swim them in.
We're getting some web based data on results and rankings.
And then we're combining that with some race analysis data,
which is more granular data.
We can open up on an individual summer and look at more recent history.
So looking at what kind of form they're in,
look at how they swim a relay event
to how they swim an individual event as well.
How much data are we talking about, and how often does it get refreshed?
When we're going into a competition,
we'll have it on I think it's about a 15-minute refresh rate.
But when we're outside of competition, we'll slow that down.
And we really only need a refreshing in probably once a week.
But we speed that right up when we're having to make a lot more decisions
in a lot shorter timeframe in competition.
Does the application give you a breakdown
of how the swimmers compare with each other?
Yeah, what we can do is down here,
we can manipulate this graph as well,
where it puts those top eight countries that we've selected.
But if I want to look at for example, if I use this one,
I've got Australia in the red and America in the green.
What this is showing me
is for us, we have a lot of depth in this event.
So all of our swimmers here, below the American's times.
So you've got Emma McKeon here with a 51.96,
is faster than the American's best swimmer.
So what that's telling me is we've got a one-second advantage.
So it's your race to lose? Yeah.
What do you do to help maximize your chances of winning?
Well, the computer does a lot of work for me, to be honest.
But I use some of my swimming intelligence
and experience in swimming to,
I can manipulate the four swimmers that it's selecting.
And then I can look at some certain skill parameters here.
So how they split a race, what they're like at relay skills.
And this will give us some historical data
on the last five individual swims that they've swum.
so I can dive into it a little bit to make my decisions a bit easier.
And then once I'm happy with the four swimmers
that are selected for each country,
then I can run the first stage of the analytics.
It will tell us who's going to win.
So it's saying Australia, we're going to finish first.
That's nice.
Seeing what the predictions of these machine learning models
are influencing relay lineups,
makes me wonder how exactly this part of the solution is built?
Let's find out.
Hi, Moose, can you walk me through the machine learning process?
Sure, so we want to use machine learning
to solve three different problems, basically.
We want to predict the swim time for the individual swimmers.
Using that information,
we want to predict what's the final standing going to be of the team
compared to other teams.
And then using that information,
we want to suggest the optimal lineup of the swimmers in the relay.
So for that we use a lot of data that's already been collected
and curated for us and put into S3.
So we basically split it into two separate parts.
At the top, we have the development and experimentation phase.
And then at the bottom here, we have the deployment phase.
So we basically use this,
and then make an Athena SQL query from within the SageMaker notebook
to get that data into SageMaker where we can then build our models.
Great.
So tell me about that iterative process of coming up with a good algorithm
and actually measuring the quality.
Because we want to make sure that the suggestions that you give the coach
presumably, are actually accurate.
Yeah, so we actually start with the coach, right.
They're the expert.
They know what features they currently look at
to determine the swim order.
So we talked to them and figure out what features do they normally use.
We then use statistical analysis to figure out
what other features might be useful for the model as well,
and then we iteratively try a couple of different algorithms like LightGBM,
<h2>or XGBOOST<a href="https://www.geeksforgeeks.org/lightgbm-vs-xgboost-which-algorithm-is-better/" target="_blank">, </a> which is the one that we settled on.</h2>
That makes sense.
And once you've settled on that, I guess you earn that confidence by validating it?
Yes, we measure the accuracy by comparing the performance of the model
to the results from previous competitions.
So we'll check if the model accurately predicted
the number of medals that this team earned.
Or will check if the model accurately predicted the swim time of the whole team.
Awesome. So once you're happy with the model,
how did you expose that model to the coaches' application?
Yeah, there's a whole pipeline to get the model from training into production.
So basically, what happens is, again, we go from Athena, that's where we start.
And with the SQL query, we have a sage maker training job,
that is actually training the algorithm using that data.
This actually produces a final model.
And then this model is uploaded into a SageMaker endpoint.
And that's where the application can connect to.
That makes sense.
Now, competitions are happening all the time.
And athlete performance, I guess, goes up and down.
So I'm guessing this model needs to be retrained very often, is that the case?
It does.
The coaches can actually choose to retrain the model
when enough new data has been collected.
And we actually use Step Functions
to automate this entire pipeline that I just drew.
So a Step Functions workflow will basically automate the entire process
from Athena over here all the way down to deploying it into the SageMaker endpoint.
Okay, now, if the coaches are the ones that make the call,
then presumably there are no data scientists involved
in checking the accuracy of the model.
So how do you automate validating that model as well?
We do have a model verification step
that happens, sort of between the model being produced
and the actual endpoint.
And that verification step, it just checks,
the results that the model is producing
and make sure that they're not completely out of bounds.
This really helps me understand how the machine learning process works.
Thanks, Moose.
The 2020 Summer Olympics, now the latest major sports cancellation
caused by the global COVID-19 pandemic.
So let's take a look ...
The pandemic had a huge impact on the world.
I want to speak with one of their coaches to hear how this impacted them specifically.
Hi, Simon.
when the Olympics were postponed by a year,
how did the application help you?
There wasn't a lot of meets going on at some stages throughout the world.
So we didn't have a lot of data on some of the athletes.
So I think where it really came in handy
was all of their Olympic trials, their selection periods,
because we were then able to capture that data,
familiarize ourselves with the opposition team a bit more,
and then get a feel at least from a data point of view
of where their strengths and weaknesses lay,
to help us choose our best case scenarios.
So how did the application help you during the games?
We had a new event, the four by one mixed medley,
you've got two males and two females, you swim them in any combination.
And if you're trying to physically work out best combinations
for each of the eight countries that may be in the final,
by the time you get through that, the Olympics can be over.
So we were able to get the best combinations on the other teams
and then try and work out, what team we had to swim in the heat
in order to make the final,
without over swimming our best swimmers all the time.
Simon, how are you using the app to benefit the athletes?
Okay, so we're able to better illustrate
what the best teams are doing with their really change over techniques,
and how much time they're giving up with the combination of block times.
And block time is the time that it takes from the swimmer coming in touching the wall,
to the swimmer's toes taking over, leaving the block.
With that knowledge, we can build that into our daily training environment.
And we can give our athletes a target time.
One of the things that I've done with the women's 4x1 group was,
we aimed for .15, and that was like a past mark.
And they would practice that skill without distraction initially,
to the point where they were very familiar with it.
I was then able to load through distraction of various forms, noise,
ice-cold water pistols in their ear,
waving taser guns up and down for distraction,
and see where that skill level failed.
Because we can't replicate the pressure of the Olympics,
but if we can teach the skill of what is required to be successful at the Olympics,
well, then we produce athletes that are given every possible chance to be successful.
That's great, Simon, thanks for sharing this with me.
My pleasure.
In sports, we're dealing with human beings,
and the computer and the machine won't know certain things
like if a swimmer was injured or a swimmer had got sick overnight.
So I might have to make a change there.
The other bit is there's a huge coaching piece to it.
We're really lucky in Australia
that our coaches are really have a great relay intelligence,
and they're quite strategic thinkers about their relay.
So a coach might come to me and say,
"I'm thinking about doing this tactically."
And I'll be able to put that scenario into the computer,
and we'll be able to play that scenario out for the coach.
It's really there as a supportive decision-making tool.
This all boils down to just wanting to support the swimmers and the coaches
to be the best that they can be
and try and help them find ways to do that.
At the end of the day, we're racing in the pool for the gold medals,
but we're also racing out of the pool
to always stay one step ahead of the other countries and nations
to make sure that our team are the best prepared that they can be
when they stand on the blocks.
I'd like to thank the Australian Dolphins for spending some time with me
and congratulate them on their outstanding 2020 Olympics.
In Tokyo, they won nine gold, three silver, eight bronze medals,
along with setting a new world record in the women's 4X100 meter freestyle relay.
There is no doubt that their spirit of innovation
is going to continue to propel them to even greater heights in the years to come.