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

Bootstrapping the Machine Learning Training Pro...

Bootstrapping the Machine Learning Training Process

AppBuilders (https://appbuilders.ch)
April 2018
Lugano, Switzerland

When is it valuable to consider using machine learning to help solve your iOS app’s problems? We will go through criteria to evaluate that, practical use cases of incorporating ML models on device, and how to bootstrap the training process for creating machine learning models that will run on device (iOS). Using techniques such as transfer learning and taking inspiration from the plentiful resources from industry and academia, you can get started doing this now. In this talk, we will go through some examples across different domains, and, yes, we will move beyond the dog / cat classifier.

Avatar for Meghan Kane

Meghan Kane

April 17, 2018
Tweet

More Decks by Meghan Kane

Other Decks in Technology

Transcript

  1. ML vs not ML basic unit of solving problem =

    function ("model") ML: enabling a machine to learn function on its own classify sign language alphabet images not ML: explicitly defining function determining if a number is even/odd
  2. What's available from Apple? image classification of 1000 common categories

    → trees, animals, food, vehicles, people → SqueezeNet (5 MB), MobileNet (17 MB), Inception V3 (95 MB), ResNet50 (103 MB), VGG16 (554 MB) scene classification of 205 categories → airport terminal, bedroom, forest, coast → Places205-GoogLeNet (25 MB)
  3. If not, train custom ML model 1. use framework for

    training TensorFlow, keras, Turi Create , Caffe, etc ⚠ warning, there are a lot of them 1. convert to .mlmodel format (OSS) →  coremltools github.com/apple/coremltools → tf-coreml github.com/tf-coreml
  4. Some questions you may have is it practical for my

    app? ! barriers to entry? data, compute power, phd, time? which framework should i use for training? ! how do i navigate all of the material out there?
  5. Is it practical for my app? image classification audio classification

    speech recognition text classification object localization gesture recognition optical character recognition (OCR) translation
  6. Mobile specific concerns 1. size of model 2. time it

    takes to run predictions 3. supported layers
  7. End-to-end Process as a developer? 1.Define problem 2. Gather data

    3. Train ML model 4.Convert to coreml 5. Import into Xcode project 6. Run predictions using Core ML framework
  8. barriers to entry? 1. A large dataset 2. Access to

    high end compute power 3. PhD in machine learning 4. All the time in the world ...nope!
  9. enter.. transfer learning ! use knowledge learned from source task

    (MobileNet) --> to train target task (ASL classifier)
  10. Quick Review: Deep Learning neural network model with many layers

    deep = many layers -> deep neural network https://heartbeat.fritz.ai/mobile-machine- learning-101-glossary-7a4ee36e0a1a
  11. still some (more recent) time in B.C. people stand on

    the shoulders of giants' work utilizing transfer learning
  12. what if i don't have enough? data augmentation! deeplearning.ai video

    lesson https://www.youtube.com/watch?v=JI8saFjK84o
  13. Performance so how did our training go? ~20 min to

    run on my MacBook 95.3% accuracy on the test data
  14. convert wav to spectrogram represent audio as image (3 dimensions)

    1st dimension: time (x-axis) 2nd dimension: frequency (y-axis) 3rd dimension: sound intensity (color)
  15. Performance so how did our training go? ~1 hour to

    run on my MacBook 77.1% accuracy on the test data
  16. Reproduce results research papers often include this make sure to

    do the same if you publish check licensing + attribute proper credit
  17. Review is it practical for my app? ! barriers to

    entry? data, compute power, phd, time? which framework should i use for training? ! how do i navigate all of the material out there?