All blog posts

Train computer vision models 100x faster with MissingLink.ai and Keras – Part 1

CNN Banners 03.1 Train Computer

To stay competitive, large and small organizations are turning to deep learning and AI for faster innovation. They strive to create value, improve customer experience and ship faster to differentiate themselves from the competition, so they place tremendous pressure and demands on their data science teams to deliver fast.

This tutorial is a step-by-step guide to training deep learning models faster with MissingLink. The goal is to enable teams to experiment ten times faster with the same resources, and cut their cloud costs by as much as 30%.

Let’s dive in – How to train a computer vision model with Keras

I will take an existing implementation of a deep learning algorithm, integrate, manage and visualize it in MissingLink. We start with a code sample that trains a model based on the MNIST dataset using a convolutional neural network, add the MissingLink SDK. We will then run the experiment in a MissingLink-controlled emulated server.

A few things we need to do before we dive into this tutorial:

NOTE

This tutorial assumes you’re using virtualenv to scope your working environment. If you don’t have it installed, you can follow this guide to set it up.

Fork the MissingLink Keras Github repositoryKeras forkAfter the forked repository is created, clone it locally in your workstation. Click Clone or download in Github:Keras downloadNow copy the URL for cloning the repositoryKeras cloneNext, let’s open a terminal and git clone using the pasted URL of your forked repository:

Now that the code is on your machine, let’s prepare the environment. Run the following commands:

Let’s run it

You can try to run the example:

Keras aniumated gif

Install and initialize the MissingLink CLI

MissingLink provides a command line interface (CLI) that allows you to control everything from the terminal.

Let’s go ahead and install it:

Next, authenticate with the MissingLink backend.

Creating a project

MissingLink allows you to manage several projects. Let’s create a new project for this tutorial:

Create the experiment in MissingLink

Open the mnist_cnn.py script file and import the MissingLink SDK:

Now we need to initialize a callback object that Keras will call during the different stages of the experiment:

Finally, let Keras use our callback object. We want to add calls during the training and test stages. Scroll all the way to the bottom of the file and add the MissingLink callback to the fit() function call:

Lastly, let the MissingLink SDK know we’re starting the testing stage:

Run the integrated experiment

We’re all set up to run the experiment again, but this time to see it in the Missing Link dashboard.

Go back to the terminal and run the script again:

You should see the initialization and the beginning of training. Now, switch back to the MissingLink dashboard.

Open the MissingLink dashboard and click the projects toolbar button on the left. In this page, you should see the list of experiments that belong to your project.

Choose the tutorials project. Your experiment appears.

Keras experiment in progress

Now you can click anywhere on the experiment line to show more information about the experiment’s progress.

Keras epoch

Commit the code changes

Let’s commit our code to the repo. Go to your terminal and run the following commands:

That’s it. In the next post, we will go over how to run multiple experiments in parallel on a managed server. MissingLink can help you manage your cloud and on-premise servers as a single grid, so you don’t have to worry about that and only focus on training your model.

We encourage you to give MissingLink a try today and let us know what you need in the future. We eagerly await your feedback and ideas as to how we can take your deep learning experiments to the next level. Reach out via the orange chat icon in the MissingLink.ai dashboard or tweet us at @missinglinkai.

Train Deep Learning Models 20X Faster

Let us show you how you can:

  • Run experiments across hundreds of machines
  • Easily collaborate with your team on experiments
  • Reproduce experiments with one click
  • Save time and immediately understand what works and what doesn’t

MissingLink is the most comprehensive deep learning platform to manage experiments, data, and resources more frequently, at scale and with greater confidence.

Request your personal demo to start training models faster

    Thank you!
    We will be in touch with more information in one business day.
    In the meantime, why not check out how Nanit is using MissingLink to streamline deep learning training and accelerate time to Market.