1
00:00:00,000 --> 00:00:02,115
Of course, image augmentation

2
00:00:02,115 --> 00:00:04,440
isn't the magic bullet
to cure overfitting.

3
00:00:04,440 --> 00:00:08,010
It really helps to have
a massive diversity of images.

4
00:00:08,010 --> 00:00:10,170
So for example, if we
look at the horses or

5
00:00:10,170 --> 00:00:13,275
humans data set and train
it for the same epochs,

6
00:00:13,275 --> 00:00:15,585
then we can take a look
at its behavior.

7
00:00:15,585 --> 00:00:19,080
So I'm going to start training
and show all 100 epochs.

8
00:00:19,080 --> 00:00:21,495
I sped it up a bit
to save your time.

9
00:00:21,495 --> 00:00:23,250
As you watch, you'll see

10
00:00:23,250 --> 00:00:25,965
the test accuracy
climbing steadily.

11
00:00:25,965 --> 00:00:29,700
At first, the validation
accuracy seems to be in step,

12
00:00:29,700 --> 00:00:31,890
but then you'll see
it varying wildly.

13
00:00:31,890 --> 00:00:33,630
What's happening here is that

14
00:00:33,630 --> 00:00:35,805
despite the image augmentation,

15
00:00:35,805 --> 00:00:38,240
the diversity of
images is still too

16
00:00:38,240 --> 00:00:40,370
sparse and the validation

17
00:00:40,370 --> 00:00:42,760
set may also be poorly designed,

18
00:00:42,760 --> 00:00:45,050
namely that the type
of image in it is

19
00:00:45,050 --> 00:00:47,855
too close to the images
in the training set.

20
00:00:47,855 --> 00:00:49,190
If you inspect the data for

21
00:00:49,190 --> 00:00:51,110
yourself you'll see
that's the case.

22
00:00:51,110 --> 00:00:53,390
For example, the humans
are almost always

23
00:00:53,390 --> 00:00:55,730
standing up and in
the center of the picture,

24
00:00:55,730 --> 00:00:58,730
in both the training
and validation sets,

25
00:00:58,730 --> 00:01:01,490
so augmenting the image
will change it to look

26
00:01:01,490 --> 00:01:02,750
like something that doesn't

27
00:01:02,750 --> 00:01:04,970
look like what's in
the validation set.

28
00:01:04,970 --> 00:01:07,519
So by the time the training
has completed,

29
00:01:07,519 --> 00:01:09,035
we can see the same pattern.

30
00:01:09,035 --> 00:01:12,635
The training accuracy is
trending towards 100 percent,

31
00:01:12,635 --> 00:01:16,145
but the validation is
fluctuating in the 60s and 70s.

32
00:01:16,145 --> 00:01:18,920
Let's plot this, we can see that

33
00:01:18,920 --> 00:01:20,270
the training accuracy climbs

34
00:01:20,270 --> 00:01:22,400
steadily in the way
that we would want,

35
00:01:22,400 --> 00:01:25,250
but the validation
fluctuated like crazy.

36
00:01:25,250 --> 00:01:27,530
So what we can learn
from this is that

37
00:01:27,530 --> 00:01:30,380
the image augmentation
introduces a random element

38
00:01:30,380 --> 00:01:32,330
to the training images but if

39
00:01:32,330 --> 00:01:35,525
the validation set doesn't
have the same randomness,

40
00:01:35,525 --> 00:01:38,285
then its results can
fluctuate like this.

41
00:01:38,285 --> 00:01:40,490
So bear in mind
that you don't just

42
00:01:40,490 --> 00:01:42,800
need a broad set of
images for training,

43
00:01:42,800 --> 00:01:44,840
you also need them for testing or

44
00:01:44,840 --> 00:01:47,530
the image augmentation
won't help you very much.