Brain Builder » Recognition » Brain Training Beginner's Guide » Walk-Through 4: Advanced Brain Training

In This Section:

In This Walk-Through:

  • Apply your learnings from the first three walk-throughs to train an advanced Brain
  • Time: 30 minutes

Sheet Metal Inspection Again?

Didn't we already train a sheet metal inspection Brain? Yes, but it was a simple example that it wasn't really useful for anything other than orienting you to the Brain Builder workspace.

Now that you've progressed through the first three walk-throughs (you didn't just skip to the end, right?), we can train a sheet metal detection Brain that can solve real business problems (if you happen to be in the sheet metal manufacturing business).

The instructions for this walk-through will go a little more quickly because you've already progressed through the first three. If you want to refresh your memory, feel free to take a few minutes to review Walk-Throughs 1-3.

Train your Brain

  1. Download the advanced sheet metal inspection dataset. Save it somewhere easy to find on your computer and unzip the file.

    Data Source and Citation: K. Song and Y. Yan, “A noise robust method based on completed local binary patterns for hot-rolled steel strip surface defects,” Applied Surface Science, vol. 285, pp. 858-864, Nov. 2013.(paper)

  2. Create a new Recognition Dataset just like in Walk-Through 3. Give it a name like "Sheet Metal Inspection - Advanced" and set it up with these six classes:

    • Crazing
    • Inclusion
    • Patches
    • Pitted Surfaces
    • Rolled-in Scale
    • Scratches

    In the dataset you downloaded, you'll see the images have been organized by class into six folders, each of which contains 300 photos.

    To upload and tag the images, you should use the same batch uploading and tagging process for this Brain as we did in Walk-Through 3. Do this sequentially for each of the 6 classes.

    (Reminder: After you have uploaded the first batch of images to the Dataset, you'll have to navigate to the Dataset gallery to find the Upload Images button.)

  3. Once you have batch uploaded the data for all six classes, let's take a look at the Brain's performance. Click Resume Tagging to go to the workspace and check out your Brain Score.

    The overall accuracy of 91.9% isn't bad, but as in Walk-Through 2 and Walk-Through 3, the batch training process has resulted in the Brain being a bit imbalanced. Here, the Scratches class performs far worse than the other five classes.

    Fortunately, we know how to fix that.

  4. Navigate to the Dataset page and click the Deploy Brain button. We're not ready to deploy quite yet, but we want to use the Optimize Brain feature to shuffle the image order and train the Brain in a more balanced way.

    Once Brain Builder finishes Optimization, you can see the updated score in the Current box on the Publishing tab. Then, navigate back to the Dataset page and click Resume Tagging to check the Brain Score drop-down for more details.

    Performance of the Scratches class is still low. Let's dig in a bit and find out why. Click the Images bubble to see exactly which testing images are incorrect.

    Clicking on any image takes you to the workspace so you can see the Brain's prediction for that image.

    Many of the Scratching images are being incorrectly classified as Inclusion. Looking at both types of images, it appears they do have similar appearances, which can cause the Brain to have trouble differentiating between them.

    To improve performance, there are a few things you can try:

    • Add additional Scratches images to help the Brain better learn that class.
    • Change the structure of the classes you're trying to teach the Brain. If two classes are frequently confused, additional data may not be sufficient for the Brain to distinguish between them. In that situation, you may want to combine the images for those classes into a single class and retrain the Brain. (Brain Builder doesn't have a mechanism to do this in the platform, so you would need to edit the data and create a new Dataset to build a new Brain with the new class structure.)
  5. Promote your Brain to Staging, and then to Production. Use the API documentation to build the API calls to pass your data into the Brain for analysis.

Information Even if your Brain isn't perfect yet, there is still value in deploying it and testing it in a real-world application. There may be images from your production use case that have variations that aren't in your training dataset. You'll want to identify those so you can update the Brain sooner than later.

Evaluate how your Brain works in the real world, and don't be afraid to come back into Brain Builder to make it smarter!


That's it! You've completed the Brain Training Beginner's Guide Walk-Throughs. You should now feel comfortable uploading data, tagging images, understanding Brain performance, and deploying your Brain.

Now it's time to start training a Brain with your data. If you get stuck, check out the Recognition Documentation at any time.

Next: Recognition Documentation >>