Zero padding adds a visible border of zeros before the same kernel is applied, so edge-centered patches can be computed without hidden values.
Valid padding stops at the edge
With valid padding, the 3 by 3 kernel only lands where the whole patch is inside the 4 by 4 image. That is why the valid feature map has 2 by 2 cells.
valid cells=(4−3+1)×(4−3+1)
Zero padding adds a visible border
Zero padding with padding 1 surrounds the 4 by 4 image with 0 values, making a 6 by 6 padded grid. The border values are shown, not hidden.
padded image 6×6 with border 0
The corner patch is computable
At padded row 0, col 0, the top-left patch is visible and its dot product with the same kernel is 0.
padded corner output=0