chapter eleven

11 Classifying Suspected Tumors

 

This chapter covers:

  • Using DataLoader s to load data from Dataset s with multiple child processes
  • Implementing an introductory model that performs step 3, classification
  • Setting up the basic skeleton for our training and validation application that loops per epoch, and feeds the model data from the training and validation Dataset s
  • Logging and displaying metrics that describe model performance and evaluating model performance using those metrics

In the previous chapters we set the stage for our cancer detection project. We covered medical details of lung cancer, took a look at the main data sources we will use for our project, and implemented transforming our raw CT scans into a PyTorch Dataset that allows us to easily consume that data.

So let’s do that!

11.1  The main entrypoint for our application

11.2  Pre-training setup and initialization

11.2.1  Initalizing the model and optimizer

11.2.2  Care and feeding of DataLoaders

11.3  Our first-pass neural network design

11.3.1  The Core Convolutions

11.3.2  The Full Model

11.4  Training and validating the model

11.4.1  Deleting the loss variable

11.4.2  The computeBatchLoss function

11.4.3  The validation loop is similar

11.5  The logMetrics function

11.6  Running the training script

11.6.1  Needed data for training

11.6.2  Interlude: the enumerateWithEstimate function

11.7  Getting 99.7% correct means we’re done, right?

11.8  Graphing training metrics with TensorBoard

11.8.1  Running TensorBoard

11.8.2  Adding tensorboard support to our metrics logging function

11.10  Conclusion