官术网_书友最值得收藏!

Finding features from an image

Let's take a look at an image of the letter X. When we feed a new image into the system, the CNN doesn't know whether the feature will match or not. Consequently, it will try to match the feature pattern everywhere across the image. This is how we build a filter:

The math logic we apply here is called convolution. To calculate the match of a feature to the portion of the image, multiply each pixel value of the feature by the value of the corresponding pixel in the image. To come to one final value, add together all of the values and divide them by the total number of pixels:

For example, if both pixels are the same color (say a value of 1) then (1) * ( 1) = (1). If not, then (-1) * (-1) = 1. In the end result, every matching pixel will have a resulting value of 1, and every mismatch will have the value of -1.

To complete this convolution process, let's move our feature grid onto the image patch. As shown in the following diagram, the 3 x 3 grid moves the 7 x 7 grid over. This forms the resulting 5 x 5 array. In the resulting grid, the values close to 1 represent strong matches, the values close to 0 represent no match, and the values close to -1 represent photographic negatives of our feature:

In the next step, we have to repeat the convolution process for all other features. This gives the filtered image—one for each of our filters. In CNN, this is known as the convolution layer, and this will be followed by additional layers that are added to it. 

This is where CNN gets into heavy computations. This example shows a simple 7 x 7 image that provides 5 x 5 as a result. However, a typical picture will be at least 128 x 128 pixels in size. The computation increases linearly with the number of features, as well as the number of pixels in each feature. 

主站蜘蛛池模板: 綦江县| 沈阳市| 微山县| 安泽县| 平邑县| 佛山市| 大兴区| 岱山县| 淄博市| 安西县| 翁牛特旗| 义马市| 韩城市| 武邑县| 简阳市| 赤城县| 大田县| 潢川县| 蕉岭县| 苍梧县| 天镇县| 定兴县| 城固县| 潮州市| 东乡县| 浦东新区| 宝山区| 大同市| 巫山县| 宿州市| 且末县| 长宁县| 乐平市| 沧州市| 北碚区| 息烽县| 嘉兴市| 静宁县| 鸡西市| 嘉禾县| 玛多县|