Introduction and Background
As the title suggests, this post is a personal recommendation for the users of Microsoft Cognitive Services, as these are the Services, which provide a Cloud-based subscription-based solution for artificially intelligent software applications, within any team, any purpose and any scale commitment. We all know Microsoft is investing a lot in manpower, promotion and commitment in Azure nowadays and almost every solution is dancing around the margins of Azure in one way or the other. They come back to the same conclusion, that the solution can be purchased as a software-as-a-Service from Azure — there are many other names, Platform-as-a-Service, Service-as-a-Service, choose yours from the pool, as liked.
In this post, I am going to cover up the most important points that your team should understand before migrating to Microsoft Cognitive Services.
Background of Microsoft Cognitive Services
Anyone, who has no idea of what Microsoft Cognitive Services are Microsoft Cognitive Services are a bundle of Services, which are provided by Microsoft to the individuals, team and/or organizations of any size and any scale to provide Services that require complex machine learning or artificially intelligent responses.
It is a tough task to accomplish the machine learning and with just one wrong input, your entire algorithm can go to {add slang here}. Microsoft is providing the Service, where you must only provide the inputs for the algorithm and you get the output. Microsoft itself manages the way algorithms are going to be fine-tuned or the performance of the algorithms.
It is a subscription based Service, provided as a Service in Azure now. In this post, you will know how likely Cognitive Services are of any help to you.
Tip #0 Ask (Convince) your boss
Microsoft Cognitive Services are tested against thousands (if not millions) of the users, data records, entities and the algorithms are concrete. You cannot meet the level, where Microsoft Cognitive Services are providing the Services, the reason is that Microsoft has partnered with quite a lot of academics’ professors, developers, teams and organizations and even most of the times, online surfers show up and share some data to Cloud — all of which are under a license and Microsoft asks for the permission but I am not here to cover up the license terms anyways.
Get the permissions, so that we may continue this post.
Tip #1
Cognitive Services are a library of Services. There are lot of Services, which are already added to the library and many are being added every month but this doesn’t mean, you should consider all of them or even half of them. They are all categorized under different sub sections, which contains collective Services provided by Microsoft CS,
- Vision
- This set of Services contains face APIs, such as recognition and tracking.
- It also provides Services, which can extract the features from faces such as age, emotion detection.
- It also provides computer vision, which can allow the users to perform OCR functions on the images.
- Speech
- It allows your users to trigger the functions, which are based on their vocal commands i.e. Natural language processing.
- Speaker Recognition — bleeding-edge technology.
- Speech to text and text to speech Services.
- Language
- It allows you to perform linguistic analysis of the text.
- You can use the previous Services to perform analysis on the photos as well, so that you read the text, using OCR and then analyze the text.
- LUIS (Language Understanding Intelligent Service) is new.
- Knowledge
- Recommender systems.
- Anything that requires complex academic, or research stuff.
- Search
- The old Bing APIs are now provided here…
Likewise, you can see that these are the categories and even these categories have different API sets and Services, which you might want to consume. It is up to you to select, which one you need.
In simple words, read the text from the images, convert them to speech and communicate. All you need to purchase is, “Computer Vision API”, and “Bing Speech API”. Your Application won’t need the rest of the Services. LUIS can be added finally to support the communication later.
There will be more Services and you can always add up more Services but if you are no longer using a Service or your Application is not related to a Service, there is no need to purchase a key for this Service.
Tip #2
Microsoft CS is provided from different areas (all Microsoft properties), such as LUIS and can be accessed through luis.ai and vice versa but you should keep the family tight and keep all the keys and resources in Azure. Thus, you can manage everything from a single subscription, instead of having to look at various accounts to configure and consume the Applications.
Microsoft CS supports REST-based API (and we will cover this in a later tip given below), so it is very easy to add the keys to the URL and start consuming the Services.
You can manage all the keys within Azure, just head over to the Cognitive Services blade and open the Application, which you want to get the keys for. Under the “Keys” section, look for the keys, which you can use to authenticate the requests.

Figure 1 List of the Cognitive Services associated with the account.
I have 4 services active, that I can access in the Azure through REST APIs. How simple that is! You can add more keys, add more services, update the keys… All from within Azure! By the end of this post, you will realize the importance of this tip.
Tip #3
Microsoft CS Azure endpoints are provided as REST API endpoints, then you can access it through any HTTP client — even a Web browser. The REST API, since working on HTTP protocol, allows you to make the best use of HTTP protocol and send/receive information. Currently, Microsoft CS supports two ways of uploading the information to the cloud,
- URL based
- Binary data base
These are the two ways that you can deliver the content to Azure for processing. Apart from this, the only required header for the request is the subscription key, added to the header of “Ocp-Apim-Subscription-Key“, which is processed first and the rest of the stuff is processed later, which is based on the subscription information.
Example
Now, let me show you a little example in WPF Application of consuming the Computer Vision API to detect what the image is all about. Azure will result in a complete sentence, which explains the image and the objects in the image as well as the task being done.
XAML code for WPF Application is given below.





Ehsan SajjadPosted Mar 17, 2017, 3:39 AM
Useful Tips Afzaal Ahmad Zeeshan :) Keep posting.