20.03.2021 Views

Deep-Learning-with-PyTorch

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

280 CHAPTER 11 Training a classification model to detect suspected tumors

11.1 A foundational model and training loop

We’re going to do two main things in this chapter. 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

we implemented in chapter 10 to feed DataLoader instances. Those instances, in turn,

will feed our classification model with data via training and validation loops.

We’ll finish the chapter by 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.

Let’s recall our high-level roadmap from chapter 9, shown here in figure 11.1.

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

Step 1 (ch. 10):

Data Loading

STep 2 (ch. 13):

Segmentation

Step 4 (ch. 11+12):

ClaSsification

.MHD

.RAW

CT

Data

segmentation

model

Step 3 (ch. 14):

Grouping

candidate

Locations

[(I,R,C),

(I,R,C),

(I,R,C),

...

]

candidate

Sample

ClaSsification

model

[NEG,

p=0.1

POS,

p=0.9

NEG,

p=0.2

...

]

Step

5 (ch. 14):

Nodule analysis

and Diagnosis

MAL/BEN

p=0.9

Figure 11.1 Our end-to-end project to detect lung cancer, with a focus on this chapter’s topic:

step 4, classification

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!