Why zero padding keep border info?


At the end of the programming exercice from the conv course, it is written the following:

*** Zero padding helps keep more information at the image borders, and is helpful for building deeper networks, because you can build a CONV layer without shrinking the height and width of the volumes**

Why that ? I don’t understand why it keeps more info and we can build deeper networks.
I thought, it will keep more info if we add padding so that we can pass the filter everywhere.

Could you please help me understand that ?

Thank you

I think you stated the correct idea in what you said here:

Here’s how I would express that idea in the next level of detail:

Notice that any given position in the internal part of the input (away from the edges) will be included in multiple output neurons: the filter touches it multiple times as it steps through the height and width dimensions, assuming the stride is not too large. But the last “pixel” on the edge only gets included in the last “step” of the filter. So adding an appropriate amount zero padding (in tune with the stride) can allow the “edge” pixels to be included in multiple filter steps.

1 Like