Neural networks Computer vision - discrete convolution
Topics: parameter sharing Each 2 Abst Jarret et al. 29 Math for my slides Computer vision. feature map forms a 2D grid of features can be computed with a discrete convolution H X ( ) of a kernel matrix kij which is Bank - FCSG : its therowsinput of a flipped filter bank the hiddenlayer weights matrix Wij with and columns re u at fe ilter r is a 3D array with n1 2D feature maps of size n2 n3. h component is denoted xijk, and each feature map is xi is the ith channel of input oted xi. The output is also a 3D array, y composed of kij is the convolution kernelfigure 1. A example of fe eature maps of size m2 m3. A filter in the bank gj isfilter a learned scaling factorrabs N PA. An i yj ismap the hidden layer has size l1 l2 and connects input feature xi to through a non-linear fil ut feature map yj. The module computes: (could have added a bias) contrast normalization an! yj = gj tanh( kij xi ) (1) layer with 4x4 down-s m s ap Figure 1. A example of feature extraction s i
3 The convolution of an image x with a kernel k is computed as follows: (x * k) ij = x i+p,j+q k r-p,r-q pq Example: k~ = k with rows and columns flipped 1 8.5 2.25 x.25 * =.5 1 k
4 The convolution of an image x with a kernel k is computed as follows: (x * k) ij = x i+p,j+q k r-p,r-q pq Example: 1 x +.5 x 8 +.25 x 2 + x 1 8.5 2.25 *.25.5 1 k = 45 x
5 The convolution of an image x with a kernel k is computed as follows: (x * k) ij = x i+p,j+q k r-p,r-q pq Example: 1 x 8 +.5 x +.25 x + x 81.5 2.25 *.25.5 1 k = 45 11 x
6 The convolution of an image x with a kernel k is computed as follows: Example: (x * k) ij = x i+p,j+q k r-p,r-q 1 x 2 +.5 x +.25 x + x 8.25 2 * = 1.5.5 1.25 x pq k 45 11
7 The convolution of an image x with a kernel k is computed as follows: Example: (x * k) ij = x i+p,j+q k r-p,r-q pq 8 2 1.5.25 x 1 x +.5 x +.25 x + x *.25.5 1 k = 45 11
8 Pre-activations from channel x i into feature map y j can be computed by: getting the convolution kernel where kij =Wij from the connection matrix Wij ~ applying the convolution xi * kij This is equivalent to computing the discrete correlation of x i with W ij
9 Simple illustration: xi * kij where Wij =Wij ~ %.5%.5% % % % % 255% % %.5%.5% % % 255% % % % % % 255% % % % 255% % % % 255% % % % % W % 128% 128% % % 128% 128% % % 255% % % 255% % % % x i x i * k ij X W %%%%% %%%%%
1 With a non-linearity, we get a detector of a feature at any position in the image % % 255% % %.2% %.19% 128%.19% 128%.2% % % % 255% % %.2% %.19% 128%.19% 128%.2% % % % 255% % %.2% %.75% 255%.2% %.2% % % 255% % % %.75% 255%.2% %.2% %.2% % 255% % % % % %%%%% x sigm(.2 x i Logis6c(%(%%%%%%%%%%%%%n%2 i * k ij -4)
11 Can use zero padding to allow going over the borders ( * ) %.5% % % % % % % %.5% % % % % 255% % % % % % % 255% % % % % % % 255% % % % % % 255% % % % % % 255% % % % % % %%%%% % % % % % % % % x i couche)d entrée) W % % % 128% % % % % 128% 128% % % % % 128% 128% % % % % 255% % % % % 255% % % % % 128% % % % % % %%%%% % x i * k ij couche)«)simple)cell)»)