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 Machine Learning for iOS Developers

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...Codemotion
 
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 2023Hal Speed
 
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 seriesNitin Mulchandani
 
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 APIsBigML, Inc
 
Ai on the edge... and containers
Ai on the edge... and containersAi on the edge... and containers
Ai on the edge... and containersRiccardo Cappello
 
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 ...Kristina Stefanova
 
Accelerating Machine Learning on Databricks Runtime
Accelerating Machine Learning on Databricks RuntimeAccelerating Machine Learning on Databricks Runtime
Accelerating Machine Learning on Databricks RuntimeDatabricks
 
Resume_Mayur_Jadhav
Resume_Mayur_JadhavResume_Mayur_Jadhav
Resume_Mayur_JadhavMayur Jadhav
 
Strata London - Deep Learning 05-2015
Strata London - Deep Learning 05-2015Strata London - Deep Learning 05-2015
Strata London - Deep Learning 05-2015Turi, Inc.
 
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 WorkshopPablo Farías Navarro
 
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 2023Hal Speed
 
Geotech presentation 2012
Geotech presentation 2012Geotech presentation 2012
Geotech presentation 2012Pradipta Sen
 
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 ApplicationsAmélie Gyrard
 
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...Amazon Web Services
 
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 ControlTeamstudio
 
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.0Mark Tabladillo
 
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...Databricks
 
Siddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobileSiddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobileLviv Startup Club
 

Similar to 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

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...IT Event
 
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?"IT Event
 
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...IT Event
 
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "IT Event
 
Konstantin Krivlenia - "Continuous integration for frontend"
Konstantin Krivlenia - "Continuous integration for frontend"Konstantin Krivlenia - "Continuous integration for frontend"
Konstantin Krivlenia - "Continuous integration for frontend"IT Event
 
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?"IT Event
 
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"IT Event
 
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"IT Event
 
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"IT Event
 
Aleksey Bogachuk - "Offline Second"
Aleksey Bogachuk - "Offline Second"Aleksey Bogachuk - "Offline Second"
Aleksey Bogachuk - "Offline Second"IT Event
 
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"IT Event
 
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 ...IT Event
 
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"IT Event
 
Алексей Рагозин "Java и linux борьба за микросекунды"
Алексей Рагозин "Java и linux борьба за микросекунды"Алексей Рагозин "Java и linux борьба за микросекунды"
Алексей Рагозин "Java и linux борьба за микросекунды"IT Event
 
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"IT Event
 
Наш ответ Uber’у
Наш ответ Uber’уНаш ответ Uber’у
Наш ответ Uber’уIT Event
 
Александр Крашенинников "Hadoop High Availability: опыт Badoo"
Александр Крашенинников "Hadoop High Availability: опыт Badoo"Александр Крашенинников "Hadoop High Availability: опыт Badoo"
Александр Крашенинников "Hadoop High Availability: опыт Badoo"IT Event
 
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"IT Event
 
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...IT Event
 
Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"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

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
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 MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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 Nanonetsnaman860154
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

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