Vision Beyond Classification
Transcript
So, thank you, thank you all for coming. So, today we're going to talk about vision beyond classification, and I guess the first question is: Why do we need to go beyond classification? So, you know how they say that a picture is worth a thousand words? And we say that because the world that we live in is very rich and very complex from a visual point of view. And most of the information that we capture about our surroundings comes from our eyes. So, 80 percent of the information comes from the eyes.
So, however, classification models they can only learn a few words about an image. So, if you take this particular image, which I think it's quite a nice one, and pass it through an image classifier - ResNet-50, which is a very popular image classifier - it will tell you something like bicycle and garden, and these are correct, correct answers. However, I think we are far from understanding, from correctly parsing the scene that we see here. So, first of all, we have two bicycles in the scene, and then we have persons on those bicycles. And at first you might think that they're riding those bicycles, but then, when you look closely, you can notice that, okay, one of the bicycles and the person are upside down, so that does not really correspond with the biases that we have about the physics in our world.
And so, yes, there is really more to this scene that we need to understand. So, first of all, we need to understand the pose of these objects with respect to the camera and also the relative pose, like the pose of the objects with respect to each other. And then on closer inspection we notice that, okay, this is actually a top-down view. So, the camera is actually positioned at the top, so this image was actually taken with a drone at the top of the garden. So, like, the Holy Grail in computer vision is: we want to train a system that achieves human-level scene understanding because, if we have that, then we have really a large number of applications that become available. So, first of all, think about visually-impaired people. So, such a system could help them navigate environments. And then we have all kinds of
applications, for virtual reality or augmented reality, that we could we could have, and then any kind of robotics or autonomous vehicles. And something that I am really interested in: I believe that if we advance research in designing such a system, we will also achieve a better understanding of our brain, of how our visual system works. However, designing a system that really achieves human-level scene understanding is a very challenging task because there are so many factors to take into account.
So, for example, as I mentioned we have different tasks that we need to think about, like object detection and pose estimation and camera position and others. And then we need to think, okay, in which order should we tackle these tasks? And then we can have different inputs and different structure in the outputs as we will see today, and then we might have different priors about the world that we might be tempted to want to inject into these models or we might want to let these models learn everything end-to-end and, of course, we want these models to be as accurate as possible, but this might conflict somewhat with the efficiency of- of the models. So, the search space is huge, and there's really a lot of work to be done. So, today I am going to guide you a bit to explore this space, and we are going to literally take this construction - supervised image classification - and we are going to try to replace each word in this and see what we get. So, in the first part, we are
going to replace classification and see what other tasks are there. Then we are going to replace image, like we will replace the single image input and see what other inputs we can use for our models. And then we'll replace the supervised part and try to go beyond strong supervision. So, I will not be talking here about unsupervised learning, which is a very important topic, because this will be covered later in the lecture series by one of my colleagues. I will talk about a self- supervised learning, and then we will end with a few open questions in the field.
So, in the previous lectures my colleagues have introduced deep learning as this deep learning puzzle as being a very flexible framework where we have these computational nodes and then we can use these computational nodes to learn a mapping between input nodes and output nodes. And then we have this loss function node- we have the loss function node that helps us train the system so that it makes predictions that are as close as possible to the desired target. So, by the end of this lecture, you will know how to redefine these building blocks so that we can perform different visual tasks using different types of inputs and different forms of supervision.
Okay. So, let's start with the tasks beyond classification. So, the topics that we will cover: We will see different task definitions, and we will see models for these tasks and how to train and evaluate them, and then some tricks of the trade. We will not go exactly in this order over the topics because they are really intertwined, but these are the topics that we will cover. So, other important tasks for scene understanding but that we will not have time to cover - I'm listing here two, for example - image captioning where you give an image to a system and then the system has to generate a language description of the image. So, for example, here the system could generate two beach chairs under an umbrella on the beach.
And this problem could be stated as a classification problem where you give, like, let's say a thousand different possible answers and the system has to choose the correct one, or the system could generate the description like in a free-form language, which is a more difficult task but maybe more meaningful actually. And another task that is also important for scene understanding is pose estimation where we actually define key points on the human- pose estimation where we define key points on the human body and then we want to detect those and to track those so that we can learn about the position of the people in the scene. And this, for example, is very useful in any gaming applications that you might imagine. Okay. So, let's see the tasks that we are really going to cover, and I've listed them here like in an increasing granularity, like we want to get more and more details about the scene. So, in the previous lectures my colleagues covered classification where you only
get, like, a sparse description of the image, like just a few words. And then today we will see object detection, semantic segmentation, and a note on instance segmentation. Okay so, task one: object detection. So, first of all, object detection is a multitask problem because we want to classify the object, like to assign it to a category, and we want to localise the object, like we want to know the position of the object in the image, like what I'm showing here. I want for this object to know that it belongs to the class sheep and then I want to know the location and I'm indicating this through this bounding box. So, for this task, the input to the system is an RGB
image with height and width and three channels of colour. And then the output, it's a class label, like a one_hot encoding for the class label where we have zeros everywhere except for the index of the class. And then we want to have a bounding box around the object for the location of the object, and generally we parameterise this through the coordinates of the centre and height and width. And we want to do this for every object in the scene. So, for the previous image that I've shown this would be the desired output. Okay. So, to train such a system we would need a dataset where we have samples for training and for testing. And then in this dataset we would have samples and then each sample would contain an image, as I said, an RGB image, and then we have a list of objects. So, for different images we can have different numbers of objects, so then here we have this list
of objects, and then for each object we have the label as a one_hot and then we have the bounding box with the four coordinates. So, in the previous lectures you've seen how to do classification. Now, the question is how can we do- how can we predict bounding box coordinates which are real values? So, like, a quick recap: In classification, we train a system, we train a mapping that assigns input data points to different classes. So for example if I have a cat, a cat image, it puts it in the cat category. If I have a car, it assigns it to the car category. So the output in this case is discrete.
However for bounding box prediction, we wanted to have a continuous output. And let's assume that we have a model that has an output module with four units that can give me the four coordinates of the bounding box. And then I would have something like this. So let's say my ground-truth bounding box, the green one, and then my system gives me a prediction like the red one. I want to train the system. I need to give it feedback on the accuracy of this bounding box. I want to say, it needs to be smaller, bigger, it needs to be more to the left or to the right.
And in the classification setting we cannot do that, like we cannot give this kind of feedback because the data generally is not ordered, when we do classification. So, if I give you an image of a cat and you mistake it for a chair or mistake it for a car, it's as worse, like you cannot say, "oh that was worse than the other." Whereas for bounding box you can say, "okay that box should be bigger, that box should be moved to the left". And we can achieve this doing regression instead of
classification because in regression, we have continuous outputs. So the way we generally do regression is we minimise for example the quadratic loss. There are other losses but quadratic loss is a simple one. So, for example, here: t would be my ground truth. Like the four ground truth coordinates of the bounding box, and then x would be the prediction of the network. And then the goal is to minimise the distance between the two. So, we minimise the mean square over the samples.
And a quick recap: Classification versus regression. As I said in classification we aim to map inputs to predefined classes, whereas in regression we want to map inputs to continuous values. In classification, the output will be discrete whereas in regression it's a continuous value and then we have this difference, this distinction that in classification there is no order in the data whereas in regression we have a notion of order in the data. And there are different algorithms that can be used to perform the two. So it's all good, we can do regression to do bounding box prediction. Now, the problem is that generally we will have more than one object in an image, and we want to
detect all of them. So, when I make a prediction, how do I know to which ground truth bounding box should I compare it? So, one might say: OK, you take the nearest bounding box and then you assign it to that, but this can get very messy, very quickly. Another way to deal with this, which is slightly cleaner is to actually approach the problem in two steps. First we do a classification such that we roughly say: OK to which ground truth bounding box your prediction belongs to and then around that rough prediction, you will refine through regression.
So, the conversion from a regression to classification, we do it by discretising the output values and what I mean by this is: let's say that my ground truth is a value, like that, like 3.78 and instead of predicting that, which could be very hard, I actually just bin the output space in equally spaced bins. Like here, I have like nine bins and then I project my value and wherever that falls that would become "one" and then this will give me one_hot label that I can use in classification.
And then if I have another value then I just get this other one_hot label. If you know the game hot and cold. Maybe that rings a bell. What it means, like if you think of something and I have to guess what you've thought of. At first, we would play like this, right? You would tell me hot if I am close to what you're thinking of or cold if i'm far, and very hot if I'm getting very, very close. So first of all, I do this classification and once I'm in the area where it's very hot, then there I can regress and I can make the right prediction like in that space.
So this is kind of the approach that we take here, in two steps. So first classification and then regression in that local area. OK. So let's see now. Detectors that actually apply exactly this strategy. First classification and then refinement through regression. And I will present two case studies for this. And first of all, there are many, many papers published on this topic but I've chosen two that have very good accuracy, and I think they're representative for the class of detectors. So Faster R-CNN, it's a two stage detector, in which first you identify good candidate bounding boxes and then you refine through regression.
The way this looks like: So first, you have your input image and you pass this through a block of convolutional layers, like, we have convolution, ReLU, pooling, as you've seen in the classification models as well. So we pass this through blocks of convolutional layers and then we obtain here, feature maps and then these are passed through this branch to identify the most promising bounding boxes. And then once we have these candidates, then we collect the features from here. We collect the features
corresponding to these bounding boxes and then we do our final regression and classification. So first, the first step. As I said, we discretise the output space. So discretising the output space means discretising the bounding box space. So the bounding box has these four coordinates, so we have first two coordinates for the centre and then height and width. To discretise the space of the centres, We just choose these anchor points and we distribute them uniformly over the image.
And then to discretise the space for height and width, we just choose candidate bounding boxes with different scale and ratio. And then this will give us N candidates per anchor. And generally we choose like three different scales and different ratios. In general, we use nine candidates per anchor. And then we train a classifier that predicts for every box, predicts an objectness score. So here we just say: is there an object or not in the box? We don't care what the class of the object is. We just want to know if there is an object or not. And then we sort and keep top candidates.
The bounding boxes where the model is most confident that there is an object there. And then we refine through regression. So imagine we would have an MLP, like, fully connected layers that have at the end four units, to give me the four coordinates of the bounding box. So, now we know how to do that. And this gives us a good accuracy actually and it runs decently fast, like 5 frames per second.
However, something that I didn't make explicit, is the fact that the operation that we have here, when we take the bounding boxes and we keep the most promising ones. Actually this operation is not differentiable. So if you've attended the previous lectures, my colleagues mentioned that deep learning is very flexible and we can replace those pieces in the puzzle, but we have to put there functions that are differentiable, so that we can backprop gradients through them, to train the system. However, the operations that we have here, they're not differentiable. So we cannot backdrop gradients through here.
So, in particular we cannot backprop gradients with respect to the parameters of the bounding boxes because we've just chosen those, we've fixed those in advance. And I just added there a note. There are ways to make this operation differentiable. However it would complicate things quite a lot. But I encourage you to check this paper by Jaderberg et al. - The Spatial Transformer Networks - and there they showed how you can do this operation, the cropping operation that we have here, in a differentiable way.
So as I said I'll just add one more note here. Because this is non differentiable here, what this means is that we have to train the system in two steps. So first, we train this part here, and then this one here is trained. So this one to train it, we just generate objectness ground truth labels and the objectness ground truth labels: we just check if any of the bounding boxes here, if they overlap significantly with one of the ground-truth boxes.
And then this is how we train this through classification. And then once this part is trained, we just put it into the bigger model and this part does not get trained after that. So this one is just used to give me some candidates but the backpropagation happens through here. So that is what we mean by two-stage detector. Right. So first we have to train this region proposal network. I probably didn't mention before, the name, it's called the Region Proposal Network and then we plug it into the bigger classifier detector. And then we get the full object detector.
And we get, as I said, we get good accuracy with a good speed but it can be quite cumbersome to actually train a system like this. So then we would really like to have one stage detectors, where we train everything end-to-end And we don't have these issues of non-differentiable building blocks. So I'm presenting here another. So, the second case study is RetinaNet which is a one stage detector. So I would just say to ignore this part with the hierarchy from here because I will explain a bit later what that exactly is.
But focus on the bigger picture. So what it does it just. OK I'll just go back to this one, so here, we just took convolutional features at one scale, from here. Right. And then we generated our bounding boxes, the candidates and the predictions. Whereas in this one, we have this hierarchy of features at different resolutions. And I will explain later how exactly we would obtain this, and then from the different scales we just generate
predictions for bounding box coordinates and for the object class. So as you can see, the output here. So here we have the output for the classes of the object. So that's K times A. K stands for the number of classes that they have in the dataset. And A stands for the number of anchors for bounding boxes. And for the second head here, we have 4 times A. So four stands for the four coordinates of the bounding boxes.
OK. So why don't we just train like this all the detectors? Why do we need to have the two stage detectors that I showed before? So actually it turns out that if we just do this for all the bounding boxes that we have in the image, actually we will end up with a very poor learning signal and we will never get a very good very good accuracy. And why this happens is the following. So.
When we want to identify the promising candidates, we use the cross entropy loss. So this is the loss for classification. Now if we analyse the graph of this loss, you can observe that the loss penalises heavily here. So this is the probability of the ground truth class. And the loss is high when the detector is not confident in the correct class. However, it goes down very slowly
when we are starting, when the detector starts being correct. So even here when the probability is higher than .6, that means the detector is quite confident in the right class, even there the loss is still quite significant. It's higher than zero. And now when you think that we have a ton of examples like this, and they most of the time belong to the background because in an image we will have few objects most of their bounding boxes will come from the background.
This will result in really overwhelming the useful examples. And this is why in the previous detector, we had this two stage operation right? So the first stage was really responsible to prune all those easy negatives that are just from the background, and they really don't help much to train our system. And, in general, one-stage detectors, to avoid this problem that I've just shown here, they employ hard negative mining heuristics. So what- what this means is that, the way you train a detector like this with hard negative mining is that
when you build your training set, you start with the set of positive examples, so that wherever you have objects the bounding boxes are corresponding to those objects and then you get a random subset of negative examples from the background. And we take a subset because as I said the full set would be too big. And then you train the detector with this more balanced training set. Then we test it on unseen images, and then we check where the detector made mistakes. And it will make mistakes because we've considered only a subset of the negatives, which means that we are probably not covering the distribution of the negative examples. So then we check where the detector made mistakes, so we check for false positives. So wherever the detector said that there was an object, here i'm giving for a person.
And those would be our hard negatives that we need to add to the training set, and then we retrain it so that the detector can learn to classify those as negatives. And we can iterate this several times. So this is an option. And I'm encouraging you to go to check this reference which gives a really in-depth presentation of this technique, of hard negative mining with a nice formalist using Bayesian theory. However, it is a very complicated training procedure.
So instead of doing this, the detector that i'm presenting here, the RetinaNet, actually comes with a much simpler and more elegant solution. So instead of doing all this hard negative mining heuristic, it actually modifies the learning loss. It modifies the cross entropy, such that the examples that are well classified, that are in this region, they are downscaled. So we just add a weighting factor so that we put less energy into those examples. And you can simply do this by adding this term here. So this is the focal loss, so this is the loss that they propose.
They call it the focal loss. Simply, you take your cross entropy and you add this weighting term. So what this means is that when you're confident in your prediction then this term here will downscale the loss for those examples. And now this leads to really good accuracy. And this is also faster, it's faster than the Faster R-CNN that I've shown before. So this is considered now like state of the art for object detection and it's a simpler detector, as I said it's training in one stage. So yeah it's much nicer.
OK so that was for object detection. Let's see now Semantic segmentation. Why do we need semantic segmentation? So actually for certain types of object, the bounding box that we get from object detectors might not be a good representation. So for example, here, if you look at the person, just because the person has their arms spread, the bounding box is very, very wide. And then if you look inside, most of the pixels in the bounding box, they do not correspond to a person, they actually belong to the background or to other objects. So we want a more refined representation and we can get this through semantic segmentation. So here we really go to the extreme and you say, OK I want to assign a class label to every pixel in the image and then this is a very, very refined representation.
So as you see here, I want to put a label on all the pixels that belong to a person or I put this label on all the pixels that belong to the class sheep or class dog, and all the rest is background. Now, we've seen how we can do classification, but now the problem is how do we do this kind of dense prediction? Because so far we have done sparse prediction where we only generated one label per image. Now we want to generate an output that has the same resolution as the input.
If you have attended previous lectures, you've seen this operation, the pooling operation. And pooling operation is responsible with reducing the resolution of- of the feature maps, and we generally do pooling operations so that as we go deeper into a model, we want the units to have an increased receptive field. And we want this because when you have a larger receptive field then you can extract more abstract features. So pooling operation is where you just compute mean or max.
You take a window and then you compute mean or max over that window. And that is the value that you copy in your output feature maps. To get a dense output from our network, we need the reverse operation. So we need an unpooling operation. So the simplest operation we can do is to do nearest neighbour upsampling. So I just take the value in my feature map and copy it in the corresponding place in the output, in the upsampled output, and then I just copy in the neighbouring locations the same value. And I do this for the entire feature map and now I have upsampled activations.
So i've just shown the simplest of the operations but there are other upsampling methods. So the thing with this very simple operation is that the result would be very blobby, whatever we get here is very blobby and this other operations that I mentioned here for upsampling they try to address this issue of blobbiness. So for example, one thing we can do is to unpool with indices. So what that means is that when we do the pooling operation, we can preserve the indices where the max pool is, that is the argmax operation in the pooling window. And then we can use the indices to know where to copy in the output.
So that will give you an output feature map with holes. But what we do after that, we need to apply a convolution and then we can smooth out the feature maps. Another option is to do deconvolutions. So basically there in deconvolution, you just reverse the operation that you have in convolution and you can upsample through that. So I put here references for these other methods. Now we have a block that can do upsampling, I will just show here as a case study, a network that that does semantic segmentation. So produces an output at the same resolution as the input.
So this is U-NET. And this was proposed for segmenting medical images. So especially in medical imaging, segmentation is a very important problem. And it really helps a lot the practitioners in the field. So in this model you have your input, your input image. It goes through different stages of convolution, ReLU, pooling as we know. We get here to the bottleneck. So this kind of model we call it an encoder-decoder model. So, this part will be the encoder and this is very similar to an image classifier. And then when we are here, we've reduced a lot the spatial resolution. Now from here, we need to start upsampling, so we go through the decoder part, to get an output that really has the same resolution as the input.
And importantly, as I said, because when we do the upsampling here, we can get a blobby feature map, we add these long skip connections from the layers in the encoder at the same level of resolution. By adding these skip connections, we can add back in the high frequency details that we might have lost when we did pooling and unpooling. And this is very important. The skip connections, you've probably seen them in the ResNet classifier. They're also very important for training because this makes backpropagation of gradients easier. Because now the gradients will backpropagate through here but you will also have gradients that backpropagate directly through these skip connections.
Now to train this kind of system: So our output will have the same size as the input times the number of classes because now for every pixel, for every location in the output, I will have a probability distribution over the classes, over the possible classes. So that's why, so for every location I have the distribution over the classes. And now to train this, we will use the same cross entropy that we've used before for classification, but now it is averaged over all the locations in the input.
Okay, so now just a quick recall of the RetinaNet. The object detector that I showed earlier, where I said that we don't need to understand how we get that hierarchy of features. So maybe you recognise that this is the same U shape that we had before. Just here it's a bit reversed. So what they did there is, like, this is like the encoder part. And then this is like the decoder part where they did upsampling here, and then they added these long skip connections from the corresponding levels in the encoder.
This is the same idea that is used in both tasks. So this just shows again how flexible these models are, that we can really reuse the same kind of ideas from one model to another. OK so now we know how to do semantic segmentation. However, this can still be very confusing especially when we have overlapping objects from the same class like here, for example. If you have overlapping objects in the same class, you would just get like a big blob saying "sheep" but you don't know where one sheep ends and where the second one begins. So what we can do to avoid this kind of problem, is to do instance segmentation. So in instance segmentation, we actually combine object detection and semantic
segmentation. So here in semantic segmentation we just assign a pixel to a class category. Here in instance segmentation, we also differentiate the instances from the same class. So now we really have a less confusing output. And we don't have time to go in detail into this approach, but I encourage you to check this paper, the Mask-RCNN paper for example, which gives a good solution for this problem.
So we have all these detectors. Now how do we evaluate them for detection or semantic segmentation? So in classification, to evaluate, it's easy, we just take the accuracy. So it takes the percentage of correct predictions out of the total number of predictions. And generally we use top one or top five. So top one you give plus one to the model, if the top prediction corresponds to the correct class. However in some datasets, some classes can be quite confusing.
Like even for people it would be difficult to distinguish between for example a chair and an armchair or something like that. So then we can be more flexible in the evaluation and we can use this top five score. So there you give a plus one, a correct score if the correct class is in the top five predictions of the model. However for object detection and semantic segmentation, the evaluation is a bit different.
We train object detectors, for example, using regression. We train it with a quadratic loss. However, we cannot directly use that same measure to evaluate the accuracy, the performance of the detector, because that might mislead us in how good that detector is. And that, mainly because quadratic loss is biased against small objects, like it
considers in the same way a mistake let's say of 10 pixels that you make on a large object or a mistake of 10 pixels that you make on a small object but for the large object those 10 pixels might represent like, I don't know, two percent of the whole size of the object whereas for the small object, maybe it's more than half of the object. So we cannot use reliably that measure to evaluate performance. So instead what we use to get a better understanding, its intersection over union.
So in this measure, we just take the intersection of the ground truth and then the prediction and then you take their intersection and divide this by their union. So now actually we train the detectors with quadratic loss but then we evaluate them with this intersection over union. This is not recommended in general, to use different measures between training and testing, because you might get surprises, like your detector might be very good at training but then when you evaluate it, you don't get the expected result. However, we cannot directly train with IOU because it has some max operations when we compute IOU and those are not differentiable, so that's why we cannot directly use that. However, there are some papers, some recent papers here that
i've put there where they proposed some approximations for this for this measure, for IOU, and then we can actually train with that same measure. OK, so then in terms of benchmarks: so for image classification we had ImageNet, and really, ImageNet was kind of a game changer in the community because having a benchmark for a task can really push progress. Like now things are comparable. People can compare their works between them. So it's important then to have such benchmarks for different tasks. And here I just listed two, there are several of them for object detection and semantic segmentation.
So Cityscapes is a benchmark for semantic segmentation. The dataset contains mainly like city scenes. They're filmed in different cities in Germany. Then they give us ground truth for images and they also have some videos. And then the second benchmark that I'm showing here, the COCO dataset, they have ground truth for object detection, for semantic segmentation, for image captioning. It's a rich dataset. In general, these benchmarks have a public platform where you can just submit your model and evaluate it. And this really gives a good good practices in the community because then your model is evaluated by an objective third party and then we can really compare results.
One of the tricks of the trade, so I've mentioned in the presentation about the detectors. I've mentioned the hard negative mining which is an important trick that appears in many different places. Another trick that I want to mention is transfer learning. Transfer learning is defined in terms of a domain and a task. And a domain is a set of features that follow some probability distribution and then a task is a pair, like this pair.
So the task is the pair y and a function approximator, so y is a set of ground truth labels and then I have a function approximator that takes in features, data points from the feature set, my domain and produces predictions and then I train this function approximator, to give predictions that are as close as possible to the ground truth. Now, when we train all these kinds of tasks, visual tasks, like object detection or semantic segmentation,
we can notice that the features must be shared because they are related, like object detection, as I said, is a classification problem plus localisation. So the intuition is that any features that we learned in classification, they should be useful for object detection as well. So we should not start from scratch all the time, when we train a new model. So we want to reuse the knowledge. And then we can reuse the knowledge either across domains or across tasks and we will see how to do that.
So the simplest transfer learning setting is to transfer across tasks. So let's say I have trained an image classifier and now I want to train, I want to get an object detector. What I can do is to start, when I design my model for object detection, I just start from the image classifier, I might remove some of the blocks, because in object detection you have a different structure in the output. So what we need to do, is to remove the last layer, so let's say in the image classifier,
and add new layers that would adapt to the new structure that I need in the output. And then we just initialise the weight of the layers that I've kept, I initialise them from the image classifier. And then the extra modules that I've added, those will be trained from scratch, whereas the other ones that I've initialised from the image classifier, they can be fine tuned. So I continue training or they could even be frozen. It really depends on the problem when it's best to do what.
So this is a very useful trick to do, because training takes time and energy, right? So we should not just throw away, if we have an image classifier, this is a very common thing in the community. Almost every model that you see in a paper they start from an image, a pretrained image classifier to reuse the features that were learned in classification.
A paper that really studies this problem of transfer learning between tasks, is this, the taskonomy paper. A very nice analysis. So they consider like 26 tasks, visual tasks, like computing normals in the scene or 2D keypoints. Let's see what else do we have, semantic segmentation that we've seen, object classification, 3D keypoints colourisation. So many different tasks, they consider many different tasks. And the question that they ask is: in which order should we learn these tasks? So basically what they do is, they consider a set of source tasks and then a set of target tasks and they train models for the source tasks and then they
check how should they combine those source networks to transfer knowledge to the target networks. Have a look at this paper, it's very nice- a nice analysis. And the second case of transfer learning that I want to mention is when we transfer across domains. So this is a project, a very cool project that you might have heard of, solving a Rubik's Cube, from OpenAI. So basically here they use a robotic hand to actually solve the Rubik's Cube. And doing this, in the real
word, using like a real robotic hand would be extremely difficult to train because it really requires a lot of data and Yeah when you do this in real world you can easily break that robotic hand. Because at the beginning when it's not trained, it can do all kind of weird movements. So then the important thing here is to actually train first in simulation. You train your model in simulation and then you transfer this into the real world. So here the source domain is the simulation and the
target domain is the real world. And the ingredient that makes this work, this transfer work, is this automatic domain randomisation, how they call it. So basically this has two parts. First they do extensive data augmentation, so data augmentation was mentioned in the previous lecture. Let's say you have a training set. But of course a training set will very rarely cover exhaustively all the possible transformations that you can have in your inputs. So what you can do is you take your training set and then you apply randomly transformations like cropping or rotation or jiterring. Yeah. different kind of transformations so that you can augment your training set so that you cover better the space of transformation and you can make your your model more robust to such transformations. So yeah in this paper they use
extensively this kind of data augmentation techniques plus they use again the hard negative mining that I mentioned earlier so that they can identify what are the most useful transformations to use that would generate the best training signal. And yeah after that they were able to actually run this in real world and to actually solve the Rubik's Cube which I think is quite impressive. OK. OK. So we've covered the first part with the classification.
And we will go now to see what we can what we can use beyond beyond just a single image input? So I think for questions we will take the questions at the end. So. OK. Let's see what other kinds of inputs we can use for our network. But the first question is why do we want to use more? We've seen We have very nice models that can do object detection, semantic segmentation only with images. Why do we need to use more than More than just images? And I'm going to show here an experiment. A study that was done on patients recovering from blindness. So they have undergone surgeries later in life to recover sight. So they had these operations
when they were already able to speak so to communicate so they could tell what they were seeing during their recovery period. So. After one week I think or two weeks after the operation they were shown these kind of images and they were tested for their visual abilities. So yes. I guess these are pretty simple images right?

Ask anything
We've read this whole study set, so questions about it get the best answers.