Skip to main content

Tools for the optimization of energy in a context recognition task

Project description

Goal

This library help to automatically optimize the settings of a context recognition project in order to make it more energy-efficient. Given possible settings (e.g. different sensors) the goal is to decide when to use them. E.g. Use accelerometer when detecting walking but use gps when driving is detected.

Installation

Run the following to install:

`python pip install eecr `

Usage

For extensive examples check the documentation at https://dis.ijs.si/eecr/

from eecr import EnergyOptimizer
optimizer = EnergyOptimizer(sequence=sequence, #a list of contexts - ground truth for current task,
                            setting_to_sequence=setting_to_sequence, #a dictionary that maps each setting
                                                                     #to a list of predictions using that setting
                            setting_to_energy=setting_to_energy,     #a dictionary that maps each setting
                                                                     #to the energy cost of that setting
                            )
solutions_sca, values_sca = optimizer.find_sca_tradeoffs()
for (s,v) in zip(solutions_sca, values_sca):
    print (s, v)

Description

Widespread accessibility of wearable sensing devices opens many possibilities for tracking the users who wear them. Possible applications range from measuring their exercise patterns and checking on their health, to determining their location. In this documentation we will use the term context-recognition for all these tasks.

A common problem when using such context-recognition systems is their impact on the battery life of the sensing device. It is easy to imagine that an application that monitors users’ habits using all the sensors in a smartphone (accelerometer, GPS, Wi-Fi etc.) will quickly drain the phone’s battery, making it useless in practice.

While many methods for reducing the energy-consumption of a context-recognition system already exist, most of them are specialized. They work either in a specific domain or can only optimize the energy consumption of specific sensors. Adapting these methods to another domain can be laborious and may require a lot of expert knowledge and experimentation.

We developed three novel methods for generating good energy-efficient solutions that are independent of the domain and can easily be used to optimize a wide range of context-recognition tasks. The first method, “”Setting-to-Context Assignment (SCA)” changes the sensing settings – which sensors to use, with what frequency, what duty cycles to use etc. – depending on what context was last detected. To do so, we developed a mathematical model that can predict the performance of any given setting-to-context assignment. The SCA method then uses the NSGA-II algorithm to search the space of possible assignments, finding the best ones. The second method, “Duty-Cycle-Assignment (DCA)” works in a similar way to the SCA method, but is specialized in optimizing only duty-cycling, i.e., periodically turning the sensors on and off. %This specialization can be justified by the fact that duty-cycling is useful in basically all context-recognition tasks.

Finally, the “Cost-Sensitive Decision-Tree (CS-DT)” method adapts sensing settings directly to the sensor data. It works by using a cost-sensitive decision tree that was adapted for context-recognition tasks. All three methods were then combined in three different ways in order to join their individual strengths. These combined methods can adapt to both the current context and to the sensor data.

Instead of returning only one solution, all of our methods can find different trade-offs between the classification quality and the energy consumption. Returning these trade-offs can help the system designer to pick one suitable for their system.

The methods are explained and in depth in PhD work <Insert a link>. The methodology was also tested on four different real-life datasets, and on a family of artificial datasets. Doing so, we proved that it works under many different conditions, with different possible settings, sensors and problem domains. We also showed that our methods compare favourably against other state-of-the-art methods. For each of the tested datasets we found many energy-efficient solutions. For example, for the Commodity12 dataset, we reduced the energy consumption from 123 mA to 29 mA in exchange for less than 1 percentage point of accuracy. For another example, we were able to use only 5% of the available data in the SHL dataset (by using a lower frequency, duty-cycling and a subset of sensors) and in exchange sacrifice only 5% of the accuracy.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eecr-0.0.1.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

eecr-0.0.1-py3-none-any.whl (105.0 kB view details)

Uploaded Python 3

File details

Details for the file eecr-0.0.1.tar.gz.

File metadata

  • Download URL: eecr-0.0.1.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.0

File hashes

Hashes for eecr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 57114e691b1806a99e8a75b5fc956ffdfedb2481c9798805e54a4b31d3fe15e8
MD5 6a11980a110dd44c302ab42a28c2835a
BLAKE2b-256 e016650eca33d4ceec7c0107e51ebf7b5fa20d1518fc60b066892c0f534b596a

See more details on using hashes here.

File details

Details for the file eecr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: eecr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 105.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.0

File hashes

Hashes for eecr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9166413943cfe68541fd8d3dbc1ba2df733387467d12c5a10dbea2bfd8e8237
MD5 289d0e19aeb3b3171d4f0a4555a235e4
BLAKE2b-256 f78f668fe524ecd751f0e353201d6214f80dbfe50b94c68caa035bca2d06d86d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page