Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What filter does TensorFlow use by default for image filtering?

Tags:

tensorflow

I'm new at machine learning and I was reading about CNN with Tensorflow but I have a doubt with this block of code:

conv1 = tf.layers.conv2d(
        inputs=input_layer,
        filters=32,
        kernel_size=[5, 5],
        padding="same",
        activation=tf.nn.relu)

According to several articles, there are a lot of filters to apply (Blur, Sharpening, etc). What kind of kernel is Tensorflow applying by default in this kind of code?

Because I'm not specifying any kernel type like:

Edge detection filter

I'm pretty confused about it, I'll really appreciate any kind of help.

Thanks in advance!

like image 444
Genarito Avatar asked Mar 11 '18 21:03

Genarito


People also ask

Which filter is used in image processing?

Box filter, Gaussian filter and bilateral filters are kind of well-known filters used in image processing. As we know all these filters are used for de-blurring and smoothing.

How many types of filters are there in image processing?

Mainly there are 2 types of filters and user those topics, there are different types of filtering techniques. Image filters are widely use for remove noises and image enhancement processes. Using filters, we can remove or emphasize image details.

What is image filtering in Python?

Image filtering theory. Filtering is one of the most basic and common image operations in image processing. You can filter an image to remove noise or to enhance features; the filtered image could be the desired result or just a preprocessing step. Regardless, filtering is an important topic to understand.


1 Answers

It's confusing, but TensorFlow has two conv2d methods: tf.nn.conv2d and tf.layers.conv2d. If you want to filter an image with a known kernel, call tf.nn.conv2d. If you want to create a layer in a convolutional neural network (CNN) that will determine its filters programmatically, call tf.layers.conv2d.

like image 147
MatthewScarpino Avatar answered Oct 27 '22 01:10

MatthewScarpino