1
00:00:00,080 --> 00:00:05,750
Hello, everyone, and welcome to this new section in which we will see how to implement data augmentation

2
00:00:05,750 --> 00:00:09,920
using a specialized data augmentation library called Albumentations.

3
00:00:09,930 --> 00:00:17,360
We will see how to use Albumentations with TensorFlow and also PyTorch, which will permit us to see

4
00:00:17,360 --> 00:00:22,040
how easy it is for us to integrate augmentation with just any library.

5
00:00:22,070 --> 00:00:26,840
Note that this session was inspired by a question posed by one of us.

6
00:00:26,840 --> 00:00:31,610
Feel free to always ask questions as this will permit us better discourse.

7
00:00:31,640 --> 00:00:37,370
We shall be looking at the Albumentations tool, which is a specialized data augmentation library.

8
00:00:37,460 --> 00:00:42,040
Albumentations is a Python library for fast and flexible image augmentations.

9
00:00:42,050 --> 00:00:48,380
It efficiently implements a rich variety of image transform operations that is optimized for performance

10
00:00:48,380 --> 00:00:54,830
and does so while providing a concise yet powerful image augmentation interface for different computer

11
00:00:54,830 --> 00:00:59,690
vision tasks, including object classification, segmentation and detection.

12
00:00:59,690 --> 00:01:04,920
Now we'll look at why we need a dedicated library like Albumentations here.

13
00:01:04,920 --> 00:01:10,410
In the documentation, they argue that if you have to do this kind of visual data augmentation, there

14
00:01:10,410 --> 00:01:15,840
are a host of libraries like TensorFlow, which we've seen already, which do this kind of data augmentation.

15
00:01:15,840 --> 00:01:21,240
But then when carrying out data augmentation with different types like, say, object detection, like

16
00:01:21,240 --> 00:01:25,290
in this case, or let's take this example here, which is more illustrative.

17
00:01:25,320 --> 00:01:34,410
You have this image as input and this bounding boxes which will permit you build a model for object

18
00:01:34,410 --> 00:01:35,280
detection.

19
00:01:35,400 --> 00:01:42,150
But then if you want to do data augmentation and then you want to augment this data by applying cropping,

20
00:01:42,150 --> 00:01:47,910
like as you could see here, notice how this image right here has been cropped like what we have now

21
00:01:47,910 --> 00:01:52,950
is something like this part or rather this part actually.

22
00:01:52,980 --> 00:01:57,960
Now notice you have cropped out this whole image and you left only with this.

23
00:01:57,960 --> 00:01:59,670
I think it goes right up.

24
00:01:59,670 --> 00:02:01,320
So it should be something like this.

25
00:02:01,560 --> 00:02:02,120
Um.

26
00:02:02,130 --> 00:02:03,450
Yeah, something like this.

27
00:02:03,840 --> 00:02:04,170
Okay.

28
00:02:04,170 --> 00:02:08,430
So you have you've cropped this image and it's part of your data augmentation pipeline.

29
00:02:08,430 --> 00:02:12,210
So let's take this off and this off.

30
00:02:12,210 --> 00:02:18,840
As we were saying, you crop this image and here's what you get now with the usual data augmentation

31
00:02:18,840 --> 00:02:21,360
methods are working with the usual libraries.

32
00:02:21,360 --> 00:02:29,640
What you have to do is after doing this cropping, you would have to manually modify each and every

33
00:02:29,640 --> 00:02:30,750
bounding box you find.

34
00:02:30,750 --> 00:02:30,910
Here.

35
00:02:30,910 --> 00:02:32,550
You see this bounding boxes right here.

36
00:02:32,580 --> 00:02:35,910
All this ones are not taken into consideration because it's not part of this crop.

37
00:02:35,910 --> 00:02:38,990
So you have to modify each and every bounding box you find here.

38
00:02:39,000 --> 00:02:41,340
This red brown boxes right here.

39
00:02:41,340 --> 00:02:48,240
And this is because this bounding boxes are got they get their positions with respect to this origin

40
00:02:48,240 --> 00:02:51,000
right here or in this case with respect to this origin.

41
00:02:51,000 --> 00:02:55,350
And so when you do this cropping, the obviously these positions change.

42
00:02:55,350 --> 00:03:05,220
Now instead of doing this manually, albumentations permits you to get this restructuring of this bounding

43
00:03:05,220 --> 00:03:10,680
boxes automatically without having to manually modify them.

44
00:03:11,100 --> 00:03:17,940
And apart from object detection, another very common use cases in image segmentation, we have this

45
00:03:17,940 --> 00:03:24,240
original image which has been transformed into this one, and then the image has a mask.

46
00:03:24,240 --> 00:03:27,180
So you are trying to segment the different parts of this image.

47
00:03:27,180 --> 00:03:35,400
And so after you've applied this rotation, you now get augmentation to apply the same rotation in the

48
00:03:35,400 --> 00:03:36,270
outputs.

49
00:03:36,270 --> 00:03:43,470
Another reason why using Albumentations is advantageous is the fact that it has this declarative definition

50
00:03:43,470 --> 00:03:47,940
of the augmentation pipeline and provides a unified interface.

51
00:03:47,940 --> 00:03:53,250
So basically this is what it takes to build our augmentation pipeline.

52
00:03:53,250 --> 00:03:57,840
Now notice how with this we can also include this probabilities.

53
00:03:57,840 --> 00:04:02,550
So you see here probability 0.3 and this probability is 0.5.

54
00:04:02,580 --> 00:04:10,620
Now stating that this brightness contrast augmentation will get a probability of 0.3 simply means that

55
00:04:10,620 --> 00:04:12,960
you are going to apply random brightness.

56
00:04:12,960 --> 00:04:16,950
Contrast three times for every ten images you process.

57
00:04:16,950 --> 00:04:24,960
And this means that if you have a data set of let's say, let's say we have a data set of 10 or 1000

58
00:04:24,990 --> 00:04:33,000
images, we have this data set of 10,000 images, then what our model will see are the probability of

59
00:04:33,000 --> 00:04:33,990
our model.

60
00:04:33,990 --> 00:04:41,130
Getting the original images is in this case of P equals 0.30.7.

61
00:04:41,130 --> 00:04:49,980
So we have a probability of it is most probable that we will get 7000 out of this 10,000.

62
00:04:50,730 --> 00:04:57,660
From the original dataset, which our model sees, and then we have 3000, which is going to be augmented.

63
00:04:57,690 --> 00:05:01,810
Then you also have this horizontal flip, so you have the 0.5.

64
00:05:01,830 --> 00:05:06,150
So this means that you could pass in an image and then there is no bright.

65
00:05:06,240 --> 00:05:08,730
Brightness contrast and there is no horizontal flip.

66
00:05:08,760 --> 00:05:14,060
Same as you could pass in an image and you have the random brightness contrast and you don't have this

67
00:05:14,070 --> 00:05:17,800
or you may not have this and you have this or you may not.

68
00:05:17,820 --> 00:05:22,560
We've seen this already or you may have this and have this, but with this random crop, you will always

69
00:05:22,560 --> 00:05:26,160
have it because you're there's no probability specified.

70
00:05:26,190 --> 00:05:33,780
Then also it's advantageous to make use of albumentations because it has been rigorously tested.

71
00:05:33,990 --> 00:05:38,280
As you can see, it has been battle tested, used widely in the industry.

72
00:05:38,310 --> 00:05:42,960
Deep learning research, machine learning competitions and open source projects, high performance,

73
00:05:42,960 --> 00:05:48,150
diverse set of supported augmentations, extensibility and rigorous testing.

74
00:05:48,180 --> 00:05:52,110
We also have here this list of transforms and the supported targets.

75
00:05:52,120 --> 00:05:55,750
As you could see, this list is broken up into two parts.

76
00:05:55,750 --> 00:06:00,370
We have the pixel level transforms and we have the spatial level transform.

77
00:06:00,820 --> 00:06:06,310
So if you want to get more information for each and every one of these transforms, it suffices just

78
00:06:06,310 --> 00:06:07,540
to click on this.

79
00:06:07,540 --> 00:06:14,410
So you just you could say, for example, let's pick this sharpen right here, click on the sharpen,

80
00:06:14,530 --> 00:06:18,460
and you have here the arguments and the description.

81
00:06:18,970 --> 00:06:22,780
Let's take another example from the spatial level transforms.

82
00:06:22,810 --> 00:06:25,690
Here we could take the vertical flip.

83
00:06:25,690 --> 00:06:27,220
So we click on this vertical flip.

84
00:06:27,220 --> 00:06:32,200
You see we have this float probability of applying the transform default 0.5.

85
00:06:32,200 --> 00:06:36,820
Now note that if you're dealing with a very large dataset, that is, if your initial data set is very

86
00:06:36,820 --> 00:06:42,940
large, then you could use probabilities between 0.1 and 0.3.

87
00:06:42,970 --> 00:06:48,770
Reason being that since your dataset is already large, it doesn't need data augmentation that much.

88
00:06:48,790 --> 00:06:54,360
Now if you're dealing with a small, medium sized dataset, you could use probabilities between 0.4

89
00:06:54,360 --> 00:06:56,440
to 0.5.

90
00:06:56,470 --> 00:07:02,230
Nonetheless, you could always pick whatever value depending on how it affects your model performance.

91
00:07:02,260 --> 00:07:07,990
Getting back to the code, we're going to make use of this example TensorFlow Data Augmentation pipeline

92
00:07:07,990 --> 00:07:09,840
built with Albumentations.

93
00:07:09,850 --> 00:07:16,600
So here we have the transforms and then we have the augmentation function.

94
00:07:17,570 --> 00:07:20,120
Then data pre-processing.

95
00:07:20,150 --> 00:07:24,950
And finally, integration with TensorFlow datasets.

96
00:07:25,310 --> 00:07:32,030
Now, based on the kind of dataset we're dealing with, we have to be very careful in the dataset augmentation

97
00:07:32,030 --> 00:07:33,620
strategies we're going to be using.

98
00:07:33,620 --> 00:07:40,430
So like, yeah, we could use this random rotate because rotation doesn't wipe off those sections which

99
00:07:40,430 --> 00:07:47,480
contain information that permits us to differentiate between a parasitized and an uninfected cell.

100
00:07:47,570 --> 00:07:55,460
Getting back to our random rotate 90 you have here this argument a float which is a probability of applying

101
00:07:55,460 --> 00:08:00,830
this transform default 0.5 so we could make use of this random rotate right here.

102
00:08:00,860 --> 00:08:03,980
Then just below we have other different rotations.

103
00:08:03,980 --> 00:08:09,860
We have the random rotate 90 apply, which rotates the image a certain number of times.

104
00:08:09,890 --> 00:08:18,840
We have the geometric rotate where we can select the angle and which will do the rotation.

105
00:08:18,870 --> 00:08:20,940
Then we have this save.

106
00:08:20,940 --> 00:08:27,660
Rotate would avoid this kind of data augmentation strategies like the cropping because yeah, you could

107
00:08:27,660 --> 00:08:35,040
crop out information which permits us differentiate between the parasitized and uninfected cells.

108
00:08:35,070 --> 00:08:41,370
You also have this resize here which we will use in, um, pre-processing our images.

109
00:08:41,580 --> 00:08:48,020
We have the vertical flip and the horizontal flip, which we are going to use.

110
00:08:48,030 --> 00:08:50,430
So here we have horizontal and vertical flip.

111
00:08:50,790 --> 00:08:52,020
Let's add that here.

112
00:08:52,050 --> 00:08:54,330
We can also just a flip.

113
00:08:54,540 --> 00:09:00,150
We also have this random grid shuffle which we could make use of this randomly shuffled grid cells in

114
00:09:00,150 --> 00:09:05,850
an image, meaning that if we have this kind of image and then we've picked a grid size of three by

115
00:09:05,850 --> 00:09:12,420
three, we could break this up this way, you break this up, and then you have this three by three

116
00:09:12,450 --> 00:09:16,230
grid cell, and then you simply randomly shuffle this position.

117
00:09:16,230 --> 00:09:22,860
So this one can end up here, this ends up here, this ends up here, and so on and so forth.

118
00:09:23,220 --> 00:09:26,070
You could also have this random brightness contrast.

119
00:09:26,070 --> 00:09:32,910
So with this one, we will take this all and then paste it right here.

120
00:09:32,940 --> 00:09:34,980
Random brightness Contrast.

121
00:09:35,260 --> 00:09:39,420
The next one, let's take this sharpen.

122
00:09:39,600 --> 00:09:40,740
So that's it.

123
00:09:41,610 --> 00:09:45,120
You could use other data augmentation strategies you want.

124
00:09:45,120 --> 00:09:53,310
Always make sure that you visualize the outputs to better understand exactly what you're using.

125
00:09:53,520 --> 00:09:55,740
Now we define our transforms.

126
00:09:55,770 --> 00:09:59,610
We have our transforms, albumentations compose.

127
00:10:00,090 --> 00:10:04,500
And then we have this list which is made of the different augmentations.

128
00:10:04,740 --> 00:10:07,270
Yeah, we just copied this out.

129
00:10:07,290 --> 00:10:08,610
Let's have this copied.

130
00:10:08,610 --> 00:10:10,710
But before this, let's do a resize.

131
00:10:10,710 --> 00:10:19,850
So here we could have a dot resize and then we specify the image size and that's it.

132
00:10:19,860 --> 00:10:22,110
So we specify the image size.

133
00:10:22,840 --> 00:10:27,190
We're going for the horizontal and vertical flip, so let's copy this out.

134
00:10:27,580 --> 00:10:28,840
There we go.

135
00:10:29,260 --> 00:10:34,330
You have that horizontal vertical flip for this random brightness contrast.

136
00:10:34,360 --> 00:10:36,460
We're going to use the default parameters.

137
00:10:36,490 --> 00:10:37,230
Sharpen.

138
00:10:37,240 --> 00:10:39,880
We're going to use the default parameters and that's it.

139
00:10:39,910 --> 00:10:43,930
We now have our transforms so we can run the cell.

140
00:10:44,410 --> 00:10:45,760
We're getting this error.

141
00:10:45,760 --> 00:10:49,660
And this is because right here we have to have this.

142
00:10:49,660 --> 00:10:51,370
So it's album annotation.

143
00:10:51,370 --> 00:10:53,170
This is going from album annotation.

144
00:10:53,200 --> 00:10:54,760
We run this again.

145
00:10:54,880 --> 00:10:56,590
We're getting some errors.

146
00:10:56,620 --> 00:10:59,100
Our meditation has no attribute sharpen.

147
00:10:59,110 --> 00:11:03,160
Even when we comment this one, we will also get this error.

148
00:11:03,190 --> 00:11:09,250
Augmentation has no attribute random grid shuffle, so we'll just comment this too and then run that

149
00:11:09,250 --> 00:11:09,940
again.

150
00:11:10,360 --> 00:11:10,690
Okay.

151
00:11:10,690 --> 00:11:11,140
That's fine.

152
00:11:11,140 --> 00:11:11,990
That looks fine.

153
00:11:12,010 --> 00:11:19,720
We can also implement this album meditation one off with this one off, either the vertical flip or

154
00:11:19,720 --> 00:11:20,740
the horizontal flip.

155
00:11:20,740 --> 00:11:24,920
So let's take this out of this here and put it right here.

156
00:11:24,920 --> 00:11:29,010
We have one off horizontal flip or the vertical flip.

157
00:11:29,030 --> 00:11:31,310
Now we're going to have this here.

158
00:11:31,310 --> 00:11:36,980
And then so we have this list actually, we're going to create this list and it's going to be made of

159
00:11:36,980 --> 00:11:42,500
this two transformations, which is the vertical and the horizontal flip.

160
00:11:42,860 --> 00:11:45,920
Let's have this here and close this.

161
00:11:45,950 --> 00:11:51,680
Okay, So we have defined that one off and then we could also specify a probability.

162
00:11:51,680 --> 00:11:55,400
So let's take P equals 0.3, for example.

163
00:11:55,400 --> 00:11:56,420
And there we go.

164
00:11:56,510 --> 00:12:02,540
This probability here actually defines whether the one off will be applied or not.

165
00:12:02,540 --> 00:12:03,680
And so we have that.

166
00:12:03,680 --> 00:12:06,090
We can run this again, and that's fine.

167
00:12:06,110 --> 00:12:13,100
Drawing inspiration from this method given in the documentation, we are going to create this, our

168
00:12:13,100 --> 00:12:17,030
own method of album end, which takes in an image.

169
00:12:18,140 --> 00:12:26,030
Creates this dictionary, fits this information in the transforms which we've created here and then

170
00:12:26,960 --> 00:12:29,180
normalizes the image.

171
00:12:29,180 --> 00:12:33,440
So this is what we do with this album meant method.

172
00:12:34,070 --> 00:12:40,010
From here we could have our training dataset similar to what we've been doing already.

173
00:12:40,010 --> 00:12:45,170
But the difference is that instead of this, we have now processed data.

174
00:12:45,200 --> 00:12:51,200
Getting back to the documentation in this process data here we have let's copy out this process data

175
00:12:51,200 --> 00:12:52,970
and this process data.

176
00:12:53,090 --> 00:12:54,830
What we're actually doing.

177
00:12:54,830 --> 00:12:57,980
Let's add this cell here and this process data.

178
00:12:57,980 --> 00:13:04,220
We're taking, the image, we're taking the label, we're taking the image size, and then the actually

179
00:13:04,220 --> 00:13:11,690
modify this image and have this and then take this label and pass it to the output since the label remains

180
00:13:11,690 --> 00:13:12,350
unchanged.

181
00:13:12,380 --> 00:13:15,650
Now, for this image size, we wouldn't need this so we could take that off.

182
00:13:15,650 --> 00:13:23,250
We're just taking the image and the label size and then as this input we pass in the image or the tensor

183
00:13:23,250 --> 00:13:25,290
out is going to be of data type.

184
00:13:25,290 --> 00:13:26,310
Float 32.

185
00:13:26,340 --> 00:13:28,670
The function is going to be Arc album.

186
00:13:28,680 --> 00:13:35,960
And so ARC album meant is our function and then we are going to make use of this TensorFlow numpy function.

187
00:13:35,970 --> 00:13:37,650
Now get into the documentation.

188
00:13:37,650 --> 00:13:43,740
We see it wraps a python function and uses it as a TensorFlow operation.

189
00:13:43,830 --> 00:13:51,960
That said, we could still work in the graph mode even though we are having this python code right here.

190
00:13:51,960 --> 00:13:59,160
And this is because our TensorFlow is going to convert everything that goes on in your as a TensorFlow

191
00:13:59,160 --> 00:14:00,030
operation.

192
00:14:00,030 --> 00:14:01,920
So we could run this.

193
00:14:01,950 --> 00:14:04,650
We have the processed data that looks fine.

194
00:14:04,650 --> 00:14:06,060
We could run this too.

195
00:14:06,060 --> 00:14:08,940
And then finally we have our train data set.

196
00:14:08,940 --> 00:14:13,230
So we run our train data set batch size not defined.

197
00:14:13,260 --> 00:14:15,660
We should have run this here.

198
00:14:15,690 --> 00:14:20,520
Okay, We run this cell and then getting back, we run this again.

199
00:14:20,550 --> 00:14:21,690
We should be fine now.

200
00:14:22,230 --> 00:14:25,440
Okay, so here we have train data set.

201
00:14:25,470 --> 00:14:27,930
We could look at that and that looks fine.

202
00:14:28,350 --> 00:14:30,510
We can quickly visualize our data set.

203
00:14:30,540 --> 00:14:37,950
We have the image, the label, and then we have an element pick from our data set.

204
00:14:37,950 --> 00:14:46,740
So now let's show this image, show em we run that, we get this error because we are dealing with batches

205
00:14:46,740 --> 00:14:47,370
of 32.

206
00:14:47,370 --> 00:14:49,620
So let's just pick one of these elements.

207
00:14:49,650 --> 00:14:52,530
Let's run that now and that should be fine.

208
00:14:52,530 --> 00:14:54,660
Okay, so here is what we obtain.

209
00:14:55,470 --> 00:14:57,240
Then we could have many more plots.

210
00:14:57,240 --> 00:15:09,630
So we have this figure we define the figure size for I in range 1 to 32 one to have plot that subplot

211
00:15:09,630 --> 00:15:18,420
subplot eight for and then I and then plot that show our image.

212
00:15:18,630 --> 00:15:20,840
I okay we run that.

213
00:15:21,760 --> 00:15:23,380
And here's what we get.

214
00:15:23,740 --> 00:15:25,270
So we have this.

215
00:15:25,270 --> 00:15:32,140
And now what we could do is let's let's get this cut out, which we have here in the documentation,

216
00:15:32,140 --> 00:15:37,000
specify a number of holes, maximum height, size, maximum width, size.

217
00:15:37,030 --> 00:15:41,140
The fuel value always apply false and the probability.

218
00:15:41,140 --> 00:15:47,650
So when we apply this, you're going to see exactly or better understand all this different arguments

219
00:15:47,650 --> 00:15:48,190
right here.

220
00:15:48,190 --> 00:15:54,610
So let's go ahead and apply cut out, which should be more visible as compared to the other transformations

221
00:15:54,610 --> 00:15:56,200
like the rotations that we did.

222
00:15:56,200 --> 00:16:05,470
So here let's have this year, let's you see how easy it is now to integrate any data augmentation strategy

223
00:16:05,470 --> 00:16:05,920
you have.

224
00:16:05,950 --> 00:16:14,950
So here we have a URL and paste that a cut out and then we take the default parameters.

225
00:16:14,980 --> 00:16:17,410
We have the cut out, let's run that again.

226
00:16:17,740 --> 00:16:21,710
And what we need to do because the train data set has been modified.

227
00:16:21,710 --> 00:16:26,990
So we need to like get the initial train data set we had after getting from here.

228
00:16:27,500 --> 00:16:30,920
Let's get back down and then check this out.

229
00:16:31,280 --> 00:16:39,650
Okay, so we have done the Transform album and run this, run this, and now we could visualize, okay,

230
00:16:39,650 --> 00:16:41,660
yeah, the cut out hasn't been implemented.

231
00:16:41,660 --> 00:16:44,420
That is, obviously there's a probability of 0.5.

232
00:16:44,420 --> 00:16:47,270
So it's possible that we don't have cut out here.

233
00:16:47,420 --> 00:16:53,930
Now, if we look at this, you see clearly that in some parts of this let's increase the size, let's

234
00:16:53,930 --> 00:16:55,160
say 15.

235
00:16:56,570 --> 00:16:56,870
Okay.

236
00:16:56,900 --> 00:17:02,360
As we were saying, if you look at this, you'll notice that in some parts or in some images, we have

237
00:17:02,360 --> 00:17:04,780
this portions which have been cut out.

238
00:17:04,790 --> 00:17:09,680
So you could see, for example, this one, you have this part which is cut out and then getting back

239
00:17:09,680 --> 00:17:11,120
to the documentation.

240
00:17:12,430 --> 00:17:14,350
We have a default number of holes.

241
00:17:14,380 --> 00:17:21,820
Eight and we could copy all this out and then modify it so you see how this could change the kind of

242
00:17:21,820 --> 00:17:22,680
output we get.

243
00:17:22,690 --> 00:17:26,440
Because here you see when there is cut out, we have one, two, three, four, five.

244
00:17:26,830 --> 00:17:32,530
Surely you have the other holes or cut out regions in the black spot so you can identify them.

245
00:17:32,530 --> 00:17:34,660
And then here you have one, two, three, four.

246
00:17:34,690 --> 00:17:37,150
You see, you even have this looks like a cut out.

247
00:17:37,150 --> 00:17:38,770
Anyway, that's the idea.

248
00:17:38,800 --> 00:17:42,670
You specify the number of cut out or number of regions you want to cut out.

249
00:17:42,700 --> 00:17:45,790
You also specify the value is going to take.

250
00:17:46,060 --> 00:17:52,120
So like in this case, when you specify zero, it simply means you're going to be having this black

251
00:17:52,120 --> 00:17:53,080
spots here.

252
00:17:53,080 --> 00:17:57,280
So let's have that, um, back here.

253
00:17:57,760 --> 00:18:01,510
Okay, so let's put this in here and then you have number of holes.

254
00:18:01,510 --> 00:18:02,140
So that's it.

255
00:18:02,140 --> 00:18:07,960
You could modify this and observe exactly what goes on to increase the size of the cut out region.

256
00:18:07,960 --> 00:18:13,510
You could simply specify the values here, and then you have the fuel value.

257
00:18:13,540 --> 00:18:17,140
You have this boolean always apply and then you have the probability.

258
00:18:17,140 --> 00:18:22,210
So if you want to always have cut out, you could simply send this probability to one and that's how

259
00:18:22,210 --> 00:18:22,990
it works.

260
00:18:22,990 --> 00:18:25,360
So we've seen how this works.

261
00:18:25,390 --> 00:18:31,150
We could go ahead and train our model using this augmented data, but before training, let's take out

262
00:18:31,150 --> 00:18:36,310
the cut out as it was just meant to show you how this works.

263
00:18:36,730 --> 00:18:39,790
Okay, so let's rerun this again.

264
00:18:40,270 --> 00:18:43,300
We run this and then we visualize.

265
00:18:44,140 --> 00:18:46,270
As you can see now, there is no cut out region.

266
00:18:46,270 --> 00:18:48,400
So that's as expected.

267
00:18:48,400 --> 00:18:51,610
That said, we'll move forward to training our model again.

268
00:18:51,610 --> 00:18:53,980
So we run that training process.

269
00:18:53,980 --> 00:18:55,660
So here are the results we get.

270
00:18:55,660 --> 00:19:04,540
After training for several epochs, you'll notice that the accuracy doesn't go up to 99% as it used

271
00:19:04,540 --> 00:19:05,620
to be before.

272
00:19:05,620 --> 00:19:12,870
And also with this validation accuracy, we even get better results here.

273
00:19:12,880 --> 00:19:15,760
As a result, we get after training for several epochs.

274
00:19:15,790 --> 00:19:21,520
Notice how here the accuracy doesn't get as high as it used to be before.

275
00:19:21,520 --> 00:19:30,490
So the accuracy we are getting now is the highest value of accuracy we get is like 94.5% and the validation

276
00:19:30,490 --> 00:19:34,960
accuracy we get in here, it's about that.

277
00:19:34,960 --> 00:19:38,620
Like the highest we get in here is like 94.48%.

278
00:19:38,620 --> 00:19:42,430
And this is the accuracy versus epoch plot we now get.

279
00:19:42,430 --> 00:19:48,160
Also, after checking on Albumentations GitHub page, we found this solution to this problems we are

280
00:19:48,160 --> 00:19:53,230
getting here where we weren't able to make use of the cut out or rather we were able to make use of

281
00:19:53,230 --> 00:19:55,930
the sharpen and the random grid shuffle.

282
00:19:55,930 --> 00:20:02,020
So here when we do this install, which you have here and then uncomment the sections, you should now

283
00:20:02,020 --> 00:20:03,040
have this working.
