Hello, everyone, and welcome back to a brand-new module. In this module, 1
we're going to be doing something really, really exciting. 2
We're kind of at the bleeding edge of technology here. 3
We're going to use Apple's latest API called CreateML to build our own machine learning models. 4
So whereas previously, we were using pre-trained machine learning models that used tools such as Caffe 5
or Keras and we were taking those pre-trained models for defined problems and converting it to a CoreML 6
compatible format using CoreML tools and using a different programming language called Python. 7
And then we ended up with something that had a format of .mlmodel which we dropped into our 8
Xcode project, and then we used that model inside our app. 9
Now, a lot of you have been frustrated by the fact that there's a limited number of pre-trained models 10
that you can actually convert to use for CoreML. 11
And I've seen a lot of you wanting to be able to train your very own models based off your own data, 12
so that instead of having to depend on these tools, you can use the tools that you already know and that 13
you've already learned about, namely, Swift and Xcode. And in WWDC this year and for the launch of Xcode 10 14
and iOS 12, 15
this is exactly the precedent that we got, and it's called CreateML. What it allows us to do is to take 16
data such as text or images or other types of files and feed it through this framework CreateML 17
to create our very own CoreML Models which we can then incorporate into our app the same way as 18
we did before. 19
Now, in this case, the training is done entirely inside the Xcode, 20
macOS playgrounds, and we'll be using the latest version of Swift as well as the latest version of the 21
iOS 12 APIs in order to achieve this. 22
And I'm going to walk you through step by step exactly how it works and how to create any model that 23
you wish. 24
Now, for the first project that we're going to be building is we're going to be creating a machine learning 25
model that can do image recognition. 26
Now, of course, because we're training our own model this time, we actually have to source some data and 27
we have to teach our model a number of things. 28
In this case, we're going to teach our model what dogs look like, and it's just as you would take a child 29
and you would show it lots of pictures or let it play with a real dog, and its eyes gets accustomed to 30
the various features of dogs. For example, they're kind of fluffy, they're kind of weird, and they have 31
these floppy ears. And when we're training our model, it's going to look at all of the features that are 32
common to all of these images 33
that is what we would normally call a dog. 34
And once it's learned all of those features that are unique to dogs, then we have our machine learning 35
model that has the intelligence to be able to recognize an image of a dog, so that the next time when 36
we show it a new image that it's never seen before, but of a dog, then we pass that image through our 37
machine learning model. It will be able to recognize it and tell us that this is a dog. 38
So this is essentially what we're trying to achieve. 39
Now, if it just recognized dog or not dog, it's a bit like our previous sort of "Hotdog!" or "Not Hotdog!" 40
type of intelligence, right, which is kind of low. 41
And so we're going to give it a few more things to learn. 42
We're going to also teach it what cats are and what rabbits look like, so that we can give it an image 43
of a cat or dog or a rabbit, and it should be able to correctly identify what that animal is based off 44
the features that it's already learned about 45
each of these animals. And then we're going to take that model that we've created and we're gonna put 46
it into our app and build our own image recognition app using data that we've sourced and a model that 47
we've created. 48
So it's essentially an end-to-end tutorial where we're going to learn about every step of creating a 49
artificially intelligent image recognition machine learning algorithm. 50
So once you're ready, head over to the next tutorial and we'll get started.