Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Machine Learning with CreateML

Swift India
September 14, 2019

Machine Learning with CreateML

Presented by Krishna Jagadish at Swift Bangalore meet up Chapter #17

Swift India

September 14, 2019
Tweet

More Decks by Swift India

Other Decks in Programming

Transcript

  1. Create ML app Krishnaprasad Jagadish Co Founder, Head of Mobile

    Engineering Parjanya Creative Solutions
  2. Agenda • What is Machine Learning ? • Brief introduction

    to CoreML • Sample Applications that use CoreML • What is CreateML • Demo • Using MLModel in an iOS App
  3. Agenda • What is Machine Learning ? • Brief introduction

    to CoreML • Sample Applications that use CoreML • What is CreateML • Demo • Using MLModel in an iOS App
  4. What is Machine Learning ? • “Machine learning is a

    type of artificial intelligence where computers “learn” without being explicitly programmed. Instead of coding an algorithm, machine learning tools enable computers to develop and refine algorithms, by finding patterns in huge amounts of data.” raywenderlich.com • AI that uses Data to Infer rules. Umbrella term for collection of algorithms that use data to derive value
  5. Humans can solve certain problems easily that machines find difficult.

    Algorithms that narrow the human - machine gap https://xkcd.com/1425/
  6. • Training set ( Labeled Data ) • Testing set

    • Validation • Transfer Learning • ML requires data in a particular format ( Vectors, Matrices, Tensors etc) • Preparing the data is most of the work.
  7. Demo • How many here know how to speak Kannada

    ? • How many here know how to write in Kannada ?
  8. Agenda • What is Machine Learning ? • Brief introduction

    to CoreML • Sample Applications that use CoreML • What is CreateML • Demo • Using MLModel in an iOS App
  9. CoreML • CoreML is a framework that lets you use

    trained models in your app. • Introduced as a part of iOS 11 along with Vision APIs • Use the .mlmodel to make predictions on the new input data • Optimised to use the CPU, GPU and Neural Engine for better performance • Runs on device and hence user data stays private
  10. Agenda • What is Machine Learning ? • Brief introduction

    to CoreML • Sample Applications that use CoreML • What is CreateML • Demo • Using MLModel in an iOS App
  11. Agenda • What is Machine Learning ? • Brief introduction

    to CoreML • Sample Applications that use CoreML • What is CreateML • Demo • Using MLModel in an iOS App
  12. CreateML • CreateML is an API that lets you create

    and train custom machine learning models on your Mac • CreateML app was introduced at WWDC 2019 • Several new templates added this year
  13. CreateML Templates • Image Classifier • Object Detector • Text

    Classifier • Sound Classifier • Activity Classifier • Tabular data
  14. Image Classifier • Model that recognises images and classifies them

    with a label • MLImageClassifier • JPGs or PNGs • At least 300 x 300
  15. Object Detector • Model that can identify specific type of

    objects in an image • Train with images and annotations for each object in the image • MLObjectDetector
  16. Text Classifier • Model to classify and recognise patterns in

    Natural Language text • Uses NLP, Semantic and Lexical analyser • Sentiment analysis, Profanity filter • MLTextClassifier • Data can be in JSON or CSV formats • MLWordTagger, MLGazetteer, MLWordEmbedding
  17. Sound Classification • Model that is used to classify audio

    data • Single Channel audio for training • M4A, MP3, AIFF or WAV • MLSoundClassifier
  18. Activity Classifier • Classify activities based on Motion Sensor Data

    • Train with tabular data using accelerometer and Gyro data • MLActivityClassifier
  19. Tabular data • Tabular regressor • Tabular classifier • Classification:

    When the decision we want to make is a “Category” • Regression: When the decision we want to make is “continuous”
  20. Classification • Binary classification ( Should I rent this house

    ? Is this email spam ? ) • Multinomial classification ( What product will a customer buy ? Character classification ? )
  21. Regression • Predict a numeric value • What should be

    the value of this house ? • What should be the credit score to approve this loan ? !26