








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









ANN are sets of interconnected computational nodes, it is computational method for problems in which finding a proper representation to solve the problem, the solution of the problem, it's difficult for traditional computer programs. ANN are sometimes referred as black boxes , as it is almost impossible to understand its functioning. There are a several types of ANN, such as Recurrent Neural Networks (RNN) or Radial Basis Function Network (RBF), in this section the most commonly used is described, which is the Multi-Layer Perceptron (MLP). Multi-Layer Perceptron (MLP) Structure. 1.1. Multi-Layer Perceptron’s (MLPs) is a feed forward architecture of ANN that have one or more than one hidden layer, each of them consists of a set of computationally simple interconnected nodes which called the neurons as shown in Error: Reference source not found). Every neuron in the hidden and output layers are usually connected to all neurons of the previous layer, each of these connections has an associate weight, which represents how strongly the connections to the two neurons. Figure (2.3): The basic structure of an MLP.
The output value of each neuron j in the layer l is described in equation Error: Reference source not found: Where N is the number of inputs, 𝑥 (^) i is the inputs which passed from ( l – 1) layer, ( Wi, j ) is weights of all edges that connecting the neuron j with the neurons of previous layer and the (𝑏 j) as bias, equation Error: Reference source not found could be written in a matrices simplified to be as following: he T. 1.1. ac tiv ati on functions This function can be a linear or nonlinear function to representing the degree of activation of the neuron, usually the range between (0,…,1) or (-1,...,1). common choice for the activation function in hidden layers is the sigmoid function as in equation ( 2 .3) : g ( z )= 1 1 + e − z (^2.^3 ) , or Rectified Linear Unit (ReLU) as in equation ( 2 .4): g ( z )= max ( z , 0 ) (^) ( 2. 4 ) The output layer needs to estimate the probability of individual classes. For this cause, most commonly used activation function in output layer is SoftMax as illustrated in equation ( 2 .5). g ( z ) (^) j = e z (^) j ∑ K k = 1 e z (^) k (^2.^5 ) where z^ j is the production corresponding to class j, 𝐾 is the total number of classes. z (^) j =∑ i N ( Wi , j ×^ xi )+^ b^ j (^2.^1 ) z = W T x + b ( 2. 2 )
of neuron in that layer, delta equation can be written as the following equation Error: Reference source not found: Where δ L is a matrix of deltas of all neuron in L, where 𝐿 represent last layer in the network, and ∇x L^ is gradient of Loss with respect to 𝑥 , where 𝑥 here is the output of activation function, and ⊙ is the Hadamard product (element-wise product of matrices). In lower hidden layers the deltas are computed using the following equation Error: Reference source not found: Where l is the number of hidden layer and ( w l + 1 ) T is weight matrix of next layer. for learning the NN, all its weights wi,j need to be adjusted, this done by calculating the weight adjustment Δwwi,j which expressed in the following equation Error: Reference source not found: Where η is learning rate, and δj is the delta of neuron j , which computed for output layer using equation Error: Reference source not found and for each of rest hidden layers using equation Error: Reference source not found. When these phases are repeated for all input instances this is called an epoch. The NN’s can run for many epochs as required to find the solution. δ L = ∇x L ⨀ g ´ ( z L ) ( 2. 7 ) δ l =( ( wl +^1 ) T δ l +^1 ) ⨀ g ´ ( zl ) ( 2. 8 ) ∆ wi , j =− η ∂ L ∂ wi , j =− η δ (^) j zi ( 2. 9 )
Deep learning represents an interesting subfield of machine learning techniques, the chief characteristic of deep learning technique is the capability of making abstractions, it is able to build complex concepts from simple ones, for example, in images it is capable to learn concepts such as humans, cars, or cats by joining sets of basic features, like edges or corners. This process is done through successive layers that increase the complexity of the learned concepts. Each output layer passes as input to the next layer which it uses to learn higher-level features (more complex), as shown in Error: Reference source not found). Deep Neural Networks (DNN). 1.1. Theoretically DNN is an ANN with many hidden layers. MLP is one of the most ANN structures which commonly used for DNN. Since the neural networks are composed of layers of interconnected neurons, it is almost impossible to success training more than a handful of hidden layers. because of the number of weights in a network can easily reach thousands or even millions, the DNN requires both extremely large computational times and data feeding to the training stages. Figure (2.4): Abstract diagram of Deep Neural Network.
The gray and green squares in the Error: Reference source not found) refer to the feature-maps and the learnable convolution kernels (filters) , respectively. The cross-lines between the last two layers refer to the fully connected layers. Each pixel in the input image represents a neuron in the input feature-map , in the CNN each layer is consist of several feature-maps which are organized in a 2-Dimensional grid of neurons. Each kernel of weights will be convoluted with all feature-maps in a specific layer to produce a single feature-map in the next layer. This operation responsible of extracting the local features of input image. The concept of local connectivity and shared weights are applied in convolutional layers, in which each neuron receives its input from a small region of the previous layer ( receptive field) which have the same size of a convolution kernel , this makes the number of weights remains comparatively small. For example if the kernel size in a specific convolutional layer is 5 × 5, this means there are only 25 weights, the local connectivity confirms that the trained CNN produces strong responses to capture local features in the input image (e.g., edges, ridges, curves). The CNN is invariant to image deformations, like rotation, translation, and scaling. Also, it is relatively fast in recognition task, but slow in training, since it takes about an hour for training some thousands of images. The following an explanation of typical CNN layer types:
1. Convolutional Layers : It receipts several input feature-maps and convolutes them with n fixed size learnable kernels to produce n of feature-maps as output, as in equation Error: Reference source not found: is the size.
Where K l denotes kernel weights in convolutional layer l , ⨂ denotes the convolution operator. Error: Reference source not found) shows one kernel convoluted with one input feature-map. The outputs of this layer mostly go through (ReLU) non-linear activation function as in equation ( 2 .4).
2. Subsampling Layers (Pooling) : It's also called pooling layers, its main job is to reduce the spatial size of the convolutional layers production feature-maps, Pooling is almost used with a stride of s ∈
1 s
pooling as shown in Error: Reference source not found), is the most common type of pooling operations. Pooling is applied for three reasons: To get local translational invariance, to get invariance against minor local changes and, most important, for data reduction. Figure (2.6): Represent a kernel convoluted with a feature map in CNN convolutional layer Figure (2.7): The max pooling operation: (A) represents a feature map, (B) represents features after performing max pooling. Y l = K l ⨂ X l − 1 ( 2. 10 )
Training the CNN .1.1. There are two phases in the back-propagation algorithm, the forward and backward phase. In both phases, the fully connected layer(s) in CNN acts the same as Back-propagation algorithm of MLP, which described in section (1.1.4). In the rest layers of CNN, the situation is more complicated, forward signal propagation and backward error propagation, the following are special rules for each layer. 1- Forward Propagation of Convolution Layer Each convolutional layer applies convolution operation between all of its inputs and kernels. Let’s consider a convolutional layer l with a kernel of weights kl^ which has a size of m × m , and a set of input feature-maps F l- (^1) which it is ether the input image or a feature-maps output from previews layer, each feature-map p in F l- has same size as N × N , after convolution operation the output feature-map size would be (N − m + 1) × (N− m + 1). The output neuron of convolution operation zq ,i , j l is computed using the equation Error: Reference source not found: Where q is the feature-map in output feature-maps set F l , i,j ∈ (0, N − m + 1) , l is the index of current layer, and x^ p , ( i + a ) , ( j + b ) l − 1 is respective failed from p feature-map which is the output from l-1 layer. The output passes through an activation like ReLU in equation ( 2 .4) to produce y (^) p ,i , j l which represents a neuron in p feature-map in l convolutional layer. Figure (2.8): Dropout Neural Net Model. A : A standard neural net with 2 hidden layers. B : Applying dropout to the network A. zq ,i , j l = (^) ∑ p∈ Fl −^1 ∑ a = 0 m − 1 ∑ b = 0 m − 1 x (^) p , ( i + a ) , ( j + b ) l − 1 k (^) p ,q , a ,b l ( 2. 13 )
2- Forward Propagation of Subsampling layer Feed forward operation of subsampling layer is straight forward, since the input feature-map is divided into none-overlapping sub-regions, mostly the size is 2×2 and each of these produces one output. Another possibility is to have overlapping but using larger size of sub-regions. The max-pooling subsampling operation which used in this thesis is defined as: where q ∈ F l feature set, s is the size of pooling sub-region , in this thesis s = 2 . 3- Backward Propagation of Convolution Layer Backward propagation for convolutional layer is followed the same principles as described in section (1.1.4), the difference in fact is that convolution kernel shares weights for entire layer. The influence of kernel weights on the Loss function which used to update the weights is computed using the equation Error: Reference source not found: From equation Error: Reference source not found will obtain the zi , j l ∂ ka , b = x ( i + a ) , ( j + b ) l − 1 , and from equation Error: Reference source not found will obtain the ∂ L ∂ zi , j l =^ ∂ L ∂ yi, j
l
map notation ( p , q ) the final equation will be as equation ( 2 .16) : xq ,u , v l = max a , b ∈ ( 0 , s − 1 ) ( yq , ( i + a ) , ( i + b ) l ) (^) ( 2. 14 ) ∂ L ∂ ka , b = (^) ∑ i = 0 N − m ∑ j = 0 N − m ∂ L ∂ zi , j l ∂ zi , j l ∂ ka , b
The common task of Siamese NN is to find a relationship or similarity between two comparable things, for example determining whether the two signatures belong to the same person. Siamese NNs learns a non-linear similarity metric by repeatedly presenting pairs of positive and negative samples, i.e. pairs of samples belong to the same class or not, this for train Siamese NN to map the input samples into a non-linear subspace. That means, two images of the same class supposed to yield a small distance in the subspace and two images of a different class supposed to have a large distance. The main properties of training the Siamese network with a shared set of weights not only to reduce the amount of computations, but also to ensure consistency between each sub-network samples. The shared weights of the network are learned with the aim to minimize the distance between relevant samples and maximize the distance between irrelevant samples. Figure (2.9): The structure of Siamese CNN , where Q and A is pair of images , W is shared set of weights , F is structure of each of two identical CNNs.
Recently, D. Laptev et al. has been proposed transformation invariant pooling operator (TI-POOLING) which joins the operator for Siamese CNN sub- networks. It is applied on the output of several parallel sharing weights as Siamese CNN sub-networks and preform a maximum operation then pass the yield vector as input to another fully-connected layers. They test their system on MNIST Handwritten digit database, which includes several rotated images for each sample. One of TI-POOLING properties is: it permits to learn from the most representative instances. However, the main usage of Siamese neural networks is dealing with similar pattern images.