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

CoreML - Models creations

David Bonnet
September 14, 2017

CoreML - Models creations

A first look at last Apple great framework CoreML and the community around for models creations.

At the end we stop by models creation on the MNIST example.

David Bonnet

September 14, 2017
Tweet

More Decks by David Bonnet

Other Decks in Programming

Transcript

  1. First Look • Bringing machine learning to everyone ! •

    Integrate your model and CoreML does all the job for you • Problem is « your model » • Apple helps by providing you some https:/ /developer.apple.com/machine-learning/
  2. Models from the ML community libsvm Neural networks Pipelines Tree

    Ensembles Linear models Support Vector Machines
  3. CoreML Conversion Tool • Apple provide a CoreML conversion tool

    in python (standard for ML) https://developer.apple.com/documentation/coreml/converting_trained_models_to_core_ml import coremltools coreml_model = coremltools.converters.caffe.convert(‘my_caffe_model.caffemodel’) coreml_model.save(‘my_model.mlmodel') • All previous presented ML communities are supported • You can write your own converter if not yet supported https://pypi.python.org/pypi/coremltools
  4. All together https://github.com/cocoa-ai/FacesVisionDemo • Using Vision framework to get face

    parts • 3 models from Caffee model zoo • Gender classification • Age classification • Emotion recognition https://github.com/caffe2/caffe2/wiki/Model-Zoo
  5. Creating our own model • Let’s do an hello world:

    MNIST (number recognition) https://www.tensorflow.org/get_started/mnist/beginners https://colah.github.io/posts/2014-10-Visualizing-MNIST/
  6. Creating our own model • Let’s do an hello world:

    MNIST (number recognition) https://www.tensorflow.org/get_started/mnist/beginners https://colah.github.io/posts/2014-10-Visualizing-MNIST/
  7. Creating our own model • Let’s do an hello world:

    MNIST (number recognition) https://www.tensorflow.org/get_started/mnist/beginners https://colah.github.io/posts/2014-10-Visualizing-MNIST/
  8. Convolutions • Big word to say « matrix operations »

    Simple box blur Edges detection http://www.aishack.in/tutorials/image-convolution-examples/
  9. Max Pooling • Reduce the amount of data by downsampling

    it http://cs231n.github.io/convolutional-networks/
  10. Rectifier Linear Unit - ReLU • An activation function defined

    as f(x) = max(0,x) https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
  11. Models optimization • Prune them ( removing extra nodes )

    • Reduce them ( combining nodes ) • Quantize them ( a Double can be a Int ) • Align them ( mmap for architecture optimization )
  12. To play more • Awesome CoreML models • https:/ /github.com/likedan/Awesome-CoreML-Models

    • Dynamic CoreML • https:/ /github.com/zedge/DynamicCoreML/tree/master/GAN