Empirical Software Engineering

, Volume 24, Issue 2, pp 562–601 | Cite as

What can Android mobile app developers do about the energy consumption of machine learning?

  • Andrea McIntosh
  • Safwat Hassan
  • Abram HindleEmail author


Machine learning is a popular method of learning functions from data to represent and to classify sensor inputs, multimedia, emails, and calendar events. Smartphone applications have been integrating more and more intelligence in the form of machine learning. Machine learning functionality now appears on most smartphones as voice recognition, spell checking, word disambiguation, face recognition, translation, spatial reasoning, and even natural language summarization. Excited app developers who want to use machine learning on mobile devices face one serious constraint that they did not face on desktop computers or cloud virtual machines: the end-user’s mobile device has limited battery life, thus computationally intensive tasks can harm end users’ phone availability by draining batteries of their stored energy. Currently, there are few guidelines for developers who want to employ machine learning on mobile devices yet are concerned about software energy consumption of their applications. In this paper, we combine empirical measurements of different machine learning algorithm implementations with complexity theory to provide concrete and theoretically grounded recommendations to developers who want to employ machine learning on smartphones. We conclude that some implementations of algorithms, such as J48, MLP, and SMO, do generally perform better than others in terms of energy consumption and accuracy, and that energy consumption is well-correlated to algorithmic complexity. However, to achieve optimal results a developer must consider their specific application as many factors — dataset size, number of data attributes, whether the model will require updating, etc. — affect which machine learning algorithm and implementation will provide the best results.


Machine learning Software energy consumption Android Mobile App development 



Andrea McIntosh was supported by a NSERC Undergraduate Student Research Award. Abram Hindle was supported by a NSERC Discovery Grant. Safwat Hassan was supported by Ahmed Hassan. We would like to thank Ahmed Hassan for his guidance.


  1. Abdulsalam H, Skillicorn DB, Martin P (2011) Classification using streaming random forests. IEEE Trans Knowl Data Eng 23(1):22–36CrossRefGoogle Scholar
  2. Aggarwal K, Hindle A, Stroulia E (2015a) Greenadvisor: A tool for analyzing the impact of software evolution on energy consumption. In: International Conference on Software Maintenance and Evolution (ICSME 2015), pp 311–320.
  3. Aggarwal K, Hindle A, Stroulia E (2015b) Greenadvisor: a tool for analyzing the impact of software evolution on energy consumption. In: 31St IEEE international conference on software maintenance and evolution. IEEE computer societyGoogle Scholar
  4. Agolli T, Pollock L, Clause J (2017) Investigating decreasing energy usage in mobile apps via indistinguishable color changes. In: 2017 IEEE/ACM 4Th international conference on mobile software engineering and systems (MOBILESoft), pp 30–34.
  5. Akdeniz: Google Play Crawler (2013) (Last accessed: May 2018)
  6. Aha D, Kibler D (1991) Instance-based learning algorithms. Mach Learn 6:37–66zbMATHGoogle Scholar
  7. App Annie (2018a) App Annie. (Last accessed: May 2018)
  8. AppBrain (2018b) Top Android phones. (Last accessed: May 2018)
  9. Apple Inc (2017) The future is here: iphone (Retrieved April 2018)
  10. Banerjee A, Chong LK, Chattopadhyay S, Roychoudhury A (2014) Detecting energy bugs and hotspots in mobile apps. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, pp 588–598Google Scholar
  11. Benfield L (2018) Cfr - another java decompiler. (Last accessed: May 2018)
  12. Bhattacharya S, Lane ND (2016) Sparsification and separation of deep learning layers for constrained resource inference on wearables. In: Proceedings of the 14th ACM Conference on Embedded Network Sensor Systems CD-ROM, SenSys ’16. ACM, New York, pp 176–189.
  13. Bottou L (1998) Online Algorithms and Stochastic Approximations. Cambridge University Press, CambridgezbMATHGoogle Scholar
  14. Breiman L (2001) Random forests. Mach Learn 45(1):5–32CrossRefzbMATHGoogle Scholar
  15. Bruce BR, Petke J, Harman M (2015) Reducing energy consumption using genetic improvement. In: Proceedings of the 2015 Annual Conference on Genetic and Evolutionary Computation, GECCO ’15. ACM, New York, pp 1327–1334.
  16. Chenlei Z, Hindle A, German DM (2014) The impact of user choice on energy consumption. IEEE Software, pp 69–75.
  17. Chowdhury SA, Hindle A (2016a) Greenoracle: Estimating software energy consumption with energy measurement corpora. In: Proceedings of the 13th International Conference on Mining Software Repositories, MSR ’16. ACM, New York, pp 49–60.
  18. Chowdhury S, Sapra V, Hindle A (2016b) Client-side energy efficiency of http/2 for web and mobile app developers. In: 23rd IEEE International Conference on Software Analysis, Evolution, and Reengineering (SANER 2016), pp 529–540.
  19. Christina B (2013) Your smartphone gains a mind of its own. Conde Nast
  20. Dex2jar download - (2018) (Last accessed: May 2018)
  21. Di Nucci D, Palomba F, Prota A, Panichella A, Zaidman A, De Lucia A (2017) Software-based energy profiling of android apps: simple, efficient and reliable?. In: 2017 IEEE 24th international conference on Software analysis, evolution and reengineering (SANER). IEEE, pp 103–114Google Scholar
  22. Good O (2015) How google translate squeezes deep learning onto a phone. Google Research Blog
  23. Google (2016) Find time for your goals with google calendar. Google Blog
  24. Google (2017) Neural networks api: Android developers (Last accessed: May 2018)
  25. Google (2018) Mobile vision (Last accessed: May 2018)
  26. Greene T (2017) Google brings on-device machine learning to mobile with tensorflow lite (Retrieved January 2018)
  27. Gui J, Mcilroy S, Nagappan M, Halfond WGJ (2015) Truth in advertising: The hidden cost of mobile ads for software developers. In: 37Th IEEE/ACM international conference on software engineering, ICSE 2015, florence, Italy. IEEE, vol 1, pp 100–110.
  28. Gui J, Li D, Wan M, Halfond WG (2016) Lightweight measurement and estimation of mobile ad energy consumption. In: 2016 IEEE/ACM 5th international workshop on Green and sustainable software (GREENS). IEEE, pp 1–7Google Scholar
  29. Hall M, Frank E, Holmes G, Pfahringer B, Reutemann P, Witten IH (2009) The weka data mining software: An update. SIGKDD Explor Newsl 11 (1):10–18. CrossRefGoogle Scholar
  30. Hasan S, King Z, Hafiz M, Sayagh M, Adams B, Hindle A (2016) Energy profiles of java collections classes. In: International Conference on Software Engineering (ICSE 2016), pp 225–236.
  31. Hern Alex, A (2015) Smartphone now most popular way to browse internet – ofcom report. (last accessed: May 2018)
  32. Hindle A, Ernst NA, Godfrey MW, Mylopoulos J (2013) Automated topic naming supporting cross-project analysis of software maintenance activities. J Empir Softw Eng 18(6):1125–1155. CrossRefGoogle Scholar
  33. Hindle A, Wilson A, Rasmussen K, Barlow EJ, Campbell J, Romansky S (2014) Greenminer: a hardware based mining software repositories software energy consumption framework. In: International Working Conference on Mining Software Repositories (MSR 2014), pp 12–21.
  34. Inc. A (2017) Core ml: Apple developer documentation (Last accessed: May 2018)
  35. Inc. W (2018) Natural language for developers (Last accessed: May 2018)
  36. Platt J (1998) Fast training of support vector machines using sequential minimal optimization. In: Schoelkopf B, Burges C, Smola A (eds) Advances in Kernel Methods - Support Vector Learning. MIT Press
  37. Jabbarvand R, Sadeghi A, Garcia J, Malek S, Ammann P (2015) Ecodroid: an approach for energy-based ranking of android apps. In: Proceedings of the Fourth International Workshop on Green and Sustainable Software. IEEE Press, pp 8–14Google Scholar
  38. John GH, Langley P (1995) Estimating continuous distributions in bayesian classifiers. In: Eleventh conference on uncertainty in artificial intelligence. Morgan kaufmann, pp 338–345Google Scholar
  39. Konradsson T (2015) Art and dalvik performance compared. Master’s thesis, UmeUniversity.
  40. LeCun Y, Cortes C, Burges CJ (1998) The mnist database of handwritten digits.
  41. Li D, Hao S, Gui J, Halfond WGJ (2014) An empirical study of the energy consumption of android applications. In: 30Th IEEE international conference on software maintenance and evolution, victoria, BC. IEEE Computer Society, pp 121–130.
  42. Li D, Lyu Y, Gui J, Halfond WGJ (2016) Automated energy optimization of http requests for mobile applications. In: Proceedings of the 38th International Conference on Software Engineering, ICSE ’16. ACM, New York, pp 249–260.
  43. Linares-Vásquez M, Bavota G, Bernal-Cárdenas C, Oliveto R, Di Penta M, Poshyvanyk D (2014) Mining energy-greedy api usage patterns in android apps: an empirical study. In: Proceedings of the 11th Working Conference on Mining Software Repositories, MSR 2014. ACM, New York, pp 2–11.
  44. Linares-Vásquez M, Bavota G, Cárdenas CEB, Oliveto R, Di Penta M, Poshyvanyk D (2015) Optimizing energy consumption of guis in android apps: a multi-objective approach. In: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering. ACM, New York, pp 143–154.
  45. Linares-Vásquez M, Vendome C, Tufano M, Poshyvanyk D (2017) How developers micro-optimize android apps. J Syst Softw 130:1–23CrossRefGoogle Scholar
  46. Lichman M (2013) UCI machine learning repository.
  47. Machine Learning Laboratory (2015) Mnist arff files.
  48. Malik H, Zhao P, Godfrey M (2015) Going green: An exploratory analysis of energy-related questions. In: Proceedings of the 12th Working Conference on Mining Software Repositories, MSR ’15. IEEE Press, Piscataway, pp 418–421.
  49. Manotas I, Pollock L, Clause J (2014) Seeds: a software engineer’s energy-optimization decision support framework. In: Proceedings of the 36th International Conference on Software Engineering, ICSE 2014. ACM, New York, pp 503–514.
  50. Manotas I, Bird C, Zhang R, Shepherd D, Jaspan C, Sadowski C, Pollock L, Clause J (2016) An empirical study of practitioners’ perspectives on green software engineering. In: Proceedings of the 38th International Conference on Software Engineering, ICSE ’16. ACM, New York, pp 237–248.
  51. Matyunina J (2017) How do i apply machine learning in an android app? (Last accessed: May 2018)
  52. Minka TP (2007) A comparison of numerical optimizers for logistic regression. Unpublished paper available at
  53. Mizutani E, Dreyfus SE (2001) On complexity analysis of supervised mlp-learning for algorithmic comparisons. In: Neural networks. IEEE, vol 1, pp 347–352Google Scholar
  54. OpenCV Team (2018) Android - opencv library. (Last accessed: May 2018)
  55. Padraig C, Sarah JD (2007) k-nearest neighbour classifiers. Technical Report UCD-CSI-2007-4, University College Dublin.
  56. Pang C, Hindle A, Adams B, Hassan AE (2015) What do programmers know about the energy consumption of software? IEEE Software, pp 83–89.
  57. Pathak A, Hu YC, Zhang M (2011a) Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In: Proceedings of the 10th ACM Workshop on Hot Topics in Networks, HotNets-X, pp 5:1–5:6Google Scholar
  58. Pathak A, Hu YC, Zhang M, Bahl P, Wang YM (2011b) Fine-grained Power Modeling for Smartphones Using System Call Tracing. In: Eurosys ’11. Salzburg, pp 153–168.
  59. Pereira R, Couto M, Saraiva Ja, Cunha J, Fernandes J a P (2016) The influence of the java collection framework on overall energy consumption. In: Proceedings of the 5th International Workshop on Green and Sustainable Software, GREENS ’16, pp 15–21Google Scholar
  60. Pinto G, Castor F, Liu YD (2014) Mining Questions About Software Energy Consumption. In: MSR 2014, pp 22–31.
  61. Rasmussen K, Wilson A, Hindle A (2014) Green mining: energy consumption of advertisement blocking methods. In: Proceedings of the 3rd International Workshop on Green and Sustainable Software (GREENS 2014), pp 38–45.
  62. Release v2.1-20171001-lanchon . dexpatcher/dex2jar . github (2018) (Last accessed: May 2018)
  63. Saborido R, Beltrame G, Khomh F, Alba E, Antoniol G (2016) Optimizing user experience in choosing android applications. In: 2016 IEEE 23Rd international conference on software analysis, evolution, and reengineering (SANER), vol 1, pp 438–448.
  64. Sahin C, Tornquist P, Mckenna R, Pearson Z, Clause J (2014) How does code obfuscation impact energy usage?. In: ICSME. IEEE Computer Society, pp 131–140Google Scholar
  65. Sahin C, Pollock L, Clause J (2016a) From benchmarks to real apps: Exploring the energy impacts of performance-directed changes. J Syst Softw 117:307–316CrossRefGoogle Scholar
  66. Sahin C, Wan M, Tornquist P, McKenna R, Pearson Z, Halfond WG, Clause J (2016b) How does code obfuscation impact energy usage? J Softw Evol Process 28(7):565–588CrossRefGoogle Scholar
  67. Selby JWA (2011) Unconventional applications of compiler analysis. Ph.D. thesis, University of WaterlooGoogle Scholar
  68. Sevarac Z, Goloskokovic I, Tait J, Carter-Greaves L, Morgan A, Steinhauer V (2016) Neuroph: Java neural network framework.
  69. Keerthi SS, Shevade SK, Bhattacharyya C, Murthy KRK (2001) Improvements to platt’s smo algorithm for svm classifier design. Neural Comput 13(3):637–649CrossRefzbMATHGoogle Scholar
  70. Su J, Zhang H (2006) A fast decision tree learning algorithm. In: American association for artificial intelligence, vol 6, pp 500–505Google Scholar
  71. TensorFlow (2016) Mobile tensorflow.
  72. Tomita TM, Maggioni M, Vogelstein JT (2015) Randomer forests. arXiv:1506.03410
  73. Triposo (2016) Triposo.
  74. Wan M, Jin Y, Li D, Gui J, Mahajan S, Halfond WG (2017) Detecting display energy hotspots in android apps. Software Testing Verification and Reliability 27(6).
  75. Webservices A (2018) Amazon aws machine learning (Last accessed: May 2018)
  76. Weotta (2016) About weotta.
  77. Witten IH, Frank E (2011) Data Mining: Practical machine learning tools and techniques, 3rd edn. Morgan Kaufmann, BurlingtonzbMATHGoogle Scholar
  78. Yang Y, Zhang J, Kisiel B (2003) A scalability analysis of classifiers in text categorization. In: Proceedings of the 26th annual international ACM SIGIR conference on Research and development in informaion retrieval. ACM, pp 96–103Google Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Department of Computing ScienceUniversity of AlbertaEdmontonCanada
  2. 2.Software Analysis and Intelligence Lab (SAIL)Queen’s UniversityKingstonCanada

Personalised recommendations