Comparing Machine Learning as a Service: Amazon, Microsoft Azure, Google Cloud AI
For most businesses, machine learning seems close to rocket science, appearing expensive and talent demanding. And, if you’re aiming at building another Netflix recommendation system, it really is. But the trend of making everything-as-a-service has affected this sophisticated sphere, too. You can jump-start an ML initiative without much investment, which would be the right move if you are new to data science and just want to grab the low hanging fruit.
One of ML’s most inspiring stories is the one about a Japanese farmer who decided to sort cucumbers automatically to help his parents with this painstaking operation. Unlike the stories that abound about large enterprises, the guy had neither expertise in machine learning, nor a big budget. But he did manage to get familiar with TensorFlow and employed deep learning to recognize different classes of cucumbers.
By using machine-learning cloud services, you can start building your first working models, yielding valuable insights from predictions with a relatively small team. We’ve already discussed machine learning strategy. Now let’s have a look at the best machine learning platforms on the market and consider some of the infrastructural decisions to be made.
What is machine learning as a service
Machine learning as a service (MLaaS) is an umbrella definition of automated and semi-automated cloud platforms that cover most infrastructure issues such as data pre-processing, model training, and model evaluation, with further prediction. Prediction results can be bridged with your internal IT infrastructure through REST APIs.
Amazon Machine Learning services, Azure Machine Learning, and Google Cloud AI are three leading cloud MLaaS services that allow for fast model training and deployment with little to no data science expertise. These should be considered first if you assemble a homegrown data science team out of available software engineers. Have a look at our data science team structures story to have a better idea of roles distribution.
Within this article, we’ll first give an overview of the main machine-learning-as-a-service platforms by Amazon, Google, and Microsoft, and will follow it by comparing machine learning APIs that these vendors support. Please note that this overview isn’t intended to provide exhaustive instructions on when and how to use these platforms, but rather what to look for before you start reading through their documentation.
Machine learning services for custom predictive analytics tasks
Azure ML studio has the most comprehensive set of services; however, we also recommend looking at Amazon SageMaker and Google ML Engine if your tasks require the use of deep neural networks
Predictive analytics with Amazon ML
Amazon Machine Learning services are available on two levels: predictive analytics with Amazon ML and the SageMaker tool for data scientists.
Amazon Machine Learning for predictive analytics is one of the most automated solutions on the market and the best fit for deadline-sensitive operations. The service can load data from multiple sources, including Amazon RDS, Amazon Redshift, CSV files, etc. All data preprocessing operations are performed automatically: The service identifies which fields are categorical and which are numerical, and it doesn’t ask a user to choose the methods of further data preprocessing (dimensionality reduction and whitening).
Prediction capacities of Amazon ML are limited to three options: binary classification, multiclass classification, and regression. That said, this Amazon ML service doesn’t support any unsupervised learning methods, and a user must select a target variable to label it in a training set. Also, a user isn’t required to know any machine learning methods because Amazon chooses them automatically after looking at the provided data.
This high automation level acts both as an advantage and disadvantage for Amazon ML use. If you need a fully automated yet limited solution, the service can match your expectations. If not, there’s SageMaker.
Amazon SageMaker and frameworks-based services
SageMaker is a machine learning environment that’s supposed to simplify the work of a fellow data scientist by providing tools for quick model building and deployment. For instance, it provides Jupyter, an authoring notebook, to simplify data exploration and analysis without server management hassle. Amazon also has built-in algorithms that are optimized for large datasets and computations in distributed systems. These include:
- Linear learner, a supervised method for classification and regression
- Factorization machines for classification and regression designed for sparse datasets
- XGBoost is a supervised boosted trees algorithm that increases prediction accuracy in classification, regression, and ranking by combining the predictions of simpler algorithms
- Image classification based on ResNet, which can also be applied for transfer learning
- Seq2seq is a supervised algorithm for predicting sequences (e.g. translating sentences, converting strings of words into shorter ones as a summary, etc.)
- K-means is an unsupervised learning method for clustering tasks
- Principal component analysis used for dimensionality reduction
- Latent Dirichlet allocation is an unsupervised method used for finding categories in documents
- Neural topic model (NTM) is an unsupervised method that explores documents, reveals top ranking words, and defines the topics (users can’t predefine topics, but they can set the expected number of them)
Built-in SageMaker methods largely intersect with the ML APIs that Amazon suggests, but here it allows data scientists to play with them and use their own datasets.
If you don’t want to use these, you can add your own methods and run models via SageMaker leveraging its deployment features. Or you can integrate SageMaker with TensorFlow and MXNet, deep learning libraries.
Generally, Amazon machine learning services provide enough freedom for both experienced data scientists and those who just need things done without digging deeper into dataset preparations and modeling. This would be a solid choice for companies that already use Amazon environment and don’t plan to transition to another cloud provider.
Microsoft Azure Machine Learning Studio
Azure Machine Learning is aimed at setting a powerful playground both for newcomers and experienced data scientists. The roster of ML products from Microsoft is similar to the ones from Amazon, but Azure, as of today, seems more flexible in terms of out-of-the-box algorithms.
Services from Azure can be divided into two main categories: Azure Machine Learning Studio and Bot Service. Let’s find out what’s under the hood of Azure ML Studio. We’ll return to Bot Service in the section dedicated to specific APIs and tools.
ML Studio is the main MLaaS package to look at. Almost all operations in Azure ML Studio must be completed manually. This includes data exploration, preprocessing, choosing methods, and validating modeling results.
Approaching machine learning with Azure entails some learning curve. But it eventually leads to a deeper understanding of all major techniques in the field. On the other hand, Azure ML supports graphical interface to visualize each step within the workflow. Perhaps the main benefit of using Azure is the variety of algorithms available to play with. The Studio supports around 100 methods that address classification (binary+multiclass), anomaly detection, regression, recommendation, and text analysis. It’s worth mentioning that the platform has one clustering algorithm (K-means).
Another big part of Azure ML is Cortana Intelligence Gallery. It’s a collection of machine learning solutions provided by the community to be explored and reused by data scientists. The Azure product is a powerful tool for starting with machine learning and introducing its capabilities to new employees.
Google Prediction API
Google provides AI services on two levels: a machine learning engine for savvy data scientists and highly automated Google Prediction API. Unfortunately, Google Prediction API has been deprecated recently and Google is pulling the plug on April 30, 2018.
The doomed Predicion API resembles Amazon ML. Its minimalistic approach narrows down to solving two main issues: classification (both binary and multiclass) and regression. Trained models can be deployed through the REST API interface.
Google doesn’t disclose exactly which algorithms were utilized for drawing predictions and didn’t allow engineers to customize models. On the other hand, Google’s environment was the best fit for running machine learning within tight deadlines and the early launch of the ML initiative. But it seems that the product wasn’t nearly as popular as Google expected. It’s a shame that those who were using Prediction API will have to “recreate existing models” using other platforms as the end-of-life FAQ suggests.
So, what’s coming instead?
Google Cloud Machine Learning Engine
High automation of Prediction API was available at the cost of flexibility. Google ML Engine is the direct opposite. It caters to experienced data scientists, it’s very flexible, and it suggests using cloud infrastructure with TensorFlow as a machine learning driver. So, ML Engine is pretty similar to SageMaker in principle.
TensorFlow is another Google product, which is an open source machine learning library of various data science tools rather than ML-as-a-service. It doesn’t have visual interface and the learning curve for TensorFlow would be quite steep. However, the library is also targeted at software engineers that plan transitioning to data science. TensorFlow is quite powerful, but aimed mostly at deep neural network tasks.
Basically, the combination of TensorFlow and Google Cloud service suggests infrastructure-as-a-service and platform-as-a-service solutions according to the three-tier model of cloud services. We talked about this concept in our whitepaper on digital transformation. Have a look, if you aren’t familiar with it.
To wrap up machine-learning-as-a-service platforms, it seems that Azure currently has the most versatile toolset on the MLaaS market. It covers most ML-related tasks, provides a visualization interface for building custom models, and has a solid set of APIs for those who don’t want to nail data science with their bare hands. However, it still lacks automation capacities available at Amazon.
Machine learning APIs from Amazon, Microsoft, and Google comparison
Besides full-blown platforms, you can use high-level APIs. These are the services with trained models under the hood that you can feed your data into and get results. APIs don’t require machine learning expertise at all. Currently, the APIs from these three vendors can be broadly divided into three large groups:
1) text recognition, translation, and textual analysis
2) image + video recognition and related analysis
3) other, that includes specific uncategorized services
Microsoft suggests the richest list of features. However, the most critical ones are available from all vendors
Speech and text processing APIs: Amazon
Amazon provides multiple APIs that aim at popular tasks within text analysis. These are also highly automated in terms of machine learning and just need proper integration to work.
Amazon Lex. The Lex API is created to embed chatbots in your applications as it contains automatic speech recognition (ASR) and natural language processing (NLP) capacities. These are based on deep learning models. The API can recognize written and spoken text and the Lex interface allows you to hook the recognized inputs to various back-end solutions. Obviously, Amazon encourages use of its Lambda cloud environment. So, prior to subscribing to Lex, get acquainted with Lambda as well. Besides standalone apps, Lex currently supports deploying chatbots for Facebook Messenger, Slack, and Twilio.
Amazon Transcribe. While Lex is a complex chatbot-oriented tool, Transcribe is created solely for recognizing spoken text. The tool can recognize multiple speakers and works with low-quality telephony audio. This makes the API a go-to solution for cataloging audio archives or a good support for the further text analysis of call-center data.
Amazon Polly. The Polly service is kind of a reverse of Lex. It turns text into speech, which will allow your chatbots to respond with voice. It’s not going to compose the text though, just make the text sound close to human. If you’ve ever tried Alexa, you’ve got the idea. Currently, it supports both female and male voices for 25 languages, mostly English and Western European ones. Some languages have multiple female and male voices, so there’s even a variety to choose from. Like Lex, Polly is recommended for use with Lambda.
Amazon Comprehend. Comprehend is another NLP set of APIs that, unlike Lex and Transcribe, aim at different text analysis tasks. Currently, Comprehend supports:
- Entities extraction (recognizing names, dates, organizations, etc.)
- Key phrase detection
- Language recognition
- Sentiment analysis (how positive, neutral, or negative a text is)
- Topic modeling (defining dominant topics by analyzing keywords)
This service will help you analyze social media responses, comments, and other big textual data that’s not amenable to manual analysis, e.g. the combo of Comprehend and Transcribe will help analyze sentiment in your telephony-driven customer service.
Amazon Translate. As the name states, the Translate service translates texts. Amazon claims that it uses neural networks which – compared to rule-based translation approaches – provides better translation quality. Unfortunately, the current version supports translation from only six languages into English and from English into those six. The languages are Arabic, Chinese, French, German, Portuguese, and Spanish.
Speech and text processing APIs: Microsoft Azure Cognitive Services
Just like Amazon, Microsoft suggests high-level APIs, Cognitive Services, that can be integrated with your infrastructure and perform tasks with no data science expertise needed.
Speech. The speech set contains four APIs that apply different types of natural language processing (NLP) techniques for natural speech recognition and other operations:
- Translator Speech API
- Bing Speech API to convert text into speech and speech into text
- Speaker Recognition API for voice verification tasks
- Custom Speech Service to apply Azure NLP capacities using own data and models
Language. The language group of APIs focuses on textual analysis similar to Amazon Comprehend:
- Language Understanding Intelligent Service is an API that analyzes intentions in text to be recognized as commands (e.g. “run YouTube app” or “turn on the living room lights”)
- Text Analysis API for sentiment analysis and defining topics
- Bing Spell Check
- Translator Text API
- Web Language Model API that estimates probabilities of words combinations and supports word autocompletion
- Linguistic Analysis API used for sentence separation, tagging the parts of speech, and dividing texts into labeled phrases
Speech and text processing APIs: Google Cloud Services
While this set of APIs mainly intersects with what Amazon and Microsoft Azure suggest, it has some interesting and unique things to look at.
Dialogflow. With various chatbots topping today’s trends, Google also has something to offer. Dialogflow is powered by NLP technologies and aims at defining intents in the text, and interpreting what a person wants. The API can be tweaked and customized for needed intents using Java, Node.js, and Python.
Cloud natural language API. This one is almost identical in its core features to Comprehend by Amazon and Language by Microsoft.
- Defining entities in text
- Recognizing sentiment
- Analyzing syntax structures
- Categorizing topics (e.g. food, news, electronics, etc.)
Cloud speech API. This service recognizes natural speech, and perhaps its main benefit compared to similar APIs is the abundance of languages supported by Google. Currently, its vocab works with over 110 global languages and variants of them. It also has some additional features:
- Word hints allow for customizing recognition to specific contexts and words that can be spoken (e.g. for better understanding of local or industry jargon)
- Filtering inappropriate content
- Handling noisy audio
Cloud translation API. Basically, you can use this API to employ Google Translate in your products. This one includes over a hundred languages and automatic language detection.
Besides text and speech, Amazon, Microsoft, and Google provide rather versatile APIs for image and video analysis.
The most versatile toolkit for image analysis is currently available at Google Cloud
While image analysis closely intersects with video APIs, many tools for video analysis are still in development or beta versions. For instance, Google suggests rich support for various image processing tasks but definitely lacks video analysis features already available at Microsoft and Amazon.
Microsoft looks like a winner, though we still think that Amazon has the most efficient video analysis APIs as it supports streaming videos. This feature tangibly extends the spectrum of use cases
Image and video processing APIs: Amazon Rekognition
No, we didn’t misspell the word. The Rekognition API is used for image and, recently, video recognition tasks. They include:
- Objects detection and classification (find and detect different objects in images and define what they are)
- In videos, it can detect activities like “dancing” or complex actions like “extinguishing fire”
- Face recognition (for detecting faces and finding matching ones) and facial analysis (this one is pretty interesting as it detects smiles, analyzes eyes, and even defines emotional sentiment in videos)
- Detecting inappropriate videos
- Recognizing celebrities in images and videos (for whatever goals that might be)
Image and video processing APIs: Microsoft Azure Cognitive Services
The Vision package from Microsoft combines six APIs that focus on different types of image, video, and text analysis.
- Computer vision that recognizes objects, actions (e.g. walking), and defines dominant colors in images
- Content moderator detects inappropriate content in images, texts, and videos
- Face API detects faces, groups them, defines age, emotions, genders, poses, smiles, and facial hair
- Emotion API is another face recognition tool that describes facial expressions
- Custom Vision Service supports building custom image recognition models using your own data
- Video indexer is a tool to find people in videos, define sentiment of speech, and mark keywords
Image and video processing APIs: Google Cloud Services
Cloud vision API. The tool is built for image recognition tasks and is quite powerful for finding specific image attributes:
- Labeling objects
- Detecting faces and analyzing expressions
- Finding landmarks and describing the scene (e.g. vacation, wedding, etc.)
- Finding texts in images and identifying languages
- Dominant colors
Cloud Video Intelligence. The video recognition API from Google is early in development so it lacks many features available with Amazon Rekognition and Microsoft Cognitive Services. Currently, the API provides the following toolset:
- Labeling objects and defining actions
- Identifying explicit content
- Transcribing speech
While on the feature-list level Google AI services may be lacking some abilities, the power of Google APIs is in the vast datasets that Google has access to.
Specific APIs and tools
Here, we’ll discuss specific API offerings and tools that come from Microsoft and Google. We didn’t include Amazon here, as their sets of APIs merely match the above-mentioned categories of text analysis and image+video analysis. However, some of the capacities of these specific APIs are also present in Amazon products.
Azure Service Bot framework. Microsoft has put a lot of effort into providing its users with flexible bot development toolset. Basically, the service contains a full-blown environment for building, testing, and deploying bots using different programming languages.
Interestingly, the Bot Service doesn’t necessarily require machine learning approaches. As Microsoft provides five templates for bots (basic, form, language understanding, proactive, and Q&A), only the language understanding type requires advanced AI techniques.
Currently, you can use .NET and Node.js technologies to build bots with Azure and deploy them on the following platforms and services:
- Web Chat
- Office 365 email
- Facebook Messenger
Bing Search from Microsoft. Microsoft suggests seven APIs that connect with the core Bing search features, including autosuggest, news, image, and video search.
Knowledge from Microsoft. This APIs group combines text analysis with a broad spectrum of unique tasks:
- Recommendations API allows for building recommender systems for purchase personalization
- Knowledge Exploration Service allows you to type in natural queries to retrieve data from databases, visualize data, and autocomplete queries
- Entity Linking Intelligence API is designed to highlight names and phrases that denote proper entities (e.g. Age of Exploration) and ensure disambiguation
- Academic Knowledge API does word autocompletion, finds similarities in documents both in words and concepts, and searches for graph patterns in documents
- QnA Maker API can be used to match variations of questions with answers to build customer care chatbots and applications
- Custom Decision Service is a reinforcement learning tool to personalize and rank different types of content (e.g. links, ads, etc.) depending on user’s preferences
Google Cloud Job Discovery. The API is still in the early development, but soon it may redefine the job search capacities that we have today. Unlike conventional job search engines that rely on precise keyword matches, Google employs machine learning to find relevant connections between highly variative job descriptions and avoid ambiguity. For instance, it strives to reduce irrelevant or too broad returns, like returning all jobs with the keyword “assistant” for the query “sales assistant.” What are the main features of the API?
- Fixing spelling errors in job search queries
- Matching the desired seniority level
- Finding relevant jobs that may have variative expressions and industry jargon involved (e.g. returning “barista” for the “server” query instead of “network specialist”; or “engagement specialist” for the “biz dev” query)
- Dealing with acronyms (e.g. returning “human resources assistant” for the “HR” query)
- Matching variative location descriptions
IBM Watson and others
All three platforms described before provide quite an exhaustive documentation to jump-start machine learning experiments and deploy trained models in a corporate infrastructure. There are also a number of other ML-as-a-service solutions that come from startups, and are respected by data scientists, like PredicSis and BigML.
But what about IBM Watson Analytics?
IBM Watson Analytics isn’t yet a full-fledged machine learning platform for the purpose of business prediction. Currently, Watson’s strength is visualizing data and describing how different values in it interact. It also has visual recognition service similar to what Google offers and a set of other cognitive services (APIs). The current problem with Watson is that the system performs narrow and relatively simple tasks that are easy to operate for non-professionals. When it comes to custom machine learning or prediction duties, it’s too early in its development to consider IBM Watson.
Finding the right storage for collecting data and further processing it with machine learning is no longer a great challenge, assuming that your data scientists have enough knowledge to operate popular storage solutions.
In most cases, machine learning requires both SQL and NoSQL database schemes, which are supported by many established and trusted solutions like Hadoop Distributed File System (HDFS), Cassandra, Amazon S3, and Redshift. For organizations that have used powerful storage systems before embarking on machine learning, this won’t be a barrier. If you plan to work with some ML-as-a-service system, the most straightforward way is to choose the same provider both for storage and machine learning as this will reduce time spent on configuring a data source.
However, some of these platforms can be easily integrated with other storages. Azure ML, for instance, mainly integrates with other Microsoft products (Azure SQL, Azure Table, Azure Blob) but also supports Hadoop and a handful of other data source options. These include direct data upload from a desktop or on-premise server. The challenges may arise if your machine learning workflow is diversified and data comes from multiple sources.
Modeling and computing
We’ve discussed ML-as-a-service solutions that mainly provide computing capacities. But if the learning workflow is performed internally, the computing challenge will strike sooner or later. Machine learning in most cases requires much computing power. Data sampling (making a curated subset) is still a relevant practice, regardless of the fact that the era of big data has come. While model prototyping can be done on a laptop, training a complex model using a large dataset requires investment into more powerful hardware. The same applies to data preprocessing, which can take days on regular office machines. In a deadline-sensitive environment – where sometimes models should be altered and retrained weekly or daily – this simply isn’t an option. There are three viable approaches to handling processing while keeping high performance:
- Accelerate hardware. If you do relatively simple tasks and don’t apply your models for big data, use solid-state drives (SSDs) for such tasks as data preparation or using analytics software. Computationally intensive operations can be addressed with one or several graphical processing units (GPUs). A number of libraries are available to let GPUs process models written even with such high-level languages as Python.
- Consider distributed computing. Distributed computing implies having multiple machines with tasks split across them. However, this approach isn’t going to work for all machine learning techniques.
- Use cloud computing for scalability. If your models process customer-related data that has intensive peak-moments, cloud computing services will allow for rapid scalability. For the companies that are required to have their data on-premise only, it’s worth considering private cloud infrastructure.
The next move
It’s easy to get lost in the variety of solutions available. They differ in terms of algorithms, they differ in terms of required skillsets, and eventually they differ in tasks. This situation is quite common for this young market as even the three leading solutions that we’ve talked about aren’t fully competitive with each other. And more than that, the velocity of change is impressive. There’s a high likelihood that you’ll stick with one vendor and suddenly another one will roll out something unexpectedly that matches your business needs.
The right move is to articulate what you plan to achieve with machine learning as early as possible. It’s not easy. Creating a bridge between data science and business value is tricky if you lack either data science or domain expertise. We at AltexSoft encounter this problem often when discussing machine learning applications with our clients. It’s usually a matter of simplifying the general problem to a single attribute. Whether it’s the price forecast or another numeric value, the class of an object or segregation of objects into multiple groups, once you find this attribute, deciding the vendor and choosing what’s proposed will be simpler.
Bradford Cross, founding partner at DCVC, argues that ML-as-a-services isn’t a viable business model. According to him, it falls in the gap between data scientists who are going to use open source products and executives who are going to buy tools solving tasks at the higher levels. However, it seems that the industry is currently overcoming its teething problems and eventually we’ll see far more companies turning to ML-as-a-service to avoid expensive talent acquisitions and still possess versatile data tools.