What if software developers could see how quickly app updates would drain your phone’s battery or use up memory, and optimize to ensure it lasts as long as possible? That simulation is just one application of new research from two studies by University of Alberta computing scientists.
What’s draining your battery, anyway?
The first paper is the product of research by Abram Hindle, assistant professor in the Department of Computing Science. Hindle’s team posed the question: what can developers do to reduce the energy consumption of machine learning algorithms?
By examining Android applications, Hindle’s research explored which apps are making use of machine learning algorithms and examined how these algorithms can cause extra drain on your battery.
“On a mobile device, most of the use of machine learning is detecting motion, detecting faces, and computer vision,” said Hindle. “We found that about five per cent of popular apps on the app store engage in machine learning.”
Smartphone apps use those machine learning algorithms for a variety of tasks. From predictive typing and spam email detection to facial recognition on your camera, these algorithms can help make apps more intuitive and reactive—but they can also eat up your phone’s battery power and memory.
Machine learning algorithms result in more responsive apps, but also increased energy consumption and decreased battery life, according to Hindle’s findings. And the most powerful algorithms might not always be the right tool for the software’s job.
“There are many reasons why an end user would care about the energy efficiency of machine learning algorithms on a phone.” said Hindle. “The main outcome is, the more accurate we want things to be, the more energy they’ll use. You end up paying for accuracy.”
Going longer without a charge
Energy consumption is also the subject of research by Shaiful Chowdhury, author of the second paper and computing science graduate student supervised by Hindle. Chowdhury has developed a new tool, GreenScaler, which is designed to better predict—and improve—software’s effects on battery life.
Current tools used to study the energy consumption of software, like apps or machine learning algorithms, need to be hooked up to a physical device and measure the energy usage while in operation. GreenScaler is able to simulate these energy consumption tests, making them easier to conduct.
“Hardware measurement of energy is expensive. And you can’t easily measure energy easily if you are simulating the entire device,” said Chowdhury. “So with this research, we want to make a model that runs on the device that can estimate the energy consumption of your application.”
The research lays the groundwork for GreenScaler to enable even small developers to gauge how their software will affect the battery life of users’ phones, and optimize their applications to reduce the strain on your battery.
“While companies like Facebook likely have the resources to measure energy consumption on physical devices, for smaller companies, measuring software energy consumption using current tools is extremely expensive and difficult,” said Chowdhury. “This new model would allow a developer, when designing an app or update, to be told whether they’re using more or less energy, and guide development to reduce energy usage.”
With the tool developed by Chowdhury and insights revealed by Hindle’s research when applying it to already available apps, the findings are promising results that software developers would be able to use the tool to optimize their software to let you go longer without needing to recharge.
The papers,“What can Android mobile app developers do about the energy consumption of machine learning?” and “GreenScaler: Automatically training software energy models with big data,” are published in Empirical Software Engineering.