1
00:00:00,610 --> 00:00:05,200
Now we've got our data ready in our car lab notebook and in Google Drive.

2
00:00:05,200 --> 00:00:11,500
Let's clean up our notebook and get it get it more set up towards our steps that we take on a new project

3
00:00:11,500 --> 00:00:11,860
system.

4
00:00:11,860 --> 00:00:14,330
So what we've done we've got collab.

5
00:00:14,350 --> 00:00:15,820
We've created a new project folder.

6
00:00:15,820 --> 00:00:17,710
We've got our data in there.

7
00:00:17,740 --> 00:00:21,880
We actually don't really need to create an environment of tools because code lab already has a lot of

8
00:00:21,880 --> 00:00:23,630
them installed for us.

9
00:00:23,650 --> 00:00:28,730
Let's try to import some anyway because what are we doing we're working with tensor flow.

10
00:00:28,750 --> 00:00:32,080
And this is what we're doing with getting our data into tenses.

11
00:00:32,080 --> 00:00:32,430
Yes.

12
00:00:32,440 --> 00:00:37,780
We're gonna use testify for that and we're gonna use tensor flow hub to pick a model that we get our

13
00:00:37,780 --> 00:00:39,490
notebooks set up for those two.

14
00:00:39,520 --> 00:00:41,850
In this video that sounds like a good idea.

15
00:00:42,070 --> 00:00:47,950
We go back to CO lab where we can do we can pretty up this because we don't need to run this command

16
00:00:47,950 --> 00:00:52,570
we could delete the cell or we will just commented out for now.

17
00:00:52,570 --> 00:01:00,150
So run that we can close this down get rid of that really just tidying up our Nope or getting it ready

18
00:01:00,600 --> 00:01:06,260
or we might do is at a tech cell and we're going to move that up there.

19
00:01:06,750 --> 00:01:09,930
And I'm going to put their title in there so we'll go.

20
00:01:09,930 --> 00:01:13,250
I'm going to put a little emoji because it's nice and fun.

21
00:01:13,710 --> 00:01:30,120
So we'll go end to end multi class dog grade classification and go There's no book builds an end to

22
00:01:30,120 --> 00:01:47,820
end multi class image classifier using tensor flow 2.0 and tensor flow hub wonderful and so let's get

23
00:01:47,820 --> 00:01:56,290
out a little headings up in here some problem data evaluation and then features.

24
00:01:56,710 --> 00:01:58,930
So this is again from our six step workflow.

25
00:01:59,500 --> 00:02:00,920
So am I put in here.

26
00:02:01,060 --> 00:02:17,920
One 2 3 4 so problem is identifying the breed of a dog given an image of a dog now is one hundred and

27
00:02:17,910 --> 00:02:20,160
twenty different dogs.

28
00:02:20,150 --> 00:02:25,620
Now if you can't identify that many breeds but I certainly can't so imagine this happened to me the

29
00:02:25,620 --> 00:02:26,540
other day right.

30
00:02:26,620 --> 00:02:32,640
I'm sitting at the cafe and a dog walks past and I kind of remember the breed name but someone next

31
00:02:32,640 --> 00:02:35,010
to me said oh that's let's make one up.

32
00:02:35,130 --> 00:02:36,540
That's an Australian terrier.

33
00:02:36,540 --> 00:02:38,290
Well that makes sense because I'm Australian.

34
00:02:38,460 --> 00:02:42,000
That's an Australian terrier I'm like wow how did they know that.

35
00:02:42,000 --> 00:02:48,730
And then I realized I only know about three dog breeds like German shepherd Labrador beagle.

36
00:02:48,720 --> 00:02:50,730
I only got that one because I'm reading that.

37
00:02:50,880 --> 00:02:56,190
And so this is what dog vision could be useful if we were trying to build something that could identify

38
00:02:56,220 --> 00:02:59,220
if I was sitting at that cafe and took a photo of that dog.

39
00:02:59,220 --> 00:03:03,510
Could my machine learning model the one that we're going to build tell me what breed it was.

40
00:03:03,630 --> 00:03:04,760
So that's our problem.

41
00:03:04,920 --> 00:03:16,110
It's like that's our statement when I'm sitting at the cafe and I take a photo of a dog I want to know

42
00:03:16,740 --> 00:03:19,920
what breed of dog it is.

43
00:03:20,520 --> 00:03:22,680
That's our problem we're putting it in real life terms.

44
00:03:22,680 --> 00:03:22,950
Right.

45
00:03:23,450 --> 00:03:24,610
And now where's our data.

46
00:03:24,630 --> 00:03:25,460
We can get our data.

47
00:03:25,470 --> 00:03:40,000
We'll just put a link here from Kaggle so the data we're using is from Cargill's dog breed identification

48
00:03:40,450 --> 00:03:51,140
competition and we'll put a link here evaluation what is our evaluation so in our head I want you to

49
00:03:51,140 --> 00:03:55,120
think about this before we even look at Kaggle because we're working on classification.

50
00:03:55,520 --> 00:04:02,080
What is a good evaluation metric for how well our dog vision is performing.

51
00:04:02,240 --> 00:04:05,300
Well one of the default metrics for classification is accuracy right.

52
00:04:05,300 --> 00:04:09,940
So if we can get it pretty accurate at predicting what dog is in a photo that's a pretty good metric.

53
00:04:09,950 --> 00:04:18,200
But let's see what Kaggle says so if we go to overview valuation submissions are evaluated on a multi

54
00:04:18,200 --> 00:04:19,590
class log loss.

55
00:04:20,330 --> 00:04:24,020
What is that between the predicted probability and the observed target.

56
00:04:24,020 --> 00:04:28,660
Well there's a link here so let's click that see now where.

57
00:04:29,140 --> 00:04:29,760
OK.

58
00:04:29,860 --> 00:04:32,260
Well these are things you're gonna have to deal with in real life right.

59
00:04:32,260 --> 00:04:35,620
You never always gonna go down the right path for a phone.

60
00:04:35,620 --> 00:04:37,300
I like how they've done that with data.

61
00:04:38,050 --> 00:04:45,720
Well multicast log loss let's have a look at the example we've got I.D. which is this long string.

62
00:04:45,900 --> 00:04:54,400
We've got a dog breed here Athan Pincher don't mock me for not being out of print hats at Afghan ham.

63
00:04:54,410 --> 00:05:00,370
That's an easier one to pronounce and zero point 0 0 8 3 zero point zero.

64
00:05:00,560 --> 00:05:06,260
These look like output prediction probabilities of a model in which they are.

65
00:05:06,260 --> 00:05:06,900
So here we go.

66
00:05:07,400 --> 00:05:08,390
If I could just read this.

67
00:05:08,390 --> 00:05:15,110
Remember if in doubt read the documentation or run the code either or for each image in the test set

68
00:05:15,110 --> 00:05:17,910
you must predict a probability for each of the different breeds.

69
00:05:17,960 --> 00:05:20,270
The file should contain a header and have the following format.

70
00:05:20,270 --> 00:05:23,490
Okay so this is what we're working towards if we wanted to make a submission.

71
00:05:23,540 --> 00:05:27,310
This competition is closed so it's a playground prediction competition.

72
00:05:27,590 --> 00:05:28,790
Well we can still make a submission.

73
00:05:28,790 --> 00:05:30,080
Let's work towards that.

74
00:05:30,110 --> 00:05:32,400
And that's the file type we need.

75
00:05:32,400 --> 00:05:33,370
All right.

76
00:05:33,380 --> 00:05:34,580
So if we go back where were we.

77
00:05:34,580 --> 00:05:38,370
Dog vision evaluation.

78
00:05:38,370 --> 00:05:52,160
The evaluation is a file with prediction probabilities for each dog breed of each test image and then

79
00:05:52,160 --> 00:05:57,170
we go here we'll copy that put it into dog vision.

80
00:05:57,170 --> 00:06:01,640
So if we ever needed to come back we can and then some features of the data.

81
00:06:01,670 --> 00:06:04,190
Well we know that the images so they're unstructured.

82
00:06:04,640 --> 00:06:06,100
Well let's have a look at our data.

83
00:06:07,130 --> 00:06:09,400
We have one hundred and twenty different breeds of dogs.

84
00:06:09,530 --> 00:06:15,380
So there's 120 different classes I'm going to copy that some information about the data

85
00:06:19,560 --> 00:06:22,490
we're dealing with images.

86
00:06:22,650 --> 00:06:25,490
This is the way I want you to start thinking about different projects right.

87
00:06:25,500 --> 00:06:25,760
You don't.

88
00:06:25,760 --> 00:06:28,440
This doesn't have to be like formal.

89
00:06:28,440 --> 00:06:33,780
By the time you've had some practice with problems you won't need to write this out but this is a good

90
00:06:33,780 --> 00:06:38,190
habit to have is that you're communicating your work not just to others like if we were to share this

91
00:06:38,190 --> 00:06:38,610
notebook.

92
00:06:38,610 --> 00:06:43,290
That's a really cool thing about collab as well you can share them but it's communicating it to yourselves

93
00:06:43,290 --> 00:06:51,270
so you know what you're working towards unstructured data so unstructured data is just anything that

94
00:06:51,390 --> 00:06:57,600
isn't in a data frame so no rows and columns doing the images unstructured data.

95
00:06:57,600 --> 00:07:06,300
So it's probably best we use deep learning slash transfer learning which is what this project is all

96
00:07:06,300 --> 00:07:07,530
about.

97
00:07:07,770 --> 00:07:09,750
What else is there about the data.

98
00:07:09,810 --> 00:07:18,390
There are 120 breeds of dogs and because it's multi class classification This means there are 120 different

99
00:07:19,260 --> 00:07:20,650
classes.

100
00:07:20,790 --> 00:07:25,590
Now if there are only two dog breeds it would be binary classification if you remember our project on

101
00:07:25,590 --> 00:07:28,200
heart disease that was binary classification.

102
00:07:28,200 --> 00:07:30,920
So whether someone has heart disease or not.

103
00:07:31,140 --> 00:07:38,840
So if we come back label CSB so ten thousand two hundred twenty two unique values.

104
00:07:38,860 --> 00:07:52,140
Okay so that means I'm guessing there is ten thousand two hundred and twenty two different images Okay

105
00:07:52,230 --> 00:07:53,920
so ten thousand training images.

106
00:07:53,920 --> 00:08:00,610
You know what we might be out to do is if we have this locally is go come on eye on that bomb look at

107
00:08:00,610 --> 00:08:01,280
that.

108
00:08:01,300 --> 00:08:02,380
Thank you Mac OS.

109
00:08:02,380 --> 00:08:04,730
You might be out to do this in windows I'm not entirely sure.

110
00:08:05,390 --> 00:08:10,660
You've got ten thousand three hundred fifty eight items and let's see if my theory was correct.

111
00:08:10,660 --> 00:08:14,620
Ten thousand two hundred twenty three in train.

112
00:08:15,100 --> 00:08:18,970
I wonder what that is where the little discrepancy is from there.

113
00:08:18,970 --> 00:08:19,410
That's right.

114
00:08:19,420 --> 00:08:20,580
We'll figure it out.

115
00:08:20,630 --> 00:08:23,260
We're not worried about that now we're cooks not chemists.

116
00:08:23,270 --> 00:08:32,720
There are around 10000 plus images in the training set there.

117
00:08:33,070 --> 00:08:40,700
Around 10000 plus images in the test set.

118
00:08:41,090 --> 00:08:42,980
These images have labels

119
00:08:46,200 --> 00:08:56,790
these images have no labels because will want to predict them wonderful so this is us setting up our

120
00:08:56,790 --> 00:08:58,290
project space.

121
00:08:58,290 --> 00:09:03,340
And now I know at the beginning we kind of said we're going to import tens of low but what's more important

122
00:09:03,340 --> 00:09:08,920
is getting our heads around what problem we're actually trying to solve before we start bringing in

123
00:09:08,920 --> 00:09:09,630
our tooling.

124
00:09:10,120 --> 00:09:19,830
So if we go here unzip the uploaded data into Google Drive wonderful so I'm gonna delete this cell.

125
00:09:19,850 --> 00:09:21,740
What should we do now.

126
00:09:21,740 --> 00:09:24,790
We might as well import tend to fly because that's what we're working with right.

127
00:09:24,800 --> 00:09:26,340
We come back to our keynote.

128
00:09:26,420 --> 00:09:27,650
This is our workflow.

129
00:09:27,740 --> 00:09:33,780
We're working with unstructured data so get our data ready we've got it uploaded into Google Drive correct.

130
00:09:33,780 --> 00:09:39,180
Get into tenses we're going to use tense of life for that and tense a flow hub so that's what we might

131
00:09:39,180 --> 00:09:44,860
as will try and do we might try and import tensor flow and tensor flow hub.

132
00:09:45,130 --> 00:09:47,020
How might we do that.

133
00:09:47,020 --> 00:09:50,850
So you could do this if you have any question you go how to import tensor flow.

134
00:09:51,250 --> 00:09:53,730
I already know so I'm just gonna show you.

135
00:09:53,740 --> 00:09:57,200
But that's just an example.

136
00:09:57,250 --> 00:10:03,680
Actually we're working in CO lab so it's better to be a bit more specific in Google collab.

137
00:10:03,700 --> 00:10:05,290
That's just what I would google.

138
00:10:05,330 --> 00:10:06,090
I'll look at that.

139
00:10:06,200 --> 00:10:06,990
A great video.

140
00:10:07,690 --> 00:10:10,120
Oh that's the old tensor flow logo.

141
00:10:10,210 --> 00:10:12,510
So if you see that logo that's they all tend to flow logo.

142
00:10:12,520 --> 00:10:14,750
We're dealing with tensor flow 2.0.

143
00:10:14,740 --> 00:10:19,550
So we want to import tensor flow

144
00:10:22,250 --> 00:10:23,900
into collab

145
00:10:27,480 --> 00:10:28,660
let's put a little heading here.

146
00:10:31,240 --> 00:10:36,570
Get our workspace ready.

147
00:10:36,630 --> 00:10:41,490
Now the beautiful thing about collab as well a little tidbit is that once you do headings in their own

148
00:10:41,490 --> 00:10:43,970
cells you get this little section over here.

149
00:10:43,980 --> 00:10:47,330
So we could go right at the top or we could go back to this section.

150
00:10:47,430 --> 00:10:50,720
So that's what we're gonna do throughout is just navigate through this.

151
00:10:50,760 --> 00:10:53,390
So we want to get our workspace ready.

152
00:10:53,620 --> 00:11:00,990
The import nice and simple import tend to flow as T F if you have a CTF just like num PIs MP Panda's

153
00:11:01,030 --> 00:11:01,840
PDA.

154
00:11:01,930 --> 00:11:03,970
TAF is short for tensor flow.

155
00:11:04,410 --> 00:11:06,050
We want to go print.

156
00:11:06,220 --> 00:11:13,520
TMF version and now this is gonna tell us what version because we're after intensive flow to on look

157
00:11:13,520 --> 00:11:17,300
at this Google Ecolab auto complete on tap.

158
00:11:17,300 --> 00:11:17,950
Thank you.

159
00:11:17,960 --> 00:11:22,220
But we're going to try and avoid using auto complete because we want to practice writing the code ourselves

160
00:11:24,250 --> 00:11:25,150
let's see what happens.

161
00:11:25,230 --> 00:11:30,320
Oh read text to many underscores.

162
00:11:30,520 --> 00:11:35,610
That's the first mistake we missed out on that red text.

163
00:11:35,610 --> 00:11:36,090
That's right.

164
00:11:36,090 --> 00:11:37,510
I'm going to show you.

165
00:11:37,500 --> 00:11:41,430
I'm going to restart my runtime.

166
00:11:42,330 --> 00:11:45,950
Remember if you ever see what I just did.

167
00:11:46,440 --> 00:11:54,510
If you ever see this come up you might have to go to runtime restart runtime but I'm going to just show

168
00:11:54,510 --> 00:12:00,500
you we don't have to worry about that cell because you've already unzip def RS show you this red text

169
00:12:00,570 --> 00:12:01,620
hopefully it comes up again.

170
00:12:01,620 --> 00:12:04,050
Boom that's what we were after.

171
00:12:04,050 --> 00:12:09,390
So the default version of tensor flowing collab will soon switch to tensor flow to point X. That's what

172
00:12:09,390 --> 00:12:10,000
we want.

173
00:12:10,000 --> 00:12:17,580
The new version offensive Low C you might if you're watching this video on the future you might already

174
00:12:17,580 --> 00:12:25,560
have tensor flow to point X or two point whatever we need to point something I because I'm running this.

175
00:12:25,710 --> 00:12:33,290
It hasn't switched over yet in color so I'm using T F one point one 5 which is not what we want.

176
00:12:33,300 --> 00:12:35,040
We want the 2.0 version.

177
00:12:35,160 --> 00:12:38,620
I'll see in the next video I'll show you a little trick if you don't have tensor flow 2.0 yet.

178
00:12:38,670 --> 00:12:42,780
If you do keep going skip the next video but if you don't watch the next video.
