Monday, 20 November 2017

Run Deep Learning Frameworks with GPU Instance Types on Amazon EMR

Leave a Comment

Today, AWS is excited to announce support for Apache MXNet and new generation GPU instance types on Amazon EMR, which enables you to run distributed deep neural networks alongside your machine learning workflows and big data processing. Additionally, you can install and run custom deep learning libraries on your EMR clusters with GPU hardware. Through using deep learning frameworks, you have a new toolkit to address use cases ranging from autonomous vehicles to artificial intelligence (AI) to personalized healthcare to computer vision.

Amazon EMR provides a managed Hadoop framework that makes it easy, fast, and cost-effective to process vast amounts of data in Amazon S3 with frameworks like Apache Spark, Apache Hive, Presto, Apache HBase, and Apache Flink. You can securely and performantly address a large set of big data use cases at low cost, including log analysis, web indexing, data transformations (ETL), financial analysis, scientific simulation, real-time processing, and bioinformatics.

EMR has a long history in enabling you to run scalable machine learning workloads. In 2013, we added support for Apache Mahout to help you use Apache Hadoop MapReduce to run distributed machine learning workloads. In 2014, customers started leveraging Apache Spark (we added official support in 2015) to easily build scalable machine learning pipelines with the variety of open-source machine learning libraries available in Spark ML.

In the past 2 years, we also added support for Apache Zeppelin notebooks, easy installation for Jupyter notebooks, and Apache Livy for interactive Spark workloads to enable data scientists to easily and quickly develop, train, and move machine learning models into production. With EMR’s per-second billing and cost savings up to 80% by using Amazon EC2 Spot Instances, you can easily run your machine learning pipelines at a massive scale but low cost.

Today, we are making it easier to implement deep learning on Amazon EMR. We have added support for Apache MXNet (0.12.0), a scalable deep learning framework, and Amazon EC2 P3 and P2 instances, EC2 compute-optimized GPU instances, preloaded with the required GPU drivers. You can now quickly and easily create scalable and secure clusters with the latest GPU hardware for distributed training with a few clicks. Furthermore, you can install and use custom deep learning libraries like BigDL or CaffeOnSpark by preloading them on a custom Amazon Linux AMI or using bootstrap actions to customize your cluster. Additionally, EMR will soon add support for TensorFlow, another popular deep learning framework.

EMR makes it easy to combine both the data exploration and preprocessing phases of development with developing and training deep learning models. First, you can easily and cost-effectively use a variety of open-source big data frameworks including Apache Spark, Apache Hadoop, and Apache Hive to explore and process large datasets in S3.

Second, you can then use MXNet and Spark to make predictions or perform inference in addition to developing, training, and running deep learning models with preprocessed data stored in S3 or on-cluster HDFS. You pay per-second, and you can set your own maximum price for EC2 Spot Instances and use Auto Scaling. Then, you can shut down your cluster and stop paying for it when your workloads are complete, to further lower costs of experimentation and production.

You can quickly create an EMR cluster with one to thousands of nodes with Spark, MXNet, Ganglia monitoring, and Zeppelin notebooks with a just few clicks in the EMR console.

After your cluster has started, you can open up your Zeppelin notebook and start exploring data and building models with Spark and MXNet.

EMR makes it easy to monitor and debug your applications through any of the following:

We plan to publish additional posts soon with examples of and best practices on leveraging MXNet and other frameworks on EMR for deep learning at scale. For more information about how to get started, see the Amazon EMR documentation.


About the Author

Jonathan Fritz is the Principal Product Manager for Amazon EMR. He leads product management for the team and works to make analytics and machine learning easy on vast amounts of data. In his spare time, he enjoys traveling to new cities, live music, and exploring the outdoors.

 

 

Powered by WPeMatico

The post Run Deep Learning Frameworks with GPU Instance Types on Amazon EMR appeared first on Artificial Intelligence Solutions.

Read More...

Building an Autonomous Vehicle, Part 4:  Using Behavioral Cloning with Apache MXNet for Your Self-Driving Car

Leave a Comment
Read More...

Thursday, 16 November 2017

Announcing ONNX Support for Apache MXNet

Leave a Comment

Today, AWS announces the availability of ONNX-MXNet, an open source Python package to import Open Neural Network Exchange (ONNX) deep learning models into Apache MXNet. MXNet is a fully featured and scalable deep learning framework that offers APIs across popular languages such as Python, Scala, and R. With ONNX format support for MXNet, developers can build and train models with other frameworks, such as PyTorch, Microsoft Cognitive Toolkit, or Caffe2, and import these models into MXNet to run them for inference using the MXNet highly optimized and scalable engine.

We’re also excited to share that AWS will be collaborating on the ONNX format. We will be working with Facebook, Microsoft, and the deep learning community to further develop ONNX, making it accessible and useful for deep learning practitioners.

What is ONNX?

ONNX is an open source format to encode deep learning models. ONNX defines the format for the neural network’s computational graph, as well as the format for an extensive list of operators used within the graph. With ONNX being supported by an increasing list of frameworks and hardware vendors, developers working on deep learning can move between frameworks easily, picking and choosing the framework that is best suited for the task at hand.

Quick Start

We’ll show how you can use ONNX-MXNet to import ONNX models into MXNet, and use the imported model for inference, benefiting from the MXNet optimized execution engine.

Step 1: Installations

First, install ONNX, following instructions on the ONNX repo.

Then, install the ONNX-MXNet package:

$ pip install onnx-mxnet

Step 2: Prepare an ONNX model to import

In this example, we will demonstrate importing a Super Resolution model, designed to increase spatial resolution of images. The model was built and trained with PyTorch, and exported into ONNX using PyTorch’s ONNX export API. More details about the model design are available in PyTorch’s example.

Download the Super Resolution ONNX model to your working directory:

$ wget http://ift.tt/2j0wpWG

Step 3: Import the ONNX model into MXNet

Now that we have an ONNX model file ready, let’s import it into MXNet using the ONNX-MXNet import API. Run the following code in a Python shell:

import onnx_mxnet
sym, params = onnx_mxnet.import_model('super_resolution.onnx')

This created two instances in the Python runtime: sym – the model’s symbolic graph, and params – the model’s weights. Importing the ONNX model is now done, and we have a standard MXNet model.

Step 4: Prepare input for inference 

Next, we will prepare an input image for inference. The following steps download an example image, resize it to the model’s expected input shape, and finally convert it into a numpy array.

From your shell console, download the example input image to your working directory:

$ wget http://ift.tt/2zOWxvA

Then, install Pillow, Python Imaging Library, so we can load and pre-process the input image:

$ pip install Pillow

Next, from your Python shell, run the code to prepare the image in the MXNet NDArray format:

import numpy as np
import mxnet as mx
from PIL import Image
img = Image.open("super_res_input.jpg").resize((224, 224))
img_ycbcr = img.convert("YCbCr")
img_y, img_cb, img_cr = img_ycbcr.split()
test_image = mx.nd.array(np.array(img_y)[np.newaxis, np.newaxis, :, :])

Step 5: Create the MXNet Module

We’ll be using the MXNet Module API to create the module, bind it and assign the loaded weights.
Note that the ONNX-MXNet import API assigns the input layer the name ‘input_0’, which we are using when initializing and binding the module.

mod = mx.mod.Module(symbol=sym, data_names=['input_0'], label_names=None)
mod.bind(for_training=False, data_shapes=[('input_0',test_image.shape)])
mod.set_params(arg_params=params, aux_params=None)

Step 6: Run inference

Now that we have an MXNet Module loaded, bound, and with trained weights, we’re ready to run inference. We’ll prepare a single input batch, and feed forward through the network:

from collections import namedtuple
Batch = namedtuple('Batch', ['data'])
mod.forward(Batch([test_image]))
output = mod.get_outputs()[0][0][0]

Step 7: Examine the results

Now let’s examine the results we received running inference on the Super Resolution image:

img_out_y = Image.fromarray(np.uint8((output.asnumpy().clip(0, 255)), mode='L'))
result_img = Image.merge(
"YCbCr", [
                img_out_y,
                img_cb.resize(img_out_y.size, Image.BICUBIC),
                img_cr.resize(img_out_y.size, Image.BICUBIC)
]).convert("RGB")
result_img.save("super_res_output.jpg")

Here’s the input image and the resulting output image. As you can see, the model was able to increase the image spatial resolution from 256 by 256 to 672 by 672.

Input image Output image
 

What’s Next?

We’re working with our ONNX partners and community to further develop ONNX, adding more useful operators, extending ONNX-MXNet to include export and increased operator coverage. We will be working with the Apache MXNet community to bring ONNX into MXNet core APIs.

Want to learn more?

The example is available here, as part of the ONNX-MXNet GitHub repo.

Check out ONNX to dive into how network graphs and operators are encoded.

Contributions are welcomed!

Special thanks to the dmlc/nnvm community, whose ONNX code was used as a reference for this implementation.

Facebook Blog:
http://ift.tt/2iZYKg1

Microsoft Blog:
http://ift.tt/2zPqoUE

 


 

About the Authors

Hagay Lupesko is an Engineering Manager for AWS Deep Learning. He focuses on building Deep Learning tools that enable developers and scientists to build intelligent applications. In his spare time he enjoys reading, hiking and spending time with his family.

 

 

 

Roshani Nagmote is a Software Developer for AWS Deep Learning. She is working on innovative tools to make Deep Learning accessible for all. In her spare time, she loves to play with her adorable nephew and is a huge dog lover.

 

 

 

 

 

Powered by WPeMatico

The post Announcing ONNX Support for Apache MXNet appeared first on Artificial Intelligence Solutions.

Read More...

Wednesday, 15 November 2017

Amazon Polly Adds 9 AWS Regions, Korean Language Support, and a New Indian English Voice

Leave a Comment
Read More...

New AWS Deep Learning AMIs for Machine Learning Practitioners

Leave a Comment

We’re excited to announce the availability of two new versions of the AWS Deep Learning AMI: a Conda-based AMI with separate Python environments for deep learning frameworks created using Conda—a popular open source package and environment management tool; and a Base AMI with GPU drivers and libraries to deploy your own customized deep learning models.

Deep learning technology is evolving at a rapid pace—everything from frameworks and algorithms to new methods and theories from academia and industry. All of this causes complexity for developers who need tools for quickly and securely testing algorithms, optimizing for specific versions of frameworks, running tests and benchmarks, or collaborating on projects starting with a blank canvas. Virtual environments provide the freedom and flexibility to do all this, which is why we’re adding it to the AWS Deep Learning AMIs today. We’ve also set up new developer resources to help you learn more about the AMIs, choose the right AMI for your project and dive into hands-on tutorials.

New Conda-based Deep Learning AMI

The Conda-based AMI comes pre-installed with Python environments for deep learning created using Conda. Each Conda-based Python environment is configured to include the official pip package of a popular deep learning framework, and its dependencies. Think of it as a fully baked virtual environment ready to run your deep learning code, for example, to train a neural network model. Our step-by-step guide provides instructions on how to activate an environment with the deep learning framework of your choice or swap between environments using simple one-line commands.

But the benefits of the AMI don’t stop there. The environments on the AMI operate as mutually-isolated, self-contained sandboxes. This means when you run your deep learning code inside the sandbox, you get full visibility and control of its run-time environment. You can install a new software package, upgrade an existing package or change an environment variable—all without worrying about interrupting other deep learning environments on the AMI.  This level of flexibility and fine-grained control over your execution environment also means you can now run tests, and benchmark the performance of your deep learning models in a manner that is consistent and reproducible over time.

Finally, the AMI provides a visual interface that plugs straight into your Jupyter notebooks so you can switch in and out of environments, launch a notebook in an environment of your choice, and even reconfigure your environment—all with a single click, right from your Jupyter notebook browser. Our step-by-step guide walks you through these integrations and other Jupyter notebooks and tutorials.

The new Conda-based Deep Learning AMI comes packaged with the latest official releases of the following deep learning frameworks:

  • Apache MXNet 0.12 with Gluon
  • TensorFlow 1.4
  • Caffe2 0.8.1
  • PyTorch 0.2
  • CNTK 2.2
  • Theano 0.9
  • Keras 1.2.2 and Keras 2.0.9

This AMI also includes the following libraries and drivers for GPU acceleration on the cloud:

  • CUDA 8 and 9
  • cuDNN 6 and 7
  • NCCL 2.0.5 libraries
  • NVidia Driver 384.81

New Deep Learning Base AMI

The Base AMI comes pre-installed with the foundational building blocks for deep learning. This includes NVIDIA CUDA libraries, GPU drivers, and system libraries to speed up and scale machine learning on Amazon Elastic Compute Cloud (EC2) instances. Think of the Base AMI as a clean slate to deploy your customized deep learning set up.

For example, for developers contributing to open source deep learning framework enhancements or even building a new deep learning engine, the Base AMI provides the foundation to install your own custom configurations and code repositories to test out new framework features. The Base AMI comes with the CUDA 9 environment installed by default, however you can also switch to a CUDA 8 environment using simple one-line commands given in our step-by-step user guide.

The Base AMI provides the following GPU drivers and libraries:

  • CUDA 8 and 9
  • CuBLAS 8 and 9
  • CuDNN 6 and 7
  • glibc 2.18
  • OpenCV 3.2.0
  • NVIDIA driver 384.81
  • NCCL 2.0.5
  • Python 2 and 3

Deep Learning AMIs with source code

In addition to the two new AMIs available today, we continue to support the AMIs that install all the popular deep learning frameworks from source in a unified Python environment, and include their source code on the AMI. This AMI is great if you want to try out and compare multiple frameworks in a shared base environment or you need quick access to source code on the AMI itself to recompile a framework with your custom set of build options.

The AMI comes in CUDA 8 and CUDA 9 versions to meet your specific needs of the AWS EC2 instance you want to use for deep learning. 

Deep Learning AMIs cheat sheet

We now have three types of AWS Deep Learning AMIs available in the AWS Marketplace to support the various needs of machine learning practitioners. Don’t forget to check out our AMI selection guide, simple tutorials, and more deep learning resources in our developer guide!

Conda-based AMI Base AMI AMIs with source code
For developers who want pre-installed pip packages of deep learning frameworks in separate virtual environments For developers who want a clean slate to set up private deep learning engine repositories or custom builds of deep learning engines For developers who want pre-installed deep learning frameworks and their source code in a shared python environment

Deep Learning AMI (Ubuntu)

Deep Learning AMI (Amazon Linux)

Deep Learning Base AMI (Ubuntu)

Deep Learning Base AMI (Amazon Linux)

For P3 instances:

Deep Learning AMI with Source Code (CUDA 9, Ubuntu)

Deep Learning AMI with Source Code (CUDA 9, Amazon Linux)

For P2 instances:

Deep Learning AMI with Source Code (CUDA 8, Ubuntu)

Deep Learning AMI with Source Code (CUDA 8, Amazon Linux)

 


 

About the Author

Cynthya Peranandam is a Principal Marketing Manager for AWS artificial intelligence solutions, helping customers use deep learning to provide business value. In her spare time she likes to run and listen to music.

 

 

 

Powered by WPeMatico

The post New AWS Deep Learning AMIs for Machine Learning Practitioners appeared first on Artificial Intelligence Solutions.

Read More...

Getting Started with the AWS Deep Learning Conda and Base AMIs

Leave a Comment

Today AWS announced the availability of two new versions of the AWS Deep Learning AMI: a Conda-based AMI and a Base AMI. This post will walk you through the instructions and additional resources for making the most of your new AMIs.

New Deep Learning AMI with Conda-managed environments

The new Deep Learning AMIs for Amazon Linux and Ubuntu come pre-installed with Python environments for deep learning created using Conda – a popular open source package and environment management tool. The Conda-managed Python environments are pre-configured for popular deep learning frameworks including Apache MXNet, TensorFlow, Caffe2, PyTorch, Keras, CNTK, and Theano. In addition, each Python environment comes in two flavors – Python 2 and Python 3. After you log in to your AWS EC2 instance using the AWS Management Console, you will be greeted with a console message that lists all the Conda environments.

You can also get this list by running the following command:

conda env list

Next, to activate a Python environment for a deep learning framework of your choice, say MXNet, run the following:

For Python 2

source activate mxnet_p27

For Python 3

source activate mxnet_p36

After you are inside the Python environment, you can view the list of installed packages by running the following command:

conda list


Running your deep learning code inside the Python environment is simple. First start the python shell:

python

Then import a deep learning framework, or run your deep learning Python code like you normally would:

import mxnet

Now let’s switch to another deep learning framework, say TensorFlow. First exit the python shell

exit()

Then deactivate the current environment for MXNet

source deactivate

Then switch to a Python environment like you did before, but this times you’ll activate TensorFlow:

For Python 2

source activate tensorflow_p27

For Python 3

source activate tensorflow_p36

To read more about managing Conda environments, you can get the Conda commands cheat sheet and additional learning resources in the getting started guide for Conda. You can also go to the new AWS Deep Learning AMI doc site and explore the introductory tutorials that you can run directly from the command line.

Manage Conda from your Jupyter notebook Interface

You can also manage the Conda environments straight from your Jupyter notebook browser interface. You can launch a Jupyter notebook server on the Conda-based AMI using instructions on our doc site. Conda supports close integrations to the Jupyter notebook with following features:

Choosing your deep learning environment

First access the Jupyter server on your internet browser. On the main Files page you can choose a Conda environment with the deep learning framework of your choice from the drop-down list, as shown in the following screen shot. You can then continue starting a new notebook. It will automatically be linked to the Python environment that you selected.

You can also use the drop-down list on this page to switch to another environment with a different deep learning framework. To help you get started with your first notebook, the Conda-based AMI comes bundled with several Jupyter notebooks and ready to launch tutorials.

Managing environments

Open the Conda tab, and you’ll see a dedicated page for managing the Conda environments on the AMI:

On this page, you can browse the list of all the pre-installed Conda environments, the software packages installed inside an environment, and even reconfigure an environment by upgrading packages or uninstalling them.

Configuring the new Deep Leaning Base AMI

The Base AMI for Amazon Linux and Ubuntu comes with a foundational platform of GPU drivers and acceleration libraries you can use to deploy your own customized deep learning environment. By default, the AMI is configured with an NVidia CUDA 9 environment. However, you can also switch to a CUDA 8 environment by reconfiguring the environment variable LD_LIBRARY_PATH. You simply need to replace the CUDA 9 portion of the environment variable string with its CUDA 8 equivalent.

CUDA 9 portion of the LD_LIBRARY_PATH string (installed by default)

…:/usr/local/cuda-9.0/http://lib64:/usr/local/cuda-9.0/extras/CUPTI/lib64:/lib/nccl/cuda-9:…… rest of LD_LIBRARY_PATH value

Replace with CUDA 8

…:/usr/local/cuda-8.0/http://lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64:/lib/nccl/cuda-8:…… rest of LD_LIBRARY_PATH value

Getting Started

Getting started with the Deep Learning AMI is easy. You can follow our step-by-step blog or visit our new AWS Deep Learning AMI doc site to get started with how-to guides and useful resources.


About the Author

 

Sumit Thakur is a Senior Product Manager for AWS Deep Learning. He works on products that make it easy for customers to get started with deep learning on cloud, with a specific focus on making it easy to use engines on Deep Learning AMI. In his spare time, he likes connecting with nature and watching sci-fi TV series.

 

 

 

Powered by WPeMatico

The post Getting Started with the AWS Deep Learning Conda and Base AMIs appeared first on Artificial Intelligence Solutions.

Read More...

Tuesday, 14 November 2017

Building an Autonomous Vehicle Part 3: Connecting Your Autonomous Vehicle

Leave a Comment

In the first blog post in our autonomous vehicle series, you built your Donkey vehicle and deployed your pilot server onto an Amazon EC2 instance. In the second blog, you learned to drive the Donkey car, and the Donkey car learned to drive itself. In this blog post, we’ll cover the process of streaming telemetry from the Donkey vehicle into AWS. We’ll use the AWS IoT service because it provides a scalable, reliable, and feature-rich set of services for all kinds of connected devices, including our connected vehicles.


1) Build an Autonomous Vehicle on AWS and Race It at the re:Invent Robocar Rally
2) Build an Autonomous Vehicle Part 2: Driving Your Vehicle
3) Building an Autonomous Vehicle Part 3: Connecting Your Autonomous Vehicle
4) Coming soon


AWS IoT setup

The autonomous car is going to generate a constant stream of telemetry while it is driving. When the vehicle is not driving, there is no telemetry to gather, so we don’t want to utilize any resources because it would be wasteful. In order to accommodate our workload, we are going to rely on serverless technologies to power our entire architecture. To start, we are going to use AWS IoT to design a fleet monitoring service. It can service any amount of vehicles using the same basic architecture. The following diagram illustrates the architecture for the fleet monitoring service.

The components of this solution are color-coded by logical functionality (and AWS services) to demonstrate how each component of the solution is secure, scalable, and entirely usage based. This kind of operational model lends itself to many business models and is useful for customers of all sizes. Whether it’s the weekend autonomous vehicle hobbyist who wants to track and compare lap times, or an automobile manufacturer that wants to develop their own connected vehicle platform, AWS IoT provides a secure, scalable, and usage-based cost structure.

This solution begins with the Donkey car, which is shaded in green. Data then passes through the IoT service to the pink section which is for short term data storage in DynamoDB, and then to the blue section for longer term storage in S3. Additionally, data in an AWS IoT topic can also be queried in real-time, and as show below will be used to drive a dashboard.

The Donkey car is already internet-connected, which means that it is capable of streaming telemetry to a centralized location, in this case AWS IoT. To ensure the security of the telemetry, we’ll generate certificates from AWS IoT and deploy them to the Donkey vehicle. By using certificates, the Donkey car can securely communicate with AWS IoT using TLSv1.2 over MQTT. MQTT is an extremely lightweight protocol that deals well with low signal networks, so it can cope with connection reliability challenges.

The simplest way to handle security is to use the one-click certificate creation method. To do this, open the AWS IoT console. In the navigation pane at the left, choose Security. Next, choose the Create button.

Create a certificate

A certificate can be created using the AWS IoT console, the AWS IoT API, or as we did in our previous blog post, using the Amazon EC2 Systems Manager Run Command on Raspberry Pi to generate and deliver the certificates. By performing this process using EC2 Systems Manager, we don’t need to manually copy the certificates to the Raspberry Pi.

For the sake of simplicity, we’ll use the AWS IoT console to complete the process.

We’re going to create a new policy that will be used to grant our Donkey car specific permissions to AWS services. This allows us to set fine-grained vehicle-specific settings, such as which AWS IoT topics can be accessed, and which IoT actions can be taken.

Begin by opening your AWS Management Console. Go to the AWS IoT console and choose Security, then Policies. Then choose Create.

We’ll use this policy to allow all actions to be performed against the AWS IoT service because we don’t need to prevent the use of the full functionality of the service. This privilege includes: iot:Publish, iot:Subscribe, iot:Connect, iot: Receive, iot:UpdateThingShadow, iot:GetThingShadow, and  iot:DeleteThingShadow.

In addition to the certificate and the policy, the AWS IoT service needs to create a Thing that describes our Donkey car. To do this, in the navigation pane at the left, choose Things from Registry. Now choose Create, and provide your Thing with a name and click Create thing.

Now that the policy and thing are created, we can associate them with the certificate that we previously created. To do that, in the navigation pane on the left, choose Security, Certificates. Locate and then select the certificate that you created previously. From the Actions menu, choose Attach Policy. Then from the Actions menu, choose Attach Thing.

AWS IoT rules

Now that we have a means of generating and communicating telemetry, we can focus on building the rest of the functionality of the solution. Our solution calls for two rules, one for Amazon DynamoDB to be accessed by our dashboard, and the other for Amazon Kinesis Firehose to distribute all telemetry to Amazon S3 and Amazon Kinesis Analytics for real-time analysis of the telemetry.

DynamoDB Rule

We will start by creating the rule for DynamoDB. In the navigation pane at the left in the AWS IoT console, choose Rules. Then choose the Create button.

On the Create a rule page, give the rule a name and add a description that easily identifies the type of data and the AWS service that is consuming those records.

 

Then choose Add action, and select Split message into multiple columns of a database table (DynamoDBv2).

Next choose Configure action.

Next, you can either create a new table or use an existing one. We’ll create a new table by choosing Create a new resource.

We now follow the Create DynamoDB table wizard. We call the Table name AutonomousVehicles and set the Primary key (partition key) to be the vehicleID attribute which will be unique among all of the vehicles in the fleet. We’ll add a sort key on the attribute time which will allow the most efficient use of DynamoDB for queries. Leave the default settings. They should be more than sufficient to handle telemetry from a single vehicle.

While DynamoDB is creating the table, we can set a TTL attribute to keep the costs of running DynamoDB very low. If you keep the default of 5 Read capacity units and 5 Write capacity units the monthly bill is around $2.50. The RCU and WCU can be adjusted up and down manually, or you can choose to use Auto Scaling. To keep costs low, we’ll also allow DynamoDB to automatically expire items based on an attribute that the user defines. In our case, we are going to add a TTL timestamp to our telemetry. In our program that runs on the Donkey car, we’ll set the attribute dynamodb_ttl as the current Unix Timestamp, plus 2592000 (30 days) and then store it in DynamoDB. 30 days later DynamoDB sees that the TTL attribute has expired and deletes those items automatically.

Choose Continue to enable TTL. Return where you left off with the AWS IoT Configure action, and from Table name select your table from the drop-down list. If you do not see it, click the refresh arrows. Next, choose Create a new role and name it AutonomousVehiclesDynamoDB or something similar. Choose Update role, and then choose Add action.

Next we can review all of our choices. When you are ready, choose Create rule.

Kinesis Firehose Rule

We can now follow similar steps to create another rule to send all of the telemetry to Kinesis Firehose. In the navigation pane at the left, choose Rules. Then choose the Create button.

On the Create a rule page, give the rule a name with a description that easily identifies the type of data and the AWS service that is consuming those records.

Then choose Add action, and select Send messages to an Amazon Kinesis Firehose stream:

Then choose Configure action.

Now there is a choice: Create a new stream or use an existing one. We’ll create a new stream by choosing Create a new resource.

We now follow the Create delivery stream wizard and provide a name for the Delivery stream. Choose Next.

Choose Next.

Ensure that Amazon S3 is selected. Choose an appropriate S3 bucket and Prefix where you want the telemetry to be stored.

Choose Create new, or Choose for the IAM role.  From the drop-down list, select Create a new IAM Role and provide it with a Role Name. Choose Allow. Then choose Next.

Finally, confirm everything is correct and choose Create delivery stream.

Return to the Configure action screen and select the new stream that was created.

Then choose Create a new role to be used by AWS IoT to access the Amazon Kinesis Firehose stream. After naming the role, choose Update role and then Add action.

Finally, confirm all of the choices, and then choose Create rule when ready.

The AWS IoT service is now ready and waiting for telemetry to stream in. Since AWS IoT is serverless and usage based, there is no cost incurred with deploying it and leaving it on. Amazon Kinesis Firehose and Amazon S3 are also priced based on the volume of data ingested. We can now generate telemetry, and then use the AWS IoT console to check that it is being sent to the proper topic.

Alternatively, we could build a dashboard that connects directly to AWS IoT so that it could consume this telemetry in near real time. Here is an example of a dashboard that is hosted on Amazon S3, which means it is completely serverless and requires no management of underlying webservers. An example of how you can visualize IoT telemetry can be found in this tutorial:

Deploy an End-to–End IoT Application (pdf)

And in this blog post:

Build a Visualization and Monitoring Dashboard for IoT Data with Amazon Kinesis Analytics and Amazon QuickSight

In our next blog post we will re-cap what we’ve done so far and talk about what’s next for autonomous vehicles.

Powered by WPeMatico

The post Building an Autonomous Vehicle Part 3: Connecting Your Autonomous Vehicle appeared first on Artificial Intelligence Solutions.

Read More...

Friday, 10 November 2017

Matrix Analytics Uses Deep Learning on AWS to Boost Early Cancer Detection

Leave a Comment

Matrix Analytics is helping to save lives. The Colorado-based startup uses deep learning on Amazon Web Services (AWS) to track disease progression for patients diagnosed with pulmonary nodules in their lungs. While often benign, careful monitoring and follow-up care are critical to knowing if and when those nodules will turn into malignant tumors.

The company’s founder, Dr. Aki Alzubaidi, was working at a Glenwood Springs hospital when he realized that some patients were falling through the cracks. The system for keeping track of them was cumbersome and disorganized, leading to unnecessarily poor outcomes for many patients with lung nodules who don’t receive the recommended follow-up care.

Predicting cancer risk and managing care

LungDirect, the company’s flagship software application, uses a two-pronged approach to early cancer intervention: predicting malignancy risk and automating follow-up care.

First, advanced computer vision capabilities built with deep learning algorithms assess the malignancy risk of pulmonary nodules based on factors such as nodule size, shape, density, volume, as well as patient demographics such as years smoking, age, gender, and race. “We want to be able to take any clinical input such as a radiology test, lab test, or personalized clinical variables and say here is the likelihood of a disease state and provide output on utility and management of next steps, and that’s our goal with deep learning,” said Dr. Alzubaidi.

Five distinct classes of machine learning models are applied to cancer risk assessment in order to account for the distinct classes of nonlinearities that could be hiding in the data. Four distinct classes of features are auto-extracted directly from the images using a set of computer vision algorithms.

Developing a tool that could “auto-magically” read patient scans to predict and diagnose cancer was not easy. But Matrix Analytics was able to quickly develop a prototype that showed proof of concept. Then the company’s deep learning models were implemented and compared to benchmarks in the preexisting literature.

The Matrix Analytics tools were able to outperform previous methods in their ability to diagnose cancer from a CT image. And compared to conventional methods, deep learning requires no hand-tuned feature extractor, making the process much more independent.

The second prong of the LungDirect approach is care management. The software automates follow-up care to ensure that each patient follows through with recommendations in order to monitor changes in their condition. Today, 11 healthcare agencies and institutions—from the Cleveland Clinic’s facilities across the country to UCHealth in Denver and Community Hospital in Grand Junction—are using LungDirect. The result has been a significantly higher rate of early lung cancer intervention for patients.

This adaptive system is now deployed on the AWS Cloud infrastructure and is available to leaders in pulmonary nodule and lung cancer management on a software-as-a-service model.

Computer vision algorithms predict tumors from CT scans

Cloud-based deep learning

Matrix Analytics uses the AWS Cloud infrastructure to process large amounts of data and complex operations. In particular, they depend on the power and scalability of GPU-powered clusters from AWS, which are ideally suited for deep learning workloads.

The company’s LungDirect system is designed to keep improving in a virtuous circle of iterative learning. Notes Dr. Alzubaidi, “The possibilities are endless with what we can do on AWS to help our customers.”

Matrix Analytics uses the AWS Deep Learning AMI (Amazon Machine Image) and TensorFlow on AWS to build and train computer vision algorithms. The AWS Deep Learning AMI comes pre-configured with popular frameworks such as Apache MXNet, TensorFlow, Caffe, and Keras. These are pre-built, open-source libraries that allow developers and data scientists to build deep learning models quickly and easily.

“Using the convenience of the AMI on AWS gives us the opportunity to offer up different business models, which allows us to become excellent technology partners as the market evolves at an ever-increasing pace.” said Dr. Alzubaidi.


 

About the Author

Cynthya Peranandam is a Principal Marketing Manager for AWS artificial intelligence solutions, helping customers use deep learning to provide business value. In her spare time she likes to run and listen to music.

 

 

 

Powered by WPeMatico

The post Matrix Analytics Uses Deep Learning on AWS to Boost Early Cancer Detection appeared first on Artificial Intelligence Solutions.

Read More...

Wednesday, 8 November 2017

Apache MXNet Version 0.12 Extends Gluon Functionality to Support Cutting Edge Research

Leave a Comment

Last week, the Apache MXNet community released version 0.12 of MXNet. The major features were support for NVIDIA Volta GPUs and sparse tensors. The release also included a number of new features for the Gluon programming interface. In particular, these features make it easier to implement cutting-edge research in your deep learning models:

  • Variational dropout, which enables you to effectively apply the dropout technique for mitigating overfitting to recurrent neural networks (RNNs)
  • Convolutional RNN, Long short-term memory (LSTM), and gated recurrent unit (GRU) Cells, which allow modeling of datasets exhibiting both time-based sequence and spatial dimensions
  • Seven new loss functions, export functionality, and trainer function enhancements

Variational dropout (VariationalDropoutCell) builds on recent research to provide a new tool for mitigating overfitting in RNNs. It draws from “A Theoretically Grounded Application of Recurrent Neural Networks” and “RNNDrop: A Novel Approach for RNNs in ASR.” Overfitting is a modeling error where the model is fit so closely to the training dataset that it diminishes its prediction accuracy when it sees new data or the test dataset. Dropout is a modeling technique that randomly zeroes out model parameters, so that the model doesn’t become overly dependent on any single input or parameter during training. However, this technique hasn’t been applied successfully to RNNs. Research to date has focused on applying dropout only to the inputs and outputs with complete randomness in what is zeroed out across all of the RNN’s time steps. Variational Dropout eliminates this randomness across time steps and applies the same random dropout array (or mask) to the RNN’s inputs, outputs, and hidden states at each time step.

The convolutional RNN, LSTM, and GRU cells (e.g., Conv1DRNNCell, Conv1DLSTMCell, Conv1DGRUCell) make it easier to model datasets that have both sequence and spatial dimensions – for example, videos or images captured over time. Convolutional LSTM models were first successfully applied in research presented in “Convolutional LSTM Network: A Machine Learning Approach for Precipitation Nowcasting.” LSTM networks are designed for analyzing sequential data while keeping track of long-term dependencies. They have advanced the state of the art in natural language processing (NLP). However, they perform with limited effectiveness when applied to spatiotemporal use cases where the dataset has a spatial dimension in addition to exhibiting a time-based sequence. Examples of spatiotemporal use cases include predicting total volume of rainfall in different pockets of Hong Kong in the next six hours (as discussed in the research paper referenced earlier) or detecting whether a video is violent. For image recognition, convolutional neural networks (CNNs) advanced the state of the art by applying a convolution operation on images, enabling the model to capture spatial context. Convolutional RNN, LSTMs, and GRUs incorporate these convolution operations into the RNN, LSTM, and GRU architectures, respectively.

This MXNet release also expanded the set of supported loss functions in Gluon by seven: (1) sigmoid binary cross entropy loss, (2) connectionist temporal classification (CTC) loss, (3) Huber loss, (4) hinge loss, (5) squared hinge loss, (6) logistic loss, and (7) triple loss. Loss functions measure how well your model is performing according to some objective. These loss functions use different mathematical computations to measure this performance, and thus they have different effects on the optimization process during model training. Choosing a loss function is more of an art than a science, and there is no simple heuristic for deciding which one to select. Instead, you can examine the extensive research on each these loss functions to get a perspective on when these loss functions were applied successfully and when not so successfully.

This release also introduces helpful additions like an export API and a learning rate property for the trainer optimizer function. The export API enables you to export your neural network model architecture and the associated model parameters to an intermediary format that can used to load the model at a later point or in a different location. This API is still experimental, so all functionality isn’t yet supported. In addition, you can now set and read the learning rate using the newly added learning rate property of trainer.

Next steps

Getting started with MXNet is simple, and a full list of changes in this release can be found in the release notes. To learn more about the Gluon interface, visit the MXNet details page or the tutorials.


About the Author

 

Vikram Madan is a Senior Product Manager for AWS Deep Learning. He works on products that make deep learning engines easier to use with a specific focus on the open source Apache MXNet engine. In his spare time, he enjoys running long distances and watching documentaries.

 

 

 

Powered by WPeMatico

The post Apache MXNet Version 0.12 Extends Gluon Functionality to Support Cutting Edge Research appeared first on Artificial Intelligence Solutions.

Read More...

Monday, 6 November 2017

Understand Movie Star Social Networks Using Amazon Rekognition and Graph Databases

Leave a Comment
Read More...

AWS Collaborates with Emory University to Develop Cloud-Based NLP Research Platform Using Apache MXNet

Leave a Comment

Natural Language Processing (NLP) is a research field in artificial intelligence that aims to develop computer programs’ understanding of human (natural) language. Even if you don’t know much about NLP, there is a good chance that you have been using it daily. Whenever you type a word using the virtual keyboard on your phone, it gives you a list of suggestions for the next word to type by analyzing the content. This is a technique known as language modeling, one of the core tasks in NLP, which measures the probabilities of words likely to follow the one you just typed based on the content. NLP has been adapted by many applications and has begun to make a real impact in the world.

The Evolution of Language and Information Technology (ELIT) team is a group of NLP researchers at Emory University focused on bringing the state-of-the-art NLP and machine learning technology to the research community. The primary focus of the ELIT project is to provide an end-to-end NLP pipeline scalable for big data analysis using the rich resources of the AWS Cloud.  Unlike many other NLP frameworks, ELIT supports a web API, making it platform independent. This way researchers can enjoy large-scale computing anywhere, anytime. The ELIT project is also on GitHub. It was developed by the Emory NLP research group in active collaboration with the AWS MXNet team. In this blog post, we describe the ELIT platform and give a demonstration of its web API, as well as NLP visualization.

The ELIT research platform

With the recent advent of deep learning in NLP, machine-learning-based NLP models began demanding extensive computing power, making it difficult for researchers without powerful machines to leverage the latest techniques in NLP. Cloud computing platforms such as AWS provide researchers with unlimited computing resources to run those models. However, this can be cumbersome for those who are not so familiar with the cloud.  The motivation behind the ELIT project is to provide a web service for NLP so that anyone with an internet connection can make a request to the service. No local installation or prior-knowledge about cloud computing is required. The following are examples of how to leverage the ELIT platform for popular NLP tasks, such as sentiment analysis.

Sentiment analysis

Before we walk through the demo, we’ll briefly explain our approach to sentiment analysis, a task of classifying each document into one of three sentiments, negative, neutral, and positive. ELIT provides two Convolutional Neural Network models for sentiment analysis that allow us to analyze data from social media and movie reviews. Given an input document, either a tweet or a movie review, it first creates an input matrix by stacking the vector representation of each word. The input matrix is then fed into the convolution and pooling layer and the convolved output is matched with the attention matrix that measures the intensity of each n-gram in the input document (in our case, n = [1, …, 5]). Finally, the attention output is fed into the softmax layer that predicts the probabilities of negative, neutral, and positive sentiments for the input (see Shin et al., 2017 for more details about our CNN models).

Demonstration

We’ll start with a screenshot from the ELIT demo page (http://demo.elit.cloud/):

On the top left, there is a text box containing the input text, “I watch “the Sound of Music” last night. The ending could have been better. It’s my favorite movie though.”:

On the top right, there are options for tokenization, sentence segmentation, and sentiment analysis with either the Twitter or the movie review model. Currently, the tokenization, segmentation, and sentiment analysis with the movie model are selected:

When you choose the Analyze button, the input text is sent to the ELIT server that runs the selected NLP pipeline, and returns the following output:

The ELIT sentiment visualizer codes the sentiment of each sentence into a color, where red, green, and blue represent the negative, neutral, and positive sentiments, respectively. It also gives an option of depicting which words contribute the most to make those predictions. In the following example, words with small contributions are visualized with higher opacities:

It’s possible to visualize the intensity levels of the words by scales. In the following example, words with high contributions are represented with bigger circles:

Of course, it’s possible to visualize the intensity using both the opacity and scale options:

Web API

The NLP output can be retrieved by the web API using any programming language of your choice. The following shows simple Python code that requests the NLP output for the input text in our example:

import requests

r = requests.post('http://ift.tt/2zmS17C', data={'text': 'I watch “the Sound of Music” last night. The ending could have been better. It’s my favorite movie though.', 'input_format': 'raw', 'tokenize': 1, 'segment': 1, 'sentiment': 'mov'})

print(r.text)

Upon the request, ELIT takes the input as raw text and runs the NLP pipeline for tokenization, sentence segmentation, and sentiment analysis with the movie model, and returns the output through HTTP. The last line prints the NLP output in the JSON format:

[[{"tokens": ["I", "watched", "u201c", "the", "Sound", "of", "Music", "u201d", "last", "night", "."], "offsets": [[0, 1], [2, 9], [10, 11], [11, 14], [15, 20], [21, 23], [24, 29], [29, 30], [31, 35], [36, 41], [41, 42]]}, "sentiment": [0.352990984916687, 0.37940868735313416, 0.26760029792785645],
{"tokens": ["The", "ending", "could", "have", "been", "better", "."], "offsets": [[43, 46], [47, 53], [54, 59], [60, 64], [65, 69], [70, 76], [76, 77]], "sentiment": [0.6561509370803833, 0.17596498131752014, 0.16788406670093536]},
{"tokens": ["It", "u2019s", "my", "favorite", "movie", "though", "."], "offsets": [[78, 80], [80, 82], [83, 85], [86, 94], [95, 100], [101, 107], [107, 108]], "sentiment-mov": [0.021425940096378326, 0.038874078541994095, 0.9397000074386597]}]]

The JSON output follows the format below:

  • documents: a list of documents → [document, …, document]
  • document: a list of sentences → [sentence, …, sentence]
  • sentence: a dictionary whose keys are {tokens, offsets, sentiment}
    • tokens: a list of tokens in the sentence.
    • offsets: a list of offsets indicating the positions of their corresponding tokens in the original text. Each offset is represented by a pair [begin, end] implying the beginning (inclusive) and the ending (exclusive) offsets of the token. The beginning of each document is set to 0 in these offsets.
    • sentiment: a list of [negative, neural, positive] sentiment scores for the sentence.

For more details, visit http://ift.tt/2y9S9po.

Decoding framework

Decoding is supported for both non-registered and registered users. For cost reasons, non-registered users are limited to HTTP requests with input text ≤ 1 MB, whereas registered users can make HTTP requests up to 10 MB. Additionally, registered users can make requests with files containing text ≤ 1 GB. All requests go through the Elastic Load Balancer to ensure scalability. Once the web API server receives a request, it sends the request to the NLP server that generates the NLP output from the input text. If the requested text is greater than 10 MB, the NLP server saves the output to Amazon S3 storage. Finally, the output is sent back to the web API server that stores the information to the database and sends the NLP output to the user.

Roadmap

ELIT currently supports three NLP tasks: tokenization, segmentation, and sentiment analysis. By the second quarter of 2018, the plan is to support most of the core NLP tasks such as part-of-speech tagging, morphological analysis, named entity recognition, dependency parsing, semantic role labeling, and coreference resolution. It will also provide an interface for training custom models. Since ELIT is an open-source project, we are aspiring to attract community involvement to help take the project forward. The following figure shows the projected project milestones:

Additional Resources

Reference

Bonggun Shin, Timothy Lee, and Jinho D. Choi. Lexicon Integrated CNN Models with Attention for Sentiment Analysis. In Proceedings of the EMNLP Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, WASSA’17, 149-158, Copenhagen, Denmark, 2017.


About the Authors

Jinho Choi is an assistant professor of Computer Science at Emory University. He has been active in NLP research, especially on the optimization of core NLP tasks for robustness and scalability. He developed an open source project called NLP4J, previously known as ClearNLP, providing NLP components showing state-of-the-art accuracy and speed, which has been widely used for both academic and industrial research. Recently, he started a new project called “Character Mining” that aims to infer explicit and implicit contexts about individual characters in colloquial writing such as dialogs and emails.

 

Joseph Spisak leads AWS’ partner ecosystem focused on Artificial Intelligence and Machine Learning. He has more than 17 years in deep tech working for companies such as Amazon, Intel and Motorola focused mainly on Video, Machine Learning and AI. In his spare time, he plays ice hockey and reads sci-fi.

 

 


The ELIT Team at Emory University

Gary Lai is a Ph.D. student in Computer Science at Emory University.  He is the founder of Jungllle Inc. that provides services for web, app, and API server development. He is the main research scientist of the ELIT project, focusing on the optimization of NLP components for large-scale computing as well as the development of backend API and a scalable infrastructure based on Amazon Web Services (AWS).

 

Bonggun Shin is a Ph.D. student in Computer Science at Emory University. His research focuses on the development of deep learning algorithms in NLP, especially on designing an interpretable document classification model so that the deep learning model is no longer a black-box but becomes comprehensible. Such interpretation helps researchers to understand the behavior of the statistical model, which enables the method to be more practical in reality.

 

Tyler Angert is a senior undergraduate in Computer Science and Math at Emory University. With a background in art and graphic design, he uses Computer Science to visualize data and implement novel user experience concepts. Apart from NLP research, he is involved in mobile health research, studying pediatric asthma management, autism, and using augmented reality (AR) as a new tool in physical therapy.

 

 

Powered by WPeMatico

The post AWS Collaborates with Emory University to Develop Cloud-Based NLP Research Platform Using Apache MXNet appeared first on Artificial Intelligence Solutions.

Read More...

ShareThis