Adrian Hornsby | Technical Evangelist | AWS
May 2017
Building AI-powered apps on AWS
<demo>
Polly, Reko & more
</demo>
@adhorn
What’s coming
1. A little bit history never kills
2. AI in AWS
1. Polly
2. Reko
3. Building Mobile apps
1. Cognito
2. CodeStar
4. Putting it all together
Text In, Life-like Speech Out
Amazon Polly
“Today in Seattle, WA
it’s 11°F”
“Today in Seattle Washington
it’s 11 degrees Fahrenheit”
47 lifelike voices spread across 24 languages
“Today in Seattle, WA, it’s 11°F”
‘"We live for the music" live from the Madison Square Garden.’
1. Automatic, Accurate Text Processing
A Focus On Voice Quality & Pronunciation
2. Intelligible and Easy to Understand
1. Automatic, Accurate Text Processing
A Focus On Voice Quality & Pronunciation
2. Intelligible and Easy to Understand
3. Add Semantic Meaning to Text
“Richard’s number is 2122341237“
“Richard’s number is 2122341237“
Telephone Number
A Focus On Voice Quality & Pronunciation
1. Automatic, Accurate Text Processing
2. Intelligible and Easy to Understand
3. Add Semantic Meaning to Text
4. Customized Pronunciation
“My daughter’s name is Kaja.”
“My daughter’s name is Kaja.”
A Focus On Voice Quality & Pronunciation
1. Automatic, Accurate Text Processing
A Focus On Voice Quality & Pronunciation
https://www.w3.org/TR/speech-synthesis/<speak>
The spelling of my last name is
<prosody rate='x-slow'>
<say-as interpret-as="characters">Adrian</say-as>
</prosody></speak>
Duolingo voices its language learning service Using Polly
Duolingo is a free language learning service where
users help translate the web and rate translations.
With Amazon Polly our users
benefit from the most lifelike
Text-to-Speech voices
available on the market.
Severin Hacker
CTO, Duolingo
”
“
• Spoken language crucial for
language learning
• Accurate pronunciation matters
• Faster iteration thanks to TTS
• As good as natural human speech
Amazon Rekognition
Deep learning-based image recognition service
Search, verify, and organize millions of images
Object and Scene
Detection
Facial
Analysis
Face
Comparison
Facial
Recognition
Bynder allows you to easily create, find and use
content for branding automation and marketing
solutions.
With our new AI capabilities,
Bynder’s software… now allows
users to save hours of admin
labor when uploading and
organizing their files, adding
exponentially more value.
Chris Hall
CEO, Bynder
”
“
With Rekognition, Bynder revolutionizes marketing admin tasks with AI capabilities
How it works
Username
Password
Sign In
SAML
Identity Provider
Amazon Cognito
2. Get AWS credentials
API Gateway
Your APIs
DynamoDB S3
Lambda
Cognito User Pools
AWS.config.region = 'us-east-1'; // Region
AWS.config.credentials = new AWS.CognitoIdentityCredentials(
{
IdentityPoolId: 'us-east-1:873891a7-92b8-45c2-9c25-212bb7555bc1',
});
Simple to use with the SDK
curl -X POST -H "Authorization: $(aws cognito-idp admin-initiate-auth
--user-pool-id us-east-1_1ZkFb79PI
--client-id 5q4eiv7mmb59lpg6jf9ei82r2j
--cli-input-json file:///tmp/authflow.json
--query AuthenticationResult.IdToken
--output text --region us-east-1)"
-H "search-key: building" -H "Cache-Control: no-cache"
"https://xxx.amazonaws.com/prod/picture/search/"
| native2ascii -encoding UTF-8 -reverse
Simple to use with the CLI
AWS CodeStar
New integrated
AWS console UI for
developers
Start developing
on AWS in minutes
Manage software
delivery in one
place
Work across your
team, securely
C o o r d i n a t e t h e c o m p o n e n t s o f d i s t r i b u t e d a p p l i c a t i o n s
u s i n g v i s u a l w o r k f l o w s
A W S S t e p F u n c t i o n s
Start
Sequential Steps
U p l o a d R AW f i l e
D e l e t e R AW f i l e
End
A W S S t e p F u n c t i o n s
S e l e c t i m a g e
c o n v e rt e r
RA W t o J P E G RA W t o P NGRA W t o TI FF
L o a d i n Da t a b a se
Start
End
Un s u p p or te d i m a g e
t yp eParallel Steps
A W S S t e p F u n c t i o n s
P r o c e s s p h o t o
Re s i ze i m a g e
Start
End
E xt r a c t m e t a d a ta Fa c i a l r e c o g n ition
L o a d i n Da t a b a se
Branching Steps
A W S S t e p F u n c t i o n s
Bookstore
Home page 1996 (20 years) when we celebrated 1million titles
EYES – recommendation engine – which was very important to allow people to find anything in those 1 million titles
Today Ai is everywhere is Amazon
From recommendation pages, to fulfillment centers, Prime Air Drones, Amazon Go and Alexa
When did it all start? Well, that was approx 60 years ago!
In 1957, Frank Rosenblatt - an electro-mechanical neural network, the Perceptron, which he trained to recognize images (20x20 “pixels”).
In 1975, Paul Werbos published a article describing “backpropagation”, an algorithm allowing better and faster training of neural networks.
So, if neural networks have been around for so long, whats wrong with them?
Why do we talk about them today?
TO understand what took so long for AI to rise let’s first take a quick look at how neural networks work.
A neuron is a simple construct, which sums multiple weighted inputs to produce an output.
Neurons are organized in layers.
The beauty of neural networks is that they’re able to self-organize:
given a large enough data set, a neural network is able to learn automatically how to produce correct answers
The training phase and its self learning feature are well adapted to solving informal problems, but here’s the catch:
they involve a lot of math operations which tend to grow exponentially as data size increases and as the number of layers increases.
“Curse of Dimensionality” :
- not enough computing power available to run them at scale.
- Not enough data available.
Neural networks need a lot of data to learn properly. The more data, the better!
Until recently, it was simply not possible to gather and store vast amounts of digital data.
40 By the late 2000s, 4 things made large-scale neural networks possible.
Algorithms: 1998 Convolutional Neural Networks, a new type of multi-layered networks ( “Deep Learning”) - dramatically reduces the computing cost of network training.
Large data sets became widely available. Text, pictures, movies, music: everything was suddenly digital and could be used to train neural networks.
Graphics Processing Units (GPUs) parallel processing power to train large neural networks.
Cloud computing brought elasticity and scalability to developers and researchers, allowing them to use as much infrastructure as needed for training… without having to build, run or pay for it long term.
AWS is an AI enabler .. For all the reason mentioned here –
When AWS was established in 2006, one core premise was to allow anyone, even a student in his door-room, to get access to the same technologies that Fortune 500 companies have – we called it democratization of technology.
Today AWS AI offering is broadening – lets have a look at what we have got
Today AWS AI offering is broadening – lets have a look at what we have got
32 Now let’s have a look at one of our high level AI offering – Polly – our text-to-speech synthesizer powered by deep learning
The basics are pretty simple, but the service has deep functionality.
You can send the service a simple string of text, and it will generate the life like voice in your choice of 47 different voices.
But it’s not naive of the context of the text. For example, the text here - ‘WA’ and ‘degree F’, that would sound strange if it were spoken out loud.
Instead, Polly will automatically expand the text strings ‘WA’ and ‘degree F’, to ‘Washington’ and ‘degrees fahrenheit’, to create more life like speech. The developer doesn’t have to do anything - just send the text, and get life like voice back.
30
24
29
a fully managed deep learning based image recognition service.
Designed from the get-go to run at scale. It comprehends scenes, objects, concepts and faces.
Given an image, it will return a list of labels. Given an image with one or more faces,it will return bounding boxes for each face, along with face attributes.
Given two images with faces, it will compare the largest face from the source image and find similarity with faces found in the tagret image.
Rekognition provides quality face recognition at scale, and supports creation of collection of millions of faces and search of similar faces in the collection.
Now lets dive into each of these features and look at the API that support these features.
Image moderation
Rekognition automatically detects explicit or suggestive adult content in your images, and provides confidence scores.
26
24
24
Project Templates: With CodeStar you can use more than twenty different project templates to quickly provision your software development environment. You can choose templates for developing your web application or web service from six popular programming languages and three AWS compute services: Amazon EC2, AWS Elastic Beanstalk, and AWS Lambda.
Team Access: AWS CodeStar enables you to collaborate across your team in a secure manner. CodeStar simplifies the process of setting up project access for teams as it provides built-in role based policies that follow security best practices from AWS. It allows you to easily manage access for project owners, contributors, and viewers without needing to manually configure your own policy for each service.
Continuous Delivery Toolchain : AWS CodeStar enables you to accelerate software delivery by providing you a fully managed, automated continuous delivery pipeline. CodeStar projects come pre-configured with CI/CD tools, such as AWS CodeCommit, AWS CodePipeline, AWS CodeBuild, AWS CodeDeploy and AWS CloudFormation. With CodeStar, You can focus on dev and test without worrying about tool configurations. I am especially excited about using this capability for Serverless applications as now with CodeStar, you can easily setup a CI/CD pipeline within minutes.
Connect your IDE’s : CodeStar allows you to connect your favorite IDE with your project template.
Unified Dashboard: Each CodeStar project comes with a central dashboard to help you coordinate your day-to-day development activities. Within this dashboard :-
You can access your underlying toolchain and keep track on how your builds, tests, or deployments are progressing in the CI/CD pipeline.
You can also integrate Atlassian’s JIRA tool, a popular third party project management and issue tracking software. Now you can track your bugs and issues right within CodeStar’s dashboard.
With Cloudwatch integration, you can keep track of your application activity directly from CodeStar in terms of how much compute is being used by your application. You can also track the history of the code commits you are making
24
24
Summary
Transition for the next talk: Deep Dive on MXNET and Deep Learning Frameworks by Julien