n-queens-based algorithm for moving object detection in distributed wireless sensor networks

8
Journal of Computing and Information Technology - CIT 16, 2008, 4, 325–332 doi:10.2498 /cit.1001401 325 N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks Biljana Stojkoska, Danco Davcev and Vladimir Trajkovik Faculty of Electrical Engineering and Information Technologies, Ss. Cyril and Methodius University, Skopje, Republic of Macedonia The main constraint of wireless sensor networks (WSN) in enabling wireless image communication is the high energy requirement, which may exceed even the future capabilities of battery technologies. In this paper we have shown that this bottleneck can be overcome by developing local in-network image processing algorithm that offers optimal energy consumption. Our algorithm is very suitable for intruder detection applications. Each node is responsible for processing the image captured by the video sensor, which consists of NxN blocks. If an intruder is detected in the monitoring region, the node will transmit the image for further processing. Otherwise, the node takes no action. Results provided from our experiments show that our algorithm is better than the traditional moving object detection techniques by a factor of (N/2) in terms of energy savings. Keywords: wireless sensor networks, multimedia, image processing, motion detection 1. Introduction In recent years, there has been a huge advance- ment in wireless sensor computing technology [3]. This has led to the production of wire- less sensors not only capable of observing and reporting physical phenomena, but also of ac- complishing other operations, like data process- ing and communication. The sensors are or- ganized in a network and they communicate by exchanging information using radio mod- ules. They are actually responsible for the first stages of the processing hierarchy. After taking samples from the environment they sense (light level, air temperature, humidity etc.) they can process data or exchange it. All useful packets are sent to the sink node. This node is usually wirily connected with a server which stores the data. Server (base station) might be the final destination of the data or might act as a hub from where the data is sent to users over the wired network (Figure 1). Figure 1. Architecture of the system. The data is not directly sent to the sink as sensors nodes have short range of radio communication while being deployed in a vast region. There are a lot of multi-hops routing protocols that of- fer optimal communication cost. Each sensor sends data to its closest neighbor responsible for retransmitting the packets [9]. With the growth of mobile internet and multi- media services, wireless image sensors are be- coming suitable for applications which require more detailed analysis of the environment, like

Upload: others

Post on 03-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Journal of Computing and Information Technology - CIT 16, 2008, 4, 325–332doi:10.2498/cit.1001401

325

N-Queens-based Algorithm forMoving Object Detection inDistributed Wireless Sensor Networks

Biljana Stojkoska, Danco Davcev and Vladimir TrajkovikFaculty of Electrical Engineering and Information Technologies, Ss. Cyril and Methodius University, Skopje,Republic of Macedonia

The main constraint of wireless sensor networks (WSN)in enabling wireless image communication is the highenergy requirement, which may exceed even the futurecapabilities of battery technologies. In this paper wehave shown that this bottleneck can be overcome bydeveloping local in-network image processing algorithmthat offers optimal energy consumption. Our algorithmis very suitable for intruder detection applications. Eachnode is responsible for processing the image capturedby the video sensor, which consists of NxN blocks. Ifan intruder is detected in the monitoring region, thenode will transmit the image for further processing.Otherwise, the node takes no action. Results providedfrom our experiments show that our algorithm is betterthan the traditional moving object detection techniquesby a factor of (N/2) in terms of energy savings.

Keywords: wireless sensor networks, multimedia, imageprocessing, motion detection

1. Introduction

In recent years, there has been a huge advance-ment in wireless sensor computing technology[3]. This has led to the production of wire-less sensors not only capable of observing andreporting physical phenomena, but also of ac-complishing other operations, like data process-ing and communication. The sensors are or-ganized in a network and they communicateby exchanging information using radio mod-ules. They are actually responsible for the firststages of the processing hierarchy. After takingsamples from the environment they sense (lightlevel, air temperature, humidity etc.) they canprocess data or exchange it. All useful packetsare sent to the sink node. This node is usuallywirily connected with a server which stores the

data. Server (base station) might be the finaldestination of the data or might act as a hubfrom where the data is sent to users over thewired network (Figure 1).

Figure 1. Architecture of the system.

The data is not directly sent to the sink as sensorsnodes have short range of radio communicationwhile being deployed in a vast region. Thereare a lot of multi-hops routing protocols that of-fer optimal communication cost. Each sensorsends data to its closest neighbor responsible forretransmitting the packets [9].

With the growth of mobile internet and multi-media services, wireless image sensors are be-coming suitable for applications which requiremore detailed analysis of the environment, like

326 N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks

security and video surveillance. The ability ofWSNs to provide support for video streamingis restricted due to the bandwidth and powerlimitations of the nodes. Video streams, unlikedata streams, are larger in size and require vari-ous guarantees for bandwidth, delay and jitterfrom the network [13]. A WSN is labored toprovide enough end-to-end bandwidth for suchcommunications. In addition, sensor nodes run-ning on small batteries are power-starved, asbattery technology has not been keeping pacewith microelectronic technology. By using theup-to-date WSN routing protocols, this opera-tion will result in unaccepted occupation of thebandwidth for a long period of time, which willreduce the efficiency of the system.

In such a scenario, maintaining the lifetime ofthe nodes and enabling the video streams totravel over the network are two diametricallyopposite requirements.

In this paper we describe fast in-network imageprocessing algorithm for surveillance applica-tion, which is especially suitable for intruderdetection applications.

The rest of the paper is organized as follows.In the next section, the relevant work relatedto the present mote platforms for camera sen-sor network is discussed. Section three of thispaper describes the traditional techniques formotion detection and explains the frameworkwe propose for WSN image processing. Theforth section explains our N-Queens-based al-gorithm for local in-network image processing.The fifth section gives the results provided fromour experiments and demonstrates the effective-ness of the proposed algorithm in minimizing

energy consumption for wireless sensor com-munication. Finally, we conclude this paper insection six.

2. Related Work

Unless WSN are touted as a popular solution insurveillance systems, little work has been donein integrating image sensors into wireless node.

Mica2 platform provides an easy way to addthe capability of capturing images just by plug-ging a module onto the mote. The camera andthe mote are interfaced using an intermediateboard providing an interface to combine them[5]. MICA motes can be purchased from Cross-bow technology, Inc. They are equipped with aradio module, 8-bit 4-7 MHz processor, mem-ory, two AA batteries and a suite of sensors [6].

Cyclops [10] is a smart vision sensor board thatcan be attached as an external sensor to a mote,such as the one from the Mica family (Figure2 left). Cyclops consists of a micro-controller(MCU), a complex programmable logic device(CPLD), an external SRAM, an external Flashand an imager that offers a limited resolution ofthe images (128x128).

Weeble node architecture is another video plat-form [11] that represents an integration of lowcost, wide angle camera withMica2 motes (Fig-ure 2 right). This node is capable of taking im-ages at a maximum resolution of 640x480 andadditionally can self-correct for arbitrary orien-tation.

Figure 2. Cyclops [10] (left) weeble architecture [11] (right).

N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks 327

SensEye[12] is a camera sensor network forvideo surveillance based on three tier architec-ture. Tier 1 consists of Cyclops nodes that wakeup periodically, obtain an image of the environ-ment and process the image to detect presenceof new objects using a simple frame differenc-ing mechanism. An image of the backgroundis stored in the memory and is used for framingdifferences for each captured image. The framedifference is passed through a simple threshold-based noise filter to get a cleaned foregroundimage. The number of foreground pixels to-gether with a thresholdingmechanism is used todetect new objects in the environment. Highertiers consist of more advanced motes with high-resolution cameras.

3. Framework for WSN Image Processing

Motion detection is the first building block ina typical surveillance application. The nextstages (object tracking and higher level pro-cessing) heavily depend on the accuracy androbustness of the first step of moving object de-tection [1].

Figure 3. Generic framework for image processingalgorithms.

In the traditional systems for video surveillance(Figure 3), the video sequence is captured bythe image sensor and compressed using JPEGcompression. The module for motion detectionreceives a wide-angle camera image as an inputand computes the difference between consecu-tive images. When this difference is above thethreshold, it announces the presence of a mov-ing object. Motion detection is still consideredas a difficult problem, due to dynamic changesin the nature, like sudden illuminations, weatherchanges, waving trees, water etc.

Most of the algorithms that have been pro-posed within the last years and have solvedthe problem of extracting moving targets from

a video stream, basically can be divided intothreemain groups: temporal differencing, back-ground subtraction and optical flow [1]. The op-tical flow approach is a very complex and timeconsuming technique that is inappropriate forsuch real-time applications and is not subject ofour interest [1].

Temporal differencing is highly adaptive to dy-namic environments, since it uses the pixel-wise difference between two or three consec-utive frames in video imagery. This methoddoes not perform well in extracting all relevantfeature pixels, especially when the foregroundobject stops moving, moves slowly or its tex-ture is uniform. This algorithm is also knownas temporal thresholding.

Themost commonly used algorithms formotiondetection are based on background subtraction.This method is very sensitive to dynamic envi-ronment, but provides complete feature data.The detection is achieved by subtracting thebackground from the current frame in all re-gions where they match. The background im-age is created in an initialized phase by averag-ing images over time. In order to adapt to thecurrent environmental conditions, the referencebackground is updated with new images overtime.

When modeling the background, there are usu-ally two common problems we are faced with:

• the presence of foreground objects duringthe process of modeling the background;

• sudden variations in illumination conditions;

Modeling of the background is usually carriedout at pixel level, where pixels could be col-lected in a number of blocks. The intensity orcolor of the pixels is the commonly used feature.

Apart from traditional systems for video surveil-lance, in WSN applications data cannot be pro-ceeded in traditional fashion. For a simple ex-ample, consider an application for intruder de-tection. A network of wireless sensor nodes hasbeen deployed tomonitor an environment. Eachnode in the network is equipped with a videosensor that periodically captures images fromthe scene, compresses them using JPEG com-pression and transmits them to the sink whichis directly connected to the central server wherethe further processing is done.

328 N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks

Such high-rate, real-time imaging applicationspose significant design challenge, as they re-quire strict end-to-end delay, bandwidth, andjitter guarantees:

• In the most multi-hops routing protocols,each node sends the packets to its parent.The nodes that are highest in the routing tree(and closest to the sink), will have the mostdata to transmit and will quickly exhausttheir available energy. In this situation, theuseful information could not reach the sinkany more.

• Sincemulti-hop communication tends to gen-erate more interference, delay, and both hig-her packet loss and error during transmis-sion, this operation will result in unacceptedoccupation of the bandwidth for a long pe-riod of time. Interference and high packetloss rate affect the bandwidth and delay val-ues of the route. This cannot satisfy the strictquality of service requirements, such as sus-taining transmission of high quality data at ahigh bit-rate.

To overcome the bottlenecks of wireless im-age communication, we propose two-level ar-chitecture for video surveillance systems. Thenodes represent the first level since they are re-sponsible for image capturing and initial frameprocessing. Image sensor nodes must processthe images in-node to extract relevant featuresbefore transmission. Nodes locally apply thealgorithms for motion detection, and if the pro-vided results are decided to be useful, the pic-ture is compressed and sent to the sink. Variouscompression standards have been analyzed forWSN efficient power management, but JPEGis considered as the most appropriate technique[4][8].

The second level is represented by the server(base station) which is responsible for furtheranalysis (object tracking and action recogni-tion) as shown on Figure 4.

Figure 4. Image processing framework in large scalewireless sensor networks.

This architecture suits well for large scale net-works used for applications such as militarytracking or intruder detection. The nodes arescattered randomly in a hostile and unattendedenvironment. After deployment, they wouldform a topology map and would start to monitorthe area for any movement or unusual activity.If a particular node detects a moving object, itcould compress the current frame (or only thecritical block of the frame) and send it over thenetwork to the base station.

4. In-network Motion Detection

WSNframework for image processing discussedin previous section reflects only on reducingnetwork traffic, therefore minimizing commu-nicational cost and increasing lifetime of thenetwork. Another issue that arises in wirelessimage sensor networks is the complex imageprocessing algorithms, which are both mem-ory and computational intensive. Data encod-ing/decoding involves significant processing,much more than the processing required forother sensed data. Further, aggregation at theintermediate nodes requires complicated algo-rithms and higher processing power.

These requirements make image processing achallenging problem, as sensor nodes are re-source constraint devices. Memory limitations,local computational energy cost and processorspeed have to be considered in order to guar-antee real-time response. To rise above theseshortcomings, we propose a new fast algorithmfor motion detection.

We were inspired by the famous problem ofN-Queens distribution on a chess field. Thequeens are put on an N×N chessboard such thatno two queens attack each other. This N-queensbased paradigm was previously proposed forblock matching techniques, as in [12] where N-Queen pixel decimation is used for fast motionestimation. We apply a similar idea as a tech-nique for motion detection.

4.1. N-queens-based Algorithm for MotionDetection

The trajectories of the moving objects can haveany direction, column, row, or diagonal in theimage. If the input frame is divided into Ncolumns and N rows, and N queens are placedsuch that:

N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks 329

• none of said N blocks occupies a positionin the same row as any other one of said Nblocks;

• none of said N blocks occupies a positionin same column as any other one of said Nblocks; and,

• none of said N blocks occupies a position inthe same diagonal as any other one of said Nblocks.

It is very possible that most of the moving objecttrajectories can cross at least one queen. It isbecause we expect that trajectories in the natureare usually continual. It is not very common tohave zig-zag trajectories.

By applying modified background subtractiontechnique, we propose to reduce the image anal-ysis. Instead of comparing all N2 blocks frombackground and current image, we can compareonly N blocks that belong to the queens, hopingthat moving object will cross at least one queen.

We made a small experiment. At the begin-ning 64 queens were placed on 32 x 32 gridcells. Generating random trajectories, for eachwe check if it passes though at least one queen.We had positive results in 75% of 100 sam-ples. As can be seen from the picture (Figure5 (a)), the trajectories with grey color are notcaptured. To decrease this possibility, queenscan be applied on more positions. One way isby reflecting the initial N queens across centralvertical line (Figure 5 (b)). This distributionwe call double N queens distribution. Othercombinations are also possible. For double Nqueens distribution the experiment was positivein 95%.

Motivated by this analysis, we propose the fol-lowing algorithm:

Step 1. capture first image;

Step 2. store first image in background framebuffer;

Step 3. forever:

• capture new image

• store new image in the input frame buffer

• divide the input frame into N columns andN rows;

• choose N referent blocks that correspond tothe positions of N-Queens problem distribu-tion;

• compare each of the N blocks from the inputframe with the same block from the back-ground frame;

• if the difference of at least one block is abovethe threshold, send the frame to the sink andgo to step 3;

• if the difference is below the threshold, up-date the background frame and go to step3.

The main challenge here is modeling the back-ground. For simplicity we pronounce the firstframe as a background, although it can be cre-ated by averaging images over time. To respondto the environmental changes, if the block dif-ference is below the threshold, we move thebackground frame slightly in the direction ofthe current frame. In other words, we update

Figure 5. N-Queens (a) and Double N-Queens (b) distribution.

330 N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks

pixels values toward new values. It has to bementioned that choosing the threshold is notonly application-specific, but also depends onthe specification of the environment.

The pseudo code of the algorithm is shown be-low:

read background image;while (true){

i:=1;read new image;while ( i<=2*N) {q position =next(q position);

s = n f[q position]-bg f [q position];

if (abs(s)>threshold){send alarm;break;}

else {if (s>0)

bg f [q position]++;else

bg f [q position]- -;}i++;}

}

The function read background image reads thebackground image and stores it in one dimen-sional array bg f. The function read new imagereads the new image and stores it in one dimen-sional array n f. The function send alarm sendsthe new image to the sink. The function nextreturns the position of the next queen which hasto be processed.

5. Evaluation

First we tested our N-Queens based algorithmwith double N-Queens distribution on videostreams taken from web cameras (320 × 240pixels camera image). We implemented imageprocessing routines within a high level process-ing language. To compare the performances,we processed the frames using traditional tech-niques based on background subtraction on aframe-by-frame basis (left pictures on Figure 6)and using our N-Queens based algorithm (rightpictures on Figure 6). Using 8 × 8 matrix rep-resentation, pixels are collected in a number ofblocks (each block consists of 64 pixels). Theinitial image was converted into 40 x 30 pixelsimage, where each pixel represents the aver-age of one block. We compared 1200 blocks

Figure 6. Motion detection using background subtraction algorithm (left) and N Queens based algorithm (right).

N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks 331

for background subtraction and 64 blocks forN-Queens based algorithm. These 64 blockssatisfy the double N-Queens distribution.

To analyze the performance achievement forMica2 platform, simulation softwarewas imple-mented in NesC, a structured, component-basedlanguage, very similar to the programming lan-guage C, and the testbed was simulated usingAvrora [5] simulator.

We measured the energy consumption for pro-cessing one image sample. The power neededto capture the image is not included in our ex-periments. The results are shown in the tablebelow:

Energy Usage (mJ)

Algorithm 128x128 176x255

Background Subtraction 23.19 63.78

N-Queens-based 2.9 5.79

As can be seen from the results, our N-Queensbased algorithm is better than the traditionalbackground subtraction technique by a factor of(N/2) in terms of energy savings. As N-Queensbased algorithm for moving object detection isa heuristic method, we suggest an adaptive ap-proach which is combination of our algorithmand the traditional background subtraction. Forexample, if we capture images at every 5 sec-onds, then four images can be processed withour algorithm, and the fifth image can be pro-cessed with traditional background subtractionmethod. The number of images processed withour algorithm is application specific. If we areinterested in detecting intruders, we can com-pute which is the common speed of the peoplepassing cross. If the time needed for the peopleto cross the whole region is 20 seconds, we canuse our algorithm for 19 image samples, andthe traditional method for one image sample.Such an adaptive approach should increase therobustness of the particular application.

6. Conclusion

In this paper, we presented a new WSN im-age processing framework. In our approach,each node in the network is responsible for thefirst stage of the processing. If an intruder is

detected, the image is transmitted to the sink.In order to minimize the energy consumption,we propose an in-network image processing al-gorithm based on the famous N-queens distri-bution of the blocks. The results we have pre-sented show that our algorithm consumes (N/2)-times less energy for local image processingthan traditional techniques.

If combined with traditional techniques, this ap-proach can perform significant improvement ofthe network performances.

References

[1] C. IANASI, V. GUI, C. I. TOMA, D. PESCARU, AFast Algorithm for Background Tracking in VideoSurveillance, Using Nonparametric Kernel DensityEstimation, FACTA UNIVERSITATIS (Nis), Se-ries: Electronics and Energetics, 18(1):127-144,April 2005

[2] C.N. WANG, S. W. YANG, C. M. LIU, T. CHIANG, Ahierarchical decimation lattice based on N-Queenwith a application for motion estimation, SignalProcessing Letters, IEEE, 10(8): 228-231, Aug.2003,

[3] F. L. LEWIS, Wireless Sensor Networks, chapter 4in D. J. Cook and S. K. Das, editors, Smart Environ-ments: Technologies, Protocols, and Applications,John Wiley, New York, 2004;

[4] H. WU AND A. ABOUZEID, “Energy Efficient Dis-tributed JPEG2000 Image Compression in Multi-hop Wireless Networks, in Proceedings of the 4thworkshop on Applications and Services in WirelessNetworks (ASWN), Boston, 2004.

[5] http://www.compilers.cs.ucla.edu/avrora[1/3/2008]

[6] http://www.xbow.com [1/3/2008]

[7] I. AKYILDIZ, T. MELODIA, K. R. CHOWDHURY, Asurvey of wireless multimedia sensor networks,Computer Networks, 51:921-960, 2007.

[8] JOHN LACH, DAVID EVANS, JON MCCUNE, JASONBRANDON, “Power-Efficient Adaptable WirelessSensor Network′′, .Military and Aerospace Pro-grammable Logic Devices International Confer-ence, 2003.

[9] K. AKKAYA, M. YOUNIS, A survey of routing proto-cols in wireless sensor networks, Elsevier Ad HocNetwork Journal, 3(3):325–349, May 2005.

[10] M. RAHIMI, R. BAER, J. WARRIOR, D. ESTRIN, M.SRIVASTAVA. Cyclops: In Situ Image Sensing andInterpretation in Wireless Sensor Networks, in Pro-ceedings of the 3rd ACM International Conferenceon Embedded Networked Sensor Systems (SenSys’05), pp. 192–204, San Diego, Calif, USA, Novem-ber 2005.

332 N-Queens-based Algorithm for Moving Object Detection in Distributed Wireless Sensor Networks

[11] P. SAMBHOOS, A.HASAN, R.HAN, T. LOOKABAUGH,J. MULLIGAN, Weeblevideo: Wide angle field-of-view video sensor networks. In Workshop on Dis-tributed Smart Cameras (DSC06), 2006, held inconjunction with ACM SenSys 2006.

[12] PURUSHOTTAM KULKARNI, DEEPAK GANESAN,PRASHANT SHENOY QIFENG LU, SensEye: A Multi-tier Camera Sensor Network, in Proceedings of the13th ACM International Conference on Multimedia(ACM Multimedia ’05), pp. 229–238, Singapore,November 2005.

[13] S. MISRA, M. REISSLEIN, G. XUE, A Survey of Mul-timedia Streaming in Wireless Sensor Networks,IEEE Communications Surveys and Tutorials, 2008.

Received: June, 2008Accepted: September, 2008

Contact addresses:

Biljana StojkoskaFaculty of Electrical Engineering

and Information TechnologiesKarposh 2, PO Box 574, Skopje

Republic of Macedoniae:mail: [email protected]

Danco DavcevFaculty of Electrical Engineering

and Information TechnologiesKarposh 2, PO Box 574, Skopje

Republic of Macedoniae:mail: [email protected]

Vladimir TrajkovikFaculty of Electrical Engineering

and Information TechnologiesKarposh 2, PO Box 574, Skopje

Republic of Macedonia

BILJANA L. STOJKOSKA obtained B.Sc. degree from the Faculty of Elec-trical Engineering at the University “Ss. Cyril & Methodius”, Skopje,Macedonia in 2006. In 2008 she received her M.Sc. degree in ComputerScience from the same university.

She is currently working as teaching and research assistant at the Com-puter Science and Informatics Department at the Faculty of ElectricalEngineering and Information Technology.

Her research interests include wireless sensor systems, intelligent in-formation systems, ICT based collaboration systems, distributed andmulti-agent systems.

DANCO P. DAVCEV obtained the degree of Engineer in Electronics andComputer Science from the Faculty of Electrical Engineering at theUniversity of Belgrade (YU) in 1972. He received his "Doctor – In-genieur" degree in Computer Science from the University of ORSAY(Paris, France) in 1975 and Ph.D. degree in Informatics from the Uni-versity of Belgrade (YU) in 1981.

He is currently a professor and head of Computer Science and Infor-matics Department. He is also head of EU Open and Distance LearningCenter at the University "Ss. Cyril & Methodius", Skopje (Macedo-nia). He has more than 250 research papers presented on InternationalConferences or published in International Journals in Computer Scienceand Informatics.

His research interests includemultimedia databases and systems, spatio-temporal data and 3D objects, intelligent information systems, distancelearning systems, distributed and multi-agent systems, wireless sensorsystems and system biology. He is a member of ACM and a SeniorMember of IEEE.

VLADIMIR TRAJKOVIK has obtained his degrees at the Faculty of Elec-trical engineering and Information Technologies, University “Ss. Cyriland Methodius” in Skopje, Macedonia. From February 1995 to De-cember 1997 he worked for Macedonian Telecommunications.

His current position is at the Faculty of Electrical Engineering and In-formation technologies at the University “Ss. Cyril and Methodius”.During the past 5 years he published more than 60 research paperspresented on International Conferences or published in InternationalJournals in Computer Science and Informatics. In the same period, hecoordinated and participated in more then 10 bilateral and multilateralEU projects.

His research interests include: information systems analyses and design,object oriented systems, distributed computer systems, distance educa-tional systems, multi-agent systems, ICT based collaboration systemsand mobile services.