Machine learning is a subset of Artificial Intelligence. It tells us something unique about our data without writing a bunch of code specific to the problem. We just feed our data in the Azure Machine Learning service. In this blog, we will cover the basics of the Convolutional Neural Network (CNN) and how we train our CNN’s model on Azure ML service without knowing to code.
Why Azure ML Service?
- In today’s scenario, many companies struggle to adopt the ML solution because data engineers face slow training and complex deployment. Azure ML service removes those barriers.
- Azure ML service is a powerful drag and drop interface. where we go from idea to deployment in a few clicks without additional setup required.
Also Read : Our Blog Post To Know About Most Important DP-100 FAQ
Overview Of Convolutional Neural Network (CNN)
- We mostly use CNN’s in Computer Vision for Image Classification, object detection, and Neural Style Transfer.
- Problem: Images can be big. with 1000 hidden units we need a lot of space.
- Solution: Use CNN’s, it’s like scanning over your image with a filter.
Also check: Azure Free Exam Voucher in Microsoft Ignite 2020
What Are Convolutional Neural Networks (CNNs)
- CNN’s are a specific type of artificial neural network.
- CNN’s works well with matrix inputs, such as images.
- There are various kinds of the layer in CNN’s: convolutional layers, pooling layers, Dropout layers, and Dense layers.
- CNN’s real-world applications: Detecting Handwritten Digits, AI-based robots, virtual assistants, NLP, Electromyography recognition, Drug discovery, Time series forecasting, and self-driving cars.
Do Check: What is the difference between Data Science vs Data Analytics.
Convolution Layer
- In CNN’s we use Convolutional layers which consist of a set of learnable filters and these filters are applied to a subregion of the input image to reduce image dimensions.
- Ensure the spatial relationship between pixels.
Also Read Our Blog Post On MLOps For An Overview.
Pooling Layer
- We use a pooling layer in CNN’s to reduce the number of dimensions(width, height) but retains the most important information. A common technique we use is Max Pooling.
- Max pooling is a type of non-linear sampling. it will divide the input image into set non-overlapping rectangles.
- Speed up Computation.
- Makes some of the detected features more robust.
To Know More About Automated Machine Learning click here.
Dropout Layer
- We prefer Dropout layers in CNN’s to prevent overfitting by increasing testing accuracy.
- We generally place the dropout layer with p = 0.5 in between fully connected layers.
- …….CONV => Relu => Pool => FC => DO => FC => DO => FC…….
Also Read : Our Blog Post on Azure Machine Learning Model.
Fully-Connected Layer
- In CNN’s Fully Connected Layer neurons are connected to all activations in the previous layer to generate class predictions.
- it’s common to use more than one fully connected layer prior to applying the classifier.
Rules Of Thumb
- The input layer should be square. Common size includes 32×32, 64×64, 96×96, 224×224.
- The input layer divisible by two multiple times after the first convolution layer is applied.
- Convolutional layers size such as 3×3 and 5×5 mostly.
- CNN used the POOL layer rather than the Convolutional layer for reducing spatial dimension until you have more exp on Convolutional Neural Networks architectures.
Also Check: Our blog post on the Microsoft dp 100 Exam
Azure ML Workspace
1)we need to install Azure ML extensions for the Azure CLI. Run the following cmd.
$ az extension add -n azure-cli-ml
2)now we will be able to use extension using az ml cmd.
3)we create a new resource group for the azure ML workspace. Run the following cmd.
$ az group create -n ml -l westus2
$ az ml workspace create -w mldws -g ml
4) we will change to working dir in our shell & export an azure ML workspace config to disk.
$ az ml folder attach -w mlws -g ml -e mls
5) Then we will install python ext to interact with our azure ML from within python. Run this cmd.
python3 -m pip install azure-cli azureml-sdk
- now we run our authoring environment in the cloud, we can simply navigate to our Machine Learning workspace in Azure and open the Azure Machine Learning interface to use the Notebook viewer provided there.
- To run our code in this env then click on compute and create compute instance. when it will be done then we have an option to start Jupyter notebook.
6) now we can load workspace config from this file without explicitly specifying the workspace and subscription in every experiment. we run the following code to load our workspace.
from azureml.core import Workspace
ws = Workspace.from_config()
Also Check Our Blog Post On Hyperparameter Tuning For an Overview.
Training A Convolutional Neural Networks On Azure
- Login to Azure portal with email ID (Azure user credential) which you used during creating Azure account.
- Now see the upper-left corner of the Azure portal, select Create a resource.
- Now search Machine Learning and select Machine Learning then select Create.
- Go to Azure Notebooks & then Create a new project.
- Then download “CNN_Keras_Azure.ipynb” from here & upload it to your project.
- Ensure “Running on Free Compute” is enabled.
Note: Do Check Our Blog Post To Get An Overview About DP-900 vs DP-100 vs DP-200 vs DP-201.
- Click Download config.json from the Overview section and then Upload config.json in your project folder and then launch option in Azure ML workspace.
- Now Click on CNN_Keras_Azure.ipynb in your project to open & execute points by points.
This is how we train the convolutional neural network model on Azure with Keras.
Also Read: Our blog post on DP 100 Exam questions and Answers. Click here
Related/References:
- [DP-100] Microsoft Certified Azure Data Scientist Associate: Everything you must know
- [AI-900] Microsoft Certified Azure AI Fundamentals Course: Everything you must know
- Microsoft Certified Azure Data Scientist Associate | DP 100 | Step By Step Activity Guides (Hands-On Labs)
- Automated Machine Learning | Azure | Pros & Cons
- Azure Machine Learning Studio
- Datastores And Datasets In Azure
- Object Detection And Tracking In Azure Machine Learning
- Overview of Hyperparameter Tuning In Azure
- Microsoft Azure Data Scientist DP-100 FAQ
Join FREE Masterclass
To know more about AI, ML, Data Science for beginners, why you should learn, Job opportunities, and what to study Including Hands-On labs you must perform to clear [DP-100] Azure Data Scientist Associate.
Click on the below image to Register Our FREE Masterclass on Microsoft Azure Data Scientist Certification [DP-100] & Live Demo With Q/A Now!
Joseph says
Very educative article, thanks for sharing.
Rahul Dangayach says
Hi Joseph,
Glad you liked our blog.
Please stay tuned for more informative blogs.
Thanks and Regards
Rahul Dangayach
Team K21 Academy
Harrison says
Very helpful information.
Rahul Dangayach says
Hi Harrison,
Glad you liked our blog.
Please stay tuned for more informative blogs.
Thanks and Regards
Rahul Dangayach
Team K21 Academy
JOSÉ RODRIGO MIRALBÉS says
How can I download the project now that azure notebooks is no longer active?