With iOS 11, the new coreML framework allows developers to recognize objects in pictures and in live video streams (from the camera feed or videos)
The following screenshot is taken from Yohann’s “Complete iOS Machine Learning Masterclass“. You’ll notice the iPhone app is able to recognize the sunglasses from the camera stream, using a specific Machine Learning trained model, provided by Apple themselves.
The power of Machine Learning allows us to easily recognize faces, places, and most of common objects. The problem lies in what happens when you show the model something it’s never seen before?
Let’s feed Star Wars’ R2D2 robot to the iPhone app:
Yes, the iPhone thinks R2D2 is a projector! The model has never been trained to know who R2D2 is and figured out that the closed thing is a projector. Now some of you Star Wars fan know that R2D2 can be a projector when it projected the secret message from Princess Leia, so it’s not totally wrong, right?
The second guess for R2D2 was a “trash can” … now that can be quite unfortunate when you call someone a trash can, wouldn’t you think so? lol
How about Yoda? Let’s feed Star Wars’ Yoda to the iPhone app. Guess what it thinks Yoda is?
The iPhone thinks Yoda is an ocarina or a sweet potato! (I could see the resemblance, can you?)
Jokes aside, what it it were a real person? It could be very rude to call someone a potato. So how do you make sure iPhone apps don’t do these mistakes?
That’s when training the model comes in…
Using Apple’s standard models will not be enough. If you only use the models that Apple suggested, you end up hitting a road block… You will need customize the models by extending them yourself, by training them so that models learn about the mistakes and don’t do it again. You would do so by adding new categories (labels) to the trained model using Python and Tensorflow. You learn how to do this in the Complete iOS Machine Learning Masterclass (look at section 10).
If you haven’t registered to the Machine Learning course yet, here is a limited-time offer to motivate you to do so. Use coupon code APPSFRESHVIP10 to get the course for $10 only instead of $200 (95% OFF)
Enjoy Machine Learning for iOS, we live in wonderful times.
See you in the course.
See what students say about the course: