1 00:00:00,080 --> 00:00:04,320 Welcome everybody to the tutorial Image Recognition with LearningML. 2 00:00:04,320 --> 00:00:08,960 LearningML is a web platform for teaching and learning about machine learning 3 00:00:08,960 --> 00:00:12,560 and is designed in the context of the Erasmus Plus project FIAS, 4 00:00:12,560 --> 00:00:18,000 Fostering Artificial Intelligence at Schools. In this tutorial we will use the LearningML 5 00:00:18,000 --> 00:00:24,000 application to build an AI model to classify images. A model is basically a mapping between 6 00:00:24,000 --> 00:00:29,519 an input and an output . What we will do today is build a model 7 00:00:29,519 --> 00:00:35,840 that classifies images of animals into four classes, crabs, butterflies, crocodiles and 8 00:00:35,840 --> 00:00:41,679 kangaroos. Let's start and go to the web application. A link can also be found in the 9 00:00:41,679 --> 00:00:48,520 description of this video. So we can choose between two versions, a stable and a beta version. 10 00:00:48,719 --> 00:00:53,979 The beta version has more functionality, but it is still being tested. This means there still 11 00:00:53,979 --> 00:00:58,820 might be errors or things not working exactly like they should. So for now, let's use the 12 00:00:58,820 --> 00:01:04,540 stable version. We are interested in images, so we click on recognize images. 13 00:01:04,540 --> 00:01:11,000 Here we see the three steps we will need to build our model. Train, learn and try. 14 00:01:11,000 --> 00:01:15,500 These correspond to the different steps in machine learning, the AI technique we 15 00:01:15,500 --> 00:01:20,239 will use to build our model. In machine learning models are trained and they 16 00:01:20,239 --> 00:01:24,719 will learn how to classify images by looking at examples, called the training 17 00:01:24,719 --> 00:01:30,120 examples. How many examples are needed depends on many factors. Using LearningML 18 00:01:30,120 --> 00:01:34,840 for simple examples like ours, 10 examples per class would be the bare 19 00:01:34,840 --> 00:01:40,680 minimum. So then, as a second step, these examples will be used to create the 20 00:01:40,680 --> 00:01:45,359 model. More precisely, the algorithm behind this will learn a mapping from 21 00:01:45,359 --> 00:01:51,719 images to the classes. And finally, we can test our model. Let's start with the 22 00:01:51,719 --> 00:01:56,480 first step, adding our training examples, the data that will be used to train the 23 00:01:56,480 --> 00:02:05,239 model. We have four classes, we have to add them one by one. So the first one is 24 00:02:05,239 --> 00:02:23,759 butterfly, okay, the second one crab, okay, the third one crocodile, oops, and the 25 00:02:23,759 --> 00:02:33,750 last one is kangaroo. Now we add images to each of these classes. You can add 26 00:02:33,750 --> 00:02:39,330 images saved on your computer and you can also use a webcam. So I don't have a 27 00:02:39,330 --> 00:02:48,000 crocodile sitting around at home so I will upload images from my computer. So I 28 00:02:48,000 --> 00:02:52,560 have already prepared the images. I have examples of all four classes and I also 29 00:02:52,560 --> 00:02:57,120 have some test examples. The latter are images that are not present in the 30 00:02:57,120 --> 00:03:01,300 training example. So I can test how well the model performs on images it has 31 00:03:01,300 --> 00:03:06,819 never seen before. So let's add the images. So first we start with the 32 00:03:06,819 --> 00:03:16,860 kangaroos. So let's add all of them at once. Then let's go to the crocodiles. So 33 00:03:16,860 --> 00:03:39,530 again, upload them all at once. And then the crabs. And finally the butterflies. 34 00:03:39,530 --> 00:03:47,210 So, and then the second step is learning how to recognize the images. 35 00:03:47,210 --> 00:03:51,530 So this step could take a while since it is computationally hard. 36 00:03:52,490 --> 00:03:54,169 So let's wait a bit for that. 37 00:04:07,129 --> 00:04:12,090 Okay, so now we can verify how accurate our model is. 38 00:04:12,090 --> 00:04:15,129 So we'll test the model on an image it has not seen before. 39 00:04:16,170 --> 00:04:18,889 So an image not included in the training examples. 40 00:04:18,889 --> 00:04:28,370 so let's go to the test folder and let's pick this one okay so it's pretty sure that it belongs 41 00:04:28,370 --> 00:04:33,930 to the class crap so what basically happens is that for each class it gives a probability 42 00:04:33,930 --> 00:04:40,170 kind of confidence that the image belongs to that class so this example is classified as a crap 43 00:04:40,170 --> 00:04:45,529 because there is an over 95 percent of confidence that it belongs to that class 44 00:04:46,410 --> 00:04:52,889 So let's try something else. Let's try another one of our test examples. So this one, 45 00:04:52,889 --> 00:04:58,730 this should be a butterfly. And yes, it is. 88% probability. 46 00:04:59,930 --> 00:05:08,569 Now let's try something completely different. What would happen if I upload the image of this 47 00:05:08,569 --> 00:05:15,129 animal? Well, it is a butterfly. So this seems to make no sense, but it actually does. The 48 00:05:15,129 --> 00:05:21,449 model has only learned how to map an image to one of the four classes it does not know anything 49 00:05:21,449 --> 00:05:28,170 besides those four classes so according to the training data this cat resembles a butterfly 50 00:05:30,279 --> 00:05:36,920 so now you can save your project you can either download the copy to your computer or save it 51 00:05:36,920 --> 00:05:44,199 in the cloud if you have a learning ml account so next time you can open the project either by 52 00:05:44,199 --> 00:05:49,079 uploading it for your computer or from your account and it will contain all the classes 53 00:05:49,079 --> 00:05:54,839 and the training examples already loaded. This means you can also open projects created by 54 00:05:54,839 --> 00:06:00,920 someone else. Several examples can be found on the LearningML website and also on our FIAS project 55 00:06:00,920 --> 00:06:06,759 page. The images used for the animal classifier we created today can be found on the LearningML 56 00:06:06,759 --> 00:06:12,839 website. You can find the link in the description of this video. In the next video we will see how 57 00:06:12,839 --> 00:06:16,360 we can use the model in our programming platform. See you then!