Machine Learning on iOS — Tutorial Series

Hunter Ward
3 min readNov 3, 2017

--

▼ OVERVIEW

Introduction

Machine Learning (ML) is the magical science of making computers learn without tediously programming explicit instructions. Advancements in GPUs have accelerated Deep Learning, a subfield of ML commonly inspired by the human brain. These techniques help us better fight cancer 💊, ride self-driving cars 🚕, identify our pets 🐕, and speak to our phones 🗣📱.

Apple’s iOS devices have run powerful ML techniques like Deep Neural Networks since the A9 chip (iPhone 6s, 2015). However, programming your own ML framework was never easy … until now! At WWDC 2017, Apple improved ML on iOS tremendously. This includes the introduction of Core ML — a straightforward machine learning framework. 👩‍💻👨‍💻

“Machine Learning on iOS” is super exciting! This series will provide a practical guide for ML on iOS. This will involve carefully curated lists of existing tutorials 🕵️, as well as my own tuts. (⚠ Disclaimer: I’ll be updating and refining articles over time.)

Assumed Knowledge

• Novice understanding of iOS Development
Zero understanding of ML, Deep Learning, Computer Vision

(Curated for novice developers, creative technologists, and curious hobbyists.)

Machine Learning Pipeline for iOS

Machine Learning and Deep Learning are powerful fields which Apple has made incredibly accessible. ML in general involves multiple steps:

Pipeline and Tools for Machine Learning on iOS (example DNN CV pipe)

The typical pipeline of a full Machine Learning project involves:

• 1: Data gathering and cleaning.
• 2: Training a model based on data.
• 3: Inferring information from new data using the trained model.

On iOS the final step can involve:

• 3a: Converting a model into a format that iOS will understand; typically a CoreML model.
• 3b: Feeding data from iOS into the model. For Computer Vision, this may involve ARKit, AVFoundation, or a UIImagePicker.

A Note on our Initial Focus

Machine Learning and its applications are big topics. We’re going to start in an area that hopefully serves many people’s interests, is simple, prepares you for other domains, and is fun 😁.

Our Initial Focus: Real Time Computer Vision applications using Supervised Deep Learning.
Dribbble by Ramotion

Next Steps

Conceptually, we’ll be going through:

  1. InferencingiOS App
  2. Data ➡ Inferencing ➡ iOS App
  3. Conversion ➡ Inferencing ➡ iOS App
  4. Data ➡ Training ➡ Conversion ➡ Inferencing ➡ iOS App

Next, we’ll get started creating ML powered applications on iOS!

Stay tuned for the next chapter: Getting started with Core ML on iOS

Chris Greening running an InceptionV3 model on iOS

GETTING STARTED WITH CORE ML ON iOS

CREATE YOUR OWN OBJECT RECOGNIZER

▶ CONVERSION… (WIP)

▶ TRAINING… (WIP)

--

--