Lab 1: Classification

Introduction

In this lab, you'll be creating a classifier to distinguish an image into one of two different classes.

You should create a Google colab notebook (you may find the notebook we used for the in-class assignment on day 1 a useful reference).

Prepare data

The data you'll be using is available for download.

You'll want to look at the format of that data in order to figure out which method from ImageDataLoader is needed to load the data.

Question: What are the two classes of images in this dataset? (You may find show_batch useful—see fast.ai book chapter 2).

Train model

Now that you have your data, you can train a model. Use an existing pretrained model (like resnet34).

See how high you can get your validation accuracy.

Test model

Which of the ten images in the validation set is the classifier least sure about? (You may find plot_top_losses useful—see fast.ai book chapter 2). Upload two images: one of each class. Does the classifier correctly classify them? With what confidence?

Challenge Try at least 2 models other than resnet34 (e.g., different depth resnet, squeezenet, densenet).

Challenge Try training a model from scratch (not using a pretrained model). Which model might work best?

This completes the lab. Submit instructions

  1. Make sure that the output of all cells is up-to-date.
  2. Rename your notebook:
    1. Click on notebook name at the top of the window.
    2. Rename to "CS152Sp21Lab1 FirstName1/FirstName2" (using the correct lab number, along with your two first names). I need this naming so I can easily navigate through the large number of shared docs I will have by the end of the semester.
  3. Choose File/Save
  4. Share your notebook with me:
    1. Click on the Share button at the top-right of your notebook.
    2. Enter rhodes@g.hmc.edu as the email address.
    3. Click the pencil icon and select Can comment.
    4. Click on Done.
  5. Enter the URL of your colab notebook in this submittal form. Do not copy the URL from the address bar (which may contain an authuser parameter and which I will not be able to open). Instead, click Share and Copy link to obtain the correct link. Enter your names in alphabetical order.
  6. At this point, you and I will go back and forth until the lab is approved.
    1. I will provide inline comments as I evaluate the submission (Google should notify you of these comments via email).
    2. You will then need to address those comments. Please do not resolve or delete the comments. I will use them as a record of our conversation. You can respond to them ("Fixed" perhaps).
    3. Once you have addressed all the comments in this round, fill out the submittal form again.
    4. Once I am completely satisifed with your lab, I will add a LGTM (Looks Good to Me) comment
    5. At that point, setup an office hour appointment with me. Ill meet with you and your partner and we'll have a short discussiona about the lab. Both of you should be able to answer questions about any part of the lab.

'