As described in our previous posts, we created an ARKit-App with Face-Recognition.
I will explain how we created our Face-Recognition model.
Where to start?
Apple’s machine learning framework CoreML supports Keras and Caffe for neural network machine learning.
Never heard of these before and done anything with machine learning, I started with a Keras tutorial:
Aside from our specific persons, we need an unknown category. So that other faces are not falsely identified as one of our classifications.
For this we searched the web, and downloaded lots of different faces.
Start the training
1. Upload our images
Now we need to upload our images to create a dataset.
Connect with SFTP to our instance. Use the username ubuntu and your AWS pem-file.
Upload the classifications in the folder data
2. Create Dataset
Go back to the DIGITS UI and create a new classification dataset.
You may need to enter a username. Choose as you like.
Set the image size to 227 x 227
Caffe’s default cropped size is 227 x 227. Otherwise greater images will be cropped.
Resize Transformation to Crop
In order to keep the aspect ratio, we crop the images.
Training images to /home/ubuntu/data
Image Encoding to JPEG(lossy)
To save space.
Now we have our dataset to create our ML model.
3. Train our model
Navigate to the main page and create a new classification model.
We reduce the training epochs to 15 for a faster result and the learning rate to 0.001
Choose the AlexNet as network