Deploying Deep Learning Models

Create a model is one thing, but deploying your model to solve a business problem is different. Take a look at one of the best options for deploying your deep learning models.

Favio Vázquez
Towards Data Science

--

What is a model?

https://towardsdatascience.com/creating-intelligence-with-data-science-2fb9f697fc79

We humans model the world and use our intelligence to understand the way things work and use that understanding and knowledge to solve difficult and complex problems. Modeling is the process of understanding the “reality”, the world around us, but creating a higher level prototype that will describe the things we are seeing, hearing and feeling, but it’s a representative thing, not the “actual” or “real” thing.

In a past article I talked about the process for solving a business problem with AI and Data Science,

The Model here is created by an AI like a deep learning (DL) algorithm. If you want to read more about DL you can read this:

Ok so you just created a model (let’s say a DL model) to solve a business problem, an now you want to have it in production.

What is production?

Going into production can mean something different for each one of you.

For some people putting a model into production means having the model accesible by anyone who can use it to calculate, measure or see something. For example here a shiny dashboard with a simple model behind it, accesible by the business analysts can be a “productionized” model.

For other people means having the model do something or interact with customers. Like having a model predict if you should lend people money when they ask for it in your mobile application.

I created this simple diagram to specify the different ways you can have a model deployed:

Here I’ll teach you how to deploy a deep learning On-Line Model or AaaS model into production with a service by Deep Cognition.

Deploying your DL model

deepcognition.ai

If you want to know more about Deep Cognition and their Deep Learning Studio (DLS) check this out:

Once the model is built, DLS allows deployment of the model as REST API. In addition to deployed REST API, a simple form based Web application is also generated and deployed for rapid testing and sharing.

These REST API or Web app can be used as an On-Line Model or AaaS. To deploy your model, you have two options:

  • Upload your DL code (like keras or TF), the system will recognize it, you can train it with the DLS and your data and then you have to click the deployment section.
  • Create your model with DLS by scratch and then train it and deploy it.

Here’s a video from a past post where you see how can you deploy it:

Basically these are the steps:

  • Click on the Deploy tab.
  • Select the training run.
  • Enter the service name.
  • Choose if you want to deploy it in your instance (can be web or local, like your company cluster) or in a remote instance (like AWS, GCP, Azure, etc.)
  • Click on the Deploy button.

And that’s it! You don’t have to spend hours thinking on how to do it if you can do it FOR FREE in a very simple way. My experience has been very successful using this way.

Some recommendations:

  • If you want high availability have a dedicated instance for deploying your model.
  • Make sure that you are using a good training result and that you have validated your parameters before going into production.
  • Read this:

--

--

Data scientist, physicist and computer engineer. Love sharing ideas, thoughts and contributing to Open Source in Machine Learning and Deep Learning ;).