Exercise 1.2 - Train and Deploy a Deep Learning Model

Train Model: Now that our data set has been created, we are ready to start training our Deep Learning Model. In general, the more images used to train a model, the more accurate the model will be. The Augmented data set will create a better model than the 5 base images. We also have provided you with an even more accurate pretrained model built on 2000+ images.

  1. Make sure you are on your Cans-Augmented-YourInitials data set.


  2. Click Train model.

    img


  3. Give your model the name of Dent Detection Model-YourInitials.

    img


  4. Select Object Detection as the type of training and switch Advanced settings on in the top right corner.

    img


  5. Scroll down to the Optimize Model using section, select Tiny YOLO v2 as the model type.

  6. Select Enable Core ML as the training option, which is what allows the model to be used on an iOS device.

  7. In the Model hyperparameters, change Max Iteration to 2000.

    img

Attention

We are only using 2000 iterations because we don't want to stretch the GPU too thin. Also, it takes a lot more time to train the model with higher iterations. Increasing the iterations can improve model accuracy, similar to adding more images to a dataset.

  1. Click the Train Model button at the top of the page.

    img


  2. The MVI Platform will schedule the model training and begin training when the resources become available. The timing of training varies on how many iterations you've chosen and how much data you’re using to train the model. As model training begins, you can move on to the next step and let it run in the background.

    img

Deploy Model: While your model is training, we are going to deploy the model that was given to you as part of the lab artifacts. The model was trained using over 2,000 images. Therefore, it will be significantly more accurate than the model you just created.

  1. First, select the Models tab.

    img


  2. Just like we did with the Data Set .zip file, we will do the same with the Model .zip file. You will drag and drop the Dent Detection Model - Lab.zip file that you saved to your computer or click Import .zip file and select the .zip file. Also, you can click the x on the progress bar for your model that is training if it is in the way.

    img


  3. Give at least 4-5 minutes for the model to finished uploading.

    img


  4. Once the model has finished uploading, click the checkbox and select the Deploy Model button.

    img


  5. Select Deploy.

    img


  6. Wait a couple seconds for the model to be deployed. It should look like the picture below when it is ready.

    img


  7. Click on the deployed model to see the details of the model.

    img


  8. Scroll down to test the model. Drag the Model Test Pic we provided you for testing and drop it into the Test Model box or select Import and upload the picture. This image was not used to train the model.

    img


  9. You can see our Deep Learning Model is able to identify which can is good and which can has a dent. On the right side is the color of each label and the confidence scores of how likely it is to be that object.

    img

Congrats, you have trained and deployed a model that can be used on Maximo Visual Inspection Mobile!