WWDC19 Recap of ML

WWDC19 Recap of ML

Event: https://mercaridev.connpass.com/event/132676/
Some demos and images are removed for NDA.

79abd7eb5642d2b3c8dcf9bcc6f581f3?s=128

kagemiku

June 13, 2019
Tweet

Transcript

  1. 2.

    ▸ kagemiku (Akira Fukunaga) ▸ GitHub: @kagemiku ▸ Twitter: @kagemiku_en

    ▸ iOS Engineer (19’s new grad) at Mercari JP ▸ First time participation in WWDC!!! 
 (and also, first time application) ABOUT ME
  2. 3.
  3. 4.
  4. 5.

    SESSIONS ▸ 209: What’s New in Machine Learning ▸ 704:

    Core ML 3 Framework ▸ 406: Create ML for Object Detection and Sound Classification ▸ 222: Understanding Images in Vision Framework ▸ 228: Creating Great Apps Using Core ML and ARKit ▸ 407: Create ML for Activity, Text, and Recommendations ▸ 232: Advances in Natural Language Framework ▸ 234: Text Recognition in Vision Framework ▸ 420: Drawing Classification and One-Shot Object Detection in Turi Create ▸ 803: Designing Great ML Experiences ▸ 614: Metal for Machine Learning
  5. 8.

    CREATE ML WHAT’S CREATE ML? ▸ Framework for creating ML

    model with Swift, appeared in Xcode 10 let data = try! MLDataTable(contentsOf: URL(fileURLWithPath: "/path/to/dataset.json")) let (trainingData, testingData) = data.randomSplit(by: 0.8, seed: 5) let sentimentClassifier = try! MLTextClassifier(trainingData: trainingData, textColumn: "text", labelColumn: "label")
  6. 10.
  7. 11.

    CREATE ML ▸ 9 templates were described in session ▸

    Image Classifier ▸ Sound Classifier ▸ Activity Classifier ▸ Tabular Classifier ▸ and so on… ▸ But now, there are only 2 templates
 at the first seed
  8. 12.

    CREATE ML ▸ 9 templates were described in session ▸

    Image Classifier ▸ Sound Classifier ▸ Activity Classifier ▸ Tabular Classifier ▸ and so on… ▸ But now, there are only 2 templates
 at the first seed
  9. 13.

    CREATE ML ▸ Dataset notes ▸ Balanced quantity ▸ :

    10 s, 100 s, 1000 s ▸ : 100 s, 100 s, 100 s ▸ At least 10 data for each label ▸ At least 299 × 299 px
  10. 16.

    DOMAIN APIS WHAT’S DOMAIN API ▸ Useful ML models prepared

    by Apple ▸ We don’t have to collect data and build model ▸ Main frameworks ▸ Computer Vision (Vision Framework) ▸ Natural Language Processing (NaturalLanguage Framework)
  11. 17.

    DOMAIN APIS NEW DOMAIN APIS ▸ Many new apis appear

    ▸ Image Saliency ▸ Image Similarity ▸ Sentiment Analysis ▸ Text Recognition ▸ NL Transfer Learning ▸ and so on…
  12. 18.

    DOMAIN APIS NEW DOMAIN APIS ▸ Many new apis appear

    ▸ Image Saliency ▸ Image Similarity ▸ Sentiment Analysis ▸ Text Recognition ▸ NL Transfer Learning ▸ and so on…
  13. 19.

    DOMAIN APIS IMAGE SALIENCY ▸ Saliency: the salient points or

    features of something are 
 the most important or most noticeable parts of it ▸ There are 2 types of saliency ▸ Attention based ▸ Objectness based
  14. 20.

    DOMAIN APIS IMAGE SALIENCY ▸ Attention based ▸ Training data:

    Human eye movement ▸ App example: image cropping ▸ Objectness based ▸ Training data: distinguished foreground object from background ▸ App example: object tracking
  15. 22.

    DOMAIN APIS ▸ code // 1. prepare request and handler

    let request: VNRequest = VNGenerateAttentionBasedSaliencyImageRequest() let requestHandler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer, orientation: .up, options: [:]) // 2. perform requests and get results try? requestHandler.perform([request]) let observation = request.results?.first as? VNSaliencyImageObservation // 3. do something using results if let salientObjects = observation?.salientObjects { for object in salientObjects { let boundingBox = object.boundingBox // do something } } IMAGE SALIENCY
  16. 23.

    DOMAIN APIS NEW DOMAIN APIS ▸ Many new apis appear

    ▸ Image Saliency ▸ Image Similarity ▸ Sentiment Analysis ▸ Text Recognition ▸ NL Transfer Learning ▸ and so on…
  17. 27.

    DOMAIN APIS ▸ code ▸ Support 7 languages at the

    moment ▸ English/French/Italian/German/Spanish/Portuguese/Simplified Chinese ▸ Japanese is not be included now // 1. Prepare NLTagger with .sentimentScore scheme let tagger = NLTagger(tagSchemes: [.sentimentScore]) // 2. Set text you want to analyze tagger.string = text // 3. Get result let (sentiment, _) = tagger.tag(at: text.startIndex, unit: .paragraph, scheme: .sentimentScore) print(sentiment!.rawValue) SENTIMENT ANALYSIS
  18. 29.

    CORE ML WHAT’S CORE ML ▸ Multi platform framework for

    ML ▸ Optimized for on-device performance ▸ low memory footprint ▸ low power consumption ▸ Protect security and privacy
  19. 30.

    CORE ML WHAT’S CORE ML ▸ Support many models ▸

    Generalized Linear Model ▸ SVM ▸ CNN/RNN ▸ Tree Ensembles ▸ and so on…
  20. 33.

    CORE ML MODEL FLEXIBILITY ▸ Model Galleries 
 You can

    start immediately using these models
  21. 35.

    CORE ML MODEL PERSONALIZATION ▸ Supporting models ▸ NN ▸

    Nearest Neighbor ▸ Fine-tune can be done in background process
  22. 36.

    CORE ML MODEL PERSONALIZATION ▸ Application example: ▸ User can

    train the existing model with user hand-written for drawing sticker automatically train
  23. 38.

    SUMMARY ▸ Create ML ▸ A brand new app ▸

    Domain APIs ▸ Significant expansion ▸ Core ML3 ▸ More flexible ▸ On-device personalization