Giter Club home page Giter Club logo

mobiledl's Introduction

This repo contains the code and data for our paper "A First Look at Deep Learning Apps on Smartphones" (WWW'19, arxiv).

Dataset (please contact Mengwei Xu for the dataset)

Snapshots of the app market (apk files) in early Jun. 2018 (deleted), early Sep. 2018 (apks_sep_2018.tar) and mid February 2019 (apks_feb_2019.tar) (each contains 16,500 the most popular apps covering 33 different categories listed on Google Play) 2. meta information crawled from Google Play Web page in early Sep. 2018 (htmls_sep_2018.tar) and mid February 2019 (htmls_feb_2019.tar)

requirements

You will need the following installed:

  • python 2.7+
  • tensorflow
  • collections
  • google.protobuf
  • bs4
  • readelf
  • apktool
  • aapt (as standalone tool)

preparations

  1. Run decompose_apps.py to decompose raw apk files using apktool
python decompose_apps.py ../data/raw_apks/ ../data/decomposed_apks/
  1. Run extract_so.py to extract section data using readelf
python extract_so.py ../data/raw_apks/ ../data/decomposed_apks/ ../data/section_data/

find DL-apps and their models

  1. Run DL_Sniffer_Model_extractor.py to get DL-apps stored in DL_PKGS and their models stored in DL_MODELS as output, in MODEL_BLKLIST we put known models that are not analyzable, you can change the magic_str and find_model_via_suffix part in each sub section according to your findings.
python DL_Sniffer_Model_extractor.py ../data/raw_apks/ ../data/decomposed_apks/ ../data/section_data/

analyze DL models

  1. In model_analyzer.py, change model_xsl to store the models extracted from DL_Sniffer_Model_extractor.py in the following format: apk_name \t model_path \t framework \t suffix \t usable \n, (the models extracted in this project are stored in code/configuration/model_xsl.txt)run this code to analyze models. (supporting Tensorflow, Tensorflow lite, Caffe, ncnn)
python model_analyzer.py ../data/decomposed_apks/

extract information on apps

  1. In apps_info.py, RAW_APK_PATH_NEW is used to store the newly crawled apps, and you should run the whole process above for them, too; HTML_PATH and HTML_PATH_NEW is used to store the information page of apps and html_path is used to store the information page of found DL-apps; Change final_dl_pkgs and new_final_dl_pkgs to store the DL-apps found by DL_Sniffer_Model_extractor.py. Run this code to get information (downloads, reviews, etc.) on apps.
  2. In apps_lib_size.py, change raw_txt to store the libs found by extract_so.py with the following format: apk name \t lib name \t framework \n, and run this code to get the size of the lib files.
python apps_lib_size.py ../data/decomposed_apks/ ../data/raw_apks_new/

Notes:

This is a very primitive attempt to analyze deep learning apps on smartphones. The current tool is still flawed in many aspects and there's a rich unexplored space for this topic. Thus we appreciate any kinds of contributions to push forward this analysis.

mobiledl's People

Contributors

pkuecho avatar xumengwei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.