An Efficient Energy Management System for Android Phone
Using Bayesian Networks
Young-Seol Lee and Sung-Bae Cho
Department of Computer ScienceYonsei University
50 Yonsei-ro, Seodaemoon-gu, Seoul 120-749, Korea [email protected], [email protected]
Abstract— Many applications on smart phones have been developed for a user’s convenience. They are using various sensors such as accelerometer, proximity, light and orientation sensors for context-awareness. Energy-efficient battery management systems become more important to support the sensors on a mobile phone because recent applications consume a large amount of energy for diverse functionalities. This paper proposes a context-aware battery management system which infers a user’s situation and controls unnecessary functionalities using embedded sensors on a mobile phone. The proposed system uses probabilistic models to infer a user’s situation and minimizes the cost of probability calculation according to the change of context. In order to show the feasibility of the proposed method, we conducted the evaluation with a real dataset collected from mobile device.
Keywords- smart phone; energy efficiency; Bayesian network; decision tree; context-aware computing
I. INTRODUCTION
Since appearance of smart phones such as Apple iPhone and Google Android phones, the market grows continuously [1]. Android phone provides a Java-based open platform to develop applications and support various kinds of hardware. It is used to develop useful context-aware services in short time.
In many cases, smart phones consume a large amount of energy to support high performance processor, wireless communication, and various sensors such as GPS receiver, G-sensor, proximity sensor, accelerometer and light sensor. The users often have to re-charge the battery or prepare a spare battery. Nowadays, it becomes an issue to develop the techniques for efficient energy management on a mobile phone [2, 3, 4].
Some researchers have studied context aware systems for efficient energy management. Paek et al. controlled GPS receiver to reduce energy consumption on a smart phone [5]. Ravi et al. predicted battery charge cycle and recommended the charge [6]. Other researchers tried to stop unnecessary functionalities in the context. It is difficult to recognize a user’s situation because of uncertainty and incompleteness of context in mobile environment.
This paper proposes a system to manage some functions, which require a large amount of energy, such as Wi-Fi, Bluetooth, screen backlight and unnecessary
applications. This system uses decision tree and rules to extract context from sensor data. It depends on Bayesian probabilistic models to determine whether a specific function will be stopped or not. For the feasibility of the proposed system, we applied it to Android phone and analyzed the effectiveness.
II. REALTED WORKS
There are some research on context-aware systems to reduce energy consumption using low power sensors [7]. Park et al. proposed the quality of service (QoS) to show multimedia content on a mobile device. They changed the quality of multimedia content according to the context for energy efficiency [8]. Simunic et al. developed an energy management system using context which is gathered by smart badges [9]. Harris et al. proposed a Bayesian network-based method to manage energy with contexts such as a user’s location and time [10]. Liu et al. developed Chameleon which was an application-level energy management system [11]. It reduced energy consumption by restricting resource for an application. Fei et al. proposed an efficient framework to use limited energy in mobile environment [12].
Context aware energy management system requires technologies to recognize a user’s situation from mobile context. There are some research to develop context-aware applications [13]. Efstratiou et al. proposed a framework to support the development of context-aware applications [14]. Paspallis et al. proposed MUSIC which is a context-aware architecture for easy development of mobile applications [15]. The architecture provides many plug-in which controls some functions such as RFID, location, light sensor, Wi-Fi and Bluetooth. Murao et al. developed a SVM-based system to monitor a user’s activities with the accelerometers [16]. The system can stop the part of accelerometers to reduce energy consumption and minimize the loss of accuracy by using virtual data. Zhou et al. proposed CAPSC (Context-Aware Pervasive Service Composition), an architecture to change combination of services according to the change of context.
III. PROPOSED SYSTEM
The proposed system consists of four components which are sensor data collection, pre-processing, Bayesian network-2012 32nd International Conference on Distributed Computing Systems Workshops
based inference, and energy management. Figure 1 shows an overview of the system.
Figure 1: System overview
A. Sensor Data Collection
We collected raw data such as CPU usage, RAM usage, proximity, acceleration, orientation, magnetic field and battery usage by using Android phone API. The data specifications and frequencies are summarized in Table 1. Most of data are collected once per five seconds. Acceleration, proximity, magnetic field and orientation are collected once per less than one second. Figure 2 shows snapshots of the interface to collect data.
Table 1: Sensor data for context awareness
Sensor Type Frequency Description
CPU Once per five
seconds CPU usage (%)
RAM Once per five
seconds RAM usage (%)
Proximity Five times per one second
Contact value (1 or 0) Acceleration Five times per
one second
3 axis acceleration (-2g~2g) Orientation Five times per
one second Orientation, pitch, roll Magnetic
field
Five times per
one second 3 axis magnetic field (uT)
Time Once per five
seconds Current time
Battery Once per five
seconds Battery level (%)
CPU usage and RAM usage can be fundamental observations to decide whether the background applications should be stopped or not. Current battery level is necessary information to manage the tradeoff between energy efficiency and powerful performance. A proximity sensor helps determine the position of the phone (hand/pocket).
Acceleration can be used to check a user’s transportation mode. Magnetic field and orientation can provide additional information to classify the transportation mode.
Figure 2: Interfaces to collect and label sensor data
B. Data Pre-processing
Continuous value is not suitable for context-aware computing in mobile environment. It requires more memory and time to calculate than discrete value. Efficient situation inference needs data discretization which transforms continuous values into discrete values. Proximity, time, battery level, CPU usage and RAM usage are transformed by some thresholds. We transformed time series data such as acceleration, magnetic field and orientation into discrete values using decision tree algorithm. In some cases, decision tree shows better performance than alternative algorithms to process time series data such as acceleration [18]. Pre-processed data are shown in Table 2.
Table 2: Sensor data for context awareness Data type Method Output value CPU usage Rule 20%, 40%, 60%, 80%,
100% RAM usage Rule 20%, 40%, 60%, 80%,
100% Acceleration, magnetic field, orientation Decision tree
still, walk, run, stair up, stair down Light Rule brightest, bright, normal,
dark, darkest Proximity Rule contact, not contact
Time Rule day, night
Battery level Rule 20%, 40%, 60%, 80%, 100%
Decision tree algorithm is used to classify a user's transportation mode from acceleration, orientation, and magnetic field. Some features such as the difference between previous and current sensor values, average sensor value for a specific period, and standard deviation of the
sensor value for a specific period are extracted for decision tree. Following equations (1)~(3) show the calculation.
¦
= − − = N i i i X x x sum 1 2 1) ( (1) N x x mean N i i i X¦
= + − = 1 2 1 ) ( (2)¦
− − = ( ( i+1 i)2 X)2 X x x mean std (3)Equation (1) represents the summation of difference between previous value xi-1 and current value xi from a specific sensor X. Equation (2) shows the mean value of difference between previous value xi-1 and current value xi from a specific sensor X. Equation (3) denotes the standard deviation of difference between previous value xi-1 and current value xi from a specific sensor X. Here, X can be any sensor to collect acceleration, orientation, and magnetic field. Table 3 summarizes the features as input values of decision tree.
Table 3: Features for decision tree
Feature Description sum_accX Summation of X-axis acceleration sum_accY Summation of Y-axis acceleration sum_accZ Summation of Z-axis acceleration
std_accX Standard deviation of X-axis acceleration std_accY Standard deviation of Y-axis
acceleration std_accZ Standard deviation of Z-axis
acceleration sum_orientation Summation of orientation
sum_pitch Summation of pitch sum_roll Summation of roll std_orientation Standard deviation of orientation
std_pitch Standard deviation of pitch std_roll Standard deviation of roll sum_magX Summation of X-axis magnetic field sum_magY Summation of Y-axis magnetic field sum_magZ Summation of Z-axis magnetic field
std_magX Standard deviation of X-axis magnetic field std_magY Standard deviation of Y-axis
magnetic field std_magZ Standard deviation of Z-axis
magnetic field
Figure 3 illustrates a generated decision tree trained from acceleration, orientation, pitch, roll and magnetic field sensor data. The root node in the generated tree has the summation of Z-axis acceleration value, which means the change of Z-axis acceleration value affects the classification of a user's transportation mode.
G
Figure 3: A part of the generated decision tree
Figure 4: Function control with transportation mode
The transportation mode is used as an observation to control the Android phone modules. For an instance, suppose that a user often play online poker using Wi-Fi communication at indoor position. Whenever he goes out, it will be helpful to turn off Wi-Fi automatically at the outdoor position for efficient energy consumption. If the system perceives the user’s transportation mode as ‘walk’, it increases the probability of outdoor position and then turns off the unnecessary Wi-Fi module as shown in Figure 4.
IV. INFERENCE AND ENERGY MANAGEMENT Bayesian network is a probabilistic model which has a directed acyclic graph (DAG) structure and conditional probability tables (CPTs). CPTs are used to represent conditional dependencies among random variables. Bayesian network is used to process uncertainty with probability. It supports efficient probability calculation based on conditional independence assumption. It can be designed with domain knowledge and trained with data. This property lets Bayesian networks to be used in many fields. Equation 4 denotes the chain rule for Bayesian network which specifies a joint probability distribution P(A1, …, An).
∏
= = n i i i n P A pa A A A P 1 1 ,..., ) ( | ( )) ( (4)where pa(Ai) is the parents of Ai in Bayesian network and Ai is a random variable.
The energy management system has four modules to control Wi-Fi, Bluetooth, brightness of the display, and background applications. Each module includes a Bayesian network to estimate the probability to turn off a specific function and a controller to turn on or off the function. The basic structure is the same as shown in Figure 5. Each Bayesian network requires different input values to estimate the necessary state of a specific function. For example, Wi-Fi state is estimated by four kinds of context such as a user’s transportation mode, contact information, time and environmental brightness. If there are no changes in the contexts, it is not necessary to recalculate the probability to turn on or off Wi-Fi. In a similar manner, other functionalities such as Bluetooth, screen brightness and background applications require probabilistic inference only when the contexts related to each function is changed.
G
Figure 5: Modular structure for energy management
In order to design efficient Bayesian network structures, we perform Bayesian network refinement process. Bayesian networks in the system are refined by iterating three steps such as design, testing and re-building.
Figure 6: BN refinement process
In the refinement process, we applied the following three methods to make more efficient Bayesian networks.
• Changing causal direction
• Segmenting states into nodes
• Considering conditional independence
First, causal directions are reversed to reduce the size of CPTs. Second, a node with many state values is divided into some nodes. Third, unnecessary links are deleted using domain knowledge.
Figure 7: A part of refined Bayesian network
A Bayesian network in Figure 7 is designed to determine whether background applications are killed or not. The initial model has four nodes such as battery usage, RAM usage, CPU usage and killing applications. Each input node has five states in the network. The conditional probability of 'killing applications' is calculated as shown in the equation (5).
) , , | ( )) ( | ( ) ( CPU RAM Battery KillApps P KillApps Pa KillApps P U P = =
∏
(5) where P(U) denotes the joint probability distribution and Urepresents a set of all random variables in the Bayesian network. The CPT size of the target node is 250 because all other nodes are connected into the target node as parent nodes.
On the other hand, 'Killing applications' node has no parents in the refined model. Equation (6) shows the probability distribution of the refined Bayesian model. It has more intermediate nodes and observation nodes than the initial model. ... ) | ( ) | ( ) | ( ) ( ) ( ⋅ ⋅ ⋅ ⋅ = KillApps CPUUsage P KillApps RAMUsage P KillApps Battery P KillApps P U P (6)
It reduces the CPT size of the nodes dramatically. It is a suitable structure in mobile environment because the smaller CPT size the smaller memory.
Also, it has a tree-like structure which does not require the construction of junction tree to infer the probability of the target node. Junction tree construction needs more process such as constructing a moral graph, triangulating the moral graph, and identifying cliques.
V. EVALUATION RESULTS
In order to evaluate the proposed system, we applied it to a LG Optimus 2X Android phone and conducted simulations. Training data are collected for three days for classifier learning and parameter tuning. Test data set is gathered for two days to compare the reduction of energy consumption. The interfaces for data collection and analysis are illustrated in Figure 8.
G
Figure 8: Interfaces to monitor sensors and resource
A. Transportation Mode Inference
In this paper, decision tree was used to estimate a user’s transportation mode from sensor data. To implement decision tree in Android OS based smart phone, we used jaDTi which is a java implementation of decision trees (http://www.run.montefiore.ulg.ac.be/~francois/software/jaD Ti/).
G
Figure 9: Performance evaluation for transportation mode
Figures 9 and 10 illustrate the performance comparison with alternatives which are hidden Markov model (HMM) and artificial neural network (ANN). HMM shows good performance to classify time series data in many fields. ANN is a representative tool for pattern classification in machine learning. Figure 9 shows the classification performance for
short time period data (ten seconds). Figure 10 shows the performance for long time period data (five minutes).
Decision tree (DT) shows the competitive performance in transportation mode classification. DT has the robust classification performance for short time data, and the best performance for long time data.
G
Figure 10: Performance evaluation for movement mode
B. Energy Consumption
G
Figure 11: Reduction of energy consumption
We measured battery level to show the feasibility of the proposed system. In order to compare the energy consumption for the simulation, the proposed system used all control functions (control of Wi-Fi, display brightness, background application, and Bluetooth) while general system did not use any other control functions. The simulations were repeated four times, and each simulation took about ten hours.
Figure 11 shows the change of the battery level for one day. In this figure, x-axis denotes time (unit: 10 seconds) and y-axis represents battery level (unit: %). In this simulation, GPS receiver maintains ‘off’ state because recent Android phone does not support control of GPS module. The proposed system checks contextual information per ten seconds, and controls Bluetooth and Wi-Fi communication, screen brightness and background applications. As shown in the figure, the time to drop 1% of the battery level has risen
128%. The result in the evaluation implies more improvement than Shafer’s work [3] and Zhuang’s work [4].
VI. CONCLUDING REMARKS
In this paper, we proposed a system to estimate a user’s states with low power sensors such as acceleration and orientation and control functions to consume a large amount of energy. The proposed system integrates probabilistic inference and energy management into a module. It performs probabilistic inference only when context changes to reduce the cost of inference. The system shows better performance than other previous works in the simulation.
Future work has to include probabilistic learning to provide user adaptive model. Control of GPS receiver must be also studied because it is an important module to reduce energy consumption. Finally, some simulations on diverse mobile phones are necessary to evaluate practical performance.
ACKNOWLEDGMENT
This research was supported by the Original Technology Research Program for Brain Science through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (2010-0018948).
REFERENCES
[1] M. Butler, “Android: Changing the Mobile Landscape,” IEEE Pervasive Computing, vol. 10, no. 1, Jan-Mar 2011, pp. 4-7, doi: 10.1109/MPRV.2011.1.
[2] K. Paul, and T. K. Kundu, “Android on Mobile Devices: An Energy Perspective,” Proc. IEEE 10th Int. Conf. on Computer and Information Technology (CIT 2010), IEEE Press, Jun. 2010, pp. 2421-2426, doi: 10.1109/CIT.2010.416.
[3] I. Shafer, and M. L. Chang, “Movement Detection for Power-Efficient Smartphone WLAN Localization,” Proc. the 13th ACM Int. Conf. on Modeling, analysis, and simulation of wireless and mobile systems (MSWIM 10), ACM Press, Oct. 2010, pp. 81-90, doi: 10.1145/1868521.1868536.
[4] Z. Zhuang, K.-H. Kim, and J. P. Singh, “Improving Energy Efficiency of Location Sensing on Smartphones,” Proc. the 8th Int. Conf. on Mobile Systems, Applications, and Services (MobiSys 10), ACM Press, Jun 2010, pp. 315-329, doi: 10.1145/1814433.1814464.
[5] J. Paek, J. Kim, and R. Govindan, “Energy-Efficient Rate-Adaptive GPS-based Positioning for Smartphones,” Proc. the 8th Int. Conf. on Mobile Systems, Applications, and Services (MobiSys 10), ACM Press, Jun 2010, pp. 299-314, doi: 10.1145/1814433.1814463.
[6] N. Ravi, J. Scott, L. Han, and L. Iftode, “Context-aware Battery Management for Mobile Phones,” Proc. the Sixth Annual IEEE International Conference on Pervasive Computing and Communications (PERCOM 08), IEEE Press, Mar 2008, pp. 224-233, doi: 10.1109/PERCOM.2008.108.
[7] J. Zhang, D. Wu, S. Ci, H. Wang, and A. K. Katsaggelos, “Power-Aware Mobile Multimedia: a Survey,” Journal of Communications, vol. 4, no. 9, Oct 2009, pp. 600-613, doi: 10.4304/jcm.4.9.600-613.
[8] J.-T. Park, J.-W. Nah, S. Wang, S.-M. Chun, “Context-Aware Mobility Management with Energy Efficiency for Multimedia Streaming Service in Wireless LAN,” Proc. the 6th IEEE
Conf. on Consumer Communications and Networking Conference (CCNC 2009), IEEE Press, Jan 2009, pp. 1-6, doi: 10.1109/CCNC.2009.4784978.
[9] L. Benini, P. Glynn, and G. D. Micheli, “Event-driven Power Management,” IEEE Trans. on Computer-Aided Design of Integrated Circuits and Systems, vol. 20, no. 7, Jul 2001, pp. 840-857, doi: 10.1109/43.931003.
[10] C. Harris, and V. Cahill, “Exploiting User Behaviour for Context-aware Power Management,” Proc. IEEE Int. Conf. on Wireless and Mobile Computing, Networking and Communications (WiMob 2005), IEEE Press, Aug 2005, vol. 4, pp. 122-130, doi: 10.1109/WIMOB.2005.1512959.
[11] X. Liu, P. Shenoy, and M. D. Corner, “Chameleon: Application-Level Power Management,” IEEE Trans. on Mobile Computing, vol. 7, no. 8, Aug 2008, pp. 995-1010, doi: 10.1109/TMC.2007.70767.
[12] Y. Fei, L. Zhong, and N. K. Jha, “An Energy-aware Framework for Dynamic Software Management in Mobile Computing Systems,” Journal of ACM Trans. on Embedded Computing Systems, vol. 7, no. 3, Apr 2008, pp. 27:1-27:31, doi: 10.1145/1347375.1347380.
[13] D. Romero, “Context-aware Middleware: An overview,” Paradigma, vol. 2, no. 3, 2008.
[14] C. Efstratiou, K. Cheverst, N. Davies, and A. Friday, “An Architecture for the Effective Support of Adaptive Context-Aware Applications,” Proc. the Second Int. Conf. on Mobile Data Management (MDM 01), Springer-Verlag, Jan 2001, pp. 15-26, doi: 10.1007/3-540-44498-X_2.
[15] N. Paspallis, R. Rouvoy, P. Barone, G. A. Papadopoulos, F. Eliassen, and A. Mamelli, “A Pluggable and Reconfigurable Architecture for a Context-Aware Enabling Middleware System,” Proc. the OTM 2008 Confederated Int. Conf., CoopIS, DOA, GADA, IS, and ODBAS (OTM 08), Springer-Verlag, Nov 2008, pp. 553-570, doi: 10.1007/978-3-540-88871-0_40.
[16] K. Murao, T. Terada, Y. Takegawa, and S. Nishio, “A Context-Aware System that Changes Sensor Combinations Considering Energy Consumption,” Proc. the 6th Int. Conf. on Pervasive Computing (Pervasive 08), Springer-Verlag, May 2008, pp. 197-212, doi: 10.1007/978-3-540-79576-6_12.
[17] J. Zhou, E. Gilman, J. Palola, J. Riekki, M. Ylianttila, and J. Sun, “Context-aware Pervasive Service Composition and its Implementation,” Personal and Ubiquitous Computing, vol. 15, no. 3, Mar 2011, pp. 291-301, doi: 10.1007/s00779-010-0333-5.
[18] J.-K. Min, and S.-B. Cho, “Mobile Human Network Management and Recommendation by Probabilistic Social Mining,” IEEE Trans. on Systems, Man, and Cybernetics, Part B: Cybernetics, vol. 41, no. 3, Jun 2011, pp. 761-771, doi: 10.1109/TSMCB.2010.2092424.
[19] K.-S. Hwang, and S.-B. Cho, “Landmark Detection from Mobile Life Log Using a Modular Bayesian Network Model,” Expert Systems with Applications, vol. 36, no. 10, Mar 2009, pp. 12065-12076, doi: 10.1016/j.eswa.2009.03.002.
[20] B. Priyantha, D. Lymberopoulos, and J. Li, “LittleRock: Enabling Energy-Efficient Continuous Sensing on Mobile Phone,” IEEE Pervasive Computing, vol. 10, no. 2, Feb 2011, pp. 12-15, doi: 10.1109/MPRV.2011.28.
[21] Y. Chon, and H. Cha, “LifeMap: A Smartphone based Context provider for Location-based Services,” IEEE Pervasive Computing, vol. 10, no. 2, Feb 2011, pp. 58-67, doi: 10.1109/MPRV.2011.13.