[+]
Getting Started
[-]
Recognition
 [-]
Brain Training Beginner's Guide
   
   
   
   
 [+]
Recognition Documentation
  
  
 [+]
APIs
[+]
Detection
[+]
Segmentation
[+]
Resources
Updated on 9/11/2019
Brain Builder Knowledge Base
Walk-Through 3: Batch Training & Deployment
Direct link to topic in this publication:
  • Recognition
  • »
  • Brain Training Beginner's Guide
  • »
  • Walk-Through 3: Batch Training & Deployment

In This Section:

In This Walk-Through:

  • Training a Brain with batch uploads
  • Deploying a trained Brain
  • Time: 20-25 minutes

Plant Identification

A nature conservancy is recruiting volunteers to do a field audit of the types of seedling plants sprouting in a certain region of forest. Because the volunteers won't have much expertise in plant types, the organization is developing a mobile application to make it easy for them to identify different species of plants.

You have 250-500 images for each of the three types of seedlings, and you want to train a Brain that can be easily integrated into your mobile application.

Batch Tagging

It would be pretty tedious to upload the images into Brain Builder and then manually label them one at a time. Fortunately, Brain Builder features a process that allows you to tag images in batches while you upload them.

  1. In the Getting Started project, click the Create Dataset button. The Create a Dataset window opens.

  2. Name the Dataset. We recommend something like "Plant Recognition."

  3. Select the Recognition bubble from the three dataset type options at the bottom.

  4. Specify the classes you want to use in this dataset. They should be Sugar Beet, Charlock, and Black Grass.

  5. Click Add Dataset. The dataset is now listed in your Getting Started project.

Uploading Data and Tagging Images

We have assembled the images you'll need for this project into zip files. Click here to download the images. This file contains all three sets of images organized into folders. Save and Unzip the file to your desktop (or another convenient place of your choice).

Dataset distributed under the under the Creative Commons BY-SA license from PAPER: A Public Image Database for Benchmark of Plant Seedling Classification Algorithms authored by Giselsson, Thomas Mosgaard and Dyrmann, Mads and Jørgensen, Rasmus Nyholm and Jensen, Peter Kryger and Midtiby, Henrik Skov.

  1. From the Dataset page, click on the Upload Images button. The Upload window appears.

  2. Add the tag you want to apply to the images you're about to upload. Let's go alphabetically and start with Black Grass. Start typing the tag into the field and you'll see the class name appear in the drop-down.

    Select the Class name and you'll see it listed below the field.

  3. Click the Upload from Computer button.

    This opens a selection window that you can use to find and choose the image files that you have saved to your computer. You can select multiple images by using CMD+A (Mac) or CTRL+A (Windows/Linux).

    Select all of the images in the Black-grass folder and click Open. The upload progress window will appear and you can watch the upload as it happens.

    Information If you have uploaded images without using the batch tagging process, you may notice this process takes a little bit longer. That's because of the time it takes for the Brain to learn all of the images you just uploaded.
  4. After the upload process completes for the set of Black Grass images, click View Dataset and then View All to open the Image Gallery. On this screen, you'll see all of the images you have already uploaded with their respective labels.

    Click the Upload Images button and upload the other two classes using the same process described above.

    After you have uploaded all three batches of images tagged with the appropriate class labels, your Brain will be trained!

  5. To check its Brain Score, click Resume Tagging to go into the Workspace. Then click the Brain Score drop-down to see how your Brain performs.

    Warning The accuracy and scores in this Walk-Through may not exactly match your experience. Images can be uploaded and processed in a different order from different computers, which can change which images are selected for testing. For more details on the Brain Score methodology, see Understanding Brain Performance.

    The Brain Score for this Brain is currently Low, and the drop-down shows that the Black Grass class is performing much more poorly than the other two types of seedlings. Brain Builder recommends adding additional Black Grass and Sugar Beet images so the Brain can better learn to distinguish between the plants.

    Looking at the testing images (you can use the arrows to scroll through all of them), it's apparent that Sugar Beet seedlings can be similar in appearance to Black Grass, which is the main cause of the Brain's confusion.

  6. Navigate back to the Dataset page, and click the Deploy Brain button. This brings you to the Brain Deployment manager page. Then, click the Publish tab. The Brain's accuracy score is shown in the Current box.

    You'll also see two other boxes labeled Staging and Production. Brain Builder supports hosting different versions of the same Brain in Staging and Production environments. This is a valuable tool for developers so you can test a new version of your Brain without interrupting the work of your users already in Production.

  7. Click the Promote button to the right of the Current box to publish your Brain in the Staging environment.

    Warning Brain Builder users on the Free tier are only allowed to have a single published Brain in Staging and/or Production at a time. After you complete this Walk-Through, you can remove this Brain from deployment by clicking the three vertical dot button on the Staging and Publishing boxes and clicking Delete. This will not delete your Brain entirely, but will remove it from being published, allowing you to publish a different Brain.

    Once your Brain is in staging, you can use the API to integrate the Staging Brain into your mobile application. The API documents are detailed on the publishing page under the API Docs tab. To construct the API call to submit images for processing, see the Inference API and SDK page.

  8. Click the Promote button to the right of the Staging box to deploy your Brain to Production.

  9. Click the Brain Actions drop-down menu in the upper-right of your screen, and select the Optimize Brain button to shuffle the data in your Dataset and improve the Brain's knowledge of the images.

    It will take a minute or two for Brain Builder to shuffle the image order, retrain, and re-test your Brain to get a new accuracy score. When optimization is complete, you'll see the update score in the Current box.

    In this instance, the Optimize Brain feature significantly improved the Brain's performance! The overall accuracy went up by about 15%, and the accuracy for the Sugar Beet and Black Grass classes increased by 23% and 14%, respectively.

    If you had already deployed the previous version of your Brain to your application and wanted to thoroughly test this new Brain before releasing it to your users, the recommended workflow would be to promote this new version of the Brain to Staging and use the API to test it there.This would let you verify that the increased performance works well in your application before your users start using it.

    Once you have validated its performance, promote it to Production.

Wrap-Up

After this walk-through, you should:

  • Be able to train a Brain by batch uploading pre-organized images
  • Deploy your Brain into Staging and Production environments
  • Use the API to integrate your Brain into an application
  • Understand the use of Retraining to improve Brain performance

Next: Walk-Through 4: Advanced Brain Training >>