Top Banner

of 12

Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

Apr 06, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    1/12

    B u i l d i n g P r o g r a m m i n g A b s t r a c t i o n s f o r W i r e l e s s

    S e n s o r N e t w o r k s U s i n g W a t e r s h e d S e g m e n t a t i o n

    M o h a m m a d H a m m o u d e h

    1a n d T a r i q A . A . A l s b o u ' i

    1

    M a n c h e s t e r M e t r o p o l i t a n U n i v e r s i t y , M a n c h e s t e r , U K ,

    m . h a m m o u d e h @ m m u . a c . u k

    A b s t r a c t T h e a v a i l a b i l i t y a n d q u a l i t y o f i n f o r m a t i o n e x t r a c t e d f r o m

    W i r e l e s s S e n s o r N e t w o r k s ( W S N s ) r e v o l u t i o n i s e d a w i d e r a n g e o f a p p l i -

    c a t i o n a r e a s . T h e s u c c e s s o f a n y W S N a p p l i c a t i o n i s , n o n e t h e l e s s , d e t e r -

    m i n e d b y t h e a b i l i t y t o r e t r i e v e i n f o r m a t i o n w i t h t h e r e q u i r e d l e v e l o f

    a c c u r a c y , w i t h i n s p e c i e d t i m e c o n s t r a i n t s , a n d w i t h m i n i m u m r e s o u r c e

    u t i l i s a t i o n . T h i s p a p e r p r e s e n t s a n e w a p p r o a c h t o l o c a l i s e d i n f o r m a t i o n

    e x t r a c t i o n t h a t u t i l i s e s t h e W a t e r s h e d s e g m e n t a t i o n a l g o r i t h m t o d y n a -

    m i c a l l y g r o u p n o d e s i n t o s e g m e n t s , w h i c h c a n b e u s e d a s p r o g r a m m i n g

    a b s t r a c t i o n s u p o n w h i c h d i e r e n t q u e r y o p e r a t i o n s c a n b e p e r f o r m e d .

    W a t e r s h e d r e s u l t s i n a s e t o f w e l l d e l i m i t e d a r e a s , s u c h t h a t t h e n u m b e r

    o f n e c e s s a r y o p e r a t i o n s ( c o m m u n i c a t i o n a n d c o m p u t a t i o n ) t o a n s w e r a

    q u e r y a r e m i n i m i s e d . T h i s p a p e r p r e s e n t s a f u l l y a s y n c h r o n o u s W a t e r -

    s h e d i m p l e m e n t a t i o n , w h e r e n o d e s c a n c o m p u t e t h e i r l o c a l d a t a i n p a r a l -

    l e l a n d i n d e p e n d e n t l y f r o m o n e a n o t h e r . T h e p r e l i m i n a r y e x p e r i m e n t a l

    r e s u l t s d e m o n s t r a t e t h a t t h e p r o p o s e d a p p r o a c h i s a b l e t o s i g n i c a n t l y

    r e d u c e t h e q u e r y p r o c e s s i n g c o s t a n d t i m e w i t h o u t i n v o l v i n g a n y l o s s o f

    e c i e n c y .

    1 I n t r o d u c t i o n

    W i r e l e s s S e n s o r N e t w o r k s ( W S N s ) a r e c u r r e n t l y b e i n g e m p l o y e d i n a v a r i e t y o f

    a p p l i c a t i o n s r a n g i n g f r o m h o m e t o i n d u s t r y , a n d f r o m h e a l t h t o m i l i t a r y . T h e s e

    a p p l i c a t i o n s h a v e a n u m b e r o f e l e m e n t s i n c o m m o n : ( 1 ) T h e r e q u e s t f o r i n f o r m a -

    t i o n ; ( 2 ) T h e a n s w e r t o t h i s r e q u e s t i s u s u a l l y p r e s e n t i n a s e t o f u n s t r u c t u r e d

    d a t a s t r e a m s ; ( 3 ) W S N s g e n e r a t e l a r g e a m o u n t o f d a t a t h a t i s ` i m p e r f e c t ' i n n a -

    t u r e a n d c o n t a i n s c o n s i d e r a b l e r e d u n d a n c y . R e s o u r c e c o n s t r a i n t s o n n o d e s i n t h e

    n e t w o r k c o u p l e d w i t h t h e c h a r a c t e r i s t i c s o f r e t u r n e d d a t a m e a n s t h a t a p p l i c a -

    t i o n s h a v e t o b e d e v e l o p e d w i t h t h e p r i m a r y d e s i g n g o a l o f m i n i m i s i n g r e s o u r c e

    u t i l i s a t i o n . D i s t r i b u t e d i n f o r m a t i o n e x t r a c t i o n h a s b e e n a d v o c a t e d t o s o l v e t h i s

    k i n d o f p r o b l e m s . I n f o r m a t i o n e x t r a c t i o n i s t h e s u b - d i s c i p l i n e o f a r t i c i a l i n t e l -

    l i g e n c e t h a t s e l e c t i v e l y s t r u c t u r e s , l t e r s , a n d m e r g e s d a t a g e n e r a t e d b y o n e o r

    m o r e s e n s o r n o d e s . I t a d d s m e a n i n g t o u n s t r u c t u r e d r a w d a t a ; t h e r e f o r e , t h e

    d a t a b e c o m e s t r u c t u r e d o r q u a s i - s t r u c t u r e d m a k i n g i t m o r e s u i t a b l e f o r i n f o r -

    m a t i o n p r o c e s s i n g t a s k s . T h i s d e n i t i o n i s c o n c i s e a n d c o v e r s e x a c t l y i n w h a t

    s e n s e t h e t e r m i n f o r m a t i o n e x t r a c t i o n w i l l b e u s e d t h r o u g h o u t t h i s p a p e r .

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    2/12

    T h i s p a p e r p r e s e n t s a n i n - n e t w o r k i n f o r m a t i o n e x t r a c t i o n s y s t e m t h a t n d s

    a n d l i n k s r e l e v a n t i n f o r m a t i o n w h i l e i g n o r i n g i r r e l e v a n t a n d e x t r a n e o u s i n f o r -

    m a t i o n . T h e n a l o u t p u t o f t h e e x t r a c t i o n p r o c e s s v a r i e s b a s e d o n u s e r q u e r i e s ;

    h o w e v e r , i t c o m m o n l y i n v o l v e s t h e e x t r a c t i o n o f f r a g m e n t s o f i n f o r m a t i o n f r o m

    v a r i o u s n o d e s w i t h i n t h e s a m e s e g m e n t a n d l i n k i n g o f t h e s e f r a g m e n t s i n t o a

    c o h e r e n t a n s w e r . W e p r o p o s e t h e u t i l i s a t i o n o f W a t e r s h e d s e g m e n t a t i o n a l g o -

    r i t h m [ 2 0 ] t h a t r e s u l t i n a s e t o f w e l l d e l i m i t e d s e g m e n t s o f h o m o g e n o u s s e n s e d

    r e g i o n s b a s e d o n n o d e s l o c a t i o n a n d t h e i r c o r r e s p o n d i n g s e n s o r r e a d i n g s . W a -

    t e r s h e d a l g o r i t h m i s s u i t a b l e f o r d y n a m i c a l l y c h a n g i n g e n v i r o n m e n t s b e c a u s e i t

    u s e s n o t h r e s h o l d i n g , i n s t e a d t h e b e s t o p t i o n i s c h o s e n a t e a c h d e c i s i o n s t a g e . W e

    a l s o p r o p o s e a p a r a l l e l a s y n c h r o n o u s W a t e r s h e d a l g o r i t h m i m p l e m e n t a t i o n t h a t

    c o m p l i e s w i t h s e n s o r n o d e c o n s t r a i n t s , i . e . r e a l - t i m e c o m p u t i n g , a n d l o w p o w e r

    c o n s u m p t i o n . T h i s i n - n e t w o r k i n f o r m a t i o n e x t r a c t i o n d o e s n o t r e t u r n t h e e n t i r e

    c o l l e c t e d d a t a , b u t i t e x t r a c t s s e n s e d a t a u n i t s f r o m o n e o r m o r e n e t w o r k s e g -

    m e n t s , t y p i c a l l y s i m p l e o r m u l t i - m o d a l i n f o r m a t i o n o f s p a t i o - t e m p o r a l n a t u r e .

    T h e g o a l o f n o d e s e g m e n t a t i o n i s t o p r o v i d e a h i g h - l e v e l p r o g r a m m i n g m o d e l f o r

    s e n s o r n e t w o r k s t h a t a b s t r a c t s a w a y t h e d e t a i l s o f i n d i v i d u a l s e n s o r n o d e s . I n

    t h i s p a p e r w e e x a m i n e q u e r y - b a s e d s y s t e m s t h a t u t i l i s e i n - n e t w o r k p r o c e s s i n g

    f o r q u e r y r e s p o n s e . H o w e v e r , t h e p r o d u c e d a b s t r a c t i o n s c a n b e u t i l i s e d i n b y

    o t h e r i n f o r m a t i o n e x t r a c t i o n s y s t e m s , i . e . e v e n t b a s e d a n d t i m e - d r i v e n .

    Q u e r y - b a s e d i n f o r m a t i o n e x t r a c t i o n i s a r e q u e s t - r e s p o n s e i n t e r a c t i o n b e t w e e n

    t h e s e n s o r n o d e s a n d e n d - u s e r o r a p p l i c a t i o n c o m p o n e n t . T h e e n d u s e r i s s u e s

    a q u e r y i n a n a p p r o p r i a t e l a n g u a g e , a n d t h e n t h e q u e r y i s d i s s e m i n a t e d t o t h e

    n e t w o r k t o r e t r i e v e t h e d e s i r e d d a t a f r o m t h e s e n s o r s b a s e d o n t h e d e s c r i p t i o n i n

    t h e q u e r y . M o s t q u e r y - b a s e d s y s t e m s p r o v i d e a h i g h l e v e l i n t e r f a c e t o t h e s e n s o r

    n e t w o r k w h i l e h i d i n g t h e n e t w o r k t o p o l o g y a s w e l l a s r a d i o c o m m u n i c a t i o n . T h e

    e n d u s e r d o e s n o t n e e d t o k n o w h o w t h e d a t a i s c o l l e c t e d o r p r o c e s s e d .

    U s e r c o n t r o l l e d , q u e r y - b a s e d , i n f o r m a t i o n e x t r a c t i o n i s u s u a l l y a p p l i e d i n

    s i t u a t i o n s w h e r e i t i s k n o w n i n a d v a n c e w h a t t y p e o f s e m a n t i c i n f o r m a t i o n i s t o

    b e e x t r a c t e d f r o m t h e n e t w o r k . F o r e x a m p l e , i t m i g h t b e n e c e s s a r y t o i d e n t i f y

    w h a t t y p e o f e v e n t s a r e h a p p e n i n g i n a c e r t a i n p a r t o f t h e m o n i t o r e d e n v i r o n m e n t

    a n d a t w h a t t i m e t h e s e e v e n t s t o o k p l a c e . D e p e n d i n g o n t h e i n f o r m a t i o n n e e d s ,

    d i e r e n t q u e r i e s c a n b e c o n s t r u c t e d t o d i e r e n t i a t e v a r i o u s t y p e s o f e v e n t s a t

    d i e r e n t l e v e l s o f s e m a n t i c g r a n u l a r i t y . I n s o m e a p p l i c a t i o n s , f o r i n s t a n c e , i t

    w i l l b e a d e q u a t e t o s p e c i f y t h a t a p a r t o f a q u e r y i s a t e m p o r a l e x p r e s s i o n ,

    w h i l e i n o t h e r s i t m i g h t b e n e c e s s a r y t o d i e r e n t i a t e b e t w e e n d i e r e n t t e m p o r a l

    c l a s s e s , f o r e x a m p l e b e t w e e n e x p r e s s i o n s i n d i c a t i n g p a s t , p r e s e n t a n d f u t u r e . I n

    o t h e r a p p l i c a t i o n s , n o t o n l y t h e s e m a n t i c n a t u r e o f t h e t a r g e t i n f o r m a t i o n i s

    p r e d e n e d , b u t a l s o t h e u n i t a n d s c o p e o f t h e e v e n t t o b e e x t r a c t e d . T h e u n i t o f

    e x t r a c t i o n r e f e r s t o t h e g r a n u l a r i t y o f i n d i v i d u a l i n f o r m a t i o n p o r t i o n s t h a t a r e

    l i f t e d o u t o f t h e s e n s o r n o d e . T h e s c o p e o f e x t r a c t i o n r e f e r s t o t h e g r a n u l a r i t y o f

    t h e e x t r a c t i o n s p a c e f o r e v e r y i n d i v i d u a l i n f o r m a t i o n r e q u e s t . I n o r d e r t o d e c i d e

    w h i c h p o r t i o n o f i n f o r m a t i o n i s s u p p o s e d t o c o n t r i b u t e i n t h e a n s w e r o f a q u e r y ,

    a n i n f o r m a t i o n e x t r a c t i o n a p p l i c a t i o n u s e s a s e t o f e x t r a c t i o n c o n d i t i o n s . T h e s e

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    3/12

    c o n d i t i o n s s t a t e w h a t f o r m a l p r o p e r t i e s a p a r t i c u l a r p o r t i o n o f i n f o r m a t i o n m u s t

    p o s s e s s t o b e l o n g t o a p a r t i c u l a r s e m a n t i c c l a s s .

    T h e W a t e r s h e d t r a n s f o r m a t i o n i s a p o p u l a r i m a g e s e g m e n t a t i o n a l g o r i t h m

    f o r g r e y s c a l e i m a g e s [ 2 0 , 1 2 , 7 , 3 , 2 , 5 , 1 7 , 1 4 , 1 9 , 2 1 ] . I t s b a s i c c o n c e p t c o m e s f r o m t h e

    e l d o f t o p o g r a p h y , r e f e r r i n g t o t h e p a r t i t i o n i n g o f a l a n d s c a p e t o a n u m b e r o f

    b a s i n s o r w a t e r c a t c h m e n t a r e a s . T h e a u t h o r s i n [ 1 2 ] u s e t h e f o l l o w i n g a n a l o g y t o

    e x p l a i n h o w t h e W a t e r s h e d a l g o r i t h m w o r k s : T h e U S A c a n b e d i v i d e d i n t o t w o

    m a i n s e g m e n t s , o n e a s s o c i a t e d w i t h t h e A t l a n t i c O c e a n a n d a n o t h e r a s s o c i a t e d

    w i t h t h e P a c i c O c e a n . A l l t h e r a i n f a l l i n g o n t h e e a s t s e g m e n t w i l l o w i n t o

    t h e A t l a n t i c O c e a n , w h i l e t h e r a i n f a l l i n g o n t h e w e s t s e g m e n t w i l l o w i n t o t h e

    o t h e r o c e a n . T h e w a t e r w i l l r e a c h t h e o c e a n g i v e n t h a t i t i s n o t t r a p p e d i n a l o c a l

    m i n i m u m a l o n g t h e w a y . B o t h s e g m e n t s a r e u s u a l l y n a m e d c a t c h m e n t b a s i n s ,

    a n d e a c h o n e h a s a n a s s o c i a t e d m i n i m u m ( t h e o c e a n ) . T h e b o u n d a r y l i n e t h a t

    s e p a r a t e s b o t h b a s i n s i s c a l l e d t h e w a t e r s h e d l i n e , c o r r e s p o n d i n g t o t h e c o n t i -

    n e n t a l d i v i d e i n t h e e x a m p l e . T h e r e f o r e , t h e i m a g e i s v i e w e d a s a t o p o g r a p h i c

    s u r f a c e w h e r e e a c h p i x e l i s a p o i n t s i t u a t e d a t s o m e a l t i t u d e a s a f u n c t i o n o f i t s

    g r e y l e v e l . T h e g r e y l e v e l s c o r r e s p o n d t o t h e a l t i t u d e a s s o c i a t e d t o t h e i m a g e

    b e t w e e n 0 a n d 255.

    A f t e r t h e o r i g i n a l W a t e r s h e d a l g o r i t h m w a s p u b l i s h e d , s e v e r a l m o d i c a t i o n s

    a n d v a r i a t i o n s o f t h i s a l g o r i t h m w a s p u b l i s h e d t o s u i t v a r i o u s a p p l i c a t i o n s . W a -

    t e r s h e d a l g o r i t h m s c a n b e c l a s s i e d i n t o t w o c o n c e p t u a l l y d i s t i n c t t e c h n i q u e s :

    i m m e r s i o n a n d r a i n i n g .

    1 . I m m e r s i o n s i m u l a t e s p r o g r e s s i v e l y i m m e r s i n g t h e e n t i r e t o p o g r a p h i c s u r f a c e

    i n a w a t e r c o n t a i n e r .

    2 . R a i n i n g s i m u l a t e s t h e r a i n f a l l o v e r a t o p o g r a p h i c s u r f a c e . T h e r a i n i n g c a n

    b e c o n s i d e r e d a s a l o c a l m e t h o d b e c a u s e e a c h d r o p l e t f o l l o w s o n i t s o w n w a y

    n o t c o n s i d e r i n g n e i g h b o u r i n g d r o p l e t s .

    O n a t a r e a s o f t h e s u r f a c e , t h e m o t i o n o f t h e w a t e r d r o p l e t i s d i r e c t e d t o w a r d s

    t h e n e a r e s t b r i m o f a d o w n w a r d s l o p e a n d i t s t o p s w h e n i t r e a c h e s a r e g i o n a l

    m i n i m u m . A n i m p o r t a n t a s p e c t o f d e s i g n i n g a p a r a l l e l a s y n c h r o n o u s a l g o r i t h m

    i s t h e e x p l o i t a t i o n o f t h e d a t a l o c a l i t y f o r m i n i m i s a t i o n o f t h e c o m m u n i c a t i o n

    o v e r h e a d . A i m i n g a t t h e g o a l , w e p r o p o s e h e r e a r e f o r m u l a t i o n o f t h e r a i n i n g

    w a t e r s h e d s e g m e n t a t i o n d u e t o i t s s u i t a b i l i t y f o r p a r a l l e l i m p l e m e n t a t i o n . T h e

    p r e s e n t e d i m p l e m e n t a t i o n i s c a p a b l e o f c o m p u t i n g t h e W a t e r s h e d t r a n s f o r m a c -

    c o r d i n g t o l o c a l c o n d i t i o n s . T h e a p p r o a c h p r o p o s e d i n t h i s p a p e r g e n e r a t e s t h e

    s a m e r e s u l t u s i n g o n l y o n e p o i n t o f s y n c h r o n i s a t i o n , t h u s d e c r e a s i n g t h e r u n n i n g

    t i m e w i t h o u t d e g r a d a t i o n i n t h e e e c t i v e n e s s o f t h e s e g m e n t a t i o n . B o t h a s s e r -

    t i o n s a r e d e m o n s t r a t e d t h r o u g h o u t t h i s p a p e r a n d s u p p o r t e d b y e x p e r i m e n t a l

    r e s u l t s .

    T h e p a p e r i s o r g a n i s e d a s f o l l o w s : S e c t i o n 2 d e s c r i b e s t h e W a t e r s h e d a l g o - r i t h m . S e c t i o n 3 i l l u s t r a t e s t h e s u i t a b i l i t y o f t h i s a l g o r i t h m f o r W S N s . S e c t i o n 5p r e s e n t s t h e p a r a l l e l a s y n c h r o n o u s i m p l e m e n t a t i o n o f t h e W a t e r s h e d a l g o r i t h m .

    T h e p e r f o r m a n c e o f t h e p r o p o s e d i m p l e m e n t a t i o n i s e v a l u a t e d i n S e c t i o n 6. S e c - t i o n 7 c o n c l u d e s t h e w o r k .

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    4/12

    2 D e s c r i p t i o n o f t h e W a t e r s h e d A l g o r i t h m

    T h i s s e c t i o n p r e s e n t s M e y e r ' s f o r m a l i s m [ 9 ] t h a t i s b a s e d o n l o c a l c o n d i t i o n s

    ( r a i n s i m u l a t i o n ) . T h e W a t e r s h e d p r o p o s e d b y M e y e r i s t h e b a s e f o r o u r p a -

    r a l l e l a s y n c h r o n o u s i m p l e m e n t a t i o n . R o e d i n k e t a l . [ 1 5 ] s u m m a r i s e d a p p r o a c h e s

    f o r p a r a l l e l i m p l e m e n t a t i o n s o f t h e W a t e r s h e d a l g o r i t h m o n p o w e r f u l ( m e m o r y

    a n d c o m p u t a t i o n ) d e v i c e s . B e f o r e o u r s y n c h r o n o u s a n d p a r a l l e l i m p l e m e n t a t i o n

    d e t a i l s a r e g i v e n , s o m e p r e l i m i n a r y d e n i t i o n s a r e i n t r o d u c e d a s d e s c r i b e d b y

    M e y e r [ 9 ] .

    L e t f(p) b e a f u n c t i o n o f o f g r e y l e v e l s , s i g n i f y i n g a c o n t i n o u s d i g i t a l i m a g e w i t h t h e d o m a i n Z2 . E v e r y p i x e l p h a s a g r e y l e v e l f(p) a n d a s e t o f n e i g h b o u r i n g p i x e l s p N(p) w i t h a d i s t a n c e f u n c t i o n d(p,p) t o e a c h n e i g h b o u r ; i n m o s t p u b l i s h e d a l g o r i t h m s a 4 t o 8n e i g h b o u r s .

    ( R e g i o n a l m i n i m u m ) I s a p o i n t o r a s e t o f c o n n e c t e d p o i n t s w i t h t h e s a m e

    g r e y l e v e l , w h e r e n o n e o f t h e m h a v e a n e i g h b o u r w i t h a l o w e r g r e y l e v e l [ 3 ] . I n

    k e e p i n g w i t h t h e r a i n s i m u l a t i o n a n a l o g y , a r e g i o n a l m i n i m u m i s t h e a r e a o f t h e

    s u r f a c e w h e r e t h e r a i n w a t e r w o u l d g e t t r a p p e d w i t h o u t o w i n g t o l o w e r l e v e l e s .

    ( L o w e r s l o p e ) I f p e x i s t s , t h e l o w e r s l o p e (LS) d e n e s t h e m a x i m u m s t e e p n e s s f r o m a p i x e l t o i t s l o w e r n e i g h b o u r s .

    (LS) = maxpN(p)

    f(p)f(p)dist(p,p)

    |f(p)f(p)

    ( S t e e p e s t d e c e n d i n g p a t h ) p ,SDP(p) i s t h e s e t o f p o i n t s p N(p)d e n e d a s f o l l o w s :

    p N(p)

    f(p) f(p)

    dist (p,p)= LS(p) , f(p) < f(p)

    i . e . t h e SDP i s a s e r i e s o f c o n n e c t e d p o i n t s w h e r e e a c h p o i n t p r e s e n t s a g r e y l e v e l

    s t r i c t l y l o w e r t h a n t h e p r e v i o u s o n e . T h e r e m a y e x i s t m u l t i p l e d e c e n d i n g p a t h s

    f r o m a g i v e n p o i n t , t h e c h o i c e b e t w e e n t h e m d e p e n d s o n t h e i m p l e m e n t a t i o n . A

    d e s c e n d i n g p a t h i s s a i d t o b e a s t e e p e s t p a t h i f e a c h p o i n t i n t h e p a t h i s c o n n e c t e d

    t o t h e n e i g h b o u r w i t h t h e l o w e s t g r e y l e v e l . A c c o r d i n g t o r a i n s i m u l a t i o n a n a l o g y ,

    t h e SDP i s t h e p a t h a d r o p o f w a t e r w o u l d f o l l o w w h e n t r a v e l l i n g d o w n t o a

    r e g i o n a l m i n i m u m .

    ( C o s t f u n c t i o n b a s e d o n l o w e r s l o p e ) T h e c o s t , cost (pi1, pi) , f o r w a l k i n g o n t h e t o p o g r a p h i c s u r f a c e f r o m p o i n t pi1 t o pi N(pi1) i s :

    LS(pi1) .dist (pi1, pi) f(pi1) > f (pi)

    LS(pi) .dist (pp1, pi) f(pi1) < f(pi)12 (LS(pi1) + LS(pi)) .dist(pi1, pi) f(pi1) = f(pi)

    ( T o p o g r a p h i c d i s t a n c e ) T h e t o p o g r a p h i c d i s t a n c e b e t w e e n t w o p o i n t s p a n d q o n

    a s u r f a c e i s t h e m i n i m a l t o p o g r a p h i c a l d i s t a n c e a m o n g a l l p a t h s b e t w e e n pa n d q o n t h e s u r a f a c e :

    T Df (p,q) = infTDf (p,q)

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    5/12

    w h e r e T Df (p,q) =n

    i=2 cost(pi1, pi) i s t h e t o p o g r a p i c a l d i s t a n c e o f a p a t h =(p = p1, p2,...,pn = q), s u c h t h a t i, pi N(pi1) a n d pi ( C a t c h m e n t b a s i n b a s e d o n t o p o g r a p h i c d i s t a n c e ) CBTD (mi) o f a l o c a l m i n i - m u m mi i s t h e s e t o f p o i n t s p w h e r e t h e t o p o g r a p h i c a l d i s t a n c e i s c l o s e r t o mi t h a n t o a n y o t h e r r e g i o n a l m i n i m u m mj , b a s e d o n t h e t o p o g r a p h i c a l d i s -

    t a n c e a n d t h e g r e y l e v e l o f t h e m i n i m a :

    CBTD (mi) = {p |f(mi) + T Df (p,mi) + T Df (p,mj)j = i}

    I n o t h e r w o r d s , t h e CB i s f o r m e d b y a r e g i o n a l m i n i m u m a n d a l l t h e p o i n t s

    w h o s e s t e e p e s t d e c s e n d i n g p a t h e n d s i n t h a t m i n i m u m [ 2 ] . A c c o r d i n g t o t h e r a i n

    s i m u l a t i o n a n a l o g y , a CB i s a n a r e a o f a t o p o g r a p h i c s u r f a c e , s u c h t h a t w h e n a

    d r o p l e t o f r a i n f a l l i n a n y p o i n t i n t h a t a r e a , i t w o u l d p o u r e i n t o i t s m i n i m u m

    f o l l o w i n g t h e s t e e p e s t d e s c e n d i n g p a t h o f t h a t p o i n t .

    3 M o d i e d W a t e r s h e d S e g m e n t a t i o n

    1 - N e i g h b o u r h o o d d e n i t i o n u s i n g S h e p a r d m e t h o d I n m o s t p u b l i s h e d

    W a t e r s h e d a l g o r i t h m v a r i a t i o n s , a 4 t o 8 p i x e l n e i g h b o u r s a r e u s e d . B e c a u s e t h e d i s t a n c e f r o m a n o d e t o i t s n e i g h b o u r s c a n v a r y , w e a d v o c a t e t h e u s e S h e p a r d

    m e t h o d [ 1 6 ] t o s e l e c t n e a r b y n o d e s . S h e p a r d d e n e d t w o c r i t e r i a :

    ( a ) A r b i t r a r y d i s t a n c e c r i t e r i o n : A l l d a t a p o i n t s w i t h i n r a d i u s r o f t h e

    p o i n t p a r e i n c l u d e d i n c o m p u t a t i o n .

    ( b ) A r b i t r a r y n u m b e r c r i t e r i o n : O n l y t h e c l o s e s t n d a t a p o i n t s a r e c o n s i d e -

    r e d i n t h e c o m p u t a t i o n o f a n y i n t e r p o l a t e d v a l u e .

    S h e p a r d h a s c h o s e n a m i x o f t h e t w o c r i t e r i a w h i c h c o m b i n e d t h e i r a d v a n -

    t a g e s . A n i n i t i a l r a d i u s r i s d e n e d d e p e n d i n g o n t h e o v e r a l l d e n s i t y o f d a t a

    p o i n t s s u c h t h a t s e v e n d a t a p o i n t s a r e i n c l u d e d o n a v e r a g e i n a c i r c l e o f r a d i u s r .

    r i s w r i t t e n a s f o l l o w s :

    r2 =7A

    N

    w e r e A i s t h e a r e a o f t h e l a r g e s t p o l y g o n e n c l o s e d b y t h e d a t a p o i n t s . T h e

    s u i t a b i l i t y o f t h i s m e t h o d f o r W S N i s p r e s e n t e d i n [ 6 ] .

    2 - I n c l u s i o n o f t h e n u m b e r o f h o p s i n t h e c a l c u l a t i o n o f t h e s t e e p e s t

    p a t h I n S e c t i o n 2 , t h e S D P ( D e n i t i o n 3) w a s d e n e d a s a s e r i e s o f c o n n e c t e d p o i n t s w h e r e e a c h p o i n t p r e s e n t s a g r e y l e v e l s t r i c t l y l o w e r t h a n t h e p r e v i o u s

    o n e . T h e r e m a y e x i s t m u l t i p l e d e s c e n d i n g p a t h s f r o m a g i v e n p o i n t , t h e c h o i c e

    b e t w e e n t h e m d e p e n d s o n t h e W a t e r s h e d a l g o r i t h m i m p l e m e n t a t i o n . F o r W S N s

    a p p l i c a t i o n s , t h e m o s t e n e r g y e c i e n t d e s c e n d i n g p a t h s h o u l d b e c h o s e n . A c c o r -

    d i n g t o [ 1 3 ] , c o m m u n i c a t i o n i s t h e m o s t p o w e r h u n g r y o p e r a t i o n . C o m m u n i c a t i o n

    c o s t c a n b e c o m p u t e d f r o m t r a n s m i s s i o n d i s t a n c e , h o p c o u n t , d e l a y , l i n k q u a l i t y ,

    a n d o t h e r f a c t o r s . H o p c o u n t i s w i d e l y u s e d f a c t o r t o m e a s u r e e n e r g y r e q u i r e -

    m e n t o f a r o u t i n g t a s k a n d f o r g r o u p i n g n o d e s i n e n e r g y e c i e n t c l u s t e r s . T h e

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    6/12

    p o w e r c o n s u m e d i n d a t a t r a n s m i s s i o n i s d i r e c t l y p r o p o r t i o n a l t o t h e s q u a r e o f

    t h e t r a n s m i s s i o n d i s t a n c e b e t w e e n t h e s e n d i n g a n d r e c e i v i n g n o d e s . T h e p o w e r

    c o n s u m p t i o n d o e s n o t o n l y d e p e n d o n t h e t r a n s m i s s i o n d i s t a n c e , b u t a l s o o n t h e

    s c a l e o f t h e n e t w o r k [ 1 8 ] . T h e r e f o r e , t h e l o w e r d i s t a n c e s m u s t b e c o m p u t e d a s a

    f u n c t i o n o f t h e n u m b e r o f h o p s a s w e l l a s t h e i n t e r - s e n s o r E u c l i d e a n d i s t a n c e s .

    T h e n e w d i s t a n c e f u n c t i o n i s t h e s u m o f t h e i n d i v i d u a l i n t e r - n o d e E u c l i d e a n

    d i s t a n c e s m u l t i p l i e d b y t h e h o p c o u n t .

    Dist(p, p) =

    dist(pi, pj)

    hc

    w h e r e i,j < hc 1 a n d hc i s t h e h o p e c o u n t .

    4 A b s t r a c t i o n s f o r L o c a l I n t e r a c t i o n s

    I n t h i s s e c t i o n , w e g i v e a b r i e f d e s c r i p t i o n o f h o w W a t e r s h e d s e g m e n t a t i o n a l -

    g o r i t h m c a n b e u s e d f o r d e n i n g a b s t r a c t i o n s f o r l o c a l i n t e r a c t i o n s a n d p l a c e

    o u r w o r k i n t h e c o n t e x t o f o t h e r e x i s t i n g w o r k i n t h e a r e a . T o d e m o n s t r a t e t h e

    u s e f u l n e s s o f t h e p r o p o s e d a b s t r a c t i o n s w e c o n s i d e r e v e n t s t h a t a r e c a u s e d b y

    m u l t i p l e e l e m e n t s t a r g e t s , e . g . a h e r d o f a n i m a l s i n a h a b i t a t m o n i t o r i n g a p -

    p l i c a t i o n o r t o x i c g a s d i u s i o n . E l e m e n t s t r i g g e r i n g t h e s e e v e n t s o f t e n e x h i b i t

    i d i o s y n c r a t i c b e h a v i o u r , s u c h a s s p l i t t i n g i n t o s e v e r a l g r o u p s o r m e r g i n g i n t o a

    s i n g l e g r o u p . T h i s t y p e o f e v e n t s i n v o l v e s s e v e r a l n e i g h b o u r i n g s e n s o r n o d e s t o

    c o l l a b o r a t e t o a c q u i r e a g g r e g a t e f e a t u r e s o f t h e t a r g e t s u c h a s s h a p e , l o c a t i o n ,

    c o v e r a g e , m o v i n g d i r e c t i o n , s p e e d , e t c . E v e n t s i n v o l v i n g t h i s k i n d o f t a r g e t s a r e

    s u b m i t t e d b y [ 8 ] a s ` r e g i o n - l i k e ' t a r g e t s . I n t h i s p a p e r , W a t e r s h e d s e g m e n t a t i o n

    i s p r o p o s e d t o b u i l d a c o o p e r a t i v e n o d e s t r u c t u r e o v e r e v e r y n e t w o r k s e g m e n t

    c o v e r e d b y t h e e v e n t s t o c o l l e c t a n d a g g r e g a t e r e l a t e d i n f o r m a t i o n .

    W a t e r s h e d g r o u p s n o d e s s h a r i n g s o m e c o m m o n g r o u p s t a t e i n t o s e g m e n t s .

    A s e g m e n t i s d e s c r i b e d a s a c o l l e c t i o n o f s p a t i a l l y d i s t r i b u t e d n o d e s w i t h a n

    e x a m p l e b e i n g t h e s e t o f n o d e s i n a g e o g r a p h i c a r e a w i t h s e n s o r r e a d i n g s i n a

    s p e c i c r a n g e . T h e r e f o r e , W a t e r s h e d s e g m e n t a t i o n c o m b i n e s t h e a d v a n t a g e s o f

    d a t a - c e n t r i c ( e . g . [ 4 ] a n d t o p o l o g i c a l l y ( e . g . [ 2 2 ] ) d e n e d g r o u p a b s t r a c t i o n s . T h i s

    m a k e s t h e g e n e r a t e d s e g m e n t s c a p a b l e o f e x p r e s s i n g a n u m b e r o f l o c a l b e h a v i o u r s

    p o w e r f u l l y , w h i c h a l l o w s n e t w o r k p r o g r a m m e r s t o w r i t e p r o g r a m s t h a t e x p r e s s

    h i g h e r l e v e l b e h a v i o u r b e y o n d t h a t o f t h e u s u a l q u e r y - b a s e d m e t h o d s . I n f a c t ,

    t h e p r o g r a m m e r i s c o n c e r n e d n o t o n l y w i t h t h e a p p l i c a t i o n l o g i c , b u t a l s o w i t h

    i d e n t i f y i n g t h e n e t w o r k p o r t i o n s t o b e i n v o l v e d i n e x t r a c t i n g a p a r t i c u l a r p i e c e

    o f i n f o r m a t i o n a n d h o w t o r e a c h t h e m . D e a l i n g w i t h t h i s n e w r e q u i r e m e n t n e c e s -

    s i t a t e s n e w p r o g r a m m i n g a b s t r a c t i o n s t o l o c a l i s e c o m p l e x i t y w i t h o u t s c a r i f y i n g

    e c i e n c y . T h e l o g i c a l s e g m e n t s o f n o d e s g e n e r a t e d b y t h e W a t e r s h e d a l g o r i t h m

    r e p l a c e t h e t i g h t p h y s i c a l n e i g h b o u r h o o d p r o v i d e d b y w i r e l e s s b r o a d c a s t w i t h

    a h i g h e r l e v e l , a p p l i c a t i o n d e n e d a b s t r a c t i o n s . S e g m e n t s a r e c r e a t e d s u c h t h a t

    t h e s p a n o f a l o g i c a l n e i g h b o u r h o o d i s s p e c i e d d y n a m i c a l l y a n d d e c l a r a t i v e l y

    b a s e d o n t h e a t t r i b u t e s o f n o d e s , a l o n g w i t h r e q u i r e m e n t s a b o u t c o m m u n i c a t i o n

    c o s t s ( s p e c i c a l l y t h e d i a m e t e r o f t h e s e g m e n t ) . A n e t w o r k s e g m e n t f o r m e d w i t h

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    7/12

    a l o g i c a l n o t i o n o f p r o x i m i t y d e t e r m i n e d b y a p p l i c a t i v e i n f o r m a t i o n i s , t h e r e f o r e ,

    c a p a b l e t o r e t u r n s p e c i e d i n f o r m a t i o n w i t h h i g h c o n d e n c e .

    S e g m e n t s g e n e r a t e d b y W a t e r s h e d a l g o r i t h m a r e a u t o m a t i c a l l y l a b e l l e d w i t h

    a m a r k e r , w h i c h i s a n i n t e g e r i d e n t i e r . A l l n o d e s w i t h i n t h e s e g m e n t s a t i s f y

    t h e l o g i c a l c o n s t r a i n t s e n c o d e d i n t h e W a t e r s h e d a l g o r i t h m . T h i s l o g i c a l a n d

    i n t u i t i v e W a t e r s h e d t e m p l a t e s e r v e s a s t h e m e m b e r s h i p f u n c t i o n t h a t d y n a m i -

    c a l l y d e t e r m i n e s a n d u p d a t e s w h i c h n o d e s b e l o n g t o t h e s e g m e n t . P r o g r a m m e r s

    m a n i p u l a t e s e g m e n t s i n s t e a d o f n o d e s w i t h i n c o m m u n i c a t i o n r a n g e . T h e p r o -

    g r a m m e r s c a n s t i l l r e a s o n i n t e r m s o f n o d e s a n d b r o a d c a s t m e s s a g e s , b u t n o w

    t h e y c a n s p e c i f y d e c l a r a t i v e l y w h i c h p o r t i o n s o f t h e n e t w o r k t o c o n s i d e r a n d

    t h e r e f o r e c o n t r o l t h e s p a n o f c o m m u n i c a t i o n t o s a v e e n e r g y .

    M a c r o p r o g r a m m i n g [ 2 2 ] h a s b e e n p u t f o r w a r d i n t h e l i t e r a t u r e a s a n e -

    c i e n t a p p r o a c h t o i n f o r m a t i o n e x t r a c t i o n t h a t p r o v i d e s a m o r e g e n e r a l - p u r p o s e

    a p p r o a c h t o d i s t r i b u t e d c o m p u t a t i o n . M a n y m a c r o p r o g r a m m i n g a p p r o a c h e s a i m

    a t p r o g r a m m i n g t h e n e t w o r k a s a w h o l e r a t h e r t h a n p r o g r a m m i n g t h e i n d i v i d u a l

    n o d e s t h a t c o m p o s e t h e n e t w o r k . G l o b a l b e h a v i o u r c a n b e s p e c i e d , p r o g r a m -

    m e d a n d t h e n t r a n s l a t e d t o n o d e l e v e l c o d e t r a n s p a r e n t l y f r o m l o w l e v e l d e t a i l s

    l i k e n e t w o r k t o p o l o g y , r a d i o c o m m u n i c a t i o n o r p o w e r c a p a c i t y . A s i g n i c a n c e

    c l a s s o f m a c r o p r o g r a m m i n g s y s t e m s a r e t h e a p p l i c a t i o n - d e n e d , i n - n e t w o r k a b s -

    t r a c t i o n s t h a t a r e u s e d i n d a t a p r o c e s s i n g . T h e R e g i m e n t [ 2 2 ] a n d H o o d s y s t e m s

    a r e e x a m p l e s o f n e i g h b o u r h o o d - b a s e d a b s t r a c t i o n s t h a t h a n d l e m a n y n o d e s c o l -

    l e c t i v e l y a n d a s e t o f o p e r a t i o n s o n i t t o e n a b l e t h e p r o g r a m m e r t o e x t r a c t

    i n f o r m a t i o n a b o u t t h e s t a t e o f t h e g r o u p . E n v i r o T r a c k [ 1 ] i s a p r o g r a m m i n g a b s -

    t r a c t i o n s p e c i c a l l y f o r t a r g e t - t r a c k i n g a p p l i c a t i o n s , w h e r e a g r o u p i s d e n e d

    a s t h e s e t o f s e n s o r s t h a t d e t e c t e d t h e s a m e e v e n t . I n S P I D E Y [ 1 0 ] , a n o d e i s

    r e p r e s e n t e d a s a l o g i c a l n o d e t h a t h a s m u l t i p l e e x p o r t e d a t t r i b u t e s ( s t a t i c a n d

    d y n a m i c ) . H o w e v e r , u t i l i s i n g t h e n e t w o r k t o p o l o g y a s a n a b s t r a c t i o n c a n r e q u i r e

    s o m e r i g i d i t y i n t h e p r o g r a m m i n g m o d e l . I t c a n a l s o b e i n e c i e n t f o r s y s t e m s

    w i t h m o b i l e n o d e s d u e t o t h e c o s t a n d c o m p l e x i t y o f m a i n t a i n i n g t h e m a p p i n g

    b e t w e e n t h e p h y s i c a l t o p o l o g y a n d t h e l o g i c a l t o p o l o g y . T h e p a r a l l e l W a t e r s h e d -

    b a s e d a b s t r a c t i o n s a r e d i e r e n t f r o m t h e s e a p p r o a c h e s i n o n e i m p o r t a n t a s p e c t ;

    s e g m e n t a t i o n r u n t i m e l o o s e l y s y n c h r o n i s e s s t a t e a c r o s s n o d e s , a t t a i n i n g g r a t e r

    r o b u s t n e s s a n d h i g h e r e c i e n c y .

    5 P a r a l l e l A s y n c h r o n o u s W a t e r s h e d I m p l e m e n t a t i o n

    E a c h n o d e , (x,y,z) , i s d e p i c t e d a s a p i x e l o n t h e i m a g e a n d t h e c o l o u r o f t h e p i x e l l o c a t e d a t (x, y) i s o b t a i n e d a s t h e n o d e s e n s e d m o d a l i t y (z) . T h e r e s o - l u t i o n o f t h e i m a g e i s t h e t o t a l n u m b e r o f n o d e s i n t h e n e t w o r k p e r a r e a u n i t .

    I n p a r a l l e l o p e r a t i o n , r a i n f a l l i n g s i m u l a t i o n W a t e r s h e d u s e s l e s s c o m m u n i c a -

    t i o n b e t w e e n n o d e s , c o m p a r e d t o i m m e r s i o n w h i c h h a s a h i g h l y g l o b a l n a t u r e .

    T h e n e w s e g m e n t a t i o n a l g o r i t h m c a n b e v i e w e d a s a n a s y n c h r o n o u s r e l a x a t i o n

    o f t h e ` H i l l C l i m b i n g ' a l g o r i t h m [ 9 ] . A l l p r o c e s s i n g i s l o c a l t o e a c h n o d e , w h i c h

    r u n s a s i m p l e n i t e s t a t e m a c h i n e a s s o c i a t e d w i t h a s i n g l e s e n s e d m o d a l i t y .

    N o n - b l o c k i n g c o m m u n i c a t i o n s a l l o w e a c h n o d e t o r u n i n d e p e n d e n t l y . S i n c e s y n -

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    8/12

    c h r o n i s a t i o n i s l i m i t e d t o N(u) a n d n o n - b l o c k i n g c o m m u n i c a t i o n s a r e u s e d , e a c h n o d e o p e r a t e s i n d e p e n d e n t l y a n d t h e a l g o r i t h m n e e d s n o g l o b a l s c h e d u l i n g .

    T h e r o l e o f t h e W a t e r s h e d p r o c e s s i s t o l a b e l e a c h n o n - m i n i m u m n o d e b y w a l -

    k i n g d o w n w a r d o n a s t e e p e s t s l o p e p a t h t o w a r d s t h e m i n i m u m . I n i t i a l l y , a l l n o d e s

    i n t h e n e t w o r k a r e c o n s i d e r e d a s n o n - m i n i m a a n d w i l l b e o o d e d f r o m d i e r e n t

    s u b - d o m a i n s . A t t h i s s t a g e o f t h e s e g m e n t a t i o n p r o c e s s , n o d e s a r e a s s i g n e d t e m -

    p o r a r y l a b e l s b e c a u s e t h e s e g m e n t a t i o n r e s u l t s d e p e n d s o n n e i g h b o u r i n g n o d e s

    r e a d i n g s . W h e n a n o d e d e t e c t s a s t e e p e s t n e i g h b o u r , i t c h a n g e s i t s t a t u s t o a

    n o n - m i n i m u m n o d e a n d g e t s l a b e l l e d f r o m t h e s t e e p e s t n e i g h b o u r o r f r o m i t s

    p r e d e c e s s o r t h a t h a s t h e s h o r t e s t d i s t a n c e a m o n g i t s n e i g h b o u r i n g n o d e s . W h e n

    t h e m i n i m u m i s r e a c h e d , i t s l a b e l i s a s s i g n e d t o a l l t h e n o d e s u p w a r d a l o n g t h e

    p a t h . I f n o n o n - m i n i m u m w e r e d e t e c t e d , t h e s t e e p e s t d i s t a n c e s m u s t b e c a l c u -

    l a t e d b a s e d o n t h e e n t i r e s e t o f l o w e r b o r d e r s . P r o c e s s t e r m i n a t i o n i s l o c a l l y

    d e t e c t e d o n e a c h n o d e . T h i s r e d u c e s t h e a m o u n t o f c o m m u n i c a t i o n a n d t h e i d l e

    t i m e i n n o d e s .

    T h e a l g o r i t h m b u i l d s s e v e r a l p a t h s w i t h d i e r e n t o r i g i n s a n d d e s t i n a t i o n s

    f r o m d a t a c o m m u n i c a t i o n s b e t w e e n n o d e s . T h i s d o e s n o t i n t r o d u c e a d d i t i o n a l

    c o s t d u e t o t h e b r o a d c a s t n a t u r e o f w i r e l e s s c o m m u n i c a t i o n s . T y p i c a l l y , a n y

    c h a n g e s i n o n e n o d e r e a d i n g s m a y a e c t a l l n o d e s o n t h e s t e e p e s t s l o p e l i n e

    b e t w e e n t h a t n o d e a n d t h e m i n i m u m . T h e r e f o r e , n o d e s m u s t k e e p m o n i t o r i n g

    a n d u p d a t i n g t h e i r m e m b e r s h i p . A a g , c a l l e d r e s e t , i s m a i n t a i n e d b y e a c h n o d e

    t o r e c o r d w h e t h e r c h a n g e s o c c u r r e d o r n o t s i n c e t h e l a s t c o m m u n i c a t i o n . O n e

    a d v a n t a g e o f t h i s i m p l e m e n t a t i o n i s t h a t n o r e l a b e l i n g a n d n o s y n c h r o n i s a t i o n

    b e t w e e n n o d e s a r e n e e d e d f r e q u e n t l y .

    O n e d i s a d v a n t a g e o f t h i s p a r a l l e l a s y n c h r o n o u s i m p l e m e n t a t i o n i s t h a t t h e

    m i d d l e n o d e s o n p l a t e a u s c a n n o t l o c a l l y d e c i d e w h e t h e r t h e y a r e o n a m i n i m u m

    o r n o n - m i n i m u m p l a t e a u , (N P), a n d n e c e s s i t a t e g l o b a l s y n c h r o n i s a t i o n p o i n t s t o i d e n t i f y a n d l a b e l t h e m i n i m u m p l a t e a u s . T o a v o i d g l o b a l s y n c h r o n i s a t i o n , a l l

    m i d d l e n o d e s a r e l a b e l l e d a s m i n i m u m o r P l a t e a u , (MP), t o a l l o w t h e m m a k e s l o c a l d e c i s i o n s . A f t e r t h a t , t h e p r o p a g a t i o n o f d a t a o v e r a n o n - m i n i m u m p l a t e a u

    a l l o w s t h e m i d d l e n o d e s o f t h a t p l a t e a u o o d e d b y a n e i g h b o u r t o s w i t c h t o

    n o n - m i n i m u m .

    A l g o r i t h m 1 p r e s e n t s t h e p s e u d o c o d e o f t h e s e g m e n t a t i o n p r o c e s s i n e a c h

    n o d e .

    6 E v a l u a t i o n

    S u p p o s e t h a t a W S N h a s b e e n d e p l o y e d t o m o n i t o r t e m p e r a t u r e o f e n v i r o n m e n -

    t a l l y s e n s i t i v e a r e a s . A n e v e n t o f i n t e r e s t i s p r e d e n e d i f t e m p e r a t u r e r e a d i n g s

    w i t h e n o u g h n u m b e r s g o a b o v e a c e r t a i n t h r e s h o l d i n a s p e c i c g e o g r a p h i c a r e a .

    I n o u r s i m u l a t i o n , a n e v e n t i s t r i g g e r e d a t r a n d o m t i m e s i n r a n d o m l o c a t i o n s

    f o l l o w e d b y i s s u i n g a q u e r y t o l o c a t e t h e h o t t e s t s p o t s . Q u e r y r e s o l u t i o n i s i m -

    p l e m e n t e d u s i n g t h r e e m e t h o d s : W a t e r s h e d - b a s e d , n o d e s a r e l o g i c a l l y g r o u p e d

    i n t o s e g m e n t s t h a t a r e u s e d t o a s s i s t q u e r y p r o c e s s i n g ; i n - n e t w o r k p r o c e s s i n g

    v i a a g g r e g a t i o n o f m e s s a g e s u p a s p a n n i n g t r e e o f t h e n e t w o r k ; a n d c e n t r a l i s e d ,

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    9/12

    A l g o r i t h m 1 T h e s e g m e n t a t i o n p r o c e s s o f n o d e s i n e a c h s t a t e .

    I n p u t n o d e c u r r e n t s t a t e o f n o d e (u) S(u) ; f(v) s t a t e s o f n e i g h b o u r s O u t p u t s e g m e n t m e m b e r s h i p

    c a s e (S(u) = initial)T h e n o d e u b r o a d c a s t s i t s d a t a d (u) a n d l a b e l l (u) t o i t s n e i g h b o u r s N(u) ,

    w a i t s f o r d a t a f r o m e a c h n e i g b h o u r v N(u) , c o m p u t e t h e f o l l o w i n g : N(u)

    =a l l n e i g h b o u r i n g r e a d i n g s e q u a l t o (u)

    N(u)

    a l l n e i g h b o u r i n g r e a d i n g s g r e a t e r t h a n (u)

    N(u)Ln

    = vi a s i n g l e t o n s e t s u c h t h a t LSmax(vi) a n d vi N(u)

    i f N(u)Ln

    = l (u) minvN(u)= (l (v)) ; S(u)

    MP

    e l s e

    S(

    u)

    NP

    c a s e (S(u) = MP)T h e n o d e u w a i t s t o r e c e i v e n e w d a t a , d(v), f r o m a n y n e i g h b o u r i f d(v) < d(u)

    N(u)ln v; S(u) N P

    e l s e

    l (u) min (l (u) , l (v)); S(u) MP

    c a s e (S(u) = N P)

    T h e n o d e (u) w a i t s f o r d a t a f r o m N(u)Ln

    ; S(u) N P

    I n a l l s t a t e s , t h e n o d e (u) s e n d s i t s d a t a f(u) t o a l l n o d e s i n N(u)

    w h e n e v e r

    a n e w r e a d i n g i s r e c o r d e d

    (a) (b) (c)

    F i g u r e 1 .

    (a)O r i g i n a l t h e r m a l m a p

    (b)W a t e r s h e d s e g m e n t a t i o n r e s u l t s

    (c)E x t e n d

    s e g m e n t a t i o n

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    10/12

    (a) (b)

    F i g u r e 2 . C o m m u n i c a t i o n o v e r h e a d a n d t h e n u m b e r o f n o d e s i n v o l v e d i n r e s o l v i n g t h e

    q u e r y

    w e r e a l l d a t a i s s e n t d i r e c t l y t o t h e s i n k f o r a n a l y s i s . A l l s i m u l a t i o n s w e r e c a r r i e d

    o u t u s i n g D i n g o [ 1 1 ] , w h i c h i s a s c a l a b l e p y t h o n - b a s e d p a c k a g e t o a l l o w r a p i d

    p r o t o t y p i n g o f W S N s a l g o r i t h m s . I n a l l e x p e r i m e n t s , w e m a k e u s e o f a t h e r m a l

    m a p , F i g u r e 1 (a) , a d o p t e d f r o m g o i n f r a r e d . c o m . F i g u r e 1 (b) s h o w s t h e r e s u l t o f s e g m e n t a t i o n i n w h i c h n o d e s i n e a c h s e g m e n t c o l l a b o r a t e t o s o l v e a q u e r y .

    I t i s e a s y t o e x t e n d t h e s e g m e n t a t i o n t o t h e w h o l e m o n i t o r e d t e r r a i n b y u s i n g

    g e n e r a l i s e d V o r o n o i , i . e . , e a c h l o c a t i o n w h e r e t h e r e i s n o s e n s o r n o d e i s a s s i g n e d

    t o i t s n e a r e s t s e g m e n t , F i g u r e 1 (c) .T h e c o s t o f t h e q u e r y r e s o l u t i o n w a s m e a s u r e d i n t e r m s o f t h e n u m b e r o f

    m e s s a g e s e x c h a n g e d t o a n s w e r t h e q u e r y . M u l t i p l e r u n s w i t h d i e r e n t t o p o l o g i e s

    a n d d i e r e n t n u m b e r o f n o d e s w e r e c a r r i e d o u t f o r t h e t h r e e q u e r y r e s o l u t i o n

    m e t h o d s . T h e s e r e s u l t s a r e p r e s e n t e d i n F i g u r e 2 (a) . T h e e n e r g y c o s t , r e s p o n s e t i m e , a n d a c c u r a c y a r e a e c t e d b y w h i c h a n d h o w m a n y n o d e s a r e i n v o l v e d

    i n a n s w e r i n g a q u e r y . E x c l u d i n g n o d e s i r r e l e v a n t t o a c e r t a i n q u e r y n o t o n l y

    i m p r o v e a n s w e r a c c u r a c y b u t a l s o s a v e s e n e r g y a n d r e d u c e t h e t i m e r e q u i r e d f o r

    d a t a a n a l y s i s . F i g u r e 2 (b) s h o w s t h e n u m b e r o f n o d e s i n v o l v e d i n r e s o l v i n g t h e s a m e q u e r y a t d i e r e n t n e t w o r k d e n s i t i e s .

    T h e r e s u l t s o b t a i n e d i n t h e a b o v e e x p e r i m e n t s i n d i c a t e t h a t s e g m e n t s c a n b e

    u s e d t o s u p p o r t i n - n e t w o r k q u e r y r e s o l u t i o n . T h e r e s u l t s s h o w s t h a t t h e c o m m u -

    n i c a t i o n o v e r h e a d a s s o c i a t e d w i t h s e g m e n t - b a s e d q u e r y p r o c e s s i n g i s a l m o s t 2f o l d s l e s s t h a n i n - n e t w o r k p r o c e s s i n g a n d 10 f o l d s l e s s t h a n t h e c e n t r a l i s e d q u e r y r e s o l u t i o n . T h e s e r e s u l t s a r e c l e a r l y e x p l a i n e d b y t h e a n a l y s i s p r e s e n t e d i n F i -

    g u r e 2 .

    7 C o n c l u s i o n

    T h e p r e l i m i n a r y w o r k i n t h i s p a p e r i n d i c a t e s t h a t s e g m e n t - b a s e d i n - n e t w o r k

    q u e r y p r o c e s s i n g p r o d u c e s c o n s i d e r a b l e e n e r g y s a v i n g s o v e r a g g r e g a t i o n a n d

    c e n t r a l i s e d a p p r o a c h e s . W a t e r s h e d l o g i c a l l y o r g a n i s e s n o d e s i n t o e n e r g y e c i e n t

    s e g m e n t s t h a t r e d u c e u n e c e s s a r y d a t a t r a n s m i s s i o n s a n d i m p r o v e r e s p o n s e a c -

    c u r a c y . C o m p a r e d t o s t a n d a r d W a t e r s h e d s e g m e n t a t i o n a l g o r i t h m s , t h e m a j o r

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    11/12

    i m p r o v e m e n t o f o u r a l g o r i t h m i s t h a t l a b e l l i n g a n d c l i m b i n g a l o n g t h e s t e e p e s t

    p a t h s a r e c o n c u r r e n t l y a n d l o c a l l y e x e c u t e d b a s e d o n t h e n o d e s t a t e , d u r i n g t h e

    e n t i r e s e g m e n t a t i o n p r o c e s s . T h e r e a r e a n u m b e r o f l i m i t a t i o n s i n t h e w o r k s o f a r

    t h a t n e e d t o b e a d d r e s s e d i n t h e f u t u r e , f o r e x a m p l e t h e c o s t o f s e g m e n t a t i o n .

    R e f e r e n c e s

    1 . T . A b d e l z a h e r , B . B l u m , Q . C a o , Y . C h e n , D . E v a n s , J . G e o r g e , S . G e o r g e , L . G u ,

    T . H e , S . K r i s h n a m u r t h y , L . L u o , S . S o n , J . S t a n k o v i c , R . S t o l e r u , a n d A . W o o d .

    E n v i r o t r a c k : T o w a r d s a n e n v i r o n m e n t a l c o m p u t i n g p a r a d i g m f o r d i s t r i b u t e d s e n -

    s o r n e t w o r k s . I n P r o c e e d i n g s o f t h e 2 4 t h I n t e r n a t i o n a l C o n f e r e n c e o n D i s t r i b u t e d

    C o m p u t i n g S y s t e m s ( I C D C S ' 0 4 ) , p a g e s 5 8 2 5 8 9 , 2 0 0 4 .

    2 . A . B i e n i e k a n d A . M o g a . A n e c i e n t w a t e r s h e d a l g o r i t h m b a s e d o n c o n n e c t e d

    c o m p o n e n t s . P a t t e r n R e c o g n i t i o n , 3 3 ( 6 ) : 9 0 7 9 1 6 , 2 0 0 0 .

    3 . A n d r B l e a u a n d L . J o s h u a L e o n . W a t e r s h e d - b a s e d s e g m e n t a t i o n a n d r e g i o n m e r -

    g i n g . C o m p u t . V i s . I m a g e U n d e r s t . , 7 7 : 3 1 7 3 7 0 , J a n u a r y 2 0 0 0 .

    4 . M a u r i c e C h u a n d J u a n J u l i a L i u . S t a t e - c e n t r i c p r o g r a m m i n g f o r s e n s o r a n d a c -

    t u a t o r n e t w o r k s y s t e m s . I E E E P e r v a s i v e C o m p u t i n g , 2 0 0 3 .

    5 . V . G r a u , A . U . J . M e w e s , M . A l c a n i z , R . K i k i n i s , a n d S . K . W a r e l d . I m p r o -

    v e d w a t e r s h e d t r a n s f o r m f o r m e d i c a l i m a g e s e g m e n t a t i o n u s i n g p r i o r i n f o r m a t i o n .

    2 3 ( 4 ) : 4 4 7 4 5 8 , 2 0 0 4 .

    6 . M . H a m m o u d e h , R . N e w m a n , C . D e n n e t t , a n d S . M o u n t . I n t e r p o l a t i o n t e c h n i q u e s

    f o r b u i l d i n g a c o n t i n u o u s m a p f r o m d i s c r e t e w i r e l e s s s e n s o r n e t w o r k d a t a . W i r e l e s s

    C o m m u n i c a t i o n s a n d M o b i l e C o m p u t i n g , J a n u a r y 2 0 1 1 .

    7 . C . J . K u o , S . F . O d e h , a n d M . C . H u a n g . I m a g e s e g m e n t a t i o n w i t h i m p r o v e d w a -

    t e r s h e d a l g o r i t h m a n d i t s f p g a i m p l e m e n t a t i o n . I E E E I S C A S 2 0 0 1 , 2 : 7 5 3 7 5 6 ,

    2 0 0 1 .

    8 . C h u n - H a n L i n , C h u n g - T a K i n g , a n d H u n g - C h a n g H s i a o . R e g i o n a b s t r a c t i o n f o r

    e v e n t t r a c k i n g i n w i r e l e s s s e n s o r n e t w o r k s . I n 8 t h I n t e r n a t i o n a l S y m p o s i u m o n

    P a r a l l e l A r c h i t e c t u r e s A l g o r i t h m s a n d N e t w o r k s , p a g e 2 0 0 5 , 2 7 4 - 2 8 1 .

    9 . F e r n a n d M e y e r . T o p o g r a p h i c d i s t a n c e a n d w a t e r s h e d l i n e s . S i g n a l P r o c e s s . , 3 8 : 1 1 3

    1 2 5 , J u l y 1 9 9 4 .

    1 0 . L u c a M o t t o l a a n d G i a n P i e t r o P i c c o . U s i n g l o g i c a l n e i g h b o r h o o d s t o e n a b l e s c o p i n g

    i n w i r e l e s s s e n s o r n e t w o r k s . I n P r o c e e d i n g s o f t h e 3 r d i n t e r n a t i o n a l M i d d l e w a r e

    d o c t o r a l s y m p o s i u m , p a g e s 6 , 2 0 0 6 .

    1 1 . S a r a h M o u n t . D i n g o w i r e l e s s s e n s o r n e t w o r k s s i m u l a t o r .

    h t t p : / / c o d e . g o o g l e . c o m / p / d i n g o - w s n / , 2 0 1 1 . [ O n l i n e ; a c c e s s e d 2 6 - M a r c h - 2 0 1 1 ] .

    1 2 . V c t o r O s m a - R u i z , J u a n I . G o d i n o - L l o r e n t e , N i c o l s S e n z - L e c h n , a n d P e d r o

    G m e z - V i l d a . A n i m p r o v e d w a t e r s h e d a l g o r i t h m b a s e d o n e c i e n t c o m p u t a t i o n

    o f s h o r t e s t p a t h s . P a t t e r n R e c o g n . , 4 0 : 1 0 7 8 1 0 9 0 , M a r c h 2 0 0 7 .

    1 3 . G . J . P o t t i e a n d W . J . K a i s e r . W i r e l e s s i n t e g r a t e d n e t w o r k s e n s o r s . C o m m u n .

    A C M , 4 3 ( 5 ) : 5 1 5 8 , 2 0 0 0 .

    1 4 . C . R a m b a b u , T . S . R a t h o r e , a n d I . C h a k r a b a r t i . A n e w w a t e r s h e d a l g o r i t h m b a s e d

    o n h i l l c l i m b i n g t e c h n i q u e f o r i m a g e s e g m e n t a t i o n . 4 : 1 4 0 4 1 4 0 8 , 2 0 0 3 .

    1 5 . R o e r d i n k a n d M e i j s t e r . T h e w a t e r s h e d t r a n s f o r m : D e n i t i o n s , a l g o r i t h m s a n d

    p a r a l l e l i z a t i o n s t r a t e g i e s . F U N D I N F : F u n d a m e n t a I n f o r m a t i c a , 4 1 , 2 0 0 0 .

    1 6 . D o n a l d S h e p a r d . A t w o - d i m e n s i o n a l i n t e r p o l a t i o n f u n c t i o n f o r i r r e g u l a r l y - s p a c e d

    d a t a . I n P r o c e e d i n g s o f t h e 1 9 6 8 2 3 r d A C M n a t i o n a l c o n f e r e n c e , p a g e s 5 1 7 5 2 4 ,

    1 9 6 8 .

  • 8/2/2019 Building Programming Abstractions for Wireless Sensor Networks Using Watershed Segmentation

    12/12

    1 7 . H a n S u n , J i n g y u Y a n g , a n d M i n g w u R e n . A f a s t w a t e r s h e d a l g o r i t h m b a s e d

    o n c h a i n c o d e a n d i t s a p p l i c a t i o n i n i m a g e s e g m e n t a t i o n . P a t t e r n R e c o g n . L e t t . ,

    2 6 : 1 2 6 6 1 2 7 4 , J u l y 2 0 0 5 .

    1 8 . P e n g S u n , W i n s t o n K . G . S e a h , a n d P i u s W . Q . L e e . E c i e n t d a t a d e l i v e r y w i t h

    p a c k e t c l o n i n g f o r u n d e r w a t e r s e n s o r n e t w o r k s . I n S y m p o s i u m o n U n d e r w a t e r T e c h -

    n o l o g y a n d W o r k s h o p o n S c i e n t i c U s e o f S u b m a r i n e C a b l e s a n d R e l a t e d T e c h n o -

    l o g i e s , p a g e s 3 4 4 1 , A p r i l 2 0 0 7 .

    1 9 . M i c h a w i e r c z a n d M a r c i n I w a n o w s k i . F a s t , p a r a l l e l w a t e r s h e d a l g o r i t h m b a s e d

    o n p a t h t r a c i n g . I n P r o c e e d i n g s o f t h e 2 0 1 0 i n t e r n a t i o n a l c o n f e r e n c e o n C o m p u t e r

    v i s i o n a n d g r a p h i c s : P a r t I I , I C C V G ' 1 0 , p a g e s 3 1 7 3 2 4 , 2 0 1 0 .

    2 0 . L . V i n c e n t a n d P . S o i l l e . W a t e r s h e d s i n d i g i t a l s p a c e s : A n e c i e n t a l g o r i t h m b a s e d

    o n i m m e r s i o n s i m u l a t i o n s . I E E E T r a n s a c t i o n s o n P a t t e r n A n a l y s i s a n d M a c h i n e

    I n t e l l i g e n c e , 1 3 : 5 8 3 5 9 8 , 1 9 9 1 .

    2 1 . B j r n W a g n e r , A n d r e a s D i n g e s , P a u l M l l e r , a n d G u n d o l f H a a s e . P a r a l l e l v o l u m e

    i m a g e s e g m e n t a t i o n w i t h w a t e r s h e d t r a n s f o r m a t i o n . I n P r o c e e d i n g s o f t h e 1 6 t h

    S c a n d i n a v i a n C o n f e r e n c e o n I m a g e A n a l y s i s , S C I A ' 0 9 , p a g e s 4 2 0 4 2 9 , 2 0 0 9 .

    2 2 . M a t t W e l s h a n d G e o M a i n l a n d . P r o g r a m m i n g s e n s o r n e t w o r k s u s i n g a b s t r a c t

    r e g i o n s . I n P r o c e e d i n g s o f t h e 1 s t c o n f e r e n c e o n S y m p o s i u m o n N e t w o r k e d S y s t e m s

    D e s i g n a n d I m p l e m e n t a t i o n - V o l u m e 1 , p a g e s 3 3 , 2 0 0 4 .