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.

366 CHAPTER 13 Using segmentation to find suspected nodules

harder to encode and therefore reconstruct. To address this, the U-Net authors added

the skip connections we see at the center of the figure. We first touched on skip connections

in chapter 8, although they are employed differently here than in the ResNet

architecture. In U-Net, skip connections short-circuit inputs along the downsampling

path into the corresponding layers in the upsampling path. These layers receive as input

both the upsampled results of the wide receptive field layers from lower in the U as well

as the output of the earlier fine detail layers via the “copy and crop” bridge connections.

This is the key innovation behind U-Net (which, interestingly, predated ResNet).

All of this means those final detail layers are operating with the best of both worlds.

They’ve got both information about the larger context surrounding the immediate

area and fine detail data from the first set of full-resolution layers.

The “conv 1x1” layer at far right, in the head of the network, changes the number

of channels from 64 to 2 (the original paper had 2 output channels; we have 1 in our

case). This is somewhat akin to the fully connected layer we used in our classification

network, but per-pixel, channel-wise: it’s a way to convert from the number of filters

used in the last upsampling step to the number of output classes needed.

13.4 Updating the model for segmentation

It’s time to move through step 2A in figure 13.8. We’ve had enough theory about

segmentation and history about U-Net; now we want to update our code, starting with

the model. Instead of just outputting a binary classification that gives us a single output

of true or false, we integrate a U-Net to get to a model that’s capable of outputting a

1. Segmentation

UNet

2. Update:

2a. Model

T/F

2b. Datasett

3. Results

2c. Training

Figure 13.8 The outline of this chapter, with a focus on the changes needed for our

segmentation model

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

Saved successfully!

Ooh no, something went wrong!