Contour Map Matching for Event Detection in Sensor Networks

Similar documents
3D Model Retrieval Method Based on Sample Prediction

Elementary Educational Computer

Pattern Recognition Systems Lab 1 Least Mean Squares

. Written in factored form it is easy to see that the roots are 2, 2, i,

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

CIS 121 Data Structures and Algorithms with Java Spring Stacks, Queues, and Heaps Monday, February 18 / Tuesday, February 19

1 Graph Sparsfication

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Structuring Redundancy for Fault Tolerance. CSE 598D: Fault Tolerant Software

Lecture 28: Data Link Layer

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method

Data diverse software fault tolerance techniques

Analysis Metrics. Intro to Algorithm Analysis. Slides. 12. Alg Analysis. 12. Alg Analysis

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming

Algorithms for Disk Covering Problems with the Most Points

On (K t e)-saturated Graphs

Improvement of the Orthogonal Code Convolution Capabilities Using FPGA Implementation

Hash Tables. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015.

Image Segmentation EEE 508

The Magma Database file formats

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13

The isoperimetric problem on the hypercube

Computational Geometry

Ones Assignment Method for Solving Traveling Salesman Problem

How do we evaluate algorithms?

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

A SOFTWARE MODEL FOR THE MULTILAYER PERCEPTRON

Security of Bluetooth: An overview of Bluetooth Security

Improving Template Based Spike Detection

Data Structures and Algorithms. Analysis of Algorithms

6.854J / J Advanced Algorithms Fall 2008

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

Performance Plus Software Parameter Definitions

Parallel Polygon Approximation Algorithm Targeted at Reconfigurable Multi-Ring Hardware

One advantage that SONAR has over any other music-sequencing product I ve worked

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

Numerical Methods Lecture 6 - Curve Fitting Techniques

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Evaluation scheme for Tracking in AMI

Announcements. Reading. Project #4 is on the web. Homework #1. Midterm #2. Chapter 4 ( ) Note policy about project #3 missing components

Accuracy Improvement in Camera Calibration

( n+1 2 ) , position=(7+1)/2 =4,(median is observation #4) Median=10lb

1. SWITCHING FUNDAMENTALS

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Analysis of Algorithms

Load balanced Parallel Prime Number Generator with Sieve of Eratosthenes on Cluster Computers *

Combination Labelings Of Graphs

Morgan Kaufmann Publishers 26 February, COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 5

condition w i B i S maximum u i

ECE4050 Data Structures and Algorithms. Lecture 6: Searching

Bayesian approach to reliability modelling for a probability of failure on demand parameter

Consider the following population data for the state of California. Year Population

Big-O Analysis. Asymptotics

Introduction. Nature-Inspired Computing. Terminology. Problem Types. Constraint Satisfaction Problems - CSP. Free Optimization Problem - FOP

An Improved Shuffled Frog-Leaping Algorithm for Knapsack Problem

Chapter 3 Classification of FFT Processor Algorithms

Basic allocator mechanisms The course that gives CMU its Zip! Memory Management II: Dynamic Storage Allocation Mar 6, 2000.

The Closest Line to a Data Set in the Plane. David Gurney Southeastern Louisiana University Hammond, Louisiana

Goals of the Lecture UML Implementation Diagrams

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

Graphs. Minimum Spanning Trees. Slides by Rose Hoberman (CMU)

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein

Analysis of Server Resource Consumption of Meteorological Satellite Application System Based on Contour Curve

CS200: Hash Tables. Prichard Ch CS200 - Hash Tables 1

An Efficient Algorithm for Graph Bisection of Triangularizations

IMP: Superposer Integrated Morphometrics Package Superposition Tool

Recursive Procedures. How can you model the relationship between consecutive terms of a sequence?

Our second algorithm. Comp 135 Machine Learning Computer Science Tufts University. Decision Trees. Decision Trees. Decision Trees.

Counting Regions in the Plane and More 1

Lecture 18. Optimization in n dimensions

arxiv: v2 [cs.ds] 24 Mar 2018

Fundamentals of Media Processing. Shin'ichi Satoh Kazuya Kodama Hiroshi Mo Duy-Dinh Le

Fast Fourier Transform (FFT) Algorithms

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1

FREQUENCY ESTIMATION OF INTERNET PACKET STREAMS WITH LIMITED SPACE: UPPER AND LOWER BOUNDS

The golden search method: Question 1

1.2 Binomial Coefficients and Subsets

15-859E: Advanced Algorithms CMU, Spring 2015 Lecture #2: Randomized MST and MST Verification January 14, 2015

Python Programming: An Introduction to Computer Science

Task scenarios Outline. Scenarios in Knowledge Extraction. Proposed Framework for Scenario to Design Diagram Transformation

Morgan Kaufmann Publishers 26 February, COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 5.

Lower Bounds for Sorting

MATHEMATICAL METHODS OF ANALYSIS AND EXPERIMENTAL DATA PROCESSING (Or Methods of Curve Fitting)

Harris Corner Detection Algorithm at Sub-pixel Level and Its Application Yuanfeng Han a, Peijiang Chen b * and Tian Meng c

Relay Placement Based on Divide-and-Conquer

Outline. Research Definition. Motivation. Foundation of Reverse Engineering. Dynamic Analysis and Design Pattern Detection in Java Programs

New HSL Distance Based Colour Clustering Algorithm

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS)

Heaps. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

Designing a learning system

Session Initiated Protocol (SIP) and Message-based Load Balancing (MBLB)

Speeding-up dynamic programming in sequence alignment

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0

Sorting in Linear Time. Data Structures and Algorithms Andrei Bulatov

Lecturers: Sanjam Garg and Prasad Raghavendra Feb 21, Midterm 1 Solutions

Alpha Individual Solutions MAΘ National Convention 2013

A Study on the Performance of Cholesky-Factorization using MPI

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Media Access Protocols. Spring 2018 CS 438 Staff, University of Illinois 1

Transcription:

Cotour Map Matchig for Evet Detectio i Sesor Networks Wewei Xue, Qiog Luo, Lei Che, Yuhao Liu Departmet of Computer Sciece Hog Kog Uiversity of Sciece ad Techology Clear Water Bay, Kowloo, Hog Kog {wwxue, luo, leiche, liu}@cs.ust.hk ABSTRACT May sesor etwork applicatios, such as object trackig ad disaster moitorig, require effective techiques for evet detectio. I this paper, we propose a ovel evet detectio mechaism based o matchig the cotour maps of i-etwork sesory data distributio. Our key observatio is that evets i sesor etworks ca be abstracted ito spatio-temporal patters of sesory data ad that patter matchig ca be doe efficietly through cotour map matchig. Therefore, we propose simple SQL extesios to allow users to specify commo types of evets as patters i cotour maps ad study eergy-efficiet techiques of cotour map costructio ad maiteace for our patterbased evet detectio. Our experimets with sythetic workloads derived from a real-world coal mie surveillace applicatio validate the effectiveess ad efficiecy of our approach.. INTRODUCTION May sesor etwork applicatios moitor evets i the physical world, such as disaster moitorig [3][29], habitat moitorig [9][27], idustrial process cotrol [] ad object trackig [2] [3][2]. A typical evet detectio mechaism i recet work o sesor databases is to set some thresholds for sesor readigs i a query [][2][29]. The ituitio is that, whe a evet occurs, there will be chages i the readigs of the sesors that are affected by the evet. For example, whe a object moves, the accelerometer attached to the object will report a icreased acceleratio readig. Based o this reasoig, a applicatio program usig thresholds will regard a evet has occurred whe the sesor readigs exceed the pre-defied thresholds. Although this threshold-based approach is simple i the implemetatio, it is usually difficult for users to specify suitable threshold values for their evets of iterest because these values deped o both the eviromet beig moitored ad the applicatio sematics. Moreover, thresholds aloe may be uable to fully specify a evet for some applicatios. For istace, i a coal mie surveillace applicatio that we are ivolved with, a gas leakage evet is characterized as the gas_desity sesor readigs at the source followig a gradual decreasig tred, which caot be easily captured by discrete threshold values. Therefore, we ivestigate a ew alterative for evet detectio i sesor etworks. Our proposed approach for evet detectio is based o the spatiotemporal patters i sesor readigs istead of simple thresholds. Our observatio is that, sice sesor etworks are deployed i a physical space ad sesor readigs are collected over time, the chages i the sesor readigs of etworked odes that are caused by a evet usually exhibit some spatio-temporal patter. This observatio has bee cofirmed by various field studies ad aalysis of real-world sesory datasets [][4] [23][27]. Now that we covert the evet detectio problem ito a patter matchig oe, the ext questio is how to solve the patter matchig problem i sesor etworks effectively ad efficietly. There has bee a great wealth of literature o patter matchig [2][28], but the challege is to seek a solutio that works for a resource-limited etwork i a distributed, real-time, ad eergyefficiet way. The solutio we fid is i cotour maps of sesory data distributio. A cotour map [5] of a attribute, e.g., temperature, for a sesor etwork is a topographic map that displays the distributio of the attribute value over the etwork. I the map, the geometric space occupied by the etwork is partitioed ito cotiguous regios, each of which cotais sesor odes of a rage of similar readigs. These regios are called cotour regios ad the boudaries of the regios are called cotour lies or cotours i short. We defie a sapshot of a cotour map, or a map sapshot i short, as the istace of the cotour map at a specific poit i time. Figure shows a sapshot of the temp cotour map (o the left) for a 2x2 etwork grid topology (o the right). The two cotour regios i differet colors represet differet temperature readigs. temp = 30 C 0 temp = 30 C Permissio to make digital or hard copies of all or part of this work for persoal or classroom use is grated without fee provided that copies are ot made or distributed for profit or commercial advatage ad that copies bear this otice ad the full citatio o the first page. To copy otherwise, or republish, to post o servers or to redistribute to lists, requires prior specific permissio ad/or a fee. SIGMOD 2006, Jue 27-29, 2006, Chicago, Illiois, USA. Copyright 2006 ACM -59593-256-9/06/0006 $5.00. 2 temp = 30 C 3 temp = 40 C Figure : Temperature cotour mappig o a 2x2 grid Cotour maps have bee show useful for a variety of sesor etwork surveillace applicatios [2][24]. They come aturally 45

to our work because they represet the sesory data distributio over time ad space. I our work, we propose eergy-efficiet techiques to costruct ad icremetally update a umber of 2-D cotour maps i a sesor etwork. Usig these cotour maps as buildig blocks, we defie evets based o the spatio-temporal patters exhibited i the cotour maps. More specifically, the spatial patter of a evet is captured by the cotours i a map whereas the temporal patter by the evolutio of the cotours over time. I our approach, a evet is detected whe a userspecified patter matches the recet sapshots of a cotour map that fall i a slidig widow. By this meas, we solve the patter matchig problem, i tur the problem of evet detectio i sesor etworks, through cotour map matchig. Sice evets i the physical world are of a great variety, we use a real-world coal mie surveillace applicatio as a case study for our work. I this applicatio, hudreds of sesor odes are deployed throughout the chaels i the mie to measure the desity of oxyge, gas ad dust as well as the temperature, humidity ad structural itegrity i the mie. For the safety of the workers, there are two commo classes of evet-detectio tasks i the applicatio: Gas, dust ad water leakage detectio. The coal mie maager wats to be otified immediately wheever the diggig machies reach a source of gas, dust or udergroud water i the mie ad a large amout of the substace breaks out. Oxyge desity moitorig. A worker patrollig i the mie eeds to fid a earby spot of a high oxyge desity to take a break from time to time. I additio, the maager requires the detectio of regios of a low oxyge desity. We have idetified ad defied three commo types of evets for this applicatio i additio to a geeral patter-based defiitio for evets. Each type of evet is specified usig a set of parameters that describe the shapes of the cotours i the map, icludig the pyramids, the faults, ad the islads. We have made simple SQL extesios to specify these types of evets as user-defied methods ad desiged efficiet algorithms to implemet these methods i our evet-orieted query processor. Fially, we have evaluated our approach usig sythetic workloads that are derived from the applicatio. The remaider of this paper is orgaized as follows. We describe the i-etwork costructio ad icremetal update of the cotour maps i Sectio 2. We give our patter-based evet specificatio i Sectio 3. I Sectio 4, we briefly preset the desig of our evetorieted query processor, maily o the query executio ad the algorithms for cotour map matchig. I Sectio 5, we preset a performace study of our approach usig sythetic workloads derived from the real-world coal mie surveillace applicatio. We discuss related work i Sectio 6 ad coclude the paper i Sectio 7. 2. CONTOUR MAPPING I this sectio, we describe cotour maps, the buildig blocks of our patter-based evet specificatio. Our approach to cotour mappig is to costruct ad icremetally update a cotour map hop by hop from bottom up i the etwork as a special kid of data aggregatio [2][8][29], rather tha collectig all sesor readigs ad trasmittig them to a server (i.e., the base statio) to costruct the map cetrally. The motivatio is that, for curret geeratio batterypowered sesor odes, power is the most limited resource ad the commuicatio cost o wireless radio chael is the domiatig factor of power cosumptio. For istace, o the widely-used Crossbow MICA2 motes [6], the cost of trasmittig a bit is about that of executig,000 istructios [9]. As a result, i-etwork cotour mappig is more eergy-efficiet tha a simple, cetralized approach. Sectio 2. describes the i-etwork costructio of a cotour map ad Sectio 2.2 the icremetal update of the map. The spatial iterpolatio o a radom etwork topology is described i Sectio 2.3. I the remaider of the paper, we use the two terms sesor readig ad attribute value iterchageably. 2. I-Network Map Costructio I this paper, we assume a statioary sesor etwork ad the base statio kows each ode s locatio i 2-D Cartesia coordiates. This locatio iformatio ca be either measured maually, or acquired by special hardware, such as a GPS module, attached to a ode. Moreover, as i the work by Hellerstei et al. [2], we impose a rectagular m grid with the square cell legth l o the etwork topology. Each cell of the grid has at most oe ode iside but ot o the cell boudaries. The grid iformatio (i.e., the values of m, ad l) is produced at the base statio ad is dissemiated throughout the etwork. Subsequetly, each ode i the etwork ca calculate which grid cell it lies i. Because wireless radio chaels are ureliable, we adopt a multipath, rig-based routig scheme [4][20] for our i-etwork map costructio istead of usig a sigle-path, tree-based routig scheme [8][9][29]. I this multi-path routig scheme, the data trasmitted by a ode is received by ad processed o every eighbor of the ode that is oe hop closer to the sik ode. We call these eighbors the parets of the ode ad the eighbors that are oe hop farther from the sik the childre of the ode. The same as i sigle-path routig, a ode i multi-path routig eeds to trasmit its data oly oce i a sample period. 2.. Partial Map Aggregatio I our i-etwork cotour map costructio, the data aggregate geerated ad trasmitted by a ode is the cotour map of a subetwork rooted at the ode. We call this data a partial map. A partial map of a ode cosists of a set of disjoit cotour regios. As show i Figure 2, each cotour regio is a orthogoal polygo i 2-D plae i our grid settig. A orthogoal polygo is a polygo whose edges are i parallel with either the x-axis or the y-axis. Two cotour regios overlap if their itersectio has a o-zero area [22]. Regios that do ot overlap are disjoit. We say that two disjoit regios are adjacet if they have oe or more coicidet edges (Figure 2 (a)). ot adjacet adjacet overlappig (a) Adjacet ad overlappig regios (b) Regios with holes Figure 2: Example cotour regios A 2-D polygoal cotour regio is stored as a liked list [22] i a partial map. Each elemet i the liked list is a array of vertices. 46

The first array i the liked list cotais the vertices o the outer boudary of the regio i a couterclockwise order. Each of the other arrays cotais the vertices i a clockwise order o a ier boudary of the regio, i.e., the boudary of a hole (Figure 2 (b)). Each vertex i a array is stored as a pair of x-y coordiates. The map costructio starts from each ode geeratig a partial map of its ow. The partial map cotais a sigle cotour regio uit, which is the grid cell of the ode. After a ode receives the partial maps from all childre, it puts each cotour regio i these partial maps ad its ow ito a ew set P w. We call P w the workig partial map of the ode. Next, the ode merges each pair of adjacet/overlappig regios i P w that satisfies some criterio. The mergig repeats util o pair of adjacet/overlappig regios i P w ca be merged. We call the partial map geerated at the ed of this mergig the fial partial map of the ode, deoted as P f. The P f is trasmitted to the parets of the ode by broadcast. Such partial map aggregatio o a ode requires oly simple operatios o the polygoal cotour regios. Three mai classes of operatios ivolved are [22]: () Area calculatio. Compute the area of a polygo usig the coordiates of the vertices. (2) Relatioship checkig. Idetify whether two polygos overlap or are disjoit. If two polygos overlap, check whether they are exactly the same, oe is cotaied i the other, or otherwise. If two polygos are disjoit, check whether they are adjacet. (3) Boolea operatios. Compute the uio, itersectio ad differece of two polygos. There are may existig algorithms i the literature for these basic polygo operatios [22]. The small computatio overhead ad storage requiremet of these algorithms make them applicable to curret geeratio resource-limited sesor odes. A crucial problem we have omitted so far is what criterio we should adopt for a ode to determie whether two adjacet or overlappig cotour regios i P w ca be merged or ot. The aggregatio performace will be poor if we oly merge regios that cotai odes havig the same attribute value. Moreover, this criterio is ulikely to improve the mappig accuracy because readigs sampled by physical sesors are itrisically ureliable [29]. Aother alterative is to divide the rage of attribute value ito a umber of equal-width buckets ad merge regios that are i the same bucket [2]. (a) (b) Figure 3: Adjacet cotour regios with differet relative size The major drawback of these criterios is that they oly cosider the attribute value but igore aother importat factor, the area of a regio. Combiig regio area with attribute value, we are able to capture the users tradeoff betwee the mappig accuracy ad the commuicatio cost i a more flexible way. For istace, it is usually reasoable to merge a tiy cotour regio ito a eighbor whose area is relatively much larger (Figure 3(a)), eve if there is a large differece betwee the attribute values of odes i these two regios. This mergig saves commuicatio cost of the tiy regio without affectig the mappig accuracy much. I cotrast, from some users perspective, it may be udesirable to merge two adjacet regios whe each of them has already occupied a large portio of the grid space (Figure 3(b)), eve if the attribute values of the odes i these two regios do ot differ much. Addressig the drawback, we desig a criterio for cotour regio mergig that takes both the attribute value ad the regio area ito accout. The criterio uses two user-specified parameters: () a error boud ε (0, ), ad (2) a mergig limit p (0, ]. ε specifies the maximum degree of iaccuracy that the user ca tolerate for the cotour map costructed. p is the maximum area of the regio to be merged i terms of the percetage of the grid area. The values of these two parameters are provided by the user i the query specificatio. ε is madatory ad p is optioal with a default value of oe. A liear regressio model v = f( = c 0 + c x + c 2 y [25] is built for each cotour regio i a partial map. I the model, v is the sesor readig of a ode at locatio ( ; c 0, c, ad c 2 are the model coefficiets ad, y are the set of basis fuctios of the model. Cosider a regio that cotais odes whose locatios ad sesor readigs are (x, y ), (x 2, y 2 ),, (x, y ) ad v, v 2,, v ( 3) respectively. The coefficiets of the model for the regio ca be computed by solvig the matrix equatio: Aw = b () T where A = V V = xi yi xi 2 xi xiyi vi c0 v w = c, b = V T f = vixi ad f = v2. 2 c viy v3 i yi x y xiyi, V x2 y2 = M M M, 2 yi x y Whe the iitial partial map that cotais a sigle regio uit is geerated by a ode, the matrices w, A ad b i the liear regressio model built for the regio are stored with the regio i additio to a error boud that has a value of zero. To esure that the matrix A is o-sigular [25], the model is built usig three locatio-attribute pairs (x, y, v), (x 2, y 2, v) ad (x 3, y 3, v). (x, y ) ad v are the locatio ad attribute value of the ode; (x 2, y 2 ) ad (x 3, y 3 ) are two differet locatios that are radomly picked iside the regio uit ad are ot equal to (x, y ). Later, i the partial map aggregatio o a ode, the error boud ε ij of mergig a pair of adjacet/overlappig regios (R i, R j ) i P w is computed usig Equatios (2)-(4): ε ij = ( εij' + εij")( + αij) (2) ( fij( fi( ) dσ + ( fij( fj( ) dσ Ri Rj ε ij' = fi( dσ + fj( dσ (3) Ri Rj 47

εi fi( dσ + εj fj( dσ Ri Rj ε ij" = (4) fi( dσ + fj( dσ Ri Rj I the equatios, f i (, σ i ad ε i are the regressio fuctio, area ad error boud of regio R i, ad f j (, σ j ad ε j are those for regio R j. f ij ( is the regressio model built o R i R j. To compute the coefficiet vector w ij of f ij ( usig Equatio (), we set A ij ad b ij i the equatio as follows [25]: A ij = A i + A j (5) b ij = b i + b j (6) where A i, b i are the matrices stored with regio R i, ad A j, b j are those of R j. α ij i Equatio (2) is a pealty factor computed usig Equatio (7). σ grid = l 2 m is the area of the grid. mi( σi, σj) p σ grid α = max( 0, ) (7) p σ grid Note that f ( dσ correspods to the volume of the 3-D R cylidroid that is beeath the surface f( over regio R [5]. Cosequetly, Equatio (2) estimates the error boud ε ij of mergig the pair of regios (R i, R j ) as the accumulatio of the errors derived from two sources: the percetage of variatio i the cylidroid volume over each regio (ε ij ' i Equatio (3)), ad the previous degree of error iherited from each regio (ε ij " i Equatio (4)). I the worse case, the value of ε ij for some pair of regios (R i, R j ) computed usig Equatio (2) may exceed oe. However, i this case the two regios are impossible to be merged so that o problem is icurred. The regressio model ca be easily exteded to use polyomial of a higher degree if ecessary [25]. Moreover, we ca adopt ay model that is guarateed to be cotiuous over a arbitrary cotour regio ad ca be icremetally recomputed i a way similar to Equatios (5)-(6). After givig the equatios to estimate the mergig error boud, we preset the procedure of cotour regio mergig i the partial map aggregatio o a ode i Algorithm. The algorithm calls the fuctio checkmergig to examie whether a pair of regios i P w ca be merged or ot. I this fuctio, the error caused by a mergig must ot exceed the user-specified ε, ad the size of the uio of the two regios must be smaller tha the sum of their sizes (Lie 2 i Fuctio checkmergig). This is because a large fial partial map P f requires a large commuicatio cost so that its size should be reduced as much as possible to save the eergy. sizeof(r) returs the total umber of bytes of R stored i the partial map. This size is proportioal to the total umber of vertices o all boudaries of R. Algorithm merges regios i P w pair by pair i a decreasig order of the mergig beefit. The beefit of mergig a pair of regios (R i, R j ) is the iverse of ε ij / Δ ij. The ituitio is that, the smaller the error boud ε ij of the merged regio ad the larger the size reductio Δ ij achieved by the mergig, the larger the mergig beefit. After two regios are merged ito a ew regio, the ew regio is immediately checked to see whether it ca be further merged with other regios i P w (Lie 9). The process repeats util o more adjacet/overlappig regios i P w ca be merged. Algorithm Cotour Regio Mergig Iput: the workig partial map P w Output: the fial partial map P f : build a empty balaced biary search tree T; 2: for each R i ( i < ) i P w do /* is the umber of regios i P w */ 3: for each R j (i < j ) i P w do checkmergig(r i, R j, T); 4: while T is ot empty do 5: extract ode a from T that has the smallest key value; 6: merge the pair of regios (R i, R j ) that a poits to ito a regio R; 7: delete all odes i T that poit to either R i or R j ; 8: remove R i ad R j from P w ; 9: for each R k i P w do checkmergig(r, R k, T); 0: isert R ito P w ; /* the liear regressio model ad error boud of : while true do R are f ij ( ad ε ij correspodigly */ 2: radomly select a pair of overlappig regios (R i, R j ) i P w ; 3: if there is o such pair the break; /* exit the loop */ 4: r i = sizeof(r i R j ) + sizeof(r j ); r j = sizeof(r j R i ) + sizeof(r i ); 5: if r i < r j the R i = R i R j ; else R j = R j R i ; 6: retur P f = P w ; Fuctio checkmergig(r i, R j, T) : if R i ad R j overlap or are adjacet the 2: if ε ij ε ad (Δ ij = sizeof(r i ) + sizeof(r j ) sizeof(r i R j )) > 0 the 3: isert a ode i T that has key value of ε ij / Δ ij ; 4: store a poiter to each of R i ad R j with the ode; There may be overlappig regios i P w that caot be merged with each other accordig to our mergig criterio. However, we eed to esure every two regios i P f are disjoit so that there is o duplicate i the cotour map costructed. To solve this problem, we remove the itersectio of two overlappig regios that are omergeable from oe of them so that the total size of the two regios is smaller after such removal (Lies -5 i the algorithm). The itersectio is radomly removed from a regio if the size reductio is the same for both regios. 2..2 Size Reductio of Partial Maps The fial partial map P f output by Algorithm o a ode is usually of a large size. Each boudary of a cotour regio i the map cosists of a sequece of ( value pairs ad all these legthy pieces of iformatio must be ecapsulated ito the radio packets ad trasmitted to the paret of the ode i multi-path routig. I order to save the commuicatio cost i this trasmissio, we adopt two techiques to reduce the size of P f o each ode. Oe techique is a scheme to compress the cotours i the map ad the other a optimizatio of the map trasmissio based o packet soopig. They both trade more computatio cost for potetially less commuicatio cost. First, we use a scheme o each ode to compress P f before the ode trasmits it to the parets. The compressio scheme icludes two steps. I the first step, the ode checks each cotour regio with holes i P f to see whether ay ier boudary of the regio is the outer boudary of aother regio i P f. If this is true, the ier boudary of the first regio is replaced by a poiter to the outer boudary of the secod regio. By this meas, oly oe copy of every cotour lie i the map eeds to be trasmitted. The secod step of the compressio scheme is based o a ice property of the cotour regios i our sceario, which is all edges of a regio are orthogoal. Suppose there are totally vertices V, V 2,, V ( 4) o a regio boudary. Because the vertices are stored 48

i a specific order, we ca reduce oe half of the size of the boudary by storig the vertices V, V 3,, V - oly. Later whe the whole boudary eeds to be recovered i the cotour regio mergig, the vertex v 2i ( i /2) ca be uiquely idetified by v 2i- ad v 2i+ based o the couterclockwise or clockwise order of the triple of vertices (v 2i-, v 2i, v 2i+ ) [22]. I additio to the cotour compressio scheme, we adopt a simple optimizatio based o packet soopig [8] for the trasmissio of P f o a ode. The motivatio of this optimizatio is that the packet size i a sesor etwork has a limit L that is determied by the hardware or etwork protocols. Cosequetly, if the size of P f o a ode is larger tha L, the ode has to divide the map ito multiple packets for trasmissio. This case is very likely to happe whe the sesor readigs vary sigificatly alog space, which causes the fial partial map o a ode to cosist of may small regios that caot be merged. Note that a variable umber of packets per partial map does ot affect the sychroizatio of the multi-path routig rig [4][20], because all packets for a partial map o a ode are still trasmitted withi the fixed epoch allocated for the level i the rig that the ode belogs to. The soopig-based optimizatio is executed i parallel with the data trasmissio o each ode. A ode trasmits its whole P f i a sigle packet if the size of P f is ot larger tha L. Otherwise, the ode sorts the cotour regios i P f i a icreasig order of their areas ad trasmits as may regios ahead i the order as possible i a packet. The ode the removes all trasmitted regios from P f ad soops o the packets that are trasmitted by the eighbors i the same hop. For each such packet P f sooped, the ode removes each utrasmitted regio i P f that is cotaied i some regio i P f. Next the ode begis a secod roud of trasmissio ad the trasmissio iteratio repeats util P f becomes empty o the ode. I each roud of the iteratio, if L is smaller tha the size of ay regio i P f, the ode trasmits a regio with the smallest size i multiple packets. This techique is feasible because multiple-path routig produces duplicate packets. As a result, small cotour regios i the fial partial map of a ode may have bee aggregated ito larger oes o the same-hop eighbors. The trasmissio of these small regios o a ode ca be suppressed if the ode detects that they are cotaied i some large regios o the same-hop eighbors of the ode ad that they have bee trasmitted by the eighbors. 2.2 Icremetal Map Update Our compressio techiques reduce the size of a partial map, but it is still cosiderable. Moreover, i real-world surveillace applicatios, evets are rare [9] ad sesor readigs are mostly uchaged or oly slightly chaged over time [4]. Cosequetly, cosecutive map sapshots costructed for these evets are extremely similar ad icremetal updates of the maps could save a large amout of eergy. I cotrast, if we blidly recostruct a ew map sapshot i every sample period of a cotiuous query, the eergy of the odes i the etwork will be depleted quickly due to the heavy commuicatio cost. Motivated by this observatio, we propose a icremetal update scheme to maitai a cotour map after the first map sapshot has bee costructed. This scheme is show i Algorithm 2. I the algorithm, each ode stores its workig partial map P wo ad fial partial map P fo i the previous sample period. The ode the geerates its fial partial map P f i the curret sample period based o P wo, P fo ad its workig partial map P w i this period. Algorithm 2 computes P f o a ode by callig Algorithm with a partial map P as the iput (Lie 5). P cosists of three sets of cotour regios: () the regios i P wo that correspod to the update uits i P w (Lies 2-6), (2) the regios i P w (Lie 7), ad (3) the regios i P wo that do o overlap ay of those i () ad (2) set by the same child (Lies 8-4). It cotais all iformatio a paret ode gets from its childre i the curret sample period, ad the iformatio obtaied i the previous sample period that ca be reused. If a ode detects a regio i P f is the same as a regio i P fo, the regio i P f is replaced by a update uit before the trasmissio of P f. The update uit cotais the ew error boud, regressio model ad the leftmost vertex o the outer boudary of the regio (Lies 2-22). By this meas, we save the commuicatio cost of the legthy boudaries of the regio. The leftmost vertex o a polygoal boudary is the oe that has the smallest x-coordiate amog all vertices o the boudary. If there are multiple vertices have the same smallest x-coordiate, we defie the leftmost vertex as the upper oe amog them. The update uit ca eve be removed if the regressio model of the correspodig regio has ot chaged ad the error boud has ot icreased (Lie 23). Algorithm 2 Icremetal Update of Partial Map Iput: the workig ad fial partial maps P wo ad P fo i the previous sample period, the workig partial map P w i the curret sample period Output: the fial partial map P f i the curret sample period : P = ; 2: for each update uit U i P w do 3: fid R i i P wo set by the same child Ch as U that U.p is the leftmost vertex o the outer boudary of R i ; 4: if R i is missig i P wo the request R i from Ch; 5: ε i = U.ε; f i ( = U.f; /* ε i ad f i ( are the error boud ad 6: isert R i ito P; liear regressio model of R i */ 7: for each regio R i i P w do isert R i ito P; 8: for each regio R i i P wo do 9: missig = true; 0: for each regio R j i P do : if R i ad R j are ot set by the same child the cotiue; 2: if R i R j the 3: missig = false; break; 4: if missig the isert R i ito P; 5: P wo = P; call Algorithm usig P as the iput; 6: for each regio R i i P f do 7: origi = false; 8: for each regio R j i P fo do 9: if R i = = R j the 20: origi = true; create a ew update uit U; 2: U.ε = ε i ; U.f = f i ( ; 22: U.p = the leftmost vertex o the outer boudary of R i ; 23: if R i.f R j.f or R i.ε > R j.ε the isert U ito P f ; 24: break; 25: if origi the remove R i from P f ; 26: P fo = P f ; retur P f ; Whe a paret ode receives a update uit from a child, the correspodig regio of the uit is located from the paret s P wo via the leftmost vertex stored i the update uit. It is possible that the regio caot be foud i P wo of the paret, because of the 49

trasmissio failure from the child to the paret i the previous sample period. I this case, the paret gets back the regio from the child by a request message (Lie 4). Note that a paret ode ca easily idetify which regio i its P wo is from which child by attachig the id of the child that set the regio to the ode. The algorithm fially updates P wo ad P fo to P to P f, respectively. 2.3 Spatial Iterpolatio o Radom Network Topologies The topology of a sesor etwork i practice is usually a radom coected graph istead of a grid. Whe we establish a grid o top of a radom topology, some cells i the grid may be empty. These empty cells will ot be ivolved i the i-etwork cotour map costructio, because oe of them have a ode iside. This absece of some cells makes the fial partial map P sf output by the sik icomplete, i.e., the uio of all regios i P sf covers oly part of the etire grid. This problem will also occur o a grid topology if the partial maps of some odes are lost due to the ureliability of radio trasmissio. To make P sf, the fial partial map at the sik, always complete regardless of the etwork topology ad packet loss, we perform spatial iterpolatio o P sf. The iterpolatio is a iterative process. I each iteratio, a grid cell c that is ot cotaied i ay regio i P sf but is adjacet to some regio i P sf is idetified. The for each regio R i P sf adjacet to c, the value d = max(0, max mi max o mi o ) is computed for R. max o ad mi o are the maximum ad miimum values of the regressio fuctio of R over regio R; max ad mi are those of the fuctio over regio R c. c is fially merged ito the adjacet regio i P sf that has the smallest d value. The merged regio iherits the regressio model ad error boud of the origial regio i P sf. The iteratio stops whe each cell i the grid is cotaied i some regio i P sf. 3. PATTERN-BASED EVENT SPECIFICATION Havig preseted the costructio ad maiteace of cotour maps, we defie the evets ad evet-drive queries studied i our work. 3. Defiitios I our patter-based approach, a evet is specified as a kid of spatio-temporal patter i a cotour map of a attribute, as give i Defiitio. Defiitio. [Evet] A evet is a time series E = ((t, P ), (t 2, P 2 ),, (t, P )) with a equal time iterval Δt betwee ay two cosecutive elemets. Each elemet P i = (R i, R i2,, R im ) i the time series is a user-specified partial map of attribute A o a sesor etwork topology ( i ). Each cotour regio R ij i P i is associated with a sigle attribute value v ij ( j i m ). T = t t is called the evet duratio. We say a sapshot C of the cotour map of A matches P i if ad oly if every regio i P i matches its overlappig regios i C withi a user-specified cofidece level ( α) (0, ). We say the cotour map of A matches E at time t if ad oly if for each P i, it matches the sapshot C i of the cotour map of A at time t Δt ( i). t is called the time of evet detectio. This defiitio requires a user to give a specific time series of partial maps as the spatio-temporal patter geerated by a evet. I each sample period of the query that moitors the evet, this use-specified patter is compared with the sapshots of a cotour map to determie whether the evet has occurred. Δt i the defiitio is the legth of the query sample period. The reaso we oly cosider a cotour map of oe attribute i the defiitio is to make the structure of a evet as simple as possible. Moreover, we oly require partial maps istead of complete map sapshots from the user so that the user does ot eed to cosider the regios i the grid that are of o iterest. A drawback of our evet defiitio is that, if a user does ot have perfect kowledge about a evet, the user may ot be able to specify the value distributio of a attribute over space ad the variatio of this distributio over time icurred by the evet. As a first attempt to address this limitatio, we further defie three commo types of evets that we observe i several sesor etwork applicatios, especially the coal mie applicatio that we described i the Itroductio. Each type of evet correspods to a rough shape i a cotour map ad is specified usig a set of parameters to fix the relative positios ad values of the cotour regios i the shape. To distiguish from these commo evets, we call the evets defied by Defiitio geeral evets i the remaider of the paper. Figure 4 shows the shapes i the cotour map icurred by the three types of evets, which we call the pyramid, the fault, ad the islad respectively. (a) Pyramid (b) Fault (c) Islad Figure 4: Illustratio of three commo types of evets Ituitively, a pyramid evet geerates a cotiuous, gradual icreasig or decreasig tred of attribute value i all directios origiated from a small regio i the space. For istace, whe the gas begis to leak i the coal mie, the cotour map of the gas_desity attribute matches a decreasig pyramid evet, with the imost regio of the evet i each map sapshot cotaiig the source of the leakage. Differet from a pyramid evet, a fault evet correspods to a sudde ad large chage i the level of the attribute value i the space. For istace, whe the udergroud water begis to leak i the coal mie, the humidity map matches a fault evet. Oe regio ivolved i the evet defiitio suffers from the water leakage but the other does ot. Note that water leakage is differet from gas leakage i that the chage i humidity does ot occur i all directios as that i the gas_desity attribute does. Differet from both pyramids ad faults, a islad evet correspods to a regio i the space that has a cosistetly large or small level of the attribute value. For istace, whe a worker i the coal mie wats to fid a place of a high oxyge level to take a break, it correspods to detectig a large-valued islad evet i the oxy_desity map. I the followig, we give the formal defiitios of these three types of evets. 50

Defiitio 2. [Pyramid Evet] Give a user-specified bucket size k, a sapshot C of the cotour map of attribute A matches a icreasig pyramid evet if ad oly if a list of cotour regios P = (R, R 2,, R ) i C satisfies the followig four coditios: () Each regio R i i P is associated with a bucket, i.e., it correspods to a rage of attribute values [b i k, (b i + ) k) ( i ). b i 0 is a iteger ad b i+ b i. R is called the imost regio ad R the outmost regio of the pyramid evet. (2) R i is a hole i R i+ ad the ratio of their areas σ i / σ i+ sf. sf (0, ) is a user-specified scalig factor. (3) σ σ. σ > 0 is a user-specified area boud. (4) N. N > is a user-specified estig level. Give a user-specified evet duratio T, we say the cotour map of A matches a icreasig pyramid evet at time t if ad oly if every sapshot of the cotour map fallig ito the iterval [t T, t] matches a icreasig pyramid evet, ad the imost regios of the evet foud i ay two cosecutive map sapshots have a overlappig area of at least σ ( α). ( α) (0, ) is a userspecified cofidece level. t is called the time of evet detectio. A decreasig pyramid evet is defied symmetrically by replacig b i+ b i with b i+ b i i Coditio (). Note that we do ot require the value of each b i i Defiitio 2 to be fixed by the user. It ca be ay iteger as log as the coditio b i+ b i ( i ) is satisfied. Defiitio 3. [Fault Evet] Give a user-specified bucket size k, a sapshot C of the cotour map of attribute A matches a fault evet if ad oly if two cotour regios R ad R 2 i C satisfy the followig three coditios: () R is associated with the bucket [b k, (b + ) k) ad R 2 the bucket [b 2 k, (b 2 + ) k). b, b 2 0 are two itegers ad b 2 b Δ. Δ is a user-specified degree of differece. (2) R ad R 2 are adjacet. The coicidet polygoal curve o their outer boudaries has a legth of at least N l. N is a userspecified umber of coicidet cell edges. l is the width of a cell. (3) The areas of the two regios σ σ ad σ 2 σ. σ > 0 is a userspecified boud of area. Give a user-specified evet duratio T, we say the cotour map of A matches a fault evet at time t if ad oly if every sapshot of the cotour map fallig ito the iterval [t T, t] matches a fault evet, ad the correspodig regios of the evet i ay two cosecutive map sapshots have a overlappig area of at least σ ( α). ( α) (0, ) is a user-specified cofidece level. t is called the time of evet detectio. Defiitio 4. [Islad Evet] Give a user-specified threshold value τ > 0, a sapshot C of the cotour map of attribute A matches a large-valued islad evet if ad oly if a cotour regio R ca be foud i C that satisfies the followig two coditios: () R is associated with a rage of attribute values [τ, + ). (2) The area of R is ot smaller tha σ. σ > 0 is a user-specified area boud. Give a user-specified evet duratio T, we say the cotour map of A matches a large-valued islad evet at time t if ad oly if every sapshot of the cotour map fallig ito the iterval [t T, t] matches a large-valued islad evet, ad the regios of the evet i ay two cosecutive map sapshots have a overlappig area of at least σ ( α). ( α) (0, ) is a user-specified cofidece level. t is called the time of evet detectio. A small-valued islad evet is defied symmetrically by replacig [τ, + ) with (, τ] i Coditio (). Fially, we ote that eve though there are a umber of userspecified parameters i the defiitios, most of the parameters have default values i our implemetatio. As a result, whe users use these evets i the form of system-provided fuctios, their effort is miimized. 3.2 Evet-Drive Queries Based o the defiitios of the evets, we exted a existig SQL-style sesor query laguage [9][29] to support the specificatio of our patter-based evet detectio. We ecapsulate the geeral evets ad the three commo types of evets as system built-i Boolea methods. The four methods are evet(mapsapshot, coffile), pyramid(mapsapshot, coffile), fault(mapsapshot, coffile) ad islad(mapsapshot, coffile), correspodigly. The first parameter of each method is a sapshot of a cotour map. The secod parameter is the pathame of a XML cofiguratio file give by the user. This file lists the sequece of partial maps that defie a geeral evet, or the values of the parameters that defie a commo evet. A method returs true whe the cotour map matches the use-specified patter at the curret time; otherwise it returs false. All of these methods are used i the WHERE clause of a SQL query. Multiple methods that are evaluated o differet cotour maps ca be coected by the AND/OR SQL keywords to specify complex relatioships betwee evets. We call queries that are embedded with oe or more of these methods evet-drive queries. The SELECT clause of a evet-drive query may cotai attributes, SQL aggregates as well as user-defied fuctios. Two example evet-drive queries are listed as follows: Query : SELECT c.sapshot FROM cotour_map(temp,0.2, 0.5) c WHERE evet(c.sapshot, fire_emergecy.xml ) SAMPLE PERIOD 0 sec Query 2: SELECT FROM WHERE alarm() cotour_map(gas_desity,0.3) c pyramid(c.sapshot, gas_leakage.xml ) As show i these two example queries, the costructio of a cotour map used by some evet is specified i the FROM clause usig the table-valued fuctio cotour_map(attribute,ε, p). The first parameter of this fuctio is the attribute of the map, ad the latter two are the user-specified parameters ε ad p for the map costructio. Note that p is optioal, as show i Query 2. Similar to the sesors table [9], each cotour_map fuctio defies a virtual table for the query. The table cotais two mai fields, timestamp ad sapshot. sapshot is the map sapshot at timestamp. A list of cotour_map fuctios, possibly o differet attributes, ca appear i the FROM clause of a sigle query. 5

4. EVENT-ORIENTED QUERY PROCESSING Give the patter-based evet specificatio, we ow preset our evet-orieted query processig framework. We focus o how the system built-i methods are hadled durig the executio of cotiuous queries (Sectio 4.) ad the algorithms for cotour map matchig (Sectio 4.2). 4. Query Executio Query executio i our framework is evet-orieted. Whe a ew evet-drive query is issued by a user, the query text ad the parameters for each cotour_map fuctio i the query are parsed ito a query message. The message is the ijected ito the sesor etwork. Whe the query message is received by a ode, the distributed query processor o the ode geerates a sub-query evaluatio pla based o the iformatio ecapsulated i the message ad begis to execute the pla. The sub-pla of a query o a ode is i charge of the i-etwork cotour map costructio. After the query has bee istalled o the odes, the cotour maps i the query are costructed i the first sample period ad are icremetally updated i the subsequet periods. I the case that a map of the same attribute is already beig used by other ruig queries, oe sapshot of the map will be aggregated i the etwork every miimum sample period of these multiple queries, ad the aggregatio uses the miimum ε ad p values of those of the multiple evet methods. By this meas, multiple cocurret queries share a sigle costructio ad maiteace procedure of a cotour map. This cotour map sharig amog multiple queries saves the eergy cosumptio sigificatly while preservig the requiremet of all queries o evet detectio accuracy. This beefit is achieved by usig a liear regressio model for cotour regio mergig rather tha usig equal-width buckets [2] i the i-etwork cotour mappig. For example, if two queries share a cotour map usig equal-width buckets of sizes k ad k 2, the map must be costructed usig a bucket size k = gcd(k, k 2 ). However, eve if both k ad k 2 are large, k may be small so that the aggregatio performace will be poor (e.g., k = 30, k 2 = 00, ad k = 0). I cotrast, usig a liear regressio model, the map is costructed i a way idepedet of the bucket size of each query. I additio to the sub-query plas o the odes, a mai evaluatio pla is geerated for a query at the base statio. The mai pla is resposible for evet detectio accordig to the cofiguratio files of the methods i the query. Each method is implemeted as a data structure i this mai pla. The structure cotais followig fields: () a flag idicatig whether the method defies a geeral evet or a commo evet, (2) the user-provided partial maps for a geeral evet or parameter values for a commo evet, ad (3) a copy of each sapshot of M that falls i the slidig widow [t c T, t c ]. Here M is the cotour map that the method is evaluated o, t c is the curret system time ad T is the evet duratio. For brevity, i the followig we call these map sapshots stored with a method i the mai query pla the map sapshots of the method. At the ed of a sample period of a query, each method i the query is evaluated usig the map sapshots of the method. The core of the evaluatio procedure is a correspodig algorithm for cotour map matchig we desig. The algorithms are described i Sectio 4.2. If the combiatio of all methods i the WHERE clause is evaluated to true at this time, the data acquisitio, aggregatio or user-defied fuctios specified i the SELECT clause of the query are performed. 4.2 Algorithms for Cotour Map Matchig We have desiged ad implemeted four algorithms for cotour map matchig i our framework, oe for the geeral evets ad each of the other three for a commo type of evets. These algorithms strictly follow the defiitio of their correspodig evets i Sectio 3.. Cosequetly, we oly give the algorithm for matchig a geeral evet, Algorithm 3, as a example ad omit those for the commo evets. We poit out that the matchig of a commo evet defied i a method requires further post-processig of the map sapshots of the method. Such post-processig is coducted before each map sapshot is stored with the method. Specifically, we associate each grid cell with a bucket based o the mea value of the regressio fuctio [5] o this regio i the map sapshot. How the whole rage of the attribute value is divided ito a umber of buckets is specified by the user i the cofiguratio file of the method. After associatig a bucket with each grid cell, adjacet cells that are i the same bucket are merged ad a differet versio of sapshot is obtaied. Algorithm 3 Matchig of a Geeral Evet Iput: the geeral evet E defied i method m Output: the curret retur value of m : for each partial map P i ( i ) i E do 2: C i = the map sapshot of m at the time t c ( i) sp; p = 0; 3: for each regio R j ( j i m ) i P i do 4: for each regio R k ( k l) i C i do 5: if (R h = R j R k ) the 6: p + = (σ h / σ j ) ( fj( dσ v j σ h / (v j σ h )); Rh 7: if p < ( α) the retur false; else p = 0; 8: retur true; 5. EXPERIMENTS I this sectio, we evaluate the performace of our proposed patter-based evet detectio mechaism usig a homegrow sesor etwork simulator. 5. Experimetal Setup We simulated the evet detectio sceario of a coal mie surveillace applicatio i our experimets. As we have described i the previous sectios, this applicatio ivolves several evet detectio tasks, such as gas leakage detectio, water leakage detectio ad oxyge desity moitorig. The sesor readigs ad the coefficiets of the regressio model are all 2 bytes i the experimets. We set the size limit of a packet i our simulator to be 49 bytes based o our applicatio developmet experieces o the Crossbow MICA2 motes [6]. We use the GPCJ library [0] for the polygo operatios i i-etwork cotour mappig. 5.. Data Geeratio We have coducted field studies i a coal mie ad collected a small amout of real-world sesory data. This real-world dataset maily cotais three attributes: gas_desity, oxy_desity ad humidity. However, due to the resource ad eviromet 52

costraits, the collected data is coarse-graied i both temporal ad spatial graularity. The sample period of the odes was set at the miute level ad there were oly a few odes deployed i the mie. Cosequetly, we geerated sythetic datasets based o the settigs ad the sesory data characteristics revealed i the realworld dataset, ad used the sythetic datasets i the experimets. Each sythetic dataset we geerated cotais the three attributes. The odes form a N N grid with a cell legth of 0 meters. There is a ode at the ceter of each grid cell ad the sik ode is at the upper-left corer of the grid. The dataset cotais 000 tuples from each ode, with oe tuple geerated every secod. The iitial value v i0 for a attribute o a ode i i the dataset is radomly selected from a set of seed values that we foud most commo for that attribute i the real-world dataset. The attribute value o the ode i a subsequet secod is radomly picked from the rage [v i0 ( d), v i0 ( + d)] with a probability of P i, or remais uchaged from the previous secod with the probability of P i. The value of P i for a ode i is uiformly chose from the rage (0, 0.3]. d (0, ) is the maximum variatio percetage of the attribute value i the real-world dataset. Fially, we chage the sythetic dataset to embed evet data for each query workload. The evet data cotai spatial-temporal patters that the query is supposed to detect. They are embedded ito the dataset by replacig the attribute values of the tuples i the dataset. The locatios of these patters i the dataset are radomly selected. The details of the query workload are give i Sectio 5..2. 5..2 Query Workload For each sythetic dataset, we geerated a query workload cosistig of four classes of queries QC-QC4 ad ra the workload over the dataset i our experimets. Each class i a workload cotais 30 queries embedded with a kid of evet detectio method. QC-QC4 cotai the evet, pyramid, fault ad islad methods, respectively. Each query i a class is to detect a radomly geerated evet istace of the correspodig type. I a query workload, the queries i QC2, QC3 ad QC4 ivolve the gas_desity, humidity ad oxy_desity attributes respectively, so that they correspod to gas leakage detectio, water leakage detectio ad oxyge desity moitorig. I cotrast, each 0 out of the 30 queries i QC ivolve oe of these three attributes so that QC ca evaluate the performace of our mechaism i detectig geeral evets that produce arbitrary spatio-temporal patters i sesory data. All of the 20 queries i the workload use the parameter values ε = 0.2 ad p = for the cotour map costructio ad has a sample period of secod. The bucket size of a query i QC2-QC4 is uiformly picked from (0, 000]. 5..3 Performace Metrics We used accuracy of evet detectio ad etwork traffic as the two metrics for performace evaluatio. The accuracy of evet detectio measures the effectiveess of our approach ad the etwork traffic reflects the power efficiecy. Both metrics are importat for sesor etwork surveillace applicatios. The accuracy of evet detectio icludes two sub-metrics similar to those used i Iformatio Retrieval: () precisio, which is the percetage of real evets detected over all evets reported by a query, ad (2) recall, which is the percetage of evets i the sythetic dataset that are successfully detected by a query. The etwork traffic is defied as the total umber of bytes trasmitted by all odes i the etwork durig the executio of a query for a fixed period of time. 5..4 Approaches Compared The mai idea of our patter-based evet detectio mechaism is to covert the problem of evet detectio i sesor etworks ito patter matchig ad the cotour map matchig. Therefore, the approach to cotour map costructio ad maiteace is most importat to the performace of our mechaism. Cosequetly, i our experimets we focused o evaluatig the effectiveess of our liear regressio based approach to i-etwork cotour mappig. We compared the performace of our approach with two other alterative approaches: () equal-width bucket based i-etwork cotour mappig [2], ad (2) server-side cotour mappig usig our proposed regressio model for cotour regio mergig without i-etwork aggregatio. The first alterative is for comparig equal-width bucket with liear regressio i cotour mappig whereas the secod for comparig a cetralized approach agaist i-etwork aggregatio. We deote these approaches as INLR (I-Network Liear Regressio), INEB (I- Network Equal-width Bucket) ad SSLR (Server-Side Liear Regressio), correspodigly. For a fair compariso, all three approaches used multi-path routig for data trasmissio. Moreover, similar to INLR we applied simple techiques for duplicate elimiatio ad icremetal update o each ode for INEB ad SSLR. 5..5 Parameters Cosidered We varied a umber of system parameters i our simulator whe comparig the performace of the three approaches of cotour map costructio. These parameters are listed as follows: () Evet Frequecy (F). It is the frequecy at which the spatiotemporal patter of the evet appears i the dataset. For istace, suppose a patter appears at 00 positios of a 000-tuple dataset, the evet frequecy is computed as (00/000) 00% = 0%. (2) Network Diameter (D). It is the width i meters of the square N N grid. (3) Trasmissio Rage (T). It is the maximum distace betwee two odes i a grid topology that ca commuicate with each other directly. (4) Lik Loss Rate (R). It is the probability with which a packet from a child ode to its paret will be dropped i our simulator. 5.2 Efficiecy of Our Approach Before comparig the performace of our INLR with the other two approaches of cotour mappig, we first validated the usefuless of the techiques it adopts. These techiques iclude: () the cotour compressio scheme (Sectio 2..2), (2) the soopig based optimizatio of partial map trasmissio (Sectio 2..2), ad (3) the icremetal update scheme (Sectio 2.2). Because oe of these techiques affect the accuracy of evet detectio, we oly show the results o etwork traffic. Figure 5 shows the etwork traffic of five variats of our INLR. The parameter settig we used i this experimet was F = 0%, D 53