SlideShare a Scribd company logo
1 of 37
Download to read offline
Keith Moon - Senior iOS Developer
Machine Learning for
iOS Developers
UnitedDefConf - Minsk
April 2017
3
• iOS Developer since 2010
• Worked with BBC News, Hotels.com and Travelex
• “Swift 3 Cookbook” to be published by Pakt
Who am I?
@keefmoon
4
• Help users discover great local food
• Make it quick and easy to order from a wide variety of takeaways
• Available on:
–Web
–iOS
–tvOS
–Android
–Amazon Echo
What is Just Eat?
3
5
• Australia
• Brazil
• Canada
• Denmark
• France
• Ireland
• Italy
• Mexico
What is Just Eat?
Global Business
• New Zealand
• Norway
• Spain
• Switzerland
• UK
8
What this talk isn’t?
• Not a ML expert
• Not a Python expert
• Not great at Maths
• Not a deep dive into ML
So what is this talk?
So what is this talk?
9
• ML from an iOS developer’s point of view
• High level overview of ML
• What features are appropriate uses of ML?
• How can you use ML in your apps?
• Current state of ML tools
• What does the future hold?
Glossary
10
Machine Learning
Artificial Intelligence Neural Network
Deep Learning
Glossary
11
Machine Learning
Artificial Intelligence
Neural Network
Deep Learning
Artificial Intelligence
Glossary
12
Machine Learning
Neural Network
Deep Learning
Artificial Intelligence
Glossary
13
Machine Learning
Neural Network
Deep Learning
Artificial Intelligence
Glossary
14
Machine Learning
Deep Learning
Neural Network
Machine Learning Examples
15
ML Use Cases
16
• Spam
• Recommendations
• Handwriting recognition
• Speech recognition
• Face Detection
• Entity extraction
• Facial Recognition
• Object Recognition
• Text Prediction
• Sentiment Analysis
• Image Style transfer
Machine Learning Goal
17
Neural Network Output Answer
Training Input
Input Question
Classifier
18
Untrained
Neural Network
Training Input
Data
Data
Data
Input to categorise
Category 1
Category 2
Category 3
1
1
2
2
3
3
Classifier
19
Trained
Neural Network
Training Input
Input to categorise
Category 1
Category 2
Category 3
Classifier
20
Neural Network
Input
Input to categorise
Hidden
Training Input
Data
Data
Data
1
2
3
Category 1
Category 2
Category 3
1
2
3
Output
⨍( )
Training the model
21
w1
w2
w3
∑i xi * wi + bx1
x2
x3
b
Forward Propagation
eg. Softmax
Training the model
22
w1
w2
w3
x1
x2
x3
b
Back Propagation
g = gradient
The extent to which
changing the value
reduces the error
g
Difference between
expected and actual
= error
g
g
g
Classifier
23
Neural Network
Input
Input to categorise
Hidden
Training Input
Data
Data
Data
1
2
3
Category 1
Category 2
Category 3
1
2
3
Output
Handwriting Image Input
26
Input
?
?
?
?
from the MNIST dataset
Handwriting Image Input
27
Input
?
?
?
?
14 pixels x 14 pixels 14 x 14 = 196 values
between 0 and 1
Handwriting Image Input
28
Input
14 pixels x 14 pixels 14 x 14 = 196 values
between 0 and 1
…
px 1
px 2
px 3
px 4
px 5
px 6
px 196
Your
App
API
Adding a ML Feature
29
What are my options?
Train
Use
1) Managed Machine Learning driven API
30
• No ML knowledge required
• Simple to implement
• Light on resources
• Only solves common ML problems
• Third-Party dependancy
• Needs connectivity
• Data ownership issues
• No control over model improvement
Adding a ML Feature What are my options?
1) Managed Machine Learning driven API
31
Adding a ML Feature What are my options?
2) Custom Model Trained and Used on Server
Your
App
API
Train
Use
32
• Can customise the model to your
needs
• Make use of open source models
• Light on mobile resources
• You control the data
• You control model improvement
• Knowledge of ML tools / Python
needed
• Server management overhead
• App friendly API needed
• Needs connectivity
Adding a ML Feature What are my options?
2) Custom Model Trained and Used on Server
33
Adding a ML Feature What are my options?
3) Custom Model Trained on Server. Used on Phone.
API
Train
Trained ModelAccelerate
Framework
Metal
Framework
GPU
CPU
34
• Can customise the model to your
needs
• Make use of open source models
• User can control the data
• Can work offline
• Knowledge of ML tools / Python needed
• Server management overhead
• Need to transfer complex model to phone
• May limit the scope of model
improvement
Adding a ML Feature What are my options?
3) Custom Model Trained on Server. Used on Phone.
36
Adding a ML Feature What are my options?
3) Custom Model Trained on Server. Used on Phone.
2) Custom Model Trained and Used on Server
1) Managed Machine Learning driven API
Future of Machine Learning on iOS
● Easier model transfer from server to phone
● Trainable network APIs from Apple
● Ability to plug and play ML models together
● Further development of Swift ML tools
37
References
Machine Learning APIs:
Google Prediction: https://cloud.google.com/prediction
Google Natural Language: https://cloud.google.com/natural-language
Microsoft Cognitive Services: https://www.microsoft.com/cognitive-services
Amazon ML: https://aws.amazon.com/documentation/machine-learning
IBM Watson: https://www.ibm.com/watson/developercloud
Open Source Model:
Tensor Flow Models: https://github.com/tensorflow/models
FaceNet for TensorFlow: https://github.com/davidsandberg/facenet
38
References
Machine Learning Frameworks:
Torch: http://torch.ch
TensorFlow: https://www.tensorflow.org
Caffe: https://github.com/BVLC/caffe
Awesome Machine Learning resources: https://github.com/josephmisiti/awesome-machine-learning
Hosting:
Amazon Web Services: https://aws.amazon.com
Amazon Deep Learning AMI - Ubuntu Edition https://aws.amazon.com/marketplace/pp/B06VSPXKDX
Digital Ocean https://www.digitalocean.com
39
References
Machine Learning Frameworks on iOS:
Torch: https://github.com/clementfarabet/torch-ios
TensorFlow: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/ios_examples
http://www.mattrajca.com/2016/11/25/getting-started-with-deep-mnist-and-tensorflow-on-ios.html
Caffe: https://github.com/noradaiko/caffe-ios-sample
Using Metal Performance Shaders with a TensorFlow trained model:
https://developer.apple.com/library/content/samplecode/MPSCNNHelloWorld
Neural Networks and Accelerate: https://developer.apple.com/videos/play/wwdc2016/715
BNNS in Accelerate: https://developer.apple.com/reference/accelerate/bnns
List of ML resources for iOS: https://github.com/alexsosn/iOS_ML
40
References
Open Source:
Face Entry Example:
https://github.com/keefmoon/faceentry
Just Eat Open Source:
https://github.com/justeat
41
Thanks! @keefmoon
keith.moon@just-eat.com
keefmoon

More Related Content

Similar to Keith Moon "Machine learning for iOS developers"

Resume_Mayur_Jadhav
Resume_Mayur_JadhavResume_Mayur_Jadhav
Resume_Mayur_Jadhav
Mayur Jadhav
 
Geotech presentation 2012
Geotech presentation 2012Geotech presentation 2012
Geotech presentation 2012
Pradipta Sen
 

Similar to Keith Moon "Machine learning for iOS developers" (20)

Introduction to ML.NET
Introduction to ML.NETIntroduction to ML.NET
Introduction to ML.NET
 
Artificial Intelligence in practice - Gerbert Kaandorp - Codemotion Amsterdam...
Artificial Intelligence in practice - Gerbert Kaandorp - Codemotion Amsterdam...Artificial Intelligence in practice - Gerbert Kaandorp - Codemotion Amsterdam...
Artificial Intelligence in practice - Gerbert Kaandorp - Codemotion Amsterdam...
 
Teaching Machine Learning with Physical Computing - July 2023
Teaching Machine Learning with Physical Computing - July 2023Teaching Machine Learning with Physical Computing - July 2023
Teaching Machine Learning with Physical Computing - July 2023
 
Embedded systems robotics and this mva training series
Embedded systems robotics and this mva training seriesEmbedded systems robotics and this mva training series
Embedded systems robotics and this mva training series
 
The Past, Present, and Future of Machine Learning APIs
The Past, Present, and Future of Machine Learning APIsThe Past, Present, and Future of Machine Learning APIs
The Past, Present, and Future of Machine Learning APIs
 
Persian MNIST in 5 Minutes
Persian MNIST in 5 MinutesPersian MNIST in 5 Minutes
Persian MNIST in 5 Minutes
 
Ai on the edge... and containers
Ai on the edge... and containersAi on the edge... and containers
Ai on the edge... and containers
 
Design and development of a mobile mashup application for geo-localized news ...
Design and development of a mobile mashup application for geo-localized news ...Design and development of a mobile mashup application for geo-localized news ...
Design and development of a mobile mashup application for geo-localized news ...
 
Accelerating Machine Learning on Databricks Runtime
Accelerating Machine Learning on Databricks RuntimeAccelerating Machine Learning on Databricks Runtime
Accelerating Machine Learning on Databricks Runtime
 
Resume_Mayur_Jadhav
Resume_Mayur_JadhavResume_Mayur_Jadhav
Resume_Mayur_Jadhav
 
Strata London - Deep Learning 05-2015
Strata London - Deep Learning 05-2015Strata London - Deep Learning 05-2015
Strata London - Deep Learning 05-2015
 
Unity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
Unity and Microsoft Azure Cognitive Services - DIGITREK21 WorkshopUnity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
Unity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
 
Combining Machine Learning with Physical Computing - June 2023
Combining Machine Learning with Physical Computing - June 2023Combining Machine Learning with Physical Computing - June 2023
Combining Machine Learning with Physical Computing - June 2023
 
Geotech presentation 2012
Geotech presentation 2012Geotech presentation 2012
Geotech presentation 2012
 
Designing Cross-Domain Semantic Web of Things Applications
Designing Cross-Domain Semantic Web of Things ApplicationsDesigning Cross-Domain Semantic Web of Things Applications
Designing Cross-Domain Semantic Web of Things Applications
 
AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...
AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...
AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...
 
Presenting Data – An Alternative to the View Control
Presenting Data – An Alternative to the View ControlPresenting Data – An Alternative to the View Control
Presenting Data – An Alternative to the View Control
 
201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0
 
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
 
Siddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobileSiddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobile
 

More from IT Event

More from IT Event (20)

Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
 
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...
 
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
 
Konstantin Krivlenia - "Continuous integration for frontend"
Konstantin Krivlenia - "Continuous integration for frontend"Konstantin Krivlenia - "Continuous integration for frontend"
Konstantin Krivlenia - "Continuous integration for frontend"
 
Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"
Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"
Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"
 
Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"
Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"
Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"
 
Vladimir Grinenko - "Dependencies in component web done right"
Vladimir Grinenko - "Dependencies in component web done right"Vladimir Grinenko - "Dependencies in component web done right"
Vladimir Grinenko - "Dependencies in component web done right"
 
Dmitry Bartalevich - "How to train your WebVR"
Dmitry Bartalevich - "How to train your WebVR"Dmitry Bartalevich - "How to train your WebVR"
Dmitry Bartalevich - "How to train your WebVR"
 
Aleksey Bogachuk - "Offline Second"
Aleksey Bogachuk - "Offline Second"Aleksey Bogachuk - "Offline Second"
Aleksey Bogachuk - "Offline Second"
 
James Allardice - "Building a better login with the credential management API"
James Allardice - "Building a better login with the credential management API"James Allardice - "Building a better login with the credential management API"
James Allardice - "Building a better login with the credential management API"
 
Fedor Skuratov "Dark Social: as messengers change the market of social media ...
Fedor Skuratov "Dark Social: as messengers change the market of social media ...Fedor Skuratov "Dark Social: as messengers change the market of social media ...
Fedor Skuratov "Dark Social: as messengers change the market of social media ...
 
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
 
Алексей Рагозин "Java и linux борьба за микросекунды"
Алексей Рагозин "Java и linux борьба за микросекунды"Алексей Рагозин "Java и linux борьба за микросекунды"
Алексей Рагозин "Java и linux борьба за микросекунды"
 
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
 
Наш ответ Uber’у
Наш ответ Uber’уНаш ответ Uber’у
Наш ответ Uber’у
 
Александр Крашенинников "Hadoop High Availability: опыт Badoo"
Александр Крашенинников "Hadoop High Availability: опыт Badoo"Александр Крашенинников "Hadoop High Availability: опыт Badoo"
Александр Крашенинников "Hadoop High Availability: опыт Badoo"
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
 
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
 
Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"
 

Recently uploaded

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Keith Moon "Machine learning for iOS developers"

  • 1.
  • 2. Keith Moon - Senior iOS Developer Machine Learning for iOS Developers UnitedDefConf - Minsk April 2017
  • 3. 3 • iOS Developer since 2010 • Worked with BBC News, Hotels.com and Travelex • “Swift 3 Cookbook” to be published by Pakt Who am I? @keefmoon
  • 4. 4 • Help users discover great local food • Make it quick and easy to order from a wide variety of takeaways • Available on: –Web –iOS –tvOS –Android –Amazon Echo What is Just Eat? 3
  • 5. 5 • Australia • Brazil • Canada • Denmark • France • Ireland • Italy • Mexico What is Just Eat? Global Business • New Zealand • Norway • Spain • Switzerland • UK
  • 6. 8 What this talk isn’t? • Not a ML expert • Not a Python expert • Not great at Maths • Not a deep dive into ML So what is this talk?
  • 7. So what is this talk? 9 • ML from an iOS developer’s point of view • High level overview of ML • What features are appropriate uses of ML? • How can you use ML in your apps? • Current state of ML tools • What does the future hold?
  • 14. ML Use Cases 16 • Spam • Recommendations • Handwriting recognition • Speech recognition • Face Detection • Entity extraction • Facial Recognition • Object Recognition • Text Prediction • Sentiment Analysis • Image Style transfer
  • 15. Machine Learning Goal 17 Neural Network Output Answer Training Input Input Question
  • 16. Classifier 18 Untrained Neural Network Training Input Data Data Data Input to categorise Category 1 Category 2 Category 3 1 1 2 2 3 3
  • 17. Classifier 19 Trained Neural Network Training Input Input to categorise Category 1 Category 2 Category 3
  • 18. Classifier 20 Neural Network Input Input to categorise Hidden Training Input Data Data Data 1 2 3 Category 1 Category 2 Category 3 1 2 3 Output
  • 19. ⨍( ) Training the model 21 w1 w2 w3 ∑i xi * wi + bx1 x2 x3 b Forward Propagation eg. Softmax
  • 20. Training the model 22 w1 w2 w3 x1 x2 x3 b Back Propagation g = gradient The extent to which changing the value reduces the error g Difference between expected and actual = error g g g
  • 21. Classifier 23 Neural Network Input Input to categorise Hidden Training Input Data Data Data 1 2 3 Category 1 Category 2 Category 3 1 2 3 Output
  • 23. Handwriting Image Input 27 Input ? ? ? ? 14 pixels x 14 pixels 14 x 14 = 196 values between 0 and 1
  • 24. Handwriting Image Input 28 Input 14 pixels x 14 pixels 14 x 14 = 196 values between 0 and 1 … px 1 px 2 px 3 px 4 px 5 px 6 px 196
  • 25. Your App API Adding a ML Feature 29 What are my options? Train Use 1) Managed Machine Learning driven API
  • 26. 30 • No ML knowledge required • Simple to implement • Light on resources • Only solves common ML problems • Third-Party dependancy • Needs connectivity • Data ownership issues • No control over model improvement Adding a ML Feature What are my options? 1) Managed Machine Learning driven API
  • 27. 31 Adding a ML Feature What are my options? 2) Custom Model Trained and Used on Server Your App API Train Use
  • 28. 32 • Can customise the model to your needs • Make use of open source models • Light on mobile resources • You control the data • You control model improvement • Knowledge of ML tools / Python needed • Server management overhead • App friendly API needed • Needs connectivity Adding a ML Feature What are my options? 2) Custom Model Trained and Used on Server
  • 29. 33 Adding a ML Feature What are my options? 3) Custom Model Trained on Server. Used on Phone. API Train Trained ModelAccelerate Framework Metal Framework GPU CPU
  • 30. 34 • Can customise the model to your needs • Make use of open source models • User can control the data • Can work offline • Knowledge of ML tools / Python needed • Server management overhead • Need to transfer complex model to phone • May limit the scope of model improvement Adding a ML Feature What are my options? 3) Custom Model Trained on Server. Used on Phone.
  • 31. 36 Adding a ML Feature What are my options? 3) Custom Model Trained on Server. Used on Phone. 2) Custom Model Trained and Used on Server 1) Managed Machine Learning driven API
  • 32. Future of Machine Learning on iOS ● Easier model transfer from server to phone ● Trainable network APIs from Apple ● Ability to plug and play ML models together ● Further development of Swift ML tools 37
  • 33. References Machine Learning APIs: Google Prediction: https://cloud.google.com/prediction Google Natural Language: https://cloud.google.com/natural-language Microsoft Cognitive Services: https://www.microsoft.com/cognitive-services Amazon ML: https://aws.amazon.com/documentation/machine-learning IBM Watson: https://www.ibm.com/watson/developercloud Open Source Model: Tensor Flow Models: https://github.com/tensorflow/models FaceNet for TensorFlow: https://github.com/davidsandberg/facenet 38
  • 34. References Machine Learning Frameworks: Torch: http://torch.ch TensorFlow: https://www.tensorflow.org Caffe: https://github.com/BVLC/caffe Awesome Machine Learning resources: https://github.com/josephmisiti/awesome-machine-learning Hosting: Amazon Web Services: https://aws.amazon.com Amazon Deep Learning AMI - Ubuntu Edition https://aws.amazon.com/marketplace/pp/B06VSPXKDX Digital Ocean https://www.digitalocean.com 39
  • 35. References Machine Learning Frameworks on iOS: Torch: https://github.com/clementfarabet/torch-ios TensorFlow: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/ios_examples http://www.mattrajca.com/2016/11/25/getting-started-with-deep-mnist-and-tensorflow-on-ios.html Caffe: https://github.com/noradaiko/caffe-ios-sample Using Metal Performance Shaders with a TensorFlow trained model: https://developer.apple.com/library/content/samplecode/MPSCNNHelloWorld Neural Networks and Accelerate: https://developer.apple.com/videos/play/wwdc2016/715 BNNS in Accelerate: https://developer.apple.com/reference/accelerate/bnns List of ML resources for iOS: https://github.com/alexsosn/iOS_ML 40
  • 36. References Open Source: Face Entry Example: https://github.com/keefmoon/faceentry Just Eat Open Source: https://github.com/justeat 41