Machine Learning(ML)

Azure Cognitive Services–Experience Image Recognition using Custom Vision (Build an Harrison Ford Classifier)

December 23, 2018 Algorithms, Artificial Intelligence(AI), Azure AI, Cognitive Services, Compuer Vision Service, Computer Vision API, Custom Vision API, Custom Vision Service, Emerging Technologies, Machine Learning(ML) No comments

Custom Vision Service as part of Azure Cognitive Services landscape of pretrained API services, provides you an ability to customize the state-of-the-art Computer Vision models for your specific use case.

Using custom vision service you can upload set of images of your choice and categorize them accordingly using tags/categories and automatically train the image recognition classifiers to learn from these images and come up with image recognition predictions when you supply an input image. Later consume this service as an API in your existing applications.

image

For example:  Here is how an image of Hollywood Actor – Harrison ford being accurately predicted by the custom model through training using a series of pictures of Harrison Ford through different ages and shapes.

I build this sample during Global AI Bootcamp Letterkenny– Hands on Labs, and will take you further through this article. Harrison Ford is my all time favourite actor.

image

Another example, Harrison Ford was one among 3 in a photo. Here is how the results would look like.

image

Here is how Harrison Ford’ sons picture is being predicted as Harrison Ford, due to similar facial characteristics. |f we further train this model, we can improve it’s capabilities to come up with accurate predictions.

image

Now let us see, how it was implemented.

In this article I am going to use a set of Harrison Ford images found on Google Images and then upload them to Custom Vision service like below. For more accuracy, I tried to collect images of Harrison Ford through different stages of his life, so that computer vision model could evolve to predict more accurate results.

image

Getting Started with Custom Vision:

The Azure Custom Vision API is a cognitive service that lets you build, deploy and improve custom image classifiers. An image classifier is an AI service that sorts images into classes (tags) according to certain characteristics. Unlike the Computer Vision service, Custom Vision allows you to create your own classifications. The Custom Vision service uses a machine learning algorithm to classify images.

Classification and object detection

Custom Vision functionality can be divided into two features. Image classification assigns a distribution of classifications to each image. Object detection is similar, but it also returns the coordinates in the image where the applied tags can be found.

To get started with our example,  first you need to have a Microsoft Account and Register/Login to https://www.customvision.ai

There going to be five steps of activities we are going to do:

1. Setup a Custom Vision Project

Create a new Project by selecting ‘New Project’ button

image

Specify the naming as the followed:

  • Name: HarrisonFordClassifier
  • Description: HarrisonFordClassifier
  • Resource Group: Leave it default to ‘Limited Trial’
  • Project Types: Classification
  • Classification Types: Multi Label (this is essential, we are going to add multiple tags per image in this example: for say ‘Actor’, ‘Person’ and ‘Harrison Ford’
  • Domain: General (for now)

image

2. Upload the Images

a.) Prepare Images

I have gathered a set of images you can download it from here, and extract the HF-Demo-Images.zip in to a folder of your choice.

There are two folders in it  first folder(harrisonford) contains all reference images for training the model and second folder(hf-quicktest) contains all the quick test images we are going to use for evaluating the model.

image

b.) Create Tags

Select ‘+’ icon to create a new tag and create the following tags

  • Actor
  • Hollywood
  • Harrison Ford
  • Person
  • Male

image

Enter Tag Name and click on ‘Save

image

c.) Upload Images

Now that we created all the tags, lets upload the images and tag them with respective tags.

Click on ‘Add Images’ button and select the images from “harrisonford” folder to upload.

image

image


d.) Assign Tags

Now specify the associated tags in My Tags section, selecting from the drop down

image

Then click on Upload

image

Have a review of the images uploaded

image

3. Train

Now let us train the model by selecting the green train button on top right hand side of the page

image

This initiates the first automatic training(Iteration 1) based on the tags you assigned and images associated to it.

image

Once that step is completed let us review the output of the training.

It shows a precision and Recall of 100% indicates our image classification model is trained now to provide Precision of 100% and Recall of 100%.

PS: Recall means out of the tags which should be predicted correctly, what percentage did our model correctly find?

image

4. Evaluate the Model

Now that our classifier is trained, let us evaluate the accuracy. For that we are going to use the sample images from “hf-quicktest” folder.

a.) First click on Quick Test button on top – image

b.) Select a local image or select an image URL

image

image

image

Lets try another image

image

image

Next let us try to upload an image of Ben Ford (Harrison Ford’s son)

image

5. Active Learning

Now that we have couple of accurate predictions, Active Learning involves training the model again from the prediction samples we used. This would make the model evolve to provide us more accurate predictions, for example we correcting the model as it identified that Ben Ford also as Harrison Ford based on similar facial features. In real world, he is a different entity other than his father.

Ben Ford is a Chef by profession. So I am going to upload some of his pictures and tag them as Ben Ford. Also couple of images of both father and son together, and then initiate the training again. Hope they would not feel agitated.

image

image

Now if you look at training performance, Precision and Recall values came down a bit, we can realize it is because we have two persons being tagged with some common tags etc.

image

Let us do a Quick Test with the previous image of Ben Ford again. voilà!, we have some accurate prediction.

image

Similarly, we can repurpose some of the previous prediction images from Predictions tab and add them with right Tags. Then retrain the model again to evolve the model.

image

image

image

The End:

Now that you have learned how you can train Custom Vision API with set of images and retrain them again for more accuracy. Once your training is completed and you are happy with the performance, you can integrate the logic in to your existing apps using Custom Vision REST APIs. You can follow the HOL that covers the integration topic here.

Custom Vision Services provides you state-of-the-art Classification and object detection capabilities to customize it for your specific need with quick and easy steps. This help you reduce your time to market and increase ROI (Return of Investment) for your product lines or ideas.

Start learning today using the below reference links.

References:

Disclaimer: All the images referenced in this article are available on the public domain and there is no way any private images are been included in this examples. We respect Harrison Ford and his family privacy, this article is just an attempt to prove the capabilities of Azure Custom Vision Services, no way intended to insult or invade Mr.Harrison Ford’s privacy.I am a big fan of you sir.

Microsoft Professional Program for Data Science

June 3, 2017 Analytics, Azure, Big Data, Big Data Analytics, Certification, Data Analytics, Data Science, Data Scientist, Emerging Technologies, Internet of Things, IoT, KnowledgeBase, Machine Learning(ML), Microsoft No comments

Microsoft has come up with a new program to bring in more skilled people to the field of Data Science by providing them the right training on right set of tools.

Microsoft has put together a curriculum  to teach key functional and technical skills, combining highly rated online courses with hands-on labs, concluding in a final capstone project. All these trainings will be delivered by Microsoft either online or through recorded sessions.

The program comprises of  10 COURSES, 16-32 HOURS PER COURSE,  8 SKILLS

The technology skills you will gain through are: T-SQL, Microsoft Excel, PowerBI, Python, R, Azure Machine Learning, HDInsight, Spark.

ENROLL NOW: through this link

Course schedule:
For exact dates for the course, please refer to the course detail page on edX.org.

For more details on this program: https://academy.microsoft.com/en-us/professional-program/data-science/ 

** This course would provide necessary insight to write Microsoft’s new Certification – Microsoft Certified Solution Associate(MCSA) – Machine Learning.

Happy Learning!!

Introduction to Data Science

June 3, 2017 Analytics, Big Data, Big Data Analytics, Big Data Management, Cloud Computing, Cold Path Analytics, Data Analytics, Data Collection, Data Hubs, Data Science, Data Scientist, Edge Analytics, Emerging Technologies, Hot Path Analytics, Human Computer Interation, Hype vs. reality, Industrial Automation, Internet of Nano Things, Internet of Things, IoT, IoT Devices, Keyword Analysis, KnowledgeBase, Machine Learning(ML), machine-to-machine (M2M), Machines, Predictive Analytics, Predictive Maintenance, Realtime Analytics, Robotics, Sentiment Analytics, Stream Analytics No comments

We all have been hearing the term Data Science and Data Scientist occupation become more popular these days. I thought of sharing some light into this specific area of science, that may seem interesting for rightly skilled readers of my blog. 

Data Science is one of the hottest topics on the Computer and Internet  nowadays. People/Corporations have gathered data from applications and systems/devices until today and now is the time to analyze them. The world wide adoption of Internet of Things has also added more scope analyzing and operating on the huge data being accumulated from these devices near real-time.

As per the standard Wikipedia definition goes Data science, also known as data-driven science, is an interdisciplinary field about scientific methods, processes and systems to extract knowledge or insights from data in various forms, either structured or unstructured, similar to data mining.”.

Data Science requires the following skillset:

  • Hacking Skills
  • Mathematics and Statistical Knowledge
  • Substantive Scientific Expertise

aoz1BJy

[Image Source: From this article by Berkeley Science Review.]

Data Science Process:

Data Science process involves collecting row data, processing data, cleaning data, data analysis using models/algorithms and visualizes them for presentational approaches.  This process is explained through a visual diagram from Wikipedia.

Data_visualization_process_v1

[Data science process flowchart, source wikipedia]

Who are Data Scientist?

Data scientists use their data and analytical ability to find and interpret rich data sources; manage large amounts of data despite hardware, software, and bandwidth constraints; merge data sources; ensure consistency of datasets; create visualizations to aid in understanding data; build mathematical models using the data; and present and communicate the data insights/findings.

They are often expected to produce answers in days rather than months, work by exploratory analysis and rapid iteration, and to produce and present results with dashboards (displays of current values) rather than papers/reports, as statisticians normally do.

Importance of Data Science and Data Scientist:

“This hot new field promises to revolutionize industries from business to government, health care to academia.”

The New York Times

Data Scientist is the sexiest job in the 21st century as per Harward Business Review.

McKinsey & Company projecting a global excess demand of 1.5 million new data scientists.

What are the skills required for a Data Scientist, let me share you a visualization through a Brain dump.

FxsL3b8

I thought of sharing an image to take you through the essential skill requirements for a Modern Data Scientist.

So what are you waiting for?, if you are rightly skilled get yourselves an Data Science Course.

Informational  Sources:

Azure in Germany–a complete EU cloud computing solution

May 18, 2017 .NET, Analytics, AppFabric, Azure, Azure in Germany, Azure IoT Suite, Cloud Computing, Cloud Services, Cloud Strategy, Cognitive Services, Computing, Data Analytics, Data Governance, Data Hubs, Data Warehouse, Emerging Technologies, Event Hubs, IaaS, Intelligent Edge, Internet of Things, IoT, IoT Central, IoT Hub, Machine Learning(ML), Media Services, Media Services & CDN, Messaging, Microsoft, Mobile Services, PaaS, SaaS, SQL Azure, Storage, Backup & Recovery, Stream Analytics, Virtual Machines, Windowz Azure No comments

With my earlier article Azure in China, it came in to my interest to look for any other country/region specific independent cloud data center requirements.  I came across Azure for US Govt(Similar to Amazon Govt Cloud) instance and Azure Germany data center.  For this article context I will be covering only Azure in Germany.

What is Azure Germany?

Just like regional regulatory requirements in China, Germany also wanted a completely locally owned/managed Azure Data Center for EU/EFTA/UK requirements. This is also to ensure stricter access control and data access policy measurements. This  approach is to enable organizations doing business in EU/EFTA and UK can better harness the power of cloud computing.

  • All customer data and related applications and hardware reside in Germany
  • Geo-replication between datacenters in Germany to support  business continuity
  • Highly secured datacenters provide 24×7 monitoring
  • It meets all Public sector or restricted industry requirements
  • Follows all Compliance requirements for EU/EFTA and UK.
  • Lower cost, locally accessible  within your business locations in Germany/EU.

“ Azure Germany is an isolated Azure instance in Germany, independent from other public clouds.”

Who controls it?

An independent data trustee controls access to all customer data in the Azure Germany datacenters. T-Systems International GmbH, a subsidiary of Deutsche Telekom and an experienced, well-respected IT provider incorporated in Germany, serves as trustee, protecting disclosure of data to third parties except as the customer directs or as required by German law.

** Even Microsoft does not have access to customer data or the datacenters without approval from and supervision by the German data trustee.

What Compliance?

Azure Germany has an ongoing commitment to maintaining the strictest data protection measures, so organizations can store and manage customer data in compliance with applicable German laws and regulations, as well as key international standards. Additional compliance standards and controls that address the unique role of the German data trustee will be audited over time. Refer to: Microsoft Trust Center compliance.

[Source : Microsoft Azure]

Useful Links:

Introducing Azure IoT Edge

May 13, 2017 .NET, Analytics, Artificial Intelligence(AI), Augmented Reality, Azure, Azure IoT Suite, Cloud Computing, Data Analytics, Edge Analytics, Embedded, Emerging Technologies, Event Hubs, Industrial Automation, Intelligent Cloud, Intelligent Edge, IoT, IoT Edge, IoT Hub, Linux, Mac OSX, Machine Learning(ML), Microsoft, Robotics, Self Driven Cars, Stream Analytics, Windows, Windowz Azure No comments

During Build! 2017 Microsoft has announced the availability of Azure IoT Edge, which would bring in some of the cloud capabilities to edge devices/networks within your Enterprise. This would enable industrial devices to utilize the capabilities of IoT in Azure within their constrained resources . 

With this Microsoft now makes it easier for developers to move some of their computing needs to these devices.  Edge devices are mostly having small foot print based to high end machines within your company network.

The essential capabilities to be supported by Azure IoT edge  include:

  • Perform Edge Analytics (a cut down version of Azure Stream Analytics)- Instead of doing analytics in cloud developer/implementer can move the basic cloud data processing and analytical capabilities to Edge Device. Run your machine learning algorithms in Edge device and take predictive analytics steps.
  • Perform Artificial Intelligence processing at edge device itself. Availability of Microsoft Cognitive Service on edge device would bring in whole lot of automation capabilities. Imagine Alexa/Siri working without internet connection, it should be able to provide you reminders etc.
  • Perform RealTime Decision making locally based on predefined rules.
  • Reduce bandwidth costs
  • Connect to other Edge devices and legacy devices within the constrained/corporate network.
  • Deploy IoT solutions to Edge Device from Cloud and provide updates as needed.
  • Operate offline without the need of real-time internet connectivity or intermittent connectivity. Doesn’t have to rely on Cloud to provide commands for processing, can do offline data capture and processing of information from other devices connected and take decisions without the need to rely on a connected cloud service.

Azure IoT Edge enables seamless deployment of cloud services such as:

Along with sharing the image represents Azure’s Enterprise Digital Vision, we will discuss about the same in later sessions:

Digital-Enterprise-Vision_png

Getting Started & More information: