## 2 Network Architecture  
Traditionally, most of the proposed network architectures in scalar wireless sensor networks are based on a flat architecture of distributed homogeneous nodes, where low-power scalar sensors are in charge of performing simple tasks such as detecting scalar physical measurements. But with the emerging of WMSN and its new applications, new types of sensor nodes besides scalar sensors (such as multimedia sensors, processing hubs, storage hubs) with different capabilities and functionalities have been used. This raises the need to reconfigure the network into different architectures in a way the network can be more scalable and more efficient depending on its specific application and QoS requirements. Therefore, based on the designed network topology, the available resources in the network can be efficiently utilized and fairly distributed throughout the network, and the desired operations of the multimedia content can be handled. In general, Network architectures in WMSNs can be divided into three reference models:  
The first model is the **single-tier flat architecture** where the network is deployed with homogeneous sensor nodes of the same capabilities and functionalities. In this model all the nodes can perform any function from image capturing through multimedia processing to data relaying toward the sink in multi-hop basis. Single-tier flat architecture is easy to manage. Moreover, multimedia processing is distributed among the nodes, which prolongs network life time. The second model is the **single-tier clustered architecture** deployed with heterogeneous sensors where camera, audio and scalar sensors within each cluster relay data to a cluster head. The cluster head has more resources and it is able to perform intensive data processing. The cluster head is wirelessly connected with the sink or the gateway either directly or through other cluster heads in multi-hop fashion. The third model is the **multi-tier architecture** with heterogeneous sensors. In this architecture, the first tier deployed with scalar sensors performs simple tasks, like motion detection, the second tier of camera sensors may perform more complicated tasks as object detection or object recognition, and at the third tier more powerful and high resolution camera sensors are capable to perform more complex tasks, like object tracking. Each tier may have a central hub to perform more data processing and communicate with the higher tier. The third tier is connected wirelessly with the sink or the gateway. This architecture can accomplish tasks with different needs with better balance among costs, coverage, functionality, and reliability requirements. On the other side, the use of just one node type in homogeneous flat network is not scalable enough to enclose all complexity and dynamic range of applications offered over WMSNs. In [8], a two-tier video surveillance system of multiple cameras is integrated with a wireless sensor network mounting passive infrared (PIR) sensors to improve the accuracy of the vision system. In the first tier, PIR sensors can be used to cover the areas that are invisible to cameras or out of their FoVs (Field of Views), and to reduce the required zooming and resolution capabilities of the cameras. PIR is very suitable to WMSN because of its low cost, low power, small size, and easy to place and it is widely used for motion detection and triggering cameras. PIR's characteristics can be exploited to detect motion and/or change in direction in its coverage area. The second tier is composed of cameras for object extraction and tracking. By using this system, changes in the motion direction can be detected by putting PIR sensors behind the obstacles and changes in background is interpreted correctly by examining the output of PIR sensor that is close to that background object; if the camera detects a moving object but the PIR sensor does not capture it, then it is considered as a change in the background.