1 00:00:03,460 --> 00:00:08,580 Now, the next step is to create the structure of a watch CNN model. 2 00:00:11,900 --> 00:00:14,870 For this, we will for this problem. 3 00:00:15,110 --> 00:00:19,940 We will be using four different conv layers with Max pulling. 4 00:00:20,690 --> 00:00:25,520 And after that we will apply our dense layer and then an output. 5 00:00:27,390 --> 00:00:28,920 So for our first Lere. 6 00:00:30,170 --> 00:00:34,940 We will have gone layer with 30 to 40 deaths and three by three with No. 7 00:00:36,600 --> 00:00:41,100 And our input sizes, one four feet by four feet by three. 8 00:00:42,650 --> 00:00:49,690 Remember, we mentioned our target size while data preprocessing as one four feet cross 150 feet. 9 00:00:50,480 --> 00:00:54,980 And since this images are Collodi images, we have RGV, we will lose. 10 00:00:55,020 --> 00:00:59,090 That's why we are providing a third dimension as three. 11 00:01:00,330 --> 00:01:02,250 After this, we want to max pulling. 12 00:01:02,970 --> 00:01:03,280 Here. 13 00:01:03,300 --> 00:01:05,040 We will use a window of two way to. 14 00:01:06,900 --> 00:01:13,740 After this, we'll use another layer which succeeded for four years and three by three window. 15 00:01:14,310 --> 00:01:15,980 Then another pulling layer. 16 00:01:17,810 --> 00:01:25,430 Then we will use another con there with 128 features and add another layer of way to window. 17 00:01:26,920 --> 00:01:34,780 Then we will have another layer of 128 filters and a pulling their weight two by two window. 18 00:01:38,430 --> 00:01:46,530 Then we will use flight then and then a single dense layer with 512 neuron and then a single output 19 00:01:46,530 --> 00:01:48,570 layer with one neuron. 20 00:01:48,720 --> 00:01:51,660 Since we only want to predict two classes. 21 00:01:55,090 --> 00:01:59,590 One important thing here is to note the number of tweeters that we are using. 22 00:02:00,550 --> 00:02:07,880 You can see as we are going on in our network, we are increasing the number of four years in what kindlier? 23 00:02:10,100 --> 00:02:14,820 So this is a general practice with each con layer. 24 00:02:15,320 --> 00:02:19,310 You have to double the number of filters you are going to use. 25 00:02:21,220 --> 00:02:28,600 And another important thing is that if you remember with Max pool of window to way to. 26 00:02:29,700 --> 00:02:33,060 You are reducing the size of your images. 27 00:02:33,930 --> 00:02:43,030 So if you ever image of 150 by 150 after max pulling, you will have a made up of 75 but 75. 28 00:02:44,830 --> 00:02:52,000 So after this, a step after this layer, we will have images in the dimension of so and if by 70 feet. 29 00:02:53,020 --> 00:02:57,400 Then after this, another MECs bullying, we will have images of. 30 00:02:58,710 --> 00:03:00,060 37 by 37. 31 00:03:01,080 --> 00:03:06,630 Then after this, we will have images of it by 18 and then nine by nine. 32 00:03:08,440 --> 00:03:18,340 So if you see the number of features are increasing as we go along on our network and the work and the 33 00:03:18,340 --> 00:03:21,490 lens of forward images are decreasing. 34 00:03:23,410 --> 00:03:25,090 This is a standard practice. 35 00:03:26,470 --> 00:03:35,050 You are a mere size should decrease with each con layer and the feature map height should increase as 36 00:03:35,050 --> 00:03:36,690 you go along the network. 37 00:03:41,310 --> 00:03:45,000 So this is the structure we are following for this problem. 38 00:03:47,450 --> 00:03:49,460 Let's just run this. 39 00:03:55,070 --> 00:03:59,070 Another thing is that earlier we were using Keita's dot Lear. 40 00:03:59,360 --> 00:04:05,030 So now we have imported Lears and we don't have to put guitars, dot layers and so on. 41 00:04:05,570 --> 00:04:07,320 So another little thing. 42 00:04:11,330 --> 00:04:12,620 Let's look at the somebody. 43 00:04:15,570 --> 00:04:22,110 You can see we have for corn layer with four different pulling layers and then. 44 00:04:23,060 --> 00:04:24,990 A dense layer and then output layer. 45 00:04:26,790 --> 00:04:32,220 The total number of parameters that we are screening in our model is at over three million. 46 00:04:35,850 --> 00:04:38,740 Now, the next step is to come by Lamartine. 47 00:04:39,480 --> 00:04:44,460 And this time, instead of using a ZULI, we are going to use them as prop. 48 00:04:47,850 --> 00:04:54,420 Oremus Propp have a little advantage or as Julie while performing image processing. 49 00:04:55,140 --> 00:04:57,400 That's why we are going to use Artemus Prop. 50 00:04:57,810 --> 00:05:02,820 And here we have also mentioned the learning rate of zero point zero zero one. 51 00:05:04,240 --> 00:05:06,450 By default, the learning rate is point zero. 52 00:05:07,150 --> 00:05:10,570 And we have mentioned learning data, pseudo point zero zero one. 53 00:05:12,050 --> 00:05:13,240 That's it on this. 54 00:05:17,750 --> 00:05:21,650 Now, the next step is to fit training data in our model. 55 00:05:23,750 --> 00:05:26,550 And earlier we were using model law fit. 56 00:05:28,580 --> 00:05:36,980 But now, since we have data in the form of green data, we are getting our data in the batches of 20 57 00:05:37,070 --> 00:05:38,720 directly from over directory. 58 00:05:39,760 --> 00:05:45,080 That's where instead of using dot fake, we are going to use dot fake gender. 59 00:05:47,250 --> 00:05:52,490 For using homemade detergent, narrator as our input we have to use for gender. 60 00:05:54,690 --> 00:05:58,110 The process is almost same instead of the Fed. 61 00:05:58,170 --> 00:06:00,060 You have to use DOT for it. 62 00:06:00,160 --> 00:06:01,130 Underscore the gender. 63 00:06:02,070 --> 00:06:02,400 Then. 64 00:06:03,600 --> 00:06:07,590 Then you have to provide the object that is generating the data. 65 00:06:07,770 --> 00:06:13,910 In our case, that is green generator that we have created earlier. 66 00:06:16,620 --> 00:06:17,070 Now. 67 00:06:18,960 --> 00:06:25,590 Now, another difference is that this train generator is generating data continuously. 68 00:06:26,700 --> 00:06:29,610 So we have to mention that stopping point. 69 00:06:30,330 --> 00:06:34,320 And we are mentioning the stopping point in the form of number of steps. 70 00:06:36,000 --> 00:06:42,540 As you remember here, while creating our train generator, we mentioned that the bed size should be 71 00:06:42,540 --> 00:06:43,290 of 20. 72 00:06:44,220 --> 00:06:50,310 So this train generator is generating data in the packets of 20 images. 73 00:06:51,240 --> 00:06:55,170 Now, our screen dataset is of 2000 images. 74 00:06:55,890 --> 00:07:00,270 So how many steps are required to cover all the two Holderness steps? 75 00:07:01,140 --> 00:07:06,830 That is two tosing divided by the number of images in each bet, which is 20. 76 00:07:07,560 --> 00:07:09,870 So that's where we want to step. 77 00:07:11,170 --> 00:07:18,250 In the hundreds of steps we are going to cover all the 2000 images that we have in our train directory. 78 00:07:19,870 --> 00:07:23,980 So just remember to use the steps, but epoch parameter. 79 00:07:25,470 --> 00:07:34,140 And this you should provide by dividing the total number of images that you have by the number of images 80 00:07:34,290 --> 00:07:35,320 you have in your head. 81 00:07:35,460 --> 00:07:36,390 Each batch. 82 00:07:37,440 --> 00:07:40,550 So 2000, they were led by 20, equal 200. 83 00:07:42,300 --> 00:07:44,910 We want to create this model for 20 bucks. 84 00:07:45,150 --> 00:07:50,240 That's why we are providing epochs equal to 20 and similar to fact. 85 00:07:50,310 --> 00:07:52,740 We can provide our validation data as well. 86 00:07:53,430 --> 00:07:57,420 Here, the validation data is in the form of validation generator. 87 00:08:00,200 --> 00:08:02,570 We have clear trade regulation, gender to clear. 88 00:08:03,380 --> 00:08:05,970 And here also we are using a bed size of 20. 89 00:08:07,100 --> 00:08:10,740 And in our ventilation formula, we have our on polls, on images. 90 00:08:11,980 --> 00:08:18,430 So then do either quite frankly, we need to run this for peace steps, so we have to provide whether 91 00:08:18,430 --> 00:08:20,260 additional steps equally 250. 92 00:08:24,170 --> 00:08:25,700 Let's run this. 93 00:08:26,300 --> 00:08:31,910 So if you see this is very similar to fact function and food function will directly provide the data 94 00:08:32,480 --> 00:08:35,130 here and sort of providing data directly. 95 00:08:35,270 --> 00:08:41,870 We are providing the generator that is generating the data and we are mentioning the steps or the limit 96 00:08:42,770 --> 00:08:46,540 on the number of times that generator is going to gender generator. 97 00:08:47,920 --> 00:08:50,600 So the training may take several minutes. 98 00:08:51,260 --> 00:08:54,440 So I am skipping the training part.