{"id":96,"date":"2021-05-27T10:10:29","date_gmt":"2021-05-27T17:10:29","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/windowsai\/?p=96"},"modified":"2021-06-01T13:26:13","modified_gmt":"2021-06-01T20:26:13","slug":"build-your-own-machine-learning-model-and-integrate-it-with-windows-ml-application","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/windowsai\/build-your-own-machine-learning-model-and-integrate-it-with-windows-ml-application\/","title":{"rendered":"Build your own machine learning model and integrate it with Windows ML application!"},"content":{"rendered":"<p style=\"text-align: justify;\">Machine learning is changing the way we interact with each other and improving many aspects of our lives. In recent years, a variety of tools and frameworks have been developed to make it easier to build and deploy machine learning models into user-facing applications.<\/p>\n<p style=\"text-align: justify;\">Amongst these tools is Windows ML, an on-device ML API that enables at-scale deployment of ML models on the breadth of the Windows device ecosystem. Windows ML usage has grown significantly since its introduction in 2018, and many developers that advantage of the API to power innovative and engaging ML experiences on Windows.<\/p>\n<p style=\"text-align: justify;\">Listening to our customers&#8217; feedback, we have recently added new tutorials to the Windows ML documentation. These new tutorials provide an end-to-end introduction to training and deploying an ML model, showing you how to create models from scratch using different products and services, and integrating these models with applications running on Windows devices through Windows ML. No previous knowledge in ML is required!<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 14pt;\"><strong>Build and train your machine learning model in No-Code Environment<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">If you\u2019re growing your knowledge in machine learning and looking for a no-code way to create a model for computer vision scenarios, you\u2019re in the right place! We\u2019ve added several tutorials showcasing end-to-end walkthroughs of how to create your own model and use it with Windows ML.<\/p>\n<p style=\"text-align: justify;\">If you want to train your model in a cloud environment, the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/image-classification-intro\">Image Classification with Custom Vision and Windows ML<\/a> tutorial will guide you through training an image classification model with Azure Custom Vision and deploying it in your application with Windows ML. The Custom Vision service is a great way to train machine learning models in the cloud, without writing a single line of code. To use Azure Custom Vision, you\u2019ll need an Azure subscription, but if you\u2019re new to Azure, you can sign up for a free\u00a0<a href=\"https:\/\/azure.microsoft.com\/en-us\/free\/services\/machine-learning\/\">Azure free account<\/a>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture1.png\"><img decoding=\"async\" class=\"wp-image-97 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture1.png\" alt=\"Image Picture1\" width=\"766\" height=\"393\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture1.png 614w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture1-300x154.png 300w\" sizes=\"(max-width: 766px) 100vw, 766px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em><span style=\"font-size: 10pt;\">Figure 1: Training result with Custom Vision.<\/span><\/em><\/p>\n<p style=\"text-align: justify;\">If you want to train a model on your local device, <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/mlnet-intro\">Image Classification with ML.NET and Windows ML<\/a> tutorial provides step-by-step guidance on how to use ML.NET Model Builder (preview) to build a model to classify images of food and integrate that model with a Windows ML application. ML.NET Model Builder is another great way to build and train machine learning models without having expertise in machine learning. Model Builder is a Visual Studio extension that allows you to train your own model in a non-code environment, locally on the device or by integrating with Azure ML.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture2.png\"><img decoding=\"async\" class=\"wp-image-98 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture2.png\" alt=\"Image Picture2\" width=\"790\" height=\"244\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture2.png 1340w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture2-300x93.png 300w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture2-1024x316.png 1024w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture2-768x237.png 768w\" sizes=\"(max-width: 790px) 100vw, 790px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em><span style=\"font-size: 10pt;\">Figure 2: Train your model with ML.NET Model Builder.<\/span><\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 14pt;\">Code to build your own custom machine learning model<\/span> <\/strong><\/p>\n<p style=\"text-align: justify;\">If you\u2019d prefer hands-on experience with basic machine learning code instead of using an automated service, our new tutorials provide the instructions you need. Basic knowledge in Python and C# programming languages is desired. Previous expertise in machine learning is preferable, but not required.<\/p>\n<p style=\"text-align: justify;\">If you&#8217;re interested in learning how to train and deploy a basic image classification neural network model, then check out the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/pytorch-intro\">Image Classification with PyTorch and Windows ML<\/a> tutorial. You\u2019ll learn how to use PyTorch to build and train a model to recognize certain types of patterns, letting it classify labels of images from the Python built-in dataset. In the second part of the tutorial, you\u2019ll learn how to export the model to ONNX format and deploy it in a Windows Machine Learning UWP (C#) application running locally on your Windows device.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4-1.png\"><img decoding=\"async\" class=\" wp-image-174 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4-1.png\" alt=\"Image Picture4\" width=\"493\" height=\"446\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4-1.png 729w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4-1-300x271.png 300w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><span style=\"font-size: 10pt;\"><em>Figure 3: Image Classification model trained with PyTorch and integrated with Windows ML app.<\/em><\/span><\/p>\n<p style=\"text-align: justify;\">If you want to learn how to train and deploy an object detection model, then the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/tensorflow-intro\">Object Detection with TensorFlow and Windows ML<\/a> tutorial is the right choice. It will guide you through the process and explain how to use the YOLO architecture to train and evaluate a real-time object detection model in a UWP application. The model will be trained with TensorFlow locally on your machine through DirectML APIs, which provide GPU accelerated training across all Windows devices. You\u2019ll then learn how to integrate the trained model into a UWP application that uses your webcam to detect objects in the frame in real-time, using local Windows ML APIs.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4.jpg\"><img decoding=\"async\" class=\"wp-image-100 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4.jpg\" alt=\"Image Picture4\" width=\"507\" height=\"308\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4.jpg 1143w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4-300x182.jpg 300w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4-1024x622.jpg 1024w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/05\/Picture4-768x466.jpg 768w\" sizes=\"(max-width: 507px) 100vw, 507px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><span style=\"font-size: 10pt;\"><em>Figure 4: YOLO model trained with TensorFlow and integrated with Windows ML app.<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 14pt;\"><strong>Getting Started<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">If you\u2019re a developer looking to learn more about machine learning implementation on Windows, get started today with our new tutorial documentation. Whether you\u2019re looking for a simple no-code environment to deploy your machine learning model or interested in coding your own custom model, we\u2019ll show you how to use the framework that works best for you.<\/p>\n<table class=\" aligncenter\" style=\"width: 62.8612%; height: 209px;\">\n<tbody>\n<tr style=\"height: 33px;\">\n<td style=\"width: 16.2939%; height: 33px; text-align: center;\" width=\"103\"><span style=\"font-size: 10pt;\"><em>\u00a0<\/em><\/span><\/td>\n<td style=\"width: 32.4281%; height: 33px; text-align: center;\" width=\"203\"><span style=\"font-size: 10pt;\"><strong><em>Tutorial<\/em><\/strong><\/span><\/td>\n<td style=\"width: 23.3227%; height: 33px; text-align: center;\" width=\"146\"><span style=\"font-size: 10pt;\"><strong><em>Scenario<\/em><\/strong><\/span><\/td>\n<td style=\"width: 79.3905%; height: 33px; text-align: center;\" width=\"172\"><span style=\"font-size: 10pt;\"><strong><em>Training Environment<\/em><\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"height: 44px;\">\n<td style=\"width: 16.2939%; height: 88px; text-align: center;\" rowspan=\"2\" width=\"103\"><span style=\"font-size: 10pt;\"><strong><em>No-Code training environment<\/em><\/strong><\/span><\/td>\n<td style=\"width: 32.4281%; height: 44px; text-align: center;\" width=\"203\"><span style=\"font-size: 10pt;\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/image-classification-intro\">Custom Vision + Windows ML<\/a><\/span><\/td>\n<td style=\"width: 23.3227%; height: 44px; text-align: center;\" width=\"146\"><span style=\"font-size: 10pt;\">Image Classification<\/span><\/td>\n<td style=\"width: 79.3905%; height: 44px; text-align: center;\" width=\"172\"><span style=\"font-size: 10pt;\">Azure Cloud<\/span><\/td>\n<\/tr>\n<tr style=\"height: 44px;\">\n<td style=\"width: 32.4281%; height: 44px; text-align: center;\" width=\"203\"><span style=\"font-size: 10pt;\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/mlnet-intro\">ML.NET + Windows ML<\/a><\/span><\/td>\n<td style=\"width: 23.3227%; height: 44px; text-align: center;\" width=\"146\"><span style=\"font-size: 10pt;\">Image Classification<\/span><\/td>\n<td style=\"width: 79.3905%; height: 44px; text-align: center;\" width=\"172\"><span style=\"font-size: 10pt;\">Azure Cloud \/ Local<\/span><\/td>\n<\/tr>\n<tr style=\"height: 44px;\">\n<td style=\"width: 16.2939%; height: 88px; text-align: center;\" rowspan=\"2\" width=\"103\"><span style=\"font-size: 10pt;\"><strong><em>Code training environment<\/em><\/strong><\/span><\/td>\n<td style=\"width: 32.4281%; height: 44px; text-align: center;\" width=\"203\"><span style=\"font-size: 10pt;\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/pytorch-intro\">PyTorch + Windows ML<\/a><\/span><\/td>\n<td style=\"width: 23.3227%; height: 44px; text-align: center;\" width=\"146\"><span style=\"font-size: 10pt;\">Image Classification<\/span><\/td>\n<td style=\"width: 79.3905%; height: 44px; text-align: center;\" width=\"172\"><span style=\"font-size: 10pt;\">Local<\/span><\/td>\n<\/tr>\n<tr style=\"height: 44px;\">\n<td style=\"width: 32.4281%; height: 44px; text-align: center;\" width=\"203\"><span style=\"font-size: 10pt;\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/tensorflow-intro\">TensorFlow + Windows ML<\/a><\/span><\/td>\n<td style=\"width: 23.3227%; height: 44px; text-align: center;\" width=\"146\"><span style=\"font-size: 10pt;\">Object Detection<\/span><\/td>\n<td style=\"width: 79.3905%; height: 44px; text-align: center;\" width=\"172\"><span style=\"font-size: 10pt;\">Local<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">If you want to take things a step forward, you can build upon your knowledge with the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/ai\/windows-ml\/tutorials\/advanced-tutorial-encryption\">Windows ML Advanced Features<\/a> tutorials. These short tutorials show complex Windows ML capabilities, such as how to select preferable execution devices when you evaluate the ONNX model, or how to execute multiple ML models in the chain with Window ML APIs. You\u2019ll also learn about how to protect your IP by loading an encrypted model resource, decrypting it to a stream, and loading the stream with Windows ML APIs without storing the decrypted model on disk. And if your target platform is older than Windows 10, these tutorials will explain how to port an existing WinML app to the redistributable NuGet package.<\/p>\n<div>As you try out these tutorials let us know if you have any suggestions or questions by leaving feedback on the documentation or samples.<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 8pt;\">PyTorch, the PyTorch logo and any related marks are trademarks of Facebook, Inc<\/span><\/p>\n<div>\n<p><span style=\"font-size: 8pt;\">TensorFlow, the TensorFlow logo and any related marks are trademarks of Google Inc.<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Windows AI platform team has recently added new tutorials to the Windows ML documentation providing a great introductory experience to machine learning, showing you how to create machine learning models from scratch and integrate them with applications running on Windows devices.<\/p>\n","protected":false},"author":45626,"featured_media":174,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[11,10,9,5,7],"class_list":["post-96","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-windows-ai","tag-custom-vision","tag-ml-net-model-builder","tag-pytorch","tag-tensorflow","tag-windows-ml","post_format-post-format-image"],"acf":[],"blog_post_summary":"<p>Windows AI platform team has recently added new tutorials to the Windows ML documentation providing a great introductory experience to machine learning, showing you how to create machine learning models from scratch and integrate them with applications running on Windows devices.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/posts\/96","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/users\/45626"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/comments?post=96"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/posts\/96\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/media?parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/categories?post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/tags?post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}