1
00:00:00,210 --> 00:00:06,750
Hi, welcome back in this section, we'll take a look at Google Deep Dream, which is a very cool algorithm

2
00:00:06,750 --> 00:00:09,210
that produces some amazing, trippy effects.

3
00:00:09,750 --> 00:00:10,980
So let's take a look at this.

4
00:00:11,190 --> 00:00:14,010
So here's what we can expect from deep dream.

5
00:00:14,520 --> 00:00:16,680
Look at these weird artifacts here.

6
00:00:16,680 --> 00:00:22,800
So we input a normal image of some clouds here, and then it produces this sort of weird image here.

7
00:00:22,800 --> 00:00:29,490
But if you zoom in on these spots in these images, you'll see some weird things like Admiral Dog or

8
00:00:29,500 --> 00:00:35,820
the pink snail or the candle bird, which I'm not even sure it's a bird looks like a can of fish or

9
00:00:35,820 --> 00:00:38,550
something, as well as a dogfish here.

10
00:00:39,180 --> 00:00:40,530
So pretty cool.

11
00:00:40,530 --> 00:00:41,220
Pretty weird.

12
00:00:41,820 --> 00:00:43,110
So what is the dream?

13
00:00:43,230 --> 00:00:50,730
Well, it's simply, we're taking an image and then outputting dreams of coolest effects on the image.

14
00:00:51,450 --> 00:00:53,430
So what is a process to do this?

15
00:00:53,670 --> 00:00:58,170
Well, let's take a look at a very trippy, hallucinogenic image in the next slide.

16
00:00:58,920 --> 00:00:59,280
Wow.

17
00:01:00,090 --> 00:01:02,400
Very, very weird, isn't it?

18
00:01:03,480 --> 00:01:08,370
And by the way, this input for this image, I believe, was very simple.

19
00:01:08,790 --> 00:01:14,310
Landscape image So you can see we've got tons of weird artifacts happening here.

20
00:01:15,000 --> 00:01:18,760
So sort of new animals that have been invented by CNN.

21
00:01:20,070 --> 00:01:22,590
So let's take a look at the deep shrimp process.

22
00:01:23,340 --> 00:01:25,620
So here's the next nice image here as well.

23
00:01:26,100 --> 00:01:33,570
So firstly, the deep, deep stream deep dream algorithm is effectively asking a pre-trained CNN to

24
00:01:33,570 --> 00:01:40,340
take a look at an image and then identify patterns that it recognizes in that image and then amplify

25
00:01:40,350 --> 00:01:43,320
them like expand and go crazy, go nuts on them.

26
00:01:44,160 --> 00:01:50,580
It uses the representations learned by CNN to produce this hallucinogenic or trippy images, and it

27
00:01:50,580 --> 00:01:58,050
was introduced by these guys from Google in 2015 in a publication titled Deep Dream called Example for

28
00:01:58,050 --> 00:01:59,460
Visualizing Neural Networks.

29
00:02:00,000 --> 00:02:04,950
And I do recall this people being very, very popular.

30
00:02:05,220 --> 00:02:08,880
It went viral, but actually when it was released back in 2015.

31
00:02:09,930 --> 00:02:13,030
So remember filters?

32
00:02:13,830 --> 00:02:19,620
This is a basically I'm going to explain the intuition behind understanding deep dream deep stream now,

33
00:02:20,430 --> 00:02:26,220
deep dream deep streamers, invidious deployment platforms and keep constantly confusing those names.

34
00:02:26,220 --> 00:02:27,360
Apologies for that.

35
00:02:28,110 --> 00:02:31,050
So remember how we created a filter visualizations?

36
00:02:31,830 --> 00:02:38,040
Keep that in mind and also remember how we did our class like civilizations where we just had some random

37
00:02:38,040 --> 00:02:38,700
noise here.

38
00:02:38,700 --> 00:02:46,350
And then we optimize on that to give us what classic things a banana looks like or a heartbeat.

39
00:02:46,350 --> 00:02:47,820
So much so I know this stuff.

40
00:02:48,360 --> 00:02:51,090
And to starfish screw a parachute.

41
00:02:51,540 --> 00:02:56,190
These were what these were the maximum the fetus image back into CNN.

42
00:02:56,640 --> 00:03:01,230
It would give you a 100 percent probability that that's a parachute or a screw.

43
00:03:01,710 --> 00:03:03,330
So keep that in mind.

44
00:03:03,540 --> 00:03:06,120
So how does this work, OK?

45
00:03:06,750 --> 00:03:11,280
Well, in deep dream, instead of maximizing a class output, we let them.

46
00:03:11,280 --> 00:03:12,150
That would decide.

47
00:03:12,540 --> 00:03:13,320
What does that mean?

48
00:03:13,890 --> 00:03:19,560
Well, it means that when we is an image and input image and the network unlicensed image, we then

49
00:03:19,560 --> 00:03:25,980
asked the network we have, which actually we choose earlier and we asked that network now to just amplify

50
00:03:25,980 --> 00:03:28,260
and enhance whatever it detected.

51
00:03:29,370 --> 00:03:32,220
So remember, each layer deals with different features.

52
00:03:32,220 --> 00:03:38,340
We have high level features like faces and more complex patterns and low level features, which could

53
00:03:38,340 --> 00:03:42,270
be things like stripes or edges or something very small.

54
00:03:42,780 --> 00:03:45,780
So the complexity of the person depends on the features.

55
00:03:45,820 --> 00:03:51,480
If we if you ask network to amplify, if it choose a different live and then occidentale to amplify

56
00:03:51,480 --> 00:03:58,200
what detected, you'll get different, different features depending on what value or what level you

57
00:03:58,560 --> 00:03:59,010
selected.

58
00:04:00,420 --> 00:04:04,110
So here's how the algorithm looks at a low level.

59
00:04:04,110 --> 00:04:08,700
So a more granular explanation of the algorithm.

60
00:04:09,420 --> 00:04:10,590
We take an input image.

61
00:04:11,160 --> 00:04:11,820
We load it.

62
00:04:12,000 --> 00:04:19,320
Pretreat Network VIDEO Inception tend to work well for this visualization algorithm, and if we're going

63
00:04:19,320 --> 00:04:23,760
to use them as a feature extractor, which you've seen in the previous lesson.

64
00:04:24,690 --> 00:04:31,470
So next we calculate loss, which is basically as some of the activations between the chosen layers.

65
00:04:31,860 --> 00:04:36,720
We then normalize at each layer so that the contributions from all the layers are equal.

66
00:04:37,500 --> 00:04:42,960
And then we use a process called gradient descent, which is the opposite of gradient descent gradient

67
00:04:42,960 --> 00:04:43,650
S.A..

68
00:04:44,280 --> 00:04:49,620
And then, unlike gradient descent, where we're trying to find a local minima gradient descent tries

69
00:04:49,620 --> 00:04:51,120
to maximize its loss.

70
00:04:51,690 --> 00:04:55,860
So this allows the network to find less meaningful patterns in the image.

71
00:04:56,610 --> 00:04:59,190
And then we apply this to different skill sizes.

72
00:04:59,190 --> 00:04:59,890
So the patterns.

73
00:04:59,980 --> 00:05:03,400
Don't all look and occur at the same level of granularity.

74
00:05:04,150 --> 00:05:08,440
So that's it for deep dream algorithm and you've seen some cool images.

75
00:05:08,890 --> 00:05:15,460
Now it's time to actually go into the code and actually experiment with Google prim and good Keras and

76
00:05:15,460 --> 00:05:16,120
PyTorch.

77
00:05:16,570 --> 00:05:18,070
So stay tuned for that lesson.

78
00:05:18,220 --> 00:05:18,670
Thank you.
