to a class Examples Painting style or artist Van Gogh Image classification (multi-label) Classify an image to multiple classes Examples Movie poster genre action, sci-fi Feature extraction Extracting latent features of an image with CNN models Examples Visual search find similar fashion Object detection Identify one or multiple objects within an image and their locations with bounding boxes. detect UI elements Segmentation Classify whether each pixel of the image belongs to a certain class segment UI elements Generative models (GANs) Two or more models trained simultaneously Examples - Generate new images - Super resolution - Image-to-image 5
are fun but difficult to train! • 2014 Ian Goodfellow’s original GAN’s paper • 2015 DCGAN (Deep Convolutional GAN) (paper) • 2014 cGAN (Conditional GAN) - Generate images conditioned on a class (paper) • 2016 Pix2Pix – paired image to image translation (paper) • 2017 CycleGAN – unpaired Image to image translation • 2018 StyleGAN – Generate images with some control on image characteristics (paper) • Many other GAN variations… 10
of the generated images • Pose • Face shape • Age • Gender • Hair color 4x4 --> 1024x1024 8GPUs trained for 1 week Current examples: faces, bedrooms and cats Link to video StyleGAN 2018 14
The Art Institute of Chicago - 5000 high res images • Best Artworks of All Time • Art Images: Drawing/Painting/Sculptures/Engravings • Overwatch Heroes Recognition • Chinese Fine Art • Museum of Modern Art Collection UI/UX Design • Rico mobile app datasets • Kaggle ◦ Common Mobile/Web App Icons ◦ Icons-50 17 https://github.com/margaretmz/awesome-ai-art-design
& inference 24 Model • tf.Keras (TensorFlow) • Python libraries: Numpy, Matplotlib etc SavedModel or Keras model Serving • Cloud • Web • Mobile • IoT • Micro controllers • Edge TPU Training Inference Data
Lite? A framework with a set of tools for deploying ML models to mobile & embedded: • A converter • An interpreter • Ops / kernels • Interface to hardware accelerations: ◦ NN API ◦ Edge TPU • A bunch of other tools: quantization, pruning, benchmarking... 26
TensorFlow Lite • ML model: ◦ Train / find a model ◦ Convert to .tflite format ◦ Run inference in Python ◦ Benchmark (optional) ◦ Add model metadata • Build Android app ◦ UI navigation ◦ Input image: canvas, gallery or camera ◦ Load model & run inference ◦ Display results in UI 30
with TFLite • Enhanced Super Resolution GAN • Pre-trained ESRGAN model from TF Hub • Convert to TFLite model ◦ Dynamic range quantization ◦ Input image 50x50 • TensorFLow C API, GPU library • Android NDK 35 https://blog.tensorflow.org/2020/12/how-to-generate-super -resolution-images-using-tensorflow-lite-on-android.html
Arts & Culture app: https://play.google.com/store/apps/details?id=com.google.android.apps.cultural Blog post: 4/2/2020 - Transform your photo in the style of an iconic artist 37
Whitebox CartoonGAN ◦ Faster & smaller ◦ Not just for selfies • Link to project repo • Link to TF Hub models • Collaboration with Sayak & Khanh • Links: project repo | blog 39
A curated list of models, apps, tutorials and learning resources… Thanks to the ML GDE and Android community! Support of TensorFlow Lite team https://github.com/margaretmz/awesome-tflite 42