a prediction-driven adaptation approach for self-adaptive

11
HAL Id: hal-00983046 https://hal.inria.fr/hal-00983046 Submitted on 24 Apr 2014 HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. A Prediction-Driven Adaptation Approach for Self-Adaptive Sensor Networks Ivan Dario Paez Anaya, Viliam Simko, Johann Bourcier, Noël Plouzeau, Jean-Marc Jézéquel To cite this version: Ivan Dario Paez Anaya, Viliam Simko, Johann Bourcier, Noël Plouzeau, Jean-Marc Jézéquel. A Prediction-Driven Adaptation Approach for Self-Adaptive Sensor Networks. 9th International Sym- posium on Software Engineering for Adaptive and Self-Managing Systems, IEEE/ACM, Jun 2014, Hyderabad, India. hal-00983046

Upload: others

Post on 16-Jan-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Prediction-Driven Adaptation Approach for Self-Adaptive

HAL Id: hal-00983046https://hal.inria.fr/hal-00983046

Submitted on 24 Apr 2014

HAL is a multi-disciplinary open accessarchive for the deposit and dissemination of sci-entific research documents, whether they are pub-lished or not. The documents may come fromteaching and research institutions in France orabroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, estdestinée au dépôt et à la diffusion de documentsscientifiques de niveau recherche, publiés ou non,émanant des établissements d’enseignement et derecherche français ou étrangers, des laboratoirespublics ou privés.

A Prediction-Driven Adaptation Approach forSelf-Adaptive Sensor Networks

Ivan Dario Paez Anaya, Viliam Simko, Johann Bourcier, Noël Plouzeau,Jean-Marc Jézéquel

To cite this version:Ivan Dario Paez Anaya, Viliam Simko, Johann Bourcier, Noël Plouzeau, Jean-Marc Jézéquel. APrediction-Driven Adaptation Approach for Self-Adaptive Sensor Networks. 9th International Sym-posium on Software Engineering for Adaptive and Self-Managing Systems, IEEE/ACM, Jun 2014,Hyderabad, India. �hal-00983046�

Page 2: A Prediction-Driven Adaptation Approach for Self-Adaptive

A Prediction-Driven Adaptation Approach for Self-AdaptiveSensor Networks

Ivan Dario Paez Anaya1, Viliam Simko2, Johann Bourcier1, Noël Plouzeau1,Jean-Marc Jézéquel1

1 IRISA - University of Rennes 1 & INRIA, 35402 Rennes, France{ivan.paez_anaya, johann.bourcier, noel.plouzeau, jean-marc.jezequel}@irisa.fr

2 Institute for Program Structures and Data Organisation (IPD), Karlsruhe Institute of Technology (KIT),Am Fasanengarten 5, 76131 Karlsruhe, Germany

[email protected]

ABSTRACT

Engineering self-adaptive software in unpredictable environ-ments such as pervasive systems, where network’s ability,remaining battery power and environmental conditions mayvary over the lifetime of the system is a very challengingtask. Many current software engineering approaches lever-age run-time architectural models to ease the design of theautonomic control loop of these self-adaptive systems. Whilethese approaches perform well in reacting to various evolu-tions of the runtime environment, implementations basedon reactive paradigms have a limited ability to anticipateproblems, leading to transient unavailability of the system,useless costly adaptations, or resources waste. In this paper,we follow a proactive self-adaptation approach that aims atovercoming the limitation of reactive approaches. Based onpredictive analysis of internal and external context informa-tion, our approach regulates new architecture reconfigura-tions and deploys them using models at runtime. We haveevaluated our approach on a case study where we combinedhourly temperature readings provided by National ClimaticData Center (NCDC) with fire reports from Moderate Res-olution Imaging Spectroradiometer (MODIS) and simulatedthe behavior of multiple systems. The results confirm thatour proactive approach outperforms a typical reactive sys-tem in scenarios with seasonal behavior.

Categories and Subject Descriptors

D.2.2 [Software Engineering]: Design Tools and Tech-niques; D.2.11 [Software Engineering]: Miscellaneous -proactive self-adaptation.

General Terms

Design, Experimentation.

Permission to make digital or hard copies of all or part of this work forpersonal or classroom use is granted without fee provided that copies arenot made or distributed for profit or commercial advantage and that copiesbear this notice and the full citation on the first page. To copy otherwise, torepublish, to post on servers or to redistribute to lists, requires prior specificpermission and/or a fee.SEAMS’14, May 31-June 07 2014, Hyderabad, India.Copyright 2014 ACM 978-1-4503-2864-7/14/05 ...$15.00.

Keywords

Self-adaptation, predictive analytics, proactive adaptation,pervasive systems.

1. INTRODUCTIONNowadays our living environment is gradually filled with

a plethora of electronic devices capable of sensing physicalparameters of their direct surroundings such as temperature,pressure and humidity. Various application domains such asenvironmental monitoring, civil safety and smart cities areemerging to take benefit of these sensing networks. Whilethese new applications can provide valuable services to oursociety, excessive battery consumption limits their lifetimeand therefore greatly limits their wide adoption.

In this paper, we argue that the lifetime of these sen-sor networks can be significantly increased by adopting aproactive adaptation approach that takes into account en-vironmental conditions. Indeed, having information aboutthe future environmental condition of a system enables anautonomous adaptation engine to preventively adapt thesystem to meet the future demand, or optimize some sys-tem metrics. As an example, having precise data aboutweather forecast provides the required information to re-duce the consumption of a fire monitoring sensor network,because the probability of detecting a fire greatly varies withthe weather.

Predictive Analytics is being embraced at an increasingrate in different fields to gain actionable and forward-lookinginsight from a vast amount of data. Nowadays, simply look-ing in the rear view mirror to obtain insight and make de-cisions is not enough to correctly adapt a system in rapidlychanging environments. A better understanding of possi-ble future situations ensures better decisions in the present.Predictive analytics is adopted in a wide variety of appli-cation domains, which includes predicting insurance fraud,finding patterns in health related data, infrastructure fail-ures and customer churn analysis.

In this paper we propose an adaptation of techniques com-ing from the Predictive Analytics domain. Our proactive ad-aptation approach combines a prediction framework basedon history analysis and a reasoning engine that evaluate thesystem state in the future to determine the most appropriatesystem configuration. The contributions of this paper are:

Page 3: A Prediction-Driven Adaptation Approach for Self-Adaptive

1. A predictive component that analyzes external and in-ternal context information and predicts future changes.

2. A reasoning component that makes use of the predic-tions to evaluate the likelihood of each potential sit-uation and decides on the most appropriate systemconfiguration.

In our approach, system adaptations are performed througha reasoning engine that looks up for alternate architecturalmodels, following the models@runtime paradigm [22]. Us-ing predictive analysis of internal and external context infor-mation, the reasoning engine chooses an architecture modelthat meets functional and non-functional requirements. Thenthe models@runtime engine generates reconfiguration instruc-tions to perform the online adaptation.

Using a pervasive system for risk evaluation and preven-tion of forest fires, we show that our proactive approachoutperforms a typical reactive approach in scenarios withtransient, intermittent and seasonal behaviors. In our casestudy, a forest is equipped with a wireless sensor network,where each sensor node can host one to three of the fol-lowing physical sensors: precipitation, humidity and tem-perature. Each sensor node has a specific sensing rate andcoverage range. Other types of nodes, called data collectors,are in charge of collecting the raw sensing data transmittedby the sensor nodes. A data collector has more computa-tional power than a sensing device, and it acts as a gatewaybetween sensing devices and our Proactive Autonomic Man-ager component. The overall goal of our case study is toprovide timeliness adaptations and optimize the power con-sumption of the system in order to extend its lifetime.

The rest of this paper is organized as follows: Section 2details our motivating example about forest fire preventionand recalls predictive analytics fundamentals used in ourapproach. Section 3 describes our proactive adaptation ap-proach and provides implementation details. Section 4 isdedicated to the evaluation of the approach with an exper-imental study. Section 5 presents related work. Section 6concludes and hints at future work.

2. BACKGROUND AND EXAMPLE

2.1 A Fire Monitoring Use CaseIn the summer of 2007, more than 80 people died in Greece

and 670,000 acres (2,711 km2) burned because of wild fires1.More recently, the wild fires caused by the remarkable heatwave of July and August, 2010 in western Russia engulfed280,000 acres (1,131 km2) around Moscow and killed at least60 people2. This illustrates that in the last couple of years,large wildfires have caused extended damages and catas-trophic consequences in lost of properties and lives. Apartfrom preventive measures, early detection and proactivityare the only ways to limit damage and casualties. Using asensor network to monitor a forest in real time is an efficientway to achieve early detection.

Let us consider a wireless sensor network, with sensornodes deployed geographically at strategic locations. Eachsensor node can host one to three of the following physi-cal parameter sensors: temperature, humidity and precip-itation. Each sensor node component is functioning at a

1http://wikipedia.org/wiki/2007_Greek_forest_fires2http://wikipedia.org/wiki/2010_Russian_wildfires

controllable sampling rate. We define 3 different levels ofsampling rate: LOW, MEDIUM and HIGH sampling rates.

Sensor nodes are equipped with 6lowPan radio for intern-ode communication. Data collector nodes are in charge ofreceiving raw data from the sensor nodes. There is a globalentity that has access to all available information in the datacollectors and maintains a global model of the current stateof the system. In this context, a system configuration ismade of the following information: (1) actual spatial distri-bution of sensor nodes, (2) a set of data collectors, (3) phys-ical values related to sensor monitoring and forest statusevolution, (4) communication protocol, (5) remaining bat-tery life and other technical constraints.

In this kind of critical scenario, reactiveness is not suffi-cient. Proactive adaptations of the system are required toanticipate events and to optimize system behavior with re-spect to its changing environment. For example, in the firemonitoring use case introducing delay in reporting a fire canbe regarded as a failure of the monitoring system and canhave dramatic consequences. By monitoring the energy con-sumption we are able to estimate when a sensor node willfail. Also, a bad configuration of the network configurationscan lead to a premature outage of battery power on a sub-part of the sensor network. If not proactively detected andfixed, this problem can introduce delays in fire detection,and prevent timely fire detection.

A second important concern lies in the cost of system ad-aptation. Indeed, as mentioned in [8] reconfiguring a systemhas a penalty cost on system availability and also in our caseon battery consumption. The use of prediction informationon future operating conditions of the system can provide adecrease in the number of useless reconfigurations, therebysaving power and extending system’s lifetime.

In short, in our use case proactive adaptation should pro-vide a better long term solution to power management whencompared with short term, purely reactive policies.

2.2 Predictive Analytics BackgroundThe concepts of Predictive Analytics are widely applied in

different scientific disciplines, including computer science,mathematics, statistics, engineering, and physics. As theterm prediction is widely used and heavily overloaded incomputer science research literature, we begin with a clari-fication.

Predictions can be categorized in many ways [3], for in-stance: (1) classification, i.e. predicting the outcome froma set of finite possible values, (2) regression, i.e. predictinga numerical value, (3) clustering or segmentation, i.e. sum-marizing data and identifying groups of similar data points,(4) association analysis, i.e. finding relationships betweenattributes, and (5) deviation analysis, i.e. finding exceptionsin major trends or structures.

Other authors, such as [31] categorize the prediction ap-proaches from a different perspective: (1) linear modelingand regression, (2) non-linear modeling, (3) time series anal-ysis. In our case, we focused on classification methods in thescope of the time series analysis.

Classification Methods. We wanted to find a classifica-tion model that, when applied on a certain time series, e.g.hourly temperature readings, would make precise predic-tions for the next N hours. Here, we could choose frommany existing classification models. In particular, we eval-

Page 4: A Prediction-Driven Adaptation Approach for Self-Adaptive

uated 8 non-linear models: (1) Multi Layer Perceptron [26],(2) Fuzzy Rules [4], (3) Probabilistic Neural Network [5],(4) Logistic Regression3, (5) Support Vector Machine [24,18], (6) Naive Bayes4, (7) Random Forest [7] and (8) Func-tional Trees [12, 20].

Time Series Analysis. Time series analysis focuses on de-scribing the relation between elements of a series. Usuallythe next value of the series is highly related to the mostrecent values, with a time-decaying importance in this rela-tionship to previous values [31].

A time series X is a discrete function that represents real-valued measurements:

X = {x1, x2...xn} : X = {xt : t ∈ T} : T = {t1, t2...tn} (1)

in a set of n equidistant time points, as described in [21].The elapsed time between two points in the time series isdefined by a value and a time unit.

A useful approach [6] is to decompose the given time se-ries data into other three components, trend, season andremainder, as illustrated in the Figure 1.

Temperature(degC)

1015

2025

data

−6−2

02

46

season

al14

1618

2022

trend

−0.3

−0.1

0.1

0 20 40 60 80 100 120

remain

der

time (days)

Figure 1: Time series decomposition of temperaturereadings of 120 days.

The trend component can be described by a monotoni-cally increasing or decreasing function (in most cases a linearfunction) that can be approximated using common regres-sion techniques.

The season component captures recurring patterns thatare composed of at least one or more frequencies, e.g. daily,weekly, monthly or yearly patterns. These frequencies canbe identified by using a Fast Fourier Transformation (FFT)or by auto-correlation techniques.

The remainder component is an unpredictable overlayof various frequencies with different amplitudes changing

3http://en.wikipedia.org/wiki/Logistic_regression4http://en.wikipedia.org/wiki/Naive_Bayes_classifier

quickly due to random influences on the time series. Theremainder can be reduced by applying smoothing techniqueslike weighted moving averages (WMA), by using lower sam-pling frequency, or by a low-pass filter that eliminates highfrequencies.

3. APPROACHIn this section we present an overview of our proactive

adaptation framework, following the self-adaptive referencemodel MAPE-K [19]. Our approach implements the MAPE-K structure by:

− Monitoring internal and external context variables.− Introducing predictive analytics to the Analyze com-

ponent.− Integrating the prediction and reasoning about it in

the Planning module.− Executing the new target reconfiguration using a mod-

els@runtime approach [23] to manage actual and po-tential architectural models.

− Exchanging information between these modules throughthe Knowledge component.

Our architecture is organized in layers as shown in Fig-ure 2. It consists of two detachable subsystems, which arecausally connected to each other: the Managed Element andthe Proactive Autonomic Manager. Our main contributionis the introduction of the predictive analysis module into theautonomic manager element.

3.1 Monitor Module

Principles. The monitor module is in charge of keepingcontinuous record of internal context information. It readssystem state variables that hold information about the op-erating environment (e.g. transmission rate, battery level).Regarding external context, the monitoring module also ob-serve external information relevant to the system (e.g. en-vironmental conditions).

Application to fire monitoring. In order to obtain realdata about external context information, we used severalexisting sources of fire detection data to feed our sensor net-work. Figure 3 shows all fire detections in the year 2010 forthe geographic area covering the continental USA includinga 50 km buffer around the periphery. The detections wereobtained using the Moderate Resolution Imaging Spectro-radiometer (MODIS) and processed as a cooperative effortbetween the USDA Forest Service Remote Sensing Applica-tions Center, NASA-Goddard Space Flight Center and theUniversity of Maryland. We downloaded these datasets fromthe USDA website5.

We have then collected hourly weather readings from sta-tions near spots of fire detections. We chose the IntegratedSurface Hourly (ISH) datasets6 provided by National Cli-matic Data Center (NCDC). Combining both data sources,we connected individual fires to weather conditions in spaceand time. Obviously, the fires detected by MODIS are notuniformly distributed throughout the US. Therefore, we havechosen to focus on a geographical area that contains a largeamount of fires, namely the state of Mississippi (see Figure 4

5http://activefiremaps.fs.fed.us/gisdata.php6http://www.ncdc.noaa.gov/oa/climate/surfaceinventories.html

Page 5: A Prediction-Driven Adaptation Approach for Self-Adaptive

KnowledgeRepository

Runtime reconfiguration

External Context

Information

Managed Element

Systemstate

Adaptationtargets

Predictive Analysis

Knowledge

Plan

Execute

Input Features Extraction

Monitor

Predictive Models Architecture

Models

Variability Model

Prediction

External variables

Legend

Component

Repository

Derive

Interface

Interaction

Figure 2: The proactive adaptation approach.confidence

Figure 3: MODIS fire detections in 2010. Over130,000 fires detected.

and 5) and selected only fires that are within a 50 km radiusfrom an ISH station (see Figure 6).

3.2 Predictive Analysis Module

Principles. The predictive analysis module receives inputfrom the current state of the system as well as from externalcontext information through the monitor module. We usepredictive models and historical information to build thecontext and model environmental variability. We then feedthe reasoning engine with this predictions to improve thedecision making process.

Application to fire monitoring. In the forest monitoringuse case we use prediction models to predict the risk of firein the future. This prediction is taken into account by theplanning module to take reconfiguration decisions on therunning system.

Area chosen for

evaluation

Figure 4: ISH Stations active in 2010 that providedhourly temperature readings. Together 2607 US sta-tions, colors represent states.

To choose good prediction models, we have implementedthe prediction of fire risk with the KNIME7 tool, using thePredictive Markup Modeling Language (PMML) [14], whichis a standard proposed by the Data Mining Group. In ouruse case, given a time series of hourly temperature read-ings, we want to predict the fire potential value for the nextN hours. This is a classification problem with 13 input at-tributes: the current and the last 9 hours of temperaturereadings, and average temperature from the past day, weekand month. We have selected 8 classification models, as pre-sented in Table 1. These classifiers produce a prediction forthe level of temperature: High , Medium and Low. Thisset of classifiers represents a large panel of existing training-based techniques for automated classification of items intocategories.

In order to compare the aforementioned classification mod-els, we needed training and testing data, as well as a scoringmethod.

7http://www.knime.com

Page 6: A Prediction-Driven Adaptation Approach for Self-Adaptive

Figure 5: Fires in Mississippi detected by MODISin 2010. Colors represent the nearest ISH stationthat would detect the fire. (20 ISH stations)

For the training set we used theMERIDIAN NAS temper-ature readings and for the testing set the temperatures fromNACHES/HARDY (AWOS) station. The geographical dis-tance between these two stations is approximately 276 km,which gives us confidence that the results are unbiased. An-other reason for choosing these stations is that there areenough fire detections close to them (for both, approx. 550fires within the radius of 50 km, see Figure 6), which allowsus to later simulate and evaluate the actual running systems.However, these classifiers do not care about fire detections,but rather predict the fire potential based on historical tem-peratures.

We run the train-test evaluation loop 43 times for eachclassifier while changing the number of hours in future forthe fire potential prediction (t + 1, t + 2, . . . , t + 24[1d], t +

Figure 6: Number of fires within 50 km radius froman ISH station. Together 12330 fire detections.

Table 1: Prediction models (classifiers) evaluated.Classifier Training SettingsMulti-LayerPerceptronπ

(0..1) normalization, 3 layers,max. 30 neurons/layer, 300 iter-ations

Fuzzy Rules linear sampling (3000 samples),min/max fuzzy norm

Probabilistic NeuralNet

Z-Score norm., Theta -0.1/+0.9

Logistic Regressionπ –SVMπ Polynomial kernel, power=0.5Naive Bayesπ –Random Forest 100 treesFunctional Trees 30 boosting iterations

π available as a PMML-based model

48[2d], . . . , t + 480[20d])). Each iteration yields several ac-curacy measures (scores). As commonly accepted in themachine-learning community, we used the F1-measure tocompare our classifiers (F1 is a harmonic mean of Precisionand Recall). By the end of the evaluation, each classifieris characterized by a series of F1-measures depicted in theFigure 7.

+1

+2

+3

+4

+5

+6

+7

+8

+9

+10

+11

+12

+13

+14

+15

+16

+17

+18

+19

+20

+21

+22

+23

+24

+48

+72

+96

+12

0+

144

+16

8

Predicted Future [Hours]

0.660.680.700.720.740.760.780.800.820.840.860.880.900.920.940.96

F1-m

easu

re (h

ighe

r is

bette

r)

Multi Layer PerceptronProbabilistic Neural NetworkFuzzy Rule ModelSupport Verctor MachineLogistic RegressionNaive BayesRandom ForestFunctional Trees

Training: MERIDIAN NAS, Testing: NATCHEZ/HARDY,

Distance between locations: 276 km

Figure 7: Comparing different classification modelsusing data from distant stations.

We clearly see that most of our classification models achievea pretty high prediction performance. For instance, predict-ing 5 hours in the future can be achieved with F1 = 85%accuracy, as depicted in Table 2. Moreover, even 20 daysin future can be predicted with more than 75% F1. In ourexperiment, we only used predictions from 1, 2, . . . , 7 hoursin future.

We finally selected the Multi Layer Perceptron (MLP)model because it gives almost the highest accuracy. In con-trast to the best performing Random Forest (RF) model,MLP is available as a PMML model. Training MLP re-quires more time than RF. However it must be done onlyonce, and running predictions using MLP is faster than RF.

Page 7: A Prediction-Driven Adaptation Approach for Self-Adaptive

A trained MLP model consists of 63 neurons organized in 3layers, with a network of 13 inputs and 3 outputs. The restof the text therefore assumes the use of MLP as a classifier.

Table 2: F1-measures of 5 best performing classifi-cation models predicting fire potential outcome for1 to 5 hours in future.

MLP PNN LR RF FTFirePotential(+1) 94% 91% 94% 94% 94%FirePotential(+2) 91% 89% 90% 91% 89%FirePotential(+3) 89% 86% 87% 89% 88%FirePotential(+4) 86% 85% 85% 87% 85%FirePotential(+5) 85% 84% 83% 85% 83%

3.3 Plan Module

Principles. Most of the current self-adaptive approachesuse decision techniques such as Event Condition Actions(ECA) [27]. An ECA technique that uses instantaneousvalues of context variables is purely reactive. In our case,we adopt an ECA technique with events based on predic-tions. These events carry aggregate information of previoushistoric data plus the foresight into the prediction horizon.Conditions remain conceptually the same: they can be assimple as a threshold. Finally, an action is generated inreply to a condition.

Application to fire monitoring. To illustrate our proac-tive adaptation in our fire potential scenario, let us assumethe following constraints in the system:

− time for redeploying a reconfiguration is 1 time unit;− there are three levels of sensing rates: high (every

hour), medium (every 8 hours), and low (every 24 hours).Using the temperature prediction, we have implemented

the following ECA rule:Event: An increase or decrease in temper-

ature.Condition: If the temperature crosses the

threshold in ascending or descend-ing manner.

Action: The system will increase or decreasethe sensing rate accordingly.

Let us consider the following scenario that lasts 3 timeunits, where we represent the system state with a (sensing-rate, temperature) tuple as follows:

− 0. (medium sensing rate, medium temperature)− 1. (medium sensing rate, high temperature)− 2. (high sensing rate, medium temperature)− 3. (medium sensing rate, medium temperature)Following a reactive approach, the system triggers a re-

configuration after 1 time unit, because the previous tem-perature reading was high. However by the time the re-configuration has taken place the temperature has droppedback to medium level, making this reconfiguration uselessand consuming extra energy.

Following our predictive approach, the system does nottake decisions on instantaneous values of environmental vari-ables, but it considers the trend and the seasonal compo-nents of the historical data, plus the forecast of the variables,thus avoiding this useless reconfiguration.

3.4 Execute ModuleThe goal of this module is to deploy the new system con-

figuration decided by the planning module on the runningsystem. We use Kevoree [11], a models@rutime tool thatprovides a reflection model of the running system, then al-lows edition of this model and generation of a new targetmodel. This target model can then be redeployed and syn-chronized with the running system.

Kevoree targets distributed systems, ranging from sen-sor networks to cloud systems. It particularly provides dis-tributed synchronization of models@runtime[10]. In the firemonitoring scenario, we mainly target sensor network nodeswhere reconfigurations have to be disseminated among dis-tributed nodes. Kevoree addresses the reconfiguration ofthese resource constrained nodes by providing two recon-figuration types: parametric reconfigurations and firmwareupdates. Parametric reconfigurations are used when thechange only involves modification of variable values. Firmwareupdates are used in all other situations. A firmware updatereconfiguration has a higher cost as it involves flashing thefirmware of the sensor nodes.

Using Kevoree we are able to disseminate reconfigurationsto dynamically update the behavior of the sensor nodes.Particularly to our case study, these reconfigurations con-sist in activating or deactivating, changing the sensing rateor flashing the firmware of the sensor nodes.

3.5 Knowledge ModuleIn Figure 2, the dotted line between the knowledge el-

ement represent interaction. The purpose of the knowl-edge repository is the continuous exchange of informationbetween all the modules.

For the serialization of prediction models we use the Pre-dictive Model Markup Language language (PMML) [14]. Aspreviously mentioned, PMML is an XML-based languagethat enables the definition and sharing of predictive modelsand can be easily integrated in KNIME, which allowed usto implement classifier and forecast models. These files canbe imported or exported inside a KNIME workflow and areready for use within the running nodes.

4. VALIDATIONWe performed an experimental study on the fire monitor-

ing scenario to validate our approach. We defined the exper-imental design of our study using the Goal-Question-Metricmethod. The GQM method was defined as a mechanismfor defining and interpreting a set of operation goals, usingmeasurements [1]. In this experiment, our goal is the follow-ing:

Purpose: ImproveIssue: the global effectivenessObject : the systemContext: self-adaptive sensor networks

To fulfill this goal, we will focus on answering the threefollowing research questions:

1. RQ1: Does a proactive adaptation approach triggerless reconfigurations than a reactive approach underseasonal behavior conditions?

2. RQ2: Does a proactive adaptation approach improveenergy consumption compared with a reactive adapta-tion approach?

Page 8: A Prediction-Driven Adaptation Approach for Self-Adaptive

3. RQ3: Does a proactive adaptation approach reducethe delay in transmitting fire alert in comparison to areactive approach?

We then defined our experiment type. V. Basili describedtwo kinds of studies: in-vivo and in-vitro [1]. Later, twomore categories were added: in-virtuo, in-silico [15]. In ourcase, we chose to carry in-silico experiments, where subjectsand real world are described as computer models. The en-vironment is composed entirely of computer models, withwhich human interaction is reduced to a minimum. This of-fers major advantages regarding cost and feasibility of repli-cating a real-world configuration.

To answer these research questions, we set up an exper-iment where we simulated 10 baselines and 28 predictivesystems. Our assumptions common to all of these systemsare as follows:

− The shortest time unit is one hour.− Each system operates in a certain interval that is either

constant or varies over time, depending on the type ofa system. If the interval changes, we consider it as anadaptation. For each system, we compute the numberA as the number of adaptations in the year.

− In every iteration, the system reads its sensors andsends the data to the data collector. For each system,we compute the number T as the number of transmis-sions in a year.

− When a fire is detected by a system, we compute thenumber of hours that the fire should have been re-ported to the base station. We call this measure “LateFire Hours” λi. We compare all systems based on:L = Σh

i=1λi, where h is the number of all hours in theyear.

− Using the metrics above, we define power consumptionmetrics as P = 0.1 ∗ T + 0.5 ∗A.

− We also compute relative versions of the metrics AR,TR, PR and LR that are relative to the reactive sys-tem.

Reactive system. This is our first baseline system that adaptsits transmission rate based on the current temperature.

Simple system. This is also a baseline system with a con-stant transmission rate. We simulated 9 variants with dif-ferent transmission rates: 1, 2, 3, 4, 5, 6, 7, 8, 12.

Predictive system. This system operates similarly to thereactive system. However, before each adaptation it uses aclassifier to predict fire potential at time t+ F (t is currenttime, F is the number of hours in future). The adaptationis cancel whenever

FirePotential(t− 1) = FirePotential(t+ F )

There are 4 variants of this system:− The default variant uses prediction before any adapta-

tion.− The variant denoted as“D”(slowing down without pre-

diction) runs the prediction only if changing from lowertransmission rate to higher transmission rate.

− The variant denoted as “U” (speeding up without pre-diction) runs the prediction only if changing from highertransmission rate to lower transmission rate.

− The variant denoted as“i” (interval check) runs predic-tion for all hours in the interval t+1, t+2, . . . , t+F , sothat there is a higher chance to cancel the adaptation.

We executed our simulation of the 38 systems on all firesdetected close to the NACHES/HARDY (AWOS) stationand collected the results, which are depicted in Figures 8Figure 9 and Figure 10. Each figure shows a comparison ofthe systems using different metrics.

RQ1: Evaluating reconfigurations.Figures 8 relates to RQ1 and depicts the number of recon-

figurations for each self adaptive systems. From this result,we can observe that all 28 systems based on proactive adap-tations are achieving a smaller number of reconfigurationsthan a reactive system. We are able to save up to 20 % of thenumber of reconfigurations of the system with the Predic-tive(1) system. These results highlight that using predictiveinformation can help to reduce the number of reconfigura-tions of a system.

RQ2: Evaluating System lifetime.Figure 9 relates to RQ2 and depicts the total power con-

sumption for each type of a systems. We use this metric toquantify the lifetime of the system as the lifetime is directlycorrelated to total power consumption. For this metric, allthe predictive systems reduced the power consumption withrespect to Reactive system. The lowest power consump-tion has been measured in the Predictive(*)D and Predic-tive(*)Di group. In other words, when choosing an adequateadaptation strategy, these results show that using predictioninformation allows for an increase in system lifetime.

RQ3: Evaluating late fire report.Figures 10 relates to RQ3 and presents the delay intro-

duced in reporting fire alerts for each self adaptive systems.From these results, we can observe that most of the pre-dictive techniques show fire detection delays similar to thereactive approach technique. This result is valuable sinceproactive techniques such as Predictive(3)U were able todecrease the number of system reconfigurations, while pro-viding a smaller delay for detecting fire. On these results,we can also observe that the Predictive(*)Di techniques areexhibiting larger delays than the other approaches. This isdue to the fact that this proactive adaptation strategy tendsto slow down the adaptation process.

We want to emphasize that the three parameters eval-uated in these three research questions are contradictory.Indeed, minimizing power consumption and minimizing thedelay for detecting fire are contradictory objectives since oneobjective requires minimal sensing rate, where the other ob-jective requires maximum sensing rate. In our result, thePredictive(3)U has performed better than the Reactive ap-proach in all these experiments.

This case study demonstrates how a proactive approachcan be more efficient over a long period of time than a re-active approach. This conclusion agrees with S.W.Chenget al. [8] in that reactive adaptation has two deficient prop-erties: (1) information used for decision making does notextend into the future, and (2) the planning horizon of thestrategy is short and does not consider the effect of currentdecisions on future utility [8].

Page 9: A Prediction-Driven Adaptation Approach for Self-Adaptive

Reac

tive

Sim

ple(

ever

y 1h

)Si

mpl

e(ev

ery

2h)

Sim

ple(

ever

y 3h

)Si

mpl

e(ev

ery

4h)

Sim

ple(

ever

y 5h

)Si

mpl

e(ev

ery

6h)

Sim

ple(

ever

y 7h

)Si

mpl

e(ev

ery

8h)

Sim

ple(

ever

y 12

h)Pr

edic

tive(

1)Pr

edic

tive(

2)Pr

edic

tive(

3)Pr

edic

tive(

4)Pr

edic

tive(

5)Pr

edic

tive(

6)Pr

edic

tive(

7)Pr

edic

tive(

1)U

Pred

ictiv

e(2)

UPr

edic

tive(

3)U

Pred

ictiv

e(4)

UPr

edic

tive(

5)U

Pred

ictiv

e(6)

UPr

edic

tive(

7)U

Pred

ictiv

e(1)

DPr

edic

tive(

2)D

Pred

ictiv

e(3)

DPr

edic

tive(

4)D

Pred

ictiv

e(5)

DPr

edic

tive(

6)D

Pred

ictiv

e(7)

DPr

edic

tive(

1)Di

Pred

ictiv

e(2)

DiPr

edic

tive(

3)Di

Pred

ictiv

e(4)

DiPr

edic

tive(

5)Di

Pred

ictiv

e(6)

DiPr

edic

tive(

7)Di0.0x

0.2x

0.4x

0.6x

0.8x

1.0x

Fact

or re

lativ

e to

the

Reac

tive

syst

em(lo

wer

is b

ette

r)

1.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.79

0.82

0.83

0.83

0.83

0.83

0.85

0.87

0.89

0.89

0.89

0.90

0.89

0.92

0.91

0.93

0.93

0.93

0.93

0.92

0.93

0.91

0.89

0.88

0.86

0.83

0.81

0.79

Figure 8: Number of needed reconfigurations relative to the reactive system

Reac

tive

Sim

ple(

ever

y 1h

)Si

mpl

e(ev

ery

2h)

Sim

ple(

ever

y 3h

)Si

mpl

e(ev

ery

4h)

Sim

ple(

ever

y 5h

)Si

mpl

e(ev

ery

6h)

Sim

ple(

ever

y 7h

)Si

mpl

e(ev

ery

8h)

Sim

ple(

ever

y 12

h)Pr

edic

tive(

1)Pr

edic

tive(

2)Pr

edic

tive(

3)Pr

edic

tive(

4)Pr

edic

tive(

5)Pr

edic

tive(

6)Pr

edic

tive(

7)Pr

edic

tive(

1)U

Pred

ictiv

e(2)

UPr

edic

tive(

3)U

Pred

ictiv

e(4)

UPr

edic

tive(

5)U

Pred

ictiv

e(6)

UPr

edic

tive(

7)U

Pred

ictiv

e(1)

DPr

edic

tive(

2)D

Pred

ictiv

e(3)

DPr

edic

tive(

4)D

Pred

ictiv

e(5)

DPr

edic

tive(

6)D

Pred

ictiv

e(7)

DPr

edic

tive(

1)Di

Pred

ictiv

e(2)

DiPr

edic

tive(

3)Di

Pred

ictiv

e(4)

DiPr

edic

tive(

5)Di

Pred

ictiv

e(6)

DiPr

edic

tive(

7)Di0.0x

0.2x

0.4x

0.6x

0.8x

1.0x

Fact

or re

lativ

e to

the

Reac

tive

syst

em(lo

wer

is b

ette

r)

1.00

1.22

0.61

0.41

0.31

0.24

0.20

0.17

0.15

0.10

0.93

0.94

0.94

0.94

0.95

0.94

0.95

0.98

0.98

0.98

0.97

0.98

0.98

0.98

0.94

0.96

0.97

0.96

0.97

0.96

0.96

0.94

0.93

0.92

0.89

0.88

0.85

0.84

Figure 9: Total power consumption relative to the reactive system.

5. RELATED WORKSince the 70s, software maintenance has been studied from

different perspectives: corrective, adaptive (reactive) andperfective [29]. In this paper we are focusing in the tem-poral characteristic of the adaptation. Research efforts inprediction include a large variety of domains such as: onlinefailure prediction[28, 32], resource and demand prediction[2, 16], and user behavior prediction[30], among others.

A key reference work with which we share conceptual sim-ilarities, is the one done by V. Poladyan [25] and later oncomplemented by S.W.Cheng et. al. in [8]. However, as itwas recognized by co-author D.Garlan in [13], their approachhas some limitations such as: a fixed set of reconfigurationstrategies, limitation to repair triggered by constraint vio-lations, which is a corrective adaptation category. Our ap-proach differ from this work by using a strategy focused onaggregate utility rather than instantaneous utility. In thesame keynote D.Garlan pointed out that in many cases it

may be better to do things before the problem occurs, byusing proactivity.

Epifani et. al. argue in [9] that it is possible to detector predict if a desired property is, or will be, violated bythe running implementation. They focus on properties suchas reliability and performance, using Discrete Time MarkovChains (DTMCs) and Queuing Networks (QNs). In our casewe evaluated eight different non-linear prediction models.Yet we share a clear separation between detection and pre-diction (failure detection and failure prediction in their case,fire detection and fire prediction in ours).

In the context of online failure predictions, failures arethe events that trigger adaptation [28, 32]. These eventscorrespond to failures such application-level exceptions andinfrastructure-level failures, changes in contextual settings(such as execution environment and usage context), changesin available services and their characteristics, and modifi-cations of business-level properties (e.g. key performance

Page 10: A Prediction-Driven Adaptation Approach for Self-Adaptive

Reac

tive

Sim

ple(

ever

y 1h

)Si

mpl

e(ev

ery

2h)

Sim

ple(

ever

y 3h

)Si

mpl

e(ev

ery

4h)

Sim

ple(

ever

y 5h

)Si

mpl

e(ev

ery

6h)

Sim

ple(

ever

y 7h

)Si

mpl

e(ev

ery

8h)

Sim

ple(

ever

y 12

h)Pr

edic

tive(

1)Pr

edic

tive(

2)Pr

edic

tive(

3)Pr

edic

tive(

4)Pr

edic

tive(

5)Pr

edic

tive(

6)Pr

edic

tive(

7)Pr

edic

tive(

1)U

Pred

ictiv

e(2)

UPr

edic

tive(

3)U

Pred

ictiv

e(4)

UPr

edic

tive(

5)U

Pred

ictiv

e(6)

UPr

edic

tive(

7)U

Pred

ictiv

e(1)

DPr

edic

tive(

2)D

Pred

ictiv

e(3)

DPr

edic

tive(

4)D

Pred

ictiv

e(5)

DPr

edic

tive(

6)D

Pred

ictiv

e(7)

DPr

edic

tive(

1)Di

Pred

ictiv

e(2)

DiPr

edic

tive(

3)Di

Pred

ictiv

e(4)

DiPr

edic

tive(

5)Di

Pred

ictiv

e(6)

DiPr

edic

tive(

7)Di0x

2x

4x

6x

8x

10x

12x

14x

16x

Fact

or re

lativ

e to

the

Reac

tive

syst

em(lo

wer

is b

ette

r)

1.00

0.00

0.72

2.76

12.38

15.34

9.24

24.28

43.93

43.89

2.34

1.72

1.35

1.40

1.40

1.37

1.51

1.02

1.00

0.95

0.99

0.98

0.98

0.98

2.33

1.70

1.39

1.38

1.37

1.39

1.53

2.33

2.64

2.68

2.74

2.81

3.03

3.46

Figure 10: Number of hours when a fire detected by the node was waiting for transmission to the datacollector. The number is relative to reactive system.

indicators). Adaptation requests (also known as adaptationrequirements or specifications) specify how the underlyingapplication should be modified upon the occurrence of theassociated event or situation. Reactiveness to this kind offailures is necessary yet often insufficient for some domains.Pro-activeness decreases the aftereffects of changes, or im-proves control of change propagation (e.g. in environmentmonitoring, safety-critical systems) [27, 17].

Resource prediction as conceived by [2, 16, 25] refers toestimating the available level of a resource in the near future,(e.g., in the next 10 seconds). Resource demand predictionrefers to the prediction of how much resource an applica-tion will consume in a particular setting. In our work weare interested in predicting resource needs and availabilitybut in predicting changes in internal and external contextinformation that may trigger adaptations.

Some criticism about predicting human behavior is thata person can change his mind from one day to another anddoes not necessarily take the same decision if is put in thesame conditions. We differ from [30], as we are focusing onpredicting environment behavior based on historical data,where is it easier to identify trend and seasonal components.

Typical self adaptive systems SAS based on model@runtimeare causally connected self-representations of the associatedsystem that emphasizes the structure, behavior, or goals ofthe system from a problem space perspective [22]. Howeverthey reason on current values of structure properties, be-havior, or goals. This kind of approach does not take intoconsideration previous history data, although it may explainoccurrences of rapidly changing conditions.

Hielscher et al. [17] proposed PROSA, an online testing-based proactive self-adaptation. Firstly, they aim at predict-ing new failures from past monitoring data, but their goalis to detect whether one specific failure that has been un-covered in on aService-Based Applications (SBA) could alsooccur in other SBA instances. Secondly, in [17] the authorsreject past monitoring data after a dynamic adaptation ofthe system. In doing this the system may fall into cyclicaladaptations without detecting it.

6. CONCLUSION AND FUTURE WORKThe proposed proactive approach is not restricted to the

case study we have chosen to evaluate but can be applied toa wide range of applications, namely applications with welldefined input parameters that can be represented as mathe-matical functions (e.g. forecasts of bandwidth demand andsupply), or critical systems with seasonal behavior (e.g. min-imizing power consumption when conditions are safe).

In this paper we evaluated the benefits of anticipating aproblem. The validation of our approach on the fire moni-toring case study have shown interesting results that confirmthe idea that pro-active adaptation based on predictive an-alytics is a promising research direction.

Indeed, the benefits of predictive analysis combined withproactive adaptation techniques out weights its overheadwhen compared with a purely reactive approach. However,our approach can be improved in several ways. One of thoseways is to draw more detailed energy consumption models.of wireless sensor networks. In the near future we would liketo explore the risk associated with the late reporting and itstrade-offs between those risks and the power usage.

We plan to investigate a distributed reasoning engine inplace of its current centralized version.

Another aspect worth considering is back-to-back adapta-tions, i.e when adapting a component in a system triggerschain reactions that causes further adaptations in other com-ponents. Complex problems may result from these chainreactions like infinite triggering of new adaptations or in-consistent configurations in different components. In futurework we plan to consider these scenarios.

7. ACKNOWLEDGMENTSThe research presented in this paper is supported by the

European Union within the FP7 Marie Curie Initial TrainingNetwork ”RELATE”under grant agreement number 264840.

Page 11: A Prediction-Driven Adaptation Approach for Self-Adaptive

8. REFERENCES[1] V. R. Basili. The role of experimentation in software

engineering: past, current, and future. In Proc. of the18th international conference on Software engineering,pages 442–449. IEEE Computer Society, 1996.

[2] S. Becker, H. Koziolek, and R. Reussner. The Palladiocomponent model for model-driven performanceprediction. Journal of Systems and Software,82(1):3–22, 2009.

[3] M. Berthold, C. Borgelt, and F. Hoppner. Guide tointelligent data analysis, volume 42. Springer, 2010.

[4] M. R. Berthold. Mixed fuzzy rule formation.International journal of approximate reasoning,32(2):67–84, 2003.

[5] M. R. Berthold and J. Diamond. Constructive trainingof probabilistic neural networks. Neurocomputing,19(1-3):167–183, 1998.

[6] G. E. Box, G. M. Jenkins, and G. C. Reinsel. Timeseries analysis: forecasting and control. Wiley, 2013.

[7] L. Breiman. Random forests. Machine learning,45(1):5–32, 2001.

[8] S.-W. Cheng, V. V. Poladian, D. Garlan, andB. Schmerl. Improving architecture-basedself-adaptation through resource prediction. InSoftware Engineering for Self-Adaptive Systems, pages71–88. Springer, 2009.

[9] I. Epifani, C. Ghezzi, R. Mirandola, andG. Tamburrelli. Model evolution by run-timeparameter adaptation. In IEEE 31st InternationalConference on Software Engineering, pages 111–121.IEEE, 2009.

[10] F. Fouquet, E. Daubert, N. Plouzeau, O. Barais,J. Bourcier, and J.-M. Jezequel. Dissemination ofreconfiguration policies on mesh networks. InDistributed Applications and Interoperable Systems,pages 16–30. Springer Berlin Heidelberg, 2012.

[11] F. Fouquet, B. Morin, F. Fleurey, O. Barais,N. Plouzeau, and J.-M. Jezequel. A dynamiccomponent model for cyber physical systems. In Proc.of the 15th ACM SIGSOFT symposium on ComponentBased Software Eng., pages 135–144. ACM, 2012.

[12] J. Gama. Functional trees. Machine Learning,55(3):219–250, 2004.

[13] D. Garlan. A 10-year perspective on softwareengineering self-adaptive systems (keynote). In Proc.of the 8th Int. Symposium on Software Engineering forAdaptive and Self-Managing Systems, pages 2–2. IEEEPress, 2013.

[14] A. Guazzelli, M. Zeller, W. Lin, and G. Williams.PMML : An Open Standard for Sharing Models. TheR Journal, pages 60–65, 2009.

[15] M. O. B. Guilherme Horta Travassos. Contributions ofin virtuo and in silico experiments for the future ofempirical studies in software engineering. In Proc. ofthe ESEIW 2003 Workshop on Empirical Studies inSoftware Engineering. IEEE Computer Society, 2004.

[16] N. R. Herbst, N. Huber, S. Kounev, and E. Amrehn.Self-adaptive workload classification and forecasting

for proactive resource provisioning. In Proc. of theACM/SPEC International Conference on PerformanceEngineering (ICPE), pages 187–198. ACM, 2013.

[17] J. Hielscher, R. Kazhamiakin, A. Metzger, andM. Pistore. A framework for proactive self-adaptationof service-based applications based on online testing.In Towards a Service-Based Internet, pages 122–133.Springer, 2008.

[18] S. S. Keerthi, S. K. Shevade, C. Bhattacharyya, andK. R. K. Murthy. Improvements to platt’s smoalgorithm for svm classifier design. NeuralComputation, 13(3):637–649, 2001.

[19] J. O. Kephart and D. M. Chess. The vision ofautonomic computing. Computer, 36(1):41–50, 2003.

[20] N. Landwehr, M. Hall, and E. Frank. Logistic modeltrees. Machine Learning, 59(1-2):161–205, 2005.

[21] T. Mitsa. Temporal data mining. CRC Press, 2010.

[22] B. Morin, O. Barais, J.-M. Jezequel, F. Fleurey, andA. Solberg. Models@ run. time to support dynamicadaptation. Computer, 42(10):44–51, 2009.

[23] B. Morin, O. Barais, G. Nain, and J.-M. Jezequel.Taming dynamically adaptive systems using modelsand aspects. In Proc. of the 31st InternationalConference on Software Engineering, pages 122–132.IEEE Computer Society, 2009.

[24] J. C. Platt. 12 fast training of support vectormachines using sequential minimal optimization. 1999.

[25] V. Poladyan. Tailoring Configuration to User’s Tasksunder Uncertainty. PhD thesis, Carnegie MellonUniversity, 2008.

[26] M. Riedmiller and H. Braun. A direct adaptivemethod for faster backpropagation learning: Therprop algorithm. In IEEE International Conference onNeural Networks, pages 586–591. IEEE, 1993.

[27] M. Salehie and L. Tahvildari. Self-adaptive software:Landscape and Research Challenges. ACMTransactions on Autonomous and Adaptive Systems,4(2):1–42, May 2009.

[28] F. Salfner, M. Lenk, and M. Malek. A survey of onlinefailure prediction methods. ACM Computing Surveys,42(3):1–42, Mar. 2010.

[29] E. B. Swanson. The dimensions of maintenance. InProc. of the 2nd international conference on Softwareengineering, pages 492–497. IEEE Computer SocietyPress, 1976.

[30] V. S. Tseng and K. W. Lin. Efficient mining andprediction of user behavior patterns in mobile websystems. Information and software technology,48(6):357–369, 2006.

[31] J. Wu and S. Coggeshall. Foundations of PredictiveAnalytics. Chapman & Hall/CRC data mining andknowledge discovery series. CRC PressINC, 2012.

[32] L. Yu, Z. Zheng, Z. Lan, and S. Coghlan. Practicalonline failure prediction for blue gene/p: Period-basedvs event-driven. In Dependable Systems and NetworksWorkshops (DSN-W), 2011 IEEE/IFIP 41stInternational Conference on, pages 259–264. IEEE,2011.