Home » Uncategorized

Building your first Machine Learning model on iPhone

This tutorial will teach you how to build a ML model on iPhone using CorelML. Interestingly this is not the first time that Apple has come out with a framework for machine learning on its devices. Last year it launched a bunch of libraries for the same:

  1. Accelerate and Basic Neural Network Subroutines (BNNS) – Efficiently utilize CPU for predictions using Convolutional Neural Networks.
  2. Metal Performance Shaders CNN (MPSCNN) – Efficiently utilize GPU for predictions using Convolutional Neural Networks.

The point of difference was, one was optimized for CPU while the other was optimized for the GPU. The reason for this is sometimes during inference the CPU can be faster than the GPU. While during training almost every time GPU is faster. These multiple frameworks created a lot of confusion among developers and since they were quite close to the hardware(for high performance), they were difficult to program in.

1

CoreML also comes with three libraries built on top of it :

  1. Vision: A library that provides high-performance image analysis and computer vision techniques to identify faces, detect features, and classify scenes in images and video.
  2. Foundation (NLP): As the name suggests it is a library that provides functionality natural language processing.
  3. Gameplay Kit: A library for game development also provides AI for the same, uses decision trees.

All of the above libraries, again are very easy to use and provide a simple interface to do a bunch of tasks. With the above libraries, the final structure of CoreML would look something like this

1

Content of this article:

  1. What is CoreML?
  2. Setting up the system
  3. Case Study: Implementing a spam message classifier app for iPhone
  4. Pros and Cons of using CoreML

To read the article, click here.

 DSC Resources

Popular Articles