















Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!
















Everything started in 1966 with The Summer Vision Project, an attempt in the reconstruction of a significant part of a visual system. We can see the timeline of the evolution of this field. At the beginning people started with analyzing two dimensional signals, and that the so-called Digital Image Processing. Later was developed the Optical Flow, that actually is a process for computing what is happening in a scene in terms of motions (of pixels). Going ahead, we can see the Kalman filters, basic technique to track blobs objects in a scene. All the techniques till 2004 were either filter-based or rule-based. In 200 2 started the so-called Learning, that represent a massive changing in this field, like machine learning fell in love with computer vision and a lot of things became possible. We can see some examples of improvement in this field, like the pedestrian detection (e.g., providing some good features with Histogram Of Oriented Gradient to Support Vector Machines), face detection (using Viola-Jones method for comparing local blocks in an image, and so on. Since 2012, we saw the transition from machine learning to deep learning in computer vision, because it was demonstrated that deep learning technique was stronger than machine learning. We can see the relationship between AI, ML and DL; artificial intelligence is the big discipline that has been invented first, whose idea was to create computers that simulate the human intelligence; then inside artificial intelligence you have several areas and machine learning is one of them and the difference between a general artificial intelligence technique is that the machine learning is a subset of technique where you have a training set and you want to discover regularities from this, and then you want to learn a model transferring what you have learned to another dataset (test set); with deep learning we are still restricting the space. There exist a lot of definitions this 3 fields, like the one given by John McCarty about AI who said that “the objective is to make programs that learn from their experience as effectively as humans do”, or the definition of ML by Arthur Samuel that “is the science of getting computers to act without being explicitly programmed”, or about DL’ fathers (Y. Bengio, G. Hinton, Y. LeCun) published a paper Nature giving its first definition: “DL allows computational models that are composed of multiple processing layers to learn representations of data with multiple levels of abstraction”. What is Deep Learning? It means using a neural network with several layers of nodes studying the relationship between input and output (with some optimization on our dataset). Why is it generally better than other ML methods on image, speech, and certain other types of data? The series of layers between input and output compute relevant features (especially in hidden layers that learn features characteristic of some local patterns in an image) automatically in a series of stages, as our brains seem to. Nowadays we have huge datasets that allow us to learn deep (with many, many, many layers) learning networks, but we have also few that are powerful enough to train these models. The ImageNet project is a large visual database designed for use in visual object recognition software research. More than 14 million images have been hand-annotated by the project to indicate what objects are pictured and in at least one million of the images, bounding boxes are also provided. ImageNet contains more than 20.000 categories, with a typical category, such as "balloon" or "strawberry", consisting of several hundred images. Since 2010, the ImageNet project runs an annual software contest, the ImageNet Large Scale Visual Recognition Challenge (ILSVRC), where software programs compete to correctly classify and detect objects and scenes. The challenge uses a "trimmed" list of one thousand non- overlapping classes. In 2018 we had another revolution: Dueling (Generative Adversarial) Neural Networks, whose concept is that we have two neural networks that compete enabling me to generate new data (explanations on how it works better explained in GAN chapter). In 2019 there were an evolution on smooth-talking AI assistants, like Alexa, Siri, and so on. In 2021 we had multi-skilled AI, aiming to have approaches that are not operating on a single modality but on a bunch of modalities altogether, like in robotics. In 2022 we are using for the first time AI for protein folding, planning to use AI in medicine for drug discovery.
What's the structure of biological neuron? The structure of the biological neuron is roughly illustrated in the slide 3. There is the nucleus for the processing of our brain takes place, there are the dendrites that are the connection of neurons with others, there is the axon where the information computed in the nucleus moves away through the synapses that will connect to the dendrites. So, we have some branching input and branching output, and this is what is happening in artificial neural perceptron. There is a flow of information from the dendrites to the axon, and there is a cell body or soma where the processing takes place. We also have the same idea in the perceptron. In our brain, we have synapses that can be excitatory or inhibited. A perceptron is a nonlinear parameterized function with restricted output range. Perceptron is a first machine learning tool, it's actually a model that has some weights that are trained in order to, for instance, classify a dataset into classes. And the computation that is happening in the perceptron is shown clearly here. There are some input values of a vector x and then you add q weights that is associated to each input. So, we have an input and then you multiply it by his weight and then you sum all of those weighted inputs. There is also a fundamental component that is the h function because the results of this information should pass through a function that is called activation function, that initially was simply a threshold. The parameters are the data, the function is nonlinear because typically h is a nonlinear function and with restricted output range because originally the idea was to put the threshold, indeed the activation function that were used in neural network in the earliest implementation are called the traditional non-linear activation function, such as the sigmoid (range: 0 ,1) and hyperbolic tangent (range: - 1 ,1). When we combine the multiple perceptron in our neural network and when we use this kind of function, the researcher realized that this function may have problems because when we compute the derivative, the order of these two tend to be zero. So, they invented the more sophisticated, indeed in general with feedforward and convolutional neural network, we prefer this kind of modern activation functions: ReLU (most popular, used inside AlexNet) and Leaky ReLU. We can also see that the branches of the perceptron correspond to the three components of biological neuron (dendrite - > input, soma - > place where the computation takes place, axon - > output branch). Let's see the details of the story. At the beginning, there was an idea from McCulloch and Pitts that was to build an electronic brain, very small; it takes a vector as input and generate only a binary output whose weights are fixed. Then, there is the real perceptron, that is not just a computational model to implement the function, but it's one of the simplest machine learning tools [see the algorithm and the graphical representation of how it works]. The perceptron learning rule can be only used if you have something that is one layer because you need the direct access to the output. Moreover, this object cannot be used for nonlinear problems, but what you can do smart is to combine the perceptron in a structure that is made up of different layers. One note is that we cannot use the same activation function for the Hidden unit and the Output unit because they have a different role in the network. But the researchers understood that it cannot be used for a simple nonlinear problem. Let me try to show you a problem of XOR that they could not be solved with the perceptron: if you add up the blue points and the white points in that way, there is no line that can separate them. So, you can either specify which are good values of the weights or you can learn them, but XOR is not - > they needed something a bit more sophisticated. This problem generated the First AI Winter, a decade where the researchers think for clever strategies to train this model because neural models cannot be applied to complex tasks. This is the moment where multilayer perceptron and backpropagation were invented. They went out from this problem by with a very simple idea. We can think about composing multiple neurons in multiple layers and we have something very flexible. Each edge in this graph corresponds to a weight, and inside these cells we can choose the activation function, typically the same one for all the layers. The Multi-Layer Perceptron is based on the idea of densely connecting different artificial neurons realizing composition of nonlinear function. We are not limited by the number of output that you can put in this architecture. An example of an architecture that can be used for this sense to do one task in computer vision is semantic segmentation: we take an image and we output the segmentation map, also an image of the same resolution of the input image, and we assign discrete values to each pixel in the input. Another important aspect is the direction for the information flow. This is the peculiar aspect of a subset of neural networks that are called feedforward neural networks; they implement the Directed Acyclic Graph (DAG). The combination of the multiple perceptron is something that was not simple. A solution is the backpropagation (1986); this algorithm is a recursive procedure and that is very efficient that look to train on relatively large dataset: you have your weights and your bias pre initialized for all the neurons in your multilayer perceptron; then you take one sample for your training set or a small set of samples, you pass it through the network, you compute the prediction given the current input and given the current set of weights and you compare this prediction with the output that is the true label (to compare means we need to do this mathematically, so we need a function that measure how much my prediction differs from my label); once we have measured these error signal, we can use it to go back and update the weights in the so-called backpropagation. In practice, for neural network the concept of learning means the concepts of solving the optimization problem. The way we solve the optimization problem is through stochastic gradient descent and you want to adjust the weights of the
the neural network/deep learning/ feedforward network does, that is to learn the mapping j from the data, in which we start with low-level, then medium level and finally high-level features. It makes sense to conclude our discussion on feedforward network with an example of XOR problem. We have seen that with a linear model we aren’t able to represent XOR in a correct way, because the set of equations are not consistent. So, the idea to solve it, is learning a different feature space: one possible solution will be to define a feedforward network with one more layer (1 input layer + 1 hidden layer + 1 output layer) that is parametrized by a function f(1)^ that takes in input the variables x, the weights W and the bias c, and his output is parametrized by the function f(2), so the complete model will be f(2)(f(1)(x)). In this way, we have demonstrated that for a certain choice of the parameters and for our functions f(1)^ and f(2), we can correctly classify every example in the set. For a more complicated function this is not true, but what we typically need to do is to use the gradient. What we would like to see is how to train our feedforward neural network in order to learn our function as parameterized by the parameter feedback such that we have to approximate as much as possible the unknown function f* for representing our ideal classifier. Before entering into their propagation, we need to do several choices in the design of the feedforward network. In particular, two aspects that we need to decide are: the cost function and the output layers. Then another important design choice is the different optimization functions that we have inside the deep network. Regarding the choice of the Cost Function, we know that it should measure the discrepancy between the prediction of the neural network and our target output. We have an infinity (in the sense that we can always invent it according to our need/problem) number of cost functions we can specify. The choice of the cost function is not independent on the choice of the output units. We can see the most popular ones used for classification and regression problems. Ideas for classification loss are to use the maximum likelihood for finding the optimal q, or we can use as a divergence the binary cross-entropy between the training data and the model’s predictions, or the categorical cross-entropy. About regression, we know the simplest losses of mean square error (MSE) and of mean absolute error (MAE), but another possibility is to use the Huber that is a combination of the two above. One possibility for the Output Units is to have Linear Units where the y output is given by a linear combination of weights W by the inputs h plus the bias b; it can happen that the gradient of the output of the model is close to 0 and it is problematic. Another possibility for output units are the Softmax Units that expresses some form of normalization in the probabilities expressed by the formula softmax(z)i in the slide, but it is better to consider the logarithm of that function to simplify it. We tend to use it because maximizing log-likelihood encourages zi to be pushed up, while encouraging all z to be pushed down (softmax encourages competition among the best classes). Another important concept is the architectural choice of Hidden Units, whose design is an active area of research. What is happening inside the hidden unit is that we are accepting an input, then we are going to find the transformation and then we are applying some elementwise non-linear function, finally we obtain the output. Nowadays the most popular activation function is the Rectified Linear Units, basically we are given an input z and we are taking the maximum between 0 and z and this represent the output of the activation function. It is similar to linear units that are easy to optimize, and in particular, what is happening is that the gradient is either 0 or 1. One bad thing about it is that these hidden units are not everywhere differentiable, moreover the “die” i.e. when inactive they will never update. To improve overall value over the years, the researcher have proposed different variations in particular to the formula on the top, that indicates what is called Generalized Rectified Linear Unit, in which we add ai min{0, zi} according to some values of aI listed in the slide with their graphical representations. Other activation functions are: Exponential Linear Units, which takes all the benefits of ReLU and doesn’t get killed; Maxout Units, that generalizes the ReLU but doesn’t fit into the mold and makes a piecewise linear approximation to an arbitrary convex function; more traditional for hidden units are the Sigmoid Units, which push outputs to range [0,1], and a good thing is that it can be differentiable, but the bad thing is that it saturates most of the domain and it is very sensitive when s(z) is closer to 0; an improvement of the sigmoid problems is given by the formula of Tanh Units. For concluding this part, we add that in most of the implementations of feedforward and convolutional neural network, sigmoid are not used, rather commonly use tanh; moreover, use ReLU by default, but be careful with learning rates, and try other generalized ReLUs and Maxout for possible improvements [give a look to the table summary]. The last part of this class is about a Universality Approximation Theorem. We are now discussing the choice related to the architecture, so the specific number of layers. This is actually a largely unsolved problem. In particular, there are two factors that the influence the design of it for feedforward neural network: the depth and the width of the network and how many layers we need in order to learn our function. This problem is related to the problem of the expressivity of neural network. The most famous result is the theoretical results by Cybenko, called the Universality Approximation Theorem. It was originally started for the additional activation function such as the sigmoid but then the prosecution theory also being studied and expanded in the case of a much wider class of activation function. The problem is that we are not guaranteed that our training algorithm will be able to learn that function. So, we have practical issues and problem related to the optimization and to the overfitting.
Even if we have the best version of the gradient, the optimizer probably will not suffice to have a good performance on our test. And the reason is that with deep neural network, we have model with very high capacity for which overfitting is a serious problem. Regularization is one of the most central topics in machine learning and therefore also in deep learning; it allows neural networks to have better performances in a large variety of tasks and also avoids the critical issue of overfitting. We’ll see different regularization strategies, but we’ll focus mostly on the Lp^ methods. Our central challenge in machine learning is that our models are able to generalize, in the sense they should perform well on new previously unseen inputs, called generalization. We assume that our training and test data are drawn as i.i.d (independent and identically distributed) from the same unknown distribution. We can control the tradeoff between the situation of underfitting and overfitting by altering the model capacity of the neural networks, which means by changing the number of parameters/weights inside the neural network; we don’t like to have a model with high capacity because then we will risk getting the overfitting zone, and on the other hand with model with low capacity we don’t have the chance to learn well on the training data. So, we likely need to stay in that region where we have the optimal capacity. About the strategies to avoid the overfitting therefore also include the changing of the capacity of the model; other two approaches are: using more data, probably it’s the best choice because the more data we have, the less the model falls down in overfitting problem; averaging many different models, that can be obtained by considering different models or by taking the same model being trained on different subsets of training data. Regularization is any modification we make to a learning algorithm that is intended to reduce its generalization error but not its training error. We are interested into regularization methods for deep architectures because deep learning algorithms are typically applied to complicated domains (e.g., images, sequences, audio, etc), also because controlling the complexity of the model is complex and a very challenging task; instead, in practical applications we almost always find that the best model (the one that minimize the generalization error) is a large model that has been regularized appropriately. Overfitting in neural networks can be controlled in many different ways: Architecture (limiting the number of hidden layers or units per layer), Early Stopping (starting with small weights and stopping before the overfitting takes place), Weight-Decay (penalizing large weights using constraints on their squared values - L2 penalty- or absolute values - L1 penalty), and Noise. The most traditional approach is to limit the capacity of the model by adding a penalty to the objective function, given by W(q) and l is a hyperparameter that goes from 0 to infinity that is a tradeoff between these two functions. The most useful approach that satisfy this scheme of using this penalty parameter is L2 Regularization where we have only the weights associated to a certain layer and then we are taking the sum of the squared norm of the weights. Another option is using L1 Regularization, that is implemented similarly to the previous method but with the only difference that we are taking the one norm of the weights; in this case, the more l is bigger, the more weights become 0. This method is mostly used as a feature selection mechanism, for instance LASSO (Least Absolute Shrinkage and Selection Operator) which integrates an L1 penalty together with a linear model and least squares cost function. The L1 penalty causes a subset of the weights to become zero, suggesting that those features can be discarded. Data Augmentation is based on the idea of using more data for generalizing better a ML model; however, the amount of data is limited, so we have to create synthesized data. This approach is widely used for classification and image recognition, whose idea is to generate new samples (x, y) just by transforming inputs. This method cannot necessarily be applied to other problems, for instance with the density estimation problem. Another problem is applying transformation that would change the class (‘b’ vs ‘d’ and ‘6’ vs ‘9’). Another strategy for regularization is the addition of random Noise to the input of the network, like in the example of Gaussian noise in which the output is the original output plus the noise that is amplified in proportion to the weights of the layers in the networks. Another technique for the regularization is Early Stopping: we start with small weights and stop the learning before it overfits or the gap between the validation set loss and training set loss starts to increase; every time the error on the validation set improves, we store a copy of the model parameters, and then when the training terminates, we return these parameters rather than the latest parameters. Another approach is the Multi-Task Learning for improving the generalization by pooling the examples, like soft constraints on the parameters, out of several tasks. We can see in the slide an example of a common way of analyzing multi-task learning by having both generic parameters (typically the upper layers of the NN) shared across all the tasks and task-specific parameters (typically the lower layers of the NN) for better controlling the overfitting. Another approach is called Parameter Sharing, in which, instead of enforcing same parameters, we can enforce soft constraints such that certain parameters inside the network are close to another one in order to store in memory only a subset of parameters. One architecture that use this idea is convolutional neural network applied in computer vision, which takes this property into account by sharing parameters across multiple image locations [look better from slides how it works]. Another approach to avoid overfitting is to use Model Ensembles, whose idea is to have different models that are being trained separately, then we have each model that produce an output and then we combine the prediction of the multi models in order to have better performance; the simplest approach is to create a different model from the original dataset obtaining a slightly different version of the dataset. Last one approach is Dropout in which we are taking a traditional feedforward neural network and then we randomly set some neurons to 0 in the forward pass, whose choice is determined by a probability r; it works because it forces the network to have a redundant representation. Bagging is a method of averaging over several models to improve generalization, but it is impractical to train many neural networks since it is expensive in time and memory, while dropout makes it practical to apply bagging to very many large neural networks. Basically, when we train the neural networks with dropout we use minibatch.
The reason why CNN became so popular is because its application benefits of structured data. About differences between traditional ML approaches and DL ones is that in the first we train the classifier and then we apply the trained classifier, while in the latter we are just going to apply the trained classifier. In CV, we have seen that there exists some features that are more effective than others. When we work with deep networks, the situation is different because the boundary between the feature structure and the classifier is actually very fancy because we have a bunch of layers that are jointly trained (main difference with ML approach). Convolutional Neural Network is simply feedforward neural networks that use a convolutional rather than a general matrix multiplication in at least one of their layers. Given an input and given the fact that we are defining a kernel, a small matrix with some values, then the result of the convolutional is another matrix and its elements are computed by considering all the associated elements of the input matrix and the kernel, multiplying them, and then summing up. For filling the elements in the new matrix, we move the kernel and repeat the same operation. This operation can be formalized by the formula below the slide, in which we have the input matrix and a smaller kernel matrix, then we iterate over indexes m and n and we are going to have an output, another matrix which each element is filled according to this equation. The first important study on the visual cortex was done by Hubel and Wiesel in 1962, which figured out that in our brain we have some parts where we process the visual information that operate by discovering some form of local features. So, the brain is structured in different sections, each with a specific task, to recognize objects and create a body reaction; in the first layers we detect some information at the local scale, while in the last layers we are going to discover more complex shapes. The idea of convolutional neural network is somehow to have a computational approach that emulates these mechanisms. The Neocognitron is the first computation in order to try to emulate it and it is actually made up of two level of cells that instruct the local features, the S-cells that extract local features and the C-cells that aggregate what is below allowing for positional errors. LeNet is the first approach really used in the real problem in an application domain with CNN invented in 1998. Given the input, we apply the convolutional layers for computing the set of feature maps with a certain kernel, and then when we apply the subsampling layers in order to reduce the size of this feature; then we repeat the same operation, we have a convolution, for having a certain number of feature maps and then we subsample again until we reach more resolution for our feature map such that we can take all of them and process them with traditional fully connected layers; the output layer of our neural network, in this case, is made of ten different output corresponding to the digits since the basic problem was a digital revolution. The Convolution is, in general, an operation of two function of real-valued argument. We can think as a convolution the example of one dimension in the theory of signals, which involves the input and the kernel and, instead of computing, there is a match since we are in the continuous space; so, we are computing the output that is a signal, still a function. It's more common in digital signal processing to use discrete signals instead of continuous signals; in that discrete space, instead of taking the integral, we are taking the summation of the argument that is actually the same of continuous space. In the case of 2D convolutions, convolution is a general-purpose filtering operation for images, in which we apply a kernel matrix, and it works by determining the value of a central pixel by adding the weighted values of all its neighbors together; the output will be a new modified filtered image [short clip of how it works]. In the two-dimensional case of the kernel operation on a small window is exactly the same. The value of the parameters are the same in the sense the value of the same-colored edges are the same. This leads us to repeat the two fundamental property of CNN: the local connectivity, so neurons are connected all only to a small number of neurons in the previous layer; and the sharing weight parameters across the spatial position, that leads us to reduce the number of parameters such that our neural network is much more robust to overfitting. In the earliest implementation of a convolutional neural network nowadays things have changed a little bit because there are basically three distinct types of operation inside the CNN: we can apply either the convolution, or some form of non-linearity, or some form of pooling. In practice, the convolutional layer consists of a set of filters and each filter covers a small portion of the input data, so-called receptive field, producing a multi-dimensional feature map. About the CNN architecture, we can see that given an input, for instance an image, our neural network will proceed with a convolutional stage, then a non-linear stage where we apply some non-linear activation function and then another non-linear stage that is the subsampling stage whose receive an output that will be reduced to a certain dimension; this operation is repeated multiple times until the end. When we apply the convolution, we are taking the input and the shared weights and computing the formula in the slide that will pass through the activation [practical example of how it works]. Sometimes, we want the output of a convolution to have the same dimension of the input matrix; in this case, the solution is zero padding that means appending zeros outside the main matrix of the input. Once we have the output of this operation, we apply the non-linearity that we have already seen in a previous chapter, for example the ReLU function. After we have passed the convolution and non- linearity layers, we want to downsample the tensor and it can be done in many ways, for instance we can operate with max pooling which takes subsets of each matrix in that sensor and then computes the maximum of a block region. In
Last thing to discuss about CNN is their flexibility to be applied not only to categorization problem. So far we have seen in the Digit classification with 10 classes for dataset MNIST using LeNet and the Object recognition for dataset ImageNet with 1000 possible classes using AlexNet. We need a neural network that does not necessarily deal with classification problem but is also able to deal with the structure of the prediction problem, and among the structural prediction problems that are of interest in computer vision, two of them are object detection and object segmentation. In the case of object detection, we would like that the neural network predicts at the same time multiple bounding boxes and each bounding boxes is associated with a category, while about segmentation it needs image as input and image as output because we want to assign the pixel of one color to a possible label. [Not in this slide: in computer vision we have also semantic segmentation and instance segmentation; semantic segmentation means the pixel of the class darker will be always of the same class, while for instance segmentation we have different labels for different objects.] How convolutional neural network were adapted in particular to detection and segmentation? Let's see first the Object Detection. It means that we have to simultaneously solve classification and regression problem because the input is the image, but the output are the different bounding boxes + the labels associated to each object in the image. For each object in the image, since the task is very difficult, is also more difficult to find the dataset of very large scale. So, the reasons why we use CNNs for detection is data scarcity and then every time we are applying the convolutional layer, we are achieving some feature representation preserving the information about the essence of the object. In the community it’s available for the detection the PASCAL VOC dataset where the number of categories and the number of images are quite limited wrt large dataset the community have at their disposal nowadays. Something very stronger came from Amsterdam group with the Selective Search that was also used in the very first deep network for object detection. It is an unsupervised technique which clusters the pixels of the image at different resolution using bottom-up grouping of image regions to generate a hierarchy of small to large regions; its goal is being fast to detect objects at any scale using hierarchical algorithms by consider multiple grouping criteria. So, the first step is to take the input and to generate a sub- segmentation creating a huge amount of possible candidates; then we recursively combine similar regions into larger ones; and, finally, it allows us to have bounding boxes that contain possible objects at different locations in the image. Let’s introduce also the R-CNN from Berkeley, that’s the very first work of applying a CNN for object detection; its idea is to use selective search to extract a certain number of proposals (2000), then each proposal is scaled to the resolution that the AlexNet wants, and then we compute the CNN features learning a classifier. They also proposed something slightly more sophisticated than that by using bounding box regression [look the following slides for more details, and also the results on PASCAL VOC and ImageNet datasets]. Which were the issues with R-CNN why the wider community decided to move over and to progress? First issue is that this is not a model where we have a real training because we have a multi-stage procedure, and the second point is that each object proposal is processed separately. Another problem is regarding the testing that is computationally slow, so it takes a huge amount of time to train the network as we would classify about 2000 region proposal per image and it last around 47 second for each test image. The first attempt to overcome this issues were Fast R-CNN in which we are using RoI (Region of Interest) Pooling that shares the forward pass of a CNN for an image across its selected subregions and then it combines all models into one network. The difficulty that the bounding boxes have different dimensions, so also the associated feature maps will have different dimensions, can be solved using the RoI Pooling for layer regions that are reshaped into a fixed size for being fed into a fully connected layer. We can also see the function loss for our neural network that represents a tradeoff between the two losses, one serving classification and the other one for regression. The fact that we are using to share the features extracted enables this algorithm to be much faster than R-CNN about the training and the test time. We have seen both R-CNN and Fast R-CNN use selective search algorithm that is a slow and time-consuming process; so, the biggest advance in the community was given by Ren’s group with Faster R-CNN which eliminated the selective search letting the network to learn the region proposal. Later, was introduced another method, so-called You Only Look Once (YOLO) different from previous methods which used regions to localize objects within the image, but it treats the detection as a regression problem using single convolutional network to predict the bounding boxes and the class probabilities for these boxes. It works by taking an input and dividing it in certain grids, then to have a network that produce two things as output, one for bounding boxes with the associated confidence and the other one for some class probability maps, and finally we obtain the final detections. It was very interesting for the community because it was much much faster than the previous methods, but it was also a limitation of struggling with small objects within the image. Instance Segmentation is a field in which the boundary between detection and segmentation is very close, in which the goal is to assign a label to each pixel of the image. One very popular approach is Mask R-CNN, an extension of the Faster R-CNN, which has an additional branch for predicting segmentation masks on each RoI. In this case, the image is processed by the CNN to extract some features and to generate the feature maps, then Region Proposal Network (RPN) uses a CNN to generate the multiple Region of Interest, and RoI Align network outputs multiple bounding boxes rather than a single definite one and warp them into a fixed dimension. Warped features are then fed into fully connected layers to make classification using softmax and boundary box prediction is further refined using the regression model; warped features are also fed into two CNNs to output a binary mask for each RoI. Mask classifier allows the network to generate masks for every class without competition among classes. We can see also different applications about Semantic Segmentation which is a problem where we need to assign a label to each pixel of the image. An example is that there exists a family of the so-called Pixel-level Prediction task as we can see in the slide. Two important fields where we need semantic segmentation are for sure Autonomous Driving and Medical Imaging. It is based on the idea of reinterpreting classification network as Fully Convolutional in which we operate on each pixel separately, instead of having a fully connected layer after the convolutional structure. Other researchers decided to operate by introducing Upsampling Layers.
What is a sequence model? We will discuss about the image captioning and the role of attention inside the recurrent neural networks or for the purpose of image captioning, then we will shift to another application that is neural machine translation. We said already what is a recurrent neural network, repeat the just the most important things: the idea of capturing the dependencies among different words in a sentence or in general different elements of a sequence that is a through introducing a recurrence formula between different data representation at subsequent time, so this is the key formula of a recurrent neural network where we are learning the new state representation, modeling the dependencies among the different element of the sequence to this idea representation, and we are learning a nonlinear function that model these dependencies. About image captioning we have seen that given an image, we want to produce a caption implementing the neural network that comprises about a CNN to learn the features present in the image and the RNN to produce a sequence of words. What we have not seen is: can we push the network to look only at some relevant features in the image when our RNN are decoding some special words? It is that we want to obtain with the so-called Sequence models with attention. If we want to address the task of image caption given an image, we ask the neural network to produce a qualitative simulated sentence of describing the content of the image, putting together a CNN and an RNN to get something quite strong. This was demonstrated by the people cited in the slide in which they introduced the first deep neural network system for image captioning, whose idea was to capture visual features through a pre-trained CNN model and then perform the task of captioning that means predicting a certain word given the visual feature by using the LSTM. With the inference approach we can predict a bunch of most likely sentences because we want typically to operate in some form of post-processing step. A typical approach is the Beam search such that we maintain k top-scoring candidate sentences (according to sum of per-word log-likelihoods), and at each step, we generate all their successors and reduce to K (beam width). The BLEU Score (BiLingual Evaluation Understudy) is a metric originally developed for machine translation task that can be also adapted for image captioning. It is an algorithm for evaluating the quality of text which has been machine- translated from one natural language to another. Quality is considered to be the correspondence between a machine's output and that of a human such that "the closer a machine translation is to a professional human translation, the better it is". The BLEU Score is computed by the N-gram precision, so we want to count the number of matches in terms of N-grams between the candidate and reference translation, then divide by total number of N-grams in candidate translation and we clip counts by the maximum number of times an N-gram occurs in any reference translation. Maybe just using the BLEU score is not a good idea, for this reason the community has developed an alternative to score as well as being computing the score with different the size of N-grams precision in order to somehow have a comprehensive evaluation of the pros and cons of different methods. We can see an architecture for Captioning with Attention in which the authors forced an RNN to use only certain visual features when it predicts certain words because, for example, some visual features may be more relevant for predicting the word “bird”, while some other visual features can be misleading and the same if we have to predict the word “water”. The architecture maintains the CNN pre-trained at the beginning from which we have an output and then at each time we force our neural networks to predict not only the probability of a certain word to be predicted but also to predict the so-called Attention Map, that is a set of 14x14 numbers that tells us which areas of the image are more important for predicting a certain word. Its prediction is fed back to the next step by combining the feature map with the attention map into the so-called Context vector. We can see how this step is repeated many times. They were introduced for the purpose of improving the systems, of improving the performance of the caption. So, we obtain a feature map from the convolutional that represents the features in form of a matrix, while from the recurrent we obtain some probability distribution that indicates that at a certain point some area of the image are more important for predicting a certain symbol as the word, then we multiply both the matrices, and we obtain the Context vector. There exists two kinds of Attention Type for the context vector: Soft Attention such that the context vector is computed with a weighted combination of the grid of features and the attention map, and the Hard Attention in which we sample just one location z per time such that z is a random variable taking on a certain value with certain probabilities that requires a more sophisticated training [we can see a graphical difference of how they act and their results in a table]. A big field that is paying a lot of attention is Neural Machine Translation that is mostly used for improving Google Translate. How do we obtain these results? It is based on the Seq2Seq learning such that can be used to perform end-to- end translation. It shows the promise of Neural Machine Translation (NMT) over Statistical Machine Translation (SMT) in which were proposed a 2 Deep LSTM architecture to do language translation from English to French: Encoder that takes the input and maps it into a fixed dimension vector, and Decoder that takes the fixed vector and maps it to an output sequence. We can see from the results they used some tricks, by using deeper architecture with large size of beam. We assume also that the latent representation is able to capture entire phrases. In 2014, ACL’s group proposed a different architecture by introducing the context vector for decoding words, where an encoder RNN learns a fixed length vector representation (context) from variable length sequence input while the decoder RNN (similar to encoder architecture) outputs a variable length sequence output from the fixed length vector