Deep Learning with PyTorch -- Part 2 Learning from images (C11-C12)

Chapter 11 Training a classification model to detect suspected tumors

  • Using PyTorch DataLoaders to load data
  • Implementing a model that performs classification on our CT data
  • Setting up the basic skeleton for our application
  • Logging and displaying metrics

11.1 A foundational model and training loop

  1. We’ll start by building the nodule classification model and training loop that will be the foundation that the rest of part 2 uses to explore the larger project. To do that, we’ll use the Ct and LunaDataset classes.
  2. Using the results from running that training loop to introduce one of the hardest challenges in this part of the book: how to get high-quality results from messy, limited data.In later chapters, we’ll explore the specific ways in which our data is limited, as well as mitigate those limitations.

Right now, we’ll work on producing a model capable of performing step 4: classification. As a reminder, we will classify candidates as nodules or non-nodules (we’ll build another classifier to attempt to tell malignant nodules from benign ones in chapter 14). That means we’re going to assign a single, specific label to each sample that we present to the model. In this case, those labels are “nodule” and “non-nodule,” since each sample represents a single candidate.

Getting an early end-to-end version of a meaningful part of your project is a great milestone to reach. Having something that works well enough for the results to be evaluated analytically let’s you move forward with future changes, confident that you are improving your results with each change—or at least that you’re able to set aside any changes and experiments that don’t work out!