a first look at deep learning apps on smartphones
play

A First Look at Deep Learning Apps on Smartphones Mengwei Xu 1 , - PowerPoint PPT Presentation

A First Look at Deep Learning Apps on Smartphones Mengwei Xu 1 , Jiawei Liu 1 , Yuanqiang Liu 1 Felix Xiaozhu Lin 2 , Yunxin Liu 3 , Xuanzhe Liu 1 1 Peking University, 2 Purdue University, 3 Microsoft Research Deep learning is popular Google is


  1. A First Look at Deep Learning Apps on Smartphones Mengwei Xu 1 , Jiawei Liu 1 , Yuanqiang Liu 1 Felix Xiaozhu Lin 2 , Yunxin Liu 3 , Xuanzhe Liu 1 1 Peking University, 2 Purdue University, 3 Microsoft Research

  2. Deep learning is popular Google is using deep learning to change the world! - summary of 1 st Keynote • Not only in CV, NLP, Robotics, but also Economics, Biology… object detection speech translation robot control NN accelerators • In the Web Conference 2019: 16 (7%) papers are “ deep ”, 12 (5%) papers are connected to “ neural ” – only in title

  3. DL inference on smartphones DL on Cloud DL on smartphones • Centralized • Decentralized • Powerful resources • Low-end (challenging) • Well-studied • Fewer prior efforts • Far from users • Close to users

  4. DL inference on smartphones DL on Cloud DL on smartphones • Centralized • Decentralized • Powerful resources • Low-end (challenging) • Well-studied • Fewer prior efforts • Far from users • Close to users

  5. DL inference on smartphones • From academia • Cross-layer optimizations • Algorithm, System, Architecture • From industrial • Android 8.1 officially introduces Neural Network APIs • There’re emerging DL frameworks for mobile: Facebook – Caffe2, Google – TF Lite, Apple – Core ML, Tencent – ncnn, Baidu – MDL

  6. DL inference on smartphones • From academia • Cross-layer optimizations • Algorithm, System, architecture Early adopters have high influence or even decide the evolution of new technologies • From industrial - Diffusion of innovations theory, 1962 • Android 8.1 officially introduces Neural Network APIs • There’re emerging DL frameworks for mobile: Facebook – Caffe2, Google – TF Lite, Apple – Core ML, Tencent – ncnn, Baidu – MDL

  7. Research goal and challenges • ( The first ) to understand how DL technique is utilized in real- world mobile applications • What are the characteristics and usage of DL apps? • How do the DL models look like? 1. How to identify DL apps? 2. How to extract DL models? Android: the target platform

  8. Identifying DL apps Detecting DL functionality code? – Difficult 😱 Heterogeneous: many ways to implement • Binary code: written in C++ code and compiled in shared library • Identify DL apps

  9. Deep learning frameworks: the popular choice mobile-oriented support for mobile platforms

  10. Identifying DL apps Detecting DL functionality code? – Difficult 😱 Heterogeneous: many ways to implement • Binary code: written in C++ code and compiled in shared library • Detecting DL framework usage? – Life is easier 😏 Most DL apps are developed by popular DL frameworks • Identify Those frameworks remain relatively stable across versions • DL apps $ re readelf -p p .ro rodata lib libMagic icCle lean. n.so # fr from adobe adobe ap app The .rodata section of libMagicClean.so in adobe app • apktool + readelf • TensorFlow detected

  11. Extracting DL models Scanning apk & check file format Tflite models use protobuf format • Ncnn models start with a magic number: 7767517 • Complementary-1: install apk and check local files Extract • Some models are fetched from network DL Models Complementary-2: decrypt files • Some models are encrypted

  12. Analysis workflow https://github.com/xumengwei/MobileDL Extract Identify DL Models DL apps • top 500 apps for each 33 categories: 16,500 in total • Jun. 2018 and Sep. 2018 app model static analysis analysis analysis

  13. How many DL apps? • There’re ???/16,500 DL apps found in Sep. 2018.

  14. How many DL apps? • There’re 211/16,500 DL apps found in Sep. 2018. • only 1.3%

  15. How many DL apps? • There’re 211/16,500 DL apps found in Sep. 2018. • only 1.3% • DL apps are downloaded by 13M (11.9%) Jun. 2018 – Sep. 2018 • DL apps receive 9.6M (10.5%) reviews

  16. How many DL apps? • There’re 211/16,500 DL apps found in Sep. 2018. • only 1.3% • DL apps are downloaded by 13M (11.9%) Jun. 2018 – Sep. 2018 • DL apps receive 9.6M (10.5%) reviews Downloads (median) Reviews (median) DL apps ~5,000,000 ~100,000 DL apps vs. non-DL apps Non-DL apps ~40,000 ~1,000

  17. How many DL apps? • There’re 211/16,500 DL apps found in Sep. 2018. • only 1.3% • DL apps are downloaded by 13M (11.9%) Jun. 2018 – Sep. 2018 • DL apps receive 9.6M (10.5%) reviews • Early adopters of DL are top apps

  18. How many DL apps? • There’re 211/16,500 DL apps found in Sep. 2018. • only 1.3% • DL apps are downloaded by 13M (11.9%) Jun. 2018 – Sep. 2018 • DL apps receive 9.6M (10.5%) reviews • Early adopters of DL are top apps • DL apps are increasing rapidly • ↑27% within 3 months DL apps change over time

  19. Which DL frameworks are most popular? • Mobile-oriented DL frameworks are gaining traction • e.g., TFLite, ncnn, Caffe2, etc 60 Jun. 2018 Sep. 2018 51 47 50 Number of DL apps most new adoption 40 31 28 26 30 25 22 22 21 20 12 12 10 10 0 caffe2 TFLite ncnn Parrots Caffe TF

  20. Which DL frameworks are most popular? • Mobile-oriented DL frameworks are gaining traction • e.g., TFLite, ncnn, Caffe2, etc framework library size (MB) 60 Jun. 2018 Sep. 2018 51 47 50 TF 15.3 Number of DL apps most new adoption generic 40 Caffe 10.1 31 28 26 30 25 22 22 21 ncnn 2.5 20 12 12 10 mobile- TFLite 2.1 10 oriented 0 Caffe2 4.1 caffe2 TFLite ncnn Parrots Caffe TF

  21. What’s the usage of DL in smartphone? • The usage is diverse – of course Audio Image Text Speech recognition Sound recognition photo beauty word prediction face detection audo-correct Other AR Translation face identification text classification recommendation Text recognition Smart reply movement tracking action detection

  22. What’s the usage of DL in smartphone? • The usage is diverse – of course • What’s the most popular use case? Audio Image Text Speech recognition Sound recognition photo beauty word prediction face detection audo-correct Other AR Translation face identification text classification recommendation Text recognition Smart reply movement tracking action detection

  23. What’s the usage of DL in smartphone? • The usage is diverse – of course • What’s the most popular use case? Audio: 24 Image: 149 Text: 26 Speech recognition Sound recognition photo beauty word prediction face detection audo-correct Other: 19 AR Translation face identification text classification recommendation Text recognition Smart reply movement tracking action detection

  24. What’s the usage of DL in smartphone? • The usage is diverse – of course • What’s the most popular use case? 44.5% DL apps use DL for photo beauty • Image: 149 photo beauty: 94 face detection DL AR face identification Text recognition

  25. What’s the usage of DL in smartphone? • The usage is diverse – of course • What’s the most popular use case? 29% DL apps in photography category • Image: 149 photo beauty: 94 face detection AR face identification Text recognition

  26. What’s the usage of DL in smartphone? • The usage is diverse – of course • What’s the most popular use case? • What’s the role played by DL? Important or dispensable?

  27. What’s the usage of DL in smartphone? • The usage is diverse – of course • What’s the most popular use case? • What’s the role played by DL? Important or dispensable? • ??% apps use DL as core feature What makes a core feature? Text recognition in different apps • Hot: invoked frequently ✓ Scanner app (Adobe) ✓ • • Essential: needed badly × Payment app (Alipay) × •

  28. What’s the usage of DL in smartphone? • The usage is diverse – of course • What’s the most popular use case? • What’s the role played by DL? Important or dispensable? • 81% apps use DL as core feature: a strong motivation for future research to improve DL experience

  29. Developers and bad practice • Most DL apps come from big companies • Google *, Facebook, Adobe, Meitu, etc Google Google Gboard Messages Google Google PhotoScan text-to-speed Street View Photos • Some DL apps use more than one DL frameworks (bad practice?) • 24 apps; 5.4MB (13.6%) storage “overhead” • Can be avoided as DL frameworks can be used interchangeably

  30. DL model resource footprint • DL models are very lightweight • vs. state-of-the-art research models • The execution time of 80% models are less than 15ms on typical smartphone memory Inference In-the-wild usage (MB) complexity (FLOPs) models In the wild 2.5 10M SOTA research ResNet-50 200 4G models MobileNet 54 500M

  31. DL model optimizations • DL models are rarely optimized • Only 6% models have been compressed

  32. DL model protection • For intellectual property and security stop sign -> speed limit sign

  33. DL model protection • For intellectual property and security stop sign -> speed limit sign • However, only small number of apps protect their models • 19.2% models are encrypted • 39.2% models are obfuscated • Very few frameworks (2) provide model protection • strip text information, convert to C++ code

Recommend


More recommend