Prerequisite: Convolutional Neural Networks
Dilated Convolution: It is a technique that expands the kernel (input) by inserting holes between the its consecutive elements. In simpler terms, it is same as convolution but it involves pixel skipping, so as to cover a larger area of the input.
An additional parameter l (dilation factor) tells how much the input is expanded. In other words, based on the value of this parameter, (l-1) pixels are skipped in the kernal. Fig 1 depicts the difference between normal vs dilated convolution. In essence, normal convolution is just 1-dilated convolution.
Dilated convolution helps expand the area of the input image covered without pooling. The objective is to cover more information from the output obtained with every convolution operation. This method offers a wider field of view at the same computational cost. We determine the value of the dilation factor (l) as by seeing how much information is obtained with each convolution on varying values of l.
By using this method, we are able to obtain more information without increasing the number of kernel parameters. In Fig 1, the image on the left depicts dilated convolution. On keeping the value of l = 2, we skip 1 pixel (l – 1 pixels) while mapping the filter onto the input, thus covering more information in each step.
where, F(s) = Input k(t) = Applied Filter *l = l-dilated convolution (F*lk)(p) = Output
Advantages of Dilated Convolution:
Using this method rather than normal convolution is better as:
- Larger receptive field (i.e. no loss of coverage)
- Computationally efficient (as it provides a larger coverage on the same computation cost)
- Lesser Memory consumption (as it skips the pooling step) implementation
- No loss of resolution of the output image (as we dilate instead of performing pooling)
- Structure of this convolution helps in maintaining the order of the data.
The following output is obtained from the above code.
The output obtained is for a dilation factor of 3. For more experimentation, you can initialize the dilated_kernel with different values of Dilation factor and observe the changes in the output obtained.
Attention reader! Don’t stop learning now. Get hold of all the important Machine Learning Concepts with the Machine Learning Foundation Course at a student-friendly price and become industry ready.