Image Similarity with SQL Server

By for April 17, 2018

Report Abuse
This solution uses SQL Server 2017 + ML Services with Python to execute a transfer learning algorithm to detect image similarity.
> **Note:** If you have already deployed this solution, click [here](https://quickstart.azure.ai/track/Deployments?type=imagesimilarity) to view your deployment. If you are unable to connect to your Virtual Machine, see this important information for [how to resolve](https://blogs.technet.microsoft.com/mckittrick/unable-to-rdp-to-virtual-machine-credssp-encryption-oracle-remediation/). ### Estimated Provisioning Time: 30 Minutes > **STOP before you proceed** If you have not yet deployed a Data Science Virtual Machine on your Azure Subscription, you must first **[accept the Terms of Use](https://portal.azure.com/#blade/Microsoft_Azure_Marketplace/LegalTermsSkuProgrammaticAccessBlade/legalTermsSkuProgrammaticAccessData/%7B%22product%22%3A%7B%22publisherId%22%3A%22microsoft-ads%22%2C%22offerId%22%3A%22windows-data-science-vm%22%2C%22planId%22%3A%22windows2016%22%7D%7D)**. ## Overview This template describes how to build and deploy an image similarity solution with [SQL Server Machine Learning Services with Python](https://docs.microsoft.com/en-us/sql/advanced-analytics/python/sql-server-python-services). In this solution, we demonstrate how to apply transfer learning, e.g., using pretrained deep neural network (DNN) model (trained on ImageNet) in solving the image similarity problem for an image based similar product recommendation scenario. The solution uses a small sample of upper body clothing images (around 300 images) as an example: there are 3 different types of textures in the clothing images: dotted, striped, and leopard. Those with similar texture are considered more similar than those with different textures. These data are scraped from the internet using Bing Image Search API and manually annotated. The URLs of these images are provided as a reference. The users of this solution are welcome to use their own dataset. The end to end machine learning workflow for building such as solution is provided: data preprocessing, featurization, training, testing, evaluation, and ranking. All these major steps are provided in SQL Server Stored procedures with python script embedded inside, which makes it convenient to deploy such as solution with SQL Server ML Services. Read more about this solution at the [Image Similarity Website](https://microsoft.github.io/ml-server-image-similarity/). ## SQL Server Machine Learning Services SQL Server Machine Learning Services brings the compute to the data by running Python on the computer that hosts the database. It includes a database service that runs outside the SQL Server process and communicates securely with the Python runtime. This solution walks through the steps to create and refine data, train R models, and perform scoring on the SQL Server machine. Data scientists who are testing and developing solutions can work from the convenience of their Python IDE on their client machine, while [pushing the compute to the SQL Server machine](https://msdn.microsoft.com/en-us/library/mt604885.aspx). The completed solutions are deployed to SQL Server 2017 by embedding calls to R in stored procedures. These solutions can then be further automated with SQL Server Integration Services and SQL Server agent. Click on the **Deploy** button to test the automation and the entire solution will be made available in your Azure subscription. ## Pricing Your Azure subscription used for the deployment will incur consumption charges on the services used in this solution, approximately $.49(USD)/hour for the default VM in the East US. ### Disclaimer * All prices shown are in US Dollar ($). This is a summary estimate, not a quote. For up to date pricing information please visit [https://azure.microsoft.com/pricing/calculator/](https://azure.microsoft.com/pricing/calculator/). >Please ensure that you stop your VM instance when not actively using the solution. Running the VM will incur higher costs. > >**Please delete the solution if you are not using it.** ## Disclaimer ©2017 Microsoft Corporation. All rights reserved. This information is provided "as-is" and may change without notice. Microsoft makes no warranties, express or implied, with respect to the information provided here. Third party data was used to generate the Solution. You are responsible for respecting the rights of others, including procuring and complying with relevant licenses in order to create similar datasets. ![ ](https://quickstart.azure.ai/track?solutionid=imagesimilarity)