1
00:00:00,000 --> 00:00:02,430
In the previous video,
we looked at training

2
00:00:02,430 --> 00:00:04,905
a small data set of
cats versus dogs,

3
00:00:04,905 --> 00:00:06,915
and saw how overfitting occurred

4
00:00:06,915 --> 00:00:08,970
relatively early on
in the training,

5
00:00:08,970 --> 00:00:11,265
leading us to
a false sense of security

6
00:00:11,265 --> 00:00:14,175
about how well the neural
network could perform.

7
00:00:14,175 --> 00:00:16,440
Let's now take a look
at the impact of

8
00:00:16,440 --> 00:00:19,230
adding image augmentation
to the training.

9
00:00:19,230 --> 00:00:22,200
Here we have exactly
the same code except

10
00:00:22,200 --> 00:00:25,140
that we've added the image
augmentation code to it.

11
00:00:25,140 --> 00:00:27,180
I'll start the training,
and we'll see that we have

12
00:00:27,180 --> 00:00:29,715
2,000 training images
in two classes.

13
00:00:29,715 --> 00:00:31,260
As we start training,

14
00:00:31,260 --> 00:00:33,450
we'll initially see
that the accuracy is

15
00:00:33,450 --> 00:00:37,275
lower than with the non-augmented
version we did earlier.

16
00:00:37,275 --> 00:00:39,630
This is because of
the random effects of

17
00:00:39,630 --> 00:00:42,240
the different image processing
that's being done.

18
00:00:42,240 --> 00:00:44,470
As it runs for a few more epochs,

19
00:00:44,470 --> 00:00:47,540
you'll see the accuracy
slowly climbing.

20
00:00:47,540 --> 00:00:51,150
I'll skip forward to see
the last few epochs,

21
00:00:51,890 --> 00:00:54,570
and by the time we
reach the last one,

22
00:00:54,570 --> 00:00:56,370
our model's about 86 percent

23
00:00:56,370 --> 00:00:57,990
accurate on the training data,

24
00:00:57,990 --> 00:01:00,480
and about 81 percent
on the test data.

25
00:01:00,480 --> 00:01:02,400
So let's plot this.

26
00:01:02,400 --> 00:01:06,050
We can see that the training
and validation accuracy,

27
00:01:06,050 --> 00:01:08,615
and loss are actually in
step with each other.

28
00:01:08,615 --> 00:01:10,190
This is a clear sign that we've

29
00:01:10,190 --> 00:01:12,635
solved the overfitting
that we had earlier.

30
00:01:12,635 --> 00:01:15,080
While our accuracy
is a little lower,

31
00:01:15,080 --> 00:01:17,180
it's also trending upwards so

32
00:01:17,180 --> 00:01:20,280
perhaps a more epochs will
get us closer to 100 percent.

33
00:01:20,280 --> 00:01:22,640
Why don't you go ahead
and give it a try?