Distributed Image Compression Architecture over Wireless Multimedia Sensor Networks

In a wireless multimedia sensor network (WMSN), the minimization of network energy consumption is a crucial task not just for scalar data but also for multimedia. In this network, a camera node (CN) captures images and transmits them to a base station (BS). Several sensor nodes (SNs) are also placed throughout the network to facilitate the proper functioning of the network. Transmitting an image requires a large amount of energy due to the image size and distance; however, SNs are resource constrained. Image compression is used to scale down image size; however, it is accompanied by a computational complexity trade-off.Moreover, direct image transmission to a BS requires more energy.Thus, in this paper, we present a distributed image compression architecture over WMSN for prolonging the overall network lifetime (at high throughput). Our scheme consists of three subtasks: determining the optimal camera radius for prolonging the CN lifetime, distributing image compression tasks among the potential SNs to balance the energy, and, finally, adopting a multihop hierarchical routing scheme to reduce the long-distance transmission energy. Simulation results show that our scheme can prolong the overall network lifetime and achieve high throughput, in comparisonwith a traditional routing scheme and its state-of-the-art variants.


Introduction
The Internet plays a vital role in communication by connecting people around the world through millions of networking devices [1].The availability of advanced low-cost devices has led to the development of the Internet of Things (IoT).The Internet is moving toward the IoT and Cloud Computing, including Big Data, which has become the most important global technology platform for the future [2].Typically, the IoT is composed of smart things (or smart devices), which have the ability to detect (sense) or cooperate (communicate) with a physical environment and other devices over largescale and easy-to-deliver channels (wireless) with optional preprocessing or control those devices to deliver some particular tasks (processing) [1].
The wireless sensor network (WSN) is another key part of the IoT, which is used in many fields, such traffic, military, industry, and environmental monitoring and control [2,3].
In general, a single wireless sensor node (SN) consists of a readily available and inexpensive sensor, a data processor, memory, a receiver/transceiver, and power units for capturing scalar data, such as temperature, pressure, humidity, velocity, acceleration, and location [4].Recently, information has been changing from scalar data to multimedia data, such as image, video, and audio data.The IoT and Cloud Computing also provide a backend solution for processing such huge multimedia data streams, which have high computational requirements; for example, Wireless Multimedia Sensor Networks (WMSNs) are used for video streaming, video conferencing, and video surveillance [5].
A WMSN extends a typical WSN by adding multimedia services and devices, such as a Complementary Metal Oxide Semiconductor (CMOS) camera and a microphone, to capture images, video, or audio, which allows the device to retrieve not only scalar data but also multimedia streams.To facilitate understanding, for all devices or sensor nodes (SN) within a WMSN, there are two main types of nodes: camera nodes (CNs) and typical sensor nodes, which are called normal nodes (NNs) and are traditionally used to aid the transmission or perform other scalar-based sensing tasks.Typically, a CN captures the multimedia content and sends it to an NN for processing or transmission to its base station (BS).Although there are various practical transmission schemes [6][7][8][9], a hierarchical structure is typically applied, such as a cluster-based approach [10], which has the key advantages of direct-transmission energy optimization and zoning, which prolong the network lifetime.Figure 1 shows an example of SN deployment; here, there are two possible clusters: (1) a transmission cluster of the NN (here, its representation as cluster head is included) and (2) a camera cluster.As shown in Figure 1(a), a transmission cluster will be normally formed according to criteria that are related to the energy usage, such as distance and remaining power.In each cluster, the sensor node members will send the data to its corresponding cluster head (CH) before further transmitting the aggregated data toward the BS.Similarly, in Figure 1(b), with the introduction of a CN, a camera cluster is a cluster that has one CN and many nearby NNs, which typically function as relay nodes toward the BS.In this cluster, camera cluster optimization is difficult to achieve since the energy of each node has been changing over time.In addition, having too small of a coverage area may lead to having insufficiently many sensor nodes for processing or transmitting data, whereas having too large of a coverage area may cause more energy to be required for communication to its node members.
In general, an SN (NN or CN) comes with resource constraints, such as limited memory, buffer size, data processing, data transmission, and capacity of battery that is very difficult to recharge [11].Moreover, multimedia data require a large amount of bandwidth and more energy for data delivery, which causes SNs to deplete their energy quickly and shortens the network lifetime; most of the energy of the WMSN is used for data transmission.One possible solution is to compress such data to reduce their size.An image can be compressed because it is composed of many pixels that are closely correlated to one another.By exploiting this correlation, image compression techniques can reduce the size of the image efficiently [12].
Although many image compression techniques have been proposed, most are very complicated and have high resource requirements; thus, they cannot perform well in a resourceconstrained WMSN [13][14][15][16].If the image compression process relies on a single SN, this sensor node may quickly run out of energy.A few dead SNs can cause the failure of the entire network, especially SNs that break or divide the network into an unbalanced structure.Accordingly, in the design of a WMSN routing protocol, distributed image compression must be considered [17].However, designing a distributed scheme that overcomes the limitations of the SN to prolong the network lifetime is challenging since there is always a trade-off between compression quality and energy (such as computing and transmission power).
Furthermore, long-distance data transmission requires more energy than short-distance transmission and causes source SNs to drain their energy quickly; therefore, direct data communication from each individual SN is not efficient in a WMSN; thus, multihop communication is recommended.However, selecting a relay sensor node among all sensor nodes for forwarding to optimally use the energy of the network is also a complicated task [18].
To overcome the abovementioned issues, we propose a novel distributed architecture of multihop image compression, namely, DICA, to extend the network lifetime and improve throughput using a combination of the fuzzy logic system (FLS) and a distribution-based computation approach.There are three main contributions of this paper: (1) we apply FLS to determine the optimal camera cluster size; (2) we design a distributed image compression technique that divides compression tasks among typical SNs (not camera nodes); and (3) we implement a hierarchical multihop routing technique to partition the network into layers, and similarly, FLS is adopted for optimum relay node selection.
The remainder of this paper is organized as follows: Section 2 highlights some key related works on distributed architectures for image compression in WMSNs.Section 3 describes our system models in detail.Section 4 provides details on our proposed architecture (DICA).Section 5 provides details on the simulation configuration and then presents and discusses the results.The performance of our proposed architecture is evaluated with respect to various metrics, in comparison with an energy-efficient distributed image compression scheme in resource-constrained multihop wireless networks (EEDIC) [14], a two-hop clustered image transmission scheme for maximizing network lifetime in wireless multimedia sensor networks (2HCIT) [19], and a traditional and simplified routing protocol, namely, lowenergy adaptive clustering (LEACH) [6].Finally, the conclusions and the future research directions are discussed in Section 6.

Related Work
Typically, a WSN requires a routing protocol to minimize the energy consumption of data transmission.As a clusteringbased approach, low-energy adaptive clustering hierarchy (LEACH) is a well-known routing protocol in WSNs.This protocol is an adaptive and self-organizing clustering protocol that generates a random value to select a CH in rotation among SNs.It was originally designed as a single-hop routing protocol, through which SNs transmit data to their CH, which then forwarded the aggregated data toward the BS.In this way, LEACH can distribute energy among SNs in the network to achieve energy reduction, thereby prolonging the network lifetime [6,20].
Unfortunately, when the scale of the network is increased, LEACH becomes inefficient since the distant CHs deplete their energies faster as they transmit the data to the BS; therefore, LEACH is unsuitable for a large-scale network.To mitigate this problem, multihop LEACH, which is an extension of LEACH, is introduced.In multihop LEACH, instead of sending data directly to the BS, the CH sends data through intermediate CHs, which are closer to the BS.This approach dramatically reduces the energy and extends the lifetime of the WSN [21].Note that there are also several LEACH derivatives for the purpose of network lifetime optimization [22].
Many researchers have applied LEACH in WSNs.However, LEACH does not consider the effects of multimedia data in WMSNs, such as images with huge size and other considerations, such as computing power and space constraints.Fortunately, as previously stated, an image normally has a large amount of redundant information, which can be removed by using image compression techniques to reduce the image size so that image transmission over multi-hop WMSNs is improved.Over the past decades, many compression techniques have been proposed and can be divided into two categories: discrete cosine transform (DCT) methods and discrete wavelet transform (DWT) methods [21].As an example of the former, JPEG is a well-known and widely used DCT-based image compression algorithm because it is very fast and energy efficient and requires less memory than other algorithms [23].
In contrast, the latter algorithms perform much better than those in the former algorithms in terms of compression ratio and image quality but with some trade-off as high computational complexity [21].JPEG2000 is another well-known DWT-based algorithm with the key advantage of providing a better image compression ratio, better image quality, and higher resistance to data transmission error and decoding error; therefore, high-complexity image transmission is not required for prolonging the network lifetime in the context of a WSN or WMSN.
JPEG2000 has been adopted in WMSNs in some works; for example, Zuo et al. [19] presented a two-hop clustered image transmission scheme that was based on traditional LEACH.They divided the clusters into two categories: camera clusters and normal clusters.The camera cluster forms during the first round; a fixed camera radius is carefully considered to ensure that the camera cluster has an adequate number of nodes to receive the image from the CN and then compress the image before sending it to the BS via the CH.At the beginning, the fixed optimized camera cluster radius is determined based on transmission radius adjustment.If the camera radius is too small, there would not be an adequate number of sensor nodes for the camera cluster, whereas if the radius is too large, the image transmission may require more energy than the image compression.In addition, conflicts between camera clusters can occur.
After that, the camera-equipped node assigns the image compression tasks to the nodes that have maximum residual energy within its radius to balance the energies of the camera cluster node members.Then, the camera-equipped node formulates the TDMA schedule based on the compression time, the transmission time of the compressed image, and the transmission time of the original image.JPEG2000 has also been used to make the image size smaller.The experimental results show that this technique can prolong the network lifetime by balancing the energy.However, setting up the camera cluster only once during network initialization is not effective since the energies of the camera cluster member nodes keep changing over time due to many factors.In the worst case, the CN still has energy, but there are no live nodes in the cluster to process and transmit the image to the destination.Furthermore, JPEG2000 is complicated for a single node to compress an image and the network cannot be scaled using conventional LEACH.
The closest work to ours was presented by Wu et al. [14].In this study, the wavelet-based image compression standard JPEG2000 is chosen as an image compression technique.The authors distributed the computational load of image compression tasks among SNs with the aim of prolonging the network lifetime.The main idea of the method that is presented in this paper is to distribute the wavelet transform tasks to numerous groups of SNs.To reduce the computational complexity and requirements, two methods were used.In the first method, the image is split into rows and columns with specific sizes, whereas in the second method, the image is cropped into a grid of the same size.Both methods send and distribute wavelet transform of these small images among SNs from source to destination.Nevertheless, in the first method, two round-trip wireless transceivers are required for the SNs who join in each level of the wavelet transform, which may lead to higher power consumption, while in the second method, there is no clear discussion about cluster formation for network load balancing.
To cope with the problems of [14], Tian et al. [15] suggested an algorithm for CH selection that is based on the distance and load factor for improving the centralized encoding algorithm of JPEG2000.First, after being captured by the CN, an image is divided into  blocks of images.Each CN sends those blocks to the  nodes with the highest remaining energy in the cluster to perform the first level of wavelet decomposition.As a result, four subbands are generated: low-low (LL), low-high (LH), high-low (HL), and high-high (HH).Then, the SNs that have participated in the wavelet transform transfer the data to the CH of the next cluster.After receiving the data, the CH forwards only one subband (LL) to a group of SNs for the next level of the wavelet transform, whereas the remaining subbands (LH, HL, and HH) are sent to three other SNs in the cluster for independent encoding.This process is repeated until the desired image compression ratio is achieved and the compressed image has arrived at the BS.This algorithm can decrease the energy consumption, offer load balancing of the network, and prolong the network lifetime.Unfortunately, the quality of the image is not satisfactory, comparing with the original JPEG2000.
Nasri et al. [24] proposed an effective JPEG2000 image compression method for multihop WSNs.This proposed method distributes the image compression tasks among SNs along the way to the BS, similar to the abovementioned studies.First, after receiving the query from the CN from the source SN, CH 1 selects multiple sensor nodes SN 1 ( = 1, . . ., 4).The source SN divides the original images into many tiles and sends them to this group of SNs (SN After completing the 1D wavelet transform, the SNs in this group send the intermediate result back to CH 3 for the other 1D wavelet transform.CH 3 sends the level 2 data to CH 4 for quantization.Then, CH 4 sends the level 2 data to a single sensor node, namely, SN 4 , for quantization, whereas the other SNs in this cluster are awakened.The number of levels depends on the compression target.After quantization, SN 4 sends the data to CH 5 .Then, CH 5 divides the quantized subbands into multiple smaller code blocks of equal size and sends them to a set of nodes, namely, SN 5 (SN 53 , SN 52 , SN 53 , and SN 54 ), for independent code block entropy encoding to produce compressed bitstreams.This procedure continues until the compressed image reaches the BS.This proposed scheme can reduce the memory consumption of SNs by dividing the original image into tiles and blocking quantized subbands into multiple smaller code blocks for entropy encoding.This scheme can also distribute the images to many nodes but needs to transmit uncompressed image along many clusters before the image is completely compressed; therefore, a large amount of energy is used during data transmission.
Another energy-efficient JPEG2000 image compression architecture is proposed by Lu et al. [25].In this proposed method, there are also two types of clusters: camera clusters and normal clusters.A camera cluster has a CN as its CH.First, the CN captures the image and divides it into tiles.Then, the tiles are sent to the member nodes of the camera cluster to share the compression tasks to minimize the total energy consumption.After finishing the compression tasks, the SNs send the compressed image to the normal CH.Then, the CH forwards the compressed image to the BS.By comparing with the scheme in which the CN performs all compression tasks and sends the compressed image out, this proposed method can reduce the energy consumption of the CN and improve the lifetime of the network.Unfortunately, in the experiment, the network lifetime is improved only in the case of dense SN deployment.
Aside from the routing protocol and image compression, as one of the pioneering forms of computational intelligence (CI) [26], fuzzy logic system (FLS) can be used in many fields to optimize the system when there are uncertainties in the system without requiring the complete information.Many studies have adopted FLS in WSNs, in particular, for routing and clustering.For example, Brante et al. [27] developed a fuzzy-logic-based relay selection scheme for multihop WSNs.The instantaneous channel conditions and the residual energy were used as fuzzy input to select the relay node.Unfortunately, when the density of nodes in the network is increased and relay selection grows dramatically, the end-to-end performance is impacted.
In addition, as stated in [26], the authors determined that, during clustering, the CH should be selected based on the residual energy and rotated periodically to balance the energy consumption.As a result, CHs that are far away from the BS die sooner than those that are nearer to the BS.Here, FLS-based unequal clustering was proposed to partition the network into clusters of different sizes.The clusters that are near the BS have smaller sizes than the distant clusters.FLS with three variables, namely, the distance to the BS, the residual energy, and the node degree, is used to compute the competitive radius, whereas each SN in the competitive radius computes the fuzzy choice using FIS with two input variables, namely, the distance and the node degree of the CH, to decide whether to join the cluster or not.However, as the network size increases, the clusters in WSN become imbalanced, which can reduce the performance of network since the node degrees and the remaining energies of the CHs are taken into account when SNs are assigned to the cluster.
Bagci and Yazici [28] also proposed the fuzzy-based clustering method.In their paper, each SN generates a random number between 0 and 1.The SN whose random number is below the predefined threshold  becomes a desired tentative CH.Each tentative CH computes the competitive radius using FLS with two input variables: the distance to the BS and the residual energy.A broadcasting message is sent by each tentative CH to compete with the other tentative CHs locally.If a tentative CH receives a broadcasting message from another tentative CH that has higher energy than its remaining energy within its competitive range, the tentative CH broadcasts the quit message; however, if the tentative CH receives broadcasting messages from tentative CHs whose energies are lower than its remaining energy, it becomes the CH.Compared to other unequal and equal clustering algorithms, this algorithm can perform better; unfortunately, it may cause imbalanced energy consumption of SNs in the WSN if the randomly selected CHs have lower remaining energy.(ii) The network is composed of two types of SNs: camera sensor nodes or camera nodes (CNs) and typical sensor nodes or normal nodes (NNs).

System Model
(iii) The number of the CNs is far less than the number of NNs.
(iv) All NNs are homogenous in each type; therefore, they have the same initial energy, computational power, memory, and so on.
(v) All SNs are unaware of their location and become static after deployment.
(vi) All SNs have the same communication range (radius =   ).
(vii) Each SN can approximate its distances to other SNs based on the received signal strength index (RSSI) [29].
(viii) A single BS is located at a specific position that is outside the sensor field and has sufficient hardware, software, and constant power supply.
(ix) The operation is broken into rounds.The transmission of a full image from a CN to the BS is considered one round.2), respectively [19].

Energy Consumption
where  elec is the energy that is consumed by the circuit per bit;  is the distance between sender and receiver. fs corresponds to free space, whereas  mp corresponds to multipath fading; they are the energies that are depleted by the amplifier for short and long distances, respectively. 0 = √ fs / mp is the reference distance between sender and receiver.If this distance is less than  0 , then  fs is used; otherwise,  mp is applied.
The energy consumption of an SN when it receives a -bit packet is as follows: After receiving data, the SN requires energy for data aggregation.The energy consumption of data aggregation is computed as follows: where  is the number of messages and  DA is the energy that is used for aggregating some data.JPEG2000, which is a wavelet-based image compression scheme, is used in this study.The energy consumption is divided into two parts: discrete wavelet transform (DWT) energy consumption and encoding energy consumption.The image compression energy consumption per bit, which is denoted as  comp , is calculated as follows [30]: ) where DWT Level is the desired decomposition level of the wavelet transform.
In an implementation on a StrongARM SA-1100 206 MHz device,  elec ,  fs , and  mp are measured to be approximately 50 nj/bit, 10 pj/bit, and 0.0013 pj/bit/m 4 , respectively. DWT , which denotes the discrete wavelet transform energy consumption, costs approximately 220 nj/bit, whereas  encode consumes an energy of approximately 20 nj/bit [14,19].

Definition and Notation.
Before proceeding to the proposed algorithm, the following definitions and notations are presented.
Definition 2 (neighboring nodes).The neighbor set of sensor nodes SN  is defined as NB  = { |  , ≤ 2  , ,  ̸ = }, where  is a set of sensor nodes that are deployed in the area (×),   denotes the broadcasting range (communication radius) of the SNs, and  , is the Euclidean distance between SN  and SN  , which is approximated using RSSI.
Definition 3 (node degree).The node degree is the number of neighbors of an SN in the field within broadcasting radius   .The degree of sensor node SN  is denoted as Deg (SN  ).The higher the degree of a sensor node SN  is, the more sensor nodes that surround SN  and the better the coverage if SN  is a cluster head.
Definition 4 (member nodes).Any SN can be a member of a cluster.After a cluster head is elected, any sensor node SN  that is in the coverage area of cluster head CH  or whose distance from CH  is less than   has a chance to be a member node of the cluster.
Definition 5 (competitive radius).The competitive radius of a camera node is determined by an appropriate camera cluster size.The competitive radius of camera node CN  is defined as  CN  and should satisfy Definition 6 (communication cluster).For energy efficiency, all SNs are grouped into sets, which are called clusters.A set of SNs consists of many SNs, of which only one is elected to be the cluster head (CH), while the rest are just member nodes.Member nodes send the data to their CH, which then forwards the data to the next destination.
Definition 7 (camera cluster).In a camera cluster, there is one camera node CN and its neighboring nodes NB CN .This cluster is formed to share the processing and transmission task of the camera node.The camera node acts as the cluster head of the camera cluster.
Definition 8 (image compression cluster).The image compression cluster is formed during data transmission.This cluster is used to compress the image before transmitting it to the BS.The highest-energy node in the camera cluster is selected to be the cluster head of image compression cluster ICH.The neighboring nodes of image compression cluster head NB ICH are members of the image compression cluster.
In our algorithm, we use nine different control messages: (i) CH-Msg (ID): this message is sent by the communication CH to its neighbors to announce itself as a CH and contains only the CH's ID.
(ii) CL-Join-Request-Msg (CH ID, ID): this message is sent by neighboring nodes of the communication CH to request to join the communication cluster.The message includes the ID of the CH and the ID of the SN that wants to join the cluster.
(iii) Level-Msg (ID, routing level): the BS and communication CHs broadcast this message, which contains their IDs and routing level information, to their neighbors to build a hierarchical routing structure.
(iv) Level-Request-Msg (ID): during a specific time, communication CHs, which do not receive any Level-Msg, broadcast this message to their neighboring SNs to request routing level information.The ID of the requesting CH is stored in this message.
(v) Level-Reply-Msg (ID, routing level): after receiving a Level-Request-Msg from the requesting communication CH, the SN replies with a Level-Request-Msg, which contains its ID and routing level information.
(vi) Cam-Msg (ID, cam energy, node degree): the CN sends a Cam-Msg, which contains its ID, remaining energy, and node degree, to its neighboring nodes to form a camera cluster.
(vii) Cam-Join-Request-Msg (ID, energy): this message is sent by a neighboring node of the CN to join the camera cluster.The message contains the ID and remaining energy of the neighboring node of the CN.
(viii) Relay-Msg (ID): this message is sent by the source SN to its neighbors to find the relay node and contains the ID of the source node.
(ix) Relay-Reply-Msg (ID, routing level, energy): after receiving Relay-Msg, the neighboring nodes of the source node send this message back to source node.This message contains their IDs, routing level information, and remaining energies.

Distributed Image Compression Architecture over Multihop Wireless Multimedia Sensor Networks
In this section, our proposed distributed image compression architecture over multihop wireless multimedia sensor networks, namely, DICA, is described in detail.Our proposed architecture is divided into five phases per round: communication cluster setup, multihop hierarchical routing setup, camera cluster setup, image compression cluster setup, and image transmission (see Figure 2).

Communication Cluster Setup.
In our proposed architecture, before proceeding to the other phases, the communication clusters are established.For the purpose of forwarding images to the BS, the WMSN is divided into many clusters, which are called communication clusters.
Each communication cluster has its own CH and member nodes.Member nodes send data to their CHs and then forward the data to the destination.We applied LEACH, which is a pioneering cluster-based routing algorithm in terms of effective energy consumption in WMSNs, for our communication cluster setup.To preserve the energy of the CNs, CNs cannot function as the CH since the CH depletes more energy for data transmission and aggregation.

Multihop Hierarchical Routing Setup.
After the communication cluster has been set up, the next step is the multihop hierarchical routing setup phase.Here, a level of the hierarchical routing information structure is constructed to offer better routing information for multihop communications.
Each SN in the field has its own routing level.The routing level is a number that is used to identify how close the SN is to the BS.The routing level starts from 1 and a low routing level indicates that the SN is near the BS.This setup phase is conducted only in the first round of the network, after the communication cluster setup is completed.This algorithm relies on the communication of CHs to broadcast the routing level information, which is much more efficient than wholenetwork broadcasting.The details of the multihop hierarchical routing setup are described in Algorithm 1.
In this phase, initially, the routing levels of all SNs in the field are set to 0. The BS broadcasts Level-Msg with its ID and routing level (=1) to all SNs that are within its communication radius.After receiving this broadcasting message from the BS, all SNs save the routing level information.In this case, the broadcasting message is received by the CH, and the CH not only saves the routing level information but also increases the routing level by 1 and finally rebroadcasts to its neighbors.This process is repeated until no more CHs receive the broadcasting message.If an SN receives more than one message, it checks the existing routing information that was saved previously against the new information.The lower routing level is accepted and the higher one is discarded, so the routing level of the node is updated with the lowest one.
CHs that do not receive any broadcasting messages for a specific time  1 are considered far away from other CHs; however, it is possible that their neighbors have the routing level information.Therefore, these CHs broadcast Level-Request-Msg to their neighbors to request the routing level information.If there is a neighboring node that receives Level-Request-Msg and its routing level is not equal to 0, it replies with Level-Request-Reply-Msg, which contains its routing level information to the source CH.After receiving the replies from its neighbors, the CH saves the received routing level information for future use.
If more than one reply message is received, the CH chooses the lowest routing information level.Then, this CH increases the routing level information by 1 and broadcasts it to its neighbors.If the source CH does not receive any replies from its neighbors during a specific time  2 , it waits for another specific time  3 .If, in the worst case, there is still no any reply during time  3 to the source CH, the source CH sets its routing level to the maximum value (here, 100).For the NNs, after waiting for a specific time  4 and not receiving any routing level information, these nodes also set their routing levels to the maximum value.

Camera Cluster
Setup.The camera cluster consists of one CN, which acts as the CH of this cluster and nearby member nodes.Once communication cluster setup and multihierarchical routing setup are completed, the camera cluster setup phase is conducted.Since the energies of the member nodes are changing all the time, this phase must be implemented in every round in the network to ensure that the camera cluster has enough member nodes for image processing and transmission.
The detailed algorithm of this phase is described in Algorithm 2. Here, the CN broadcasts the Cam-Msg to its neighbors within its competitive radius to form the camera cluster.The competitive radius computation will be discussed in the next subsection.Cam-Msg contains the ID, remaining energy, and node degree of the CN in the previous round.
After receiving this message, the neighboring nodes of the CN calculate the camera cluster membership, which will be discussed later.In the camera cluster membership calculation, an FLS cost is calculated.After calculating this cost, whose value is between 0 and 1, the neighboring node generates a random number between 0 and 1, which is called the local chance.If the local chance is lower than the fuzzy cost, the neighboring node sends Cam-Join-Request-Msg, which contains the ID and remaining energy of this node, to the CN.Then, this node becomes a member of the camera cluster.

Fuzzy Logic
System.Fuzzy logic or set, which was developed by Zadeh [31], is an effective technique for improving decision-making in resource-constrained networks such as WSNs because FLS can reduce the resource consumption while maintaining effective performance and offering good solutions for many control problems by imitating the human thought process.FLS consists of four key components: fuzzier, inference engine, fuzzy rules, and defuzzifier, as shown in Figure 3 [32].
The fuzzifier gets crisp inputs and converts them to a fuzzy set, which is represented by a linguistic term, such as "near," "medium," or "far," using a membership function.This process is known as fuzzification.Used for quantifying linguistic terms, the membership function maps nonfuzzy input values onto fuzzy linguistic terms, and vice versa.There are different forms of membership functions, such as triangular, trapezoidal, Gaussian, piecewise linear, and singleton; however, there are a few membership functions that are commonly used, that is, triangular, trapezoidal, and Gaussian.The choice of membership functions depends on the experience of and assessment by the researcher.The membership function is applied in both fuzzification and defuzzification.After the fuzzification process, the inference is made by inference system based on a set of rules, which are stored in the rule base.Each of these rules is typically an IF-THEN rule with conditions and a conclusion.Lastly, the output of FLS is defuzzified using the membership function.Defuzzification transforms the fuzzy set back into a crisp output value [33].

Competitive Radius.
The competitive radius is one of the most important factors for the camera cluster since it is used to limit the SNs that can be members of the camera cluster.If the competitive radius is too large, more energy may be required for the CN to communicate with its node members, whereas if it is too small, there may be an inadequate number of SNs to join the camera cluster as well as processing and transmiting the images to the BS.Based on RSSI, the competitive camera radius is computed using the following formula: node degree = 0; (4) competitve radius =  max (5) else (6) node degree ← calculate node degree (7) competitive radius ← calculate competitive radius based on algorithm in Section 4.3.2(8) end (9) Broadcast Cam-Msg (ID, cam energy, node degree) within its competitive radius (10) Else (11) if Node receives Cam-Msg then (12) local chance ← generate random value (13) fuzzy cost ← calculate Fuzzy Cost (cam energy, RSSI, node degree) based on algorithm in Section 4.3.3(14) if local chance ≦ fuzzy cost then (15) Sends Cam-Join-Request-Msg (ID, energy) to CN (16) end if (17) end (18) end if Algorithm 2: Fuzzy logic-based camera cluster setup.

Fuzzification
Inference system Defuzzification Rule base

Fuzzy decision block
Crisp inputs Crisp outputs where RSSI max denotes the maximum RSSI of the SNs and ∝ is the weight of the camera radius, which is used to adjust the camera radius.This weight of the camera radius ∝ ranges between 0 and 1.In the first round, ∝ is equal to 1.
To determine the weight of the camera radius ∝, FLS is applied.In FLS, three input variables are used.First, the CN energy is the remaining energy of the CN, as a percentage: CN   = CN    /CN    .Second, the camera node degree is the number of other CNs that are within the competitive radius of the CN, divided by the total number of CNs in the network: (CN  ) = | CN  |/#CNs.Finally, the node degree of the camera cluster is the number of SNs in the camera cluster in the previous round, divided by the total number of SNs:   = Deg(CN  )/#SNs.Here, Deg(CN  ) is set to 0 in the first round of the network.
As shown in Figure 4, all three variables have the same linguistic variables for the fuzzy set: low, medium, and high.Since trapezoidal and triangular membership functions are suitable for real-time operation and their computations are not complex [34], we applied them to our fuzzy input and output variables.All fuzzy input parameters of the membership function are formulated based on [32] and our experiment.Mamdani's method is chosen as the fuzzy inference technique that is used to map the set of input linguistic variables to the output set [35].A set of 27 fuzzy rules and output membership functions are shown in Table 1 and Figure 5, respectively.

Camera Cluster Membership.
The camera cluster membership algorithm also adopts FLS to determine the size of the camera cluster.Not all SNs within the competitive radius can be members of the camera cluster; only the qualified ones are selected to join this cluster.As shown in Table 2, three fuzzy logic input variables are used for camera member node selection.Each of them has its own membership function.The first and second variables are camera node energy and node degree, respectively, which are the same as the input variables of FLS of competitive radius, as shown in Figure 4; therefore, we discuss only the third variable, namely, RSSI, which is a measurement of the power of the radio signal from the camera node (see also Figure 6).Weak, medium, and strong are the linguistic input variables for the fuzzy set.The triangular membership function is used for weak and strong, whereas the trapezoidal membership function is applied to medium [36].
Fuzzy inference relies on 27 rules, which are generated from three fuzzy input variables, as described in Table 2.The output, as depicted in Figure 7, is the fuzzy cost, which determines the possibility that nodes can be members of the camera cluster.

Image Compression Cluster
Setup.The image compression cluster is formed to prepare the SNs for distributed image compression.In the image compression cluster setup phase, initially, the CN selects the highest-energy SN in  the camera cluster.This highest-energy SN becomes the image compression cluster head (ICH).Not all neighbors of the ICH become members of the image compression cluster automatically.The ICH chooses a set of SNs that have the highest energies as its image compression cluster to participate in image compression.The number of SNs depends on the compression target; however, the ICH typically chooses the four highest-energy SNs within its communication radius to be members of the image compression cluster.

Image Transmission.
The purpose of the image transmission phase is to ensure that the image has been captured, compressed, and sent hop by hop to the BS successfully.In this phase, there are two main subphases: distributed image compression and relay node selection.

Distributed Image Compression.
In this paper, we distribute the discrete wavelet transform level and encoding to different sensor nodes within the image compression cluster.At the beginning, a camera node captures an image and then divides this image equally into several small images (here, 4).
(1) Discrete Wavelet Transform (DWT).As briefly discussed, the discrete wavelet transform is an effective technique for signal analysis and has been widely used in image processing, especially image compression.Here, JPEG2000 adopts DWT in its compression technique.DWT decomposes the image into a set of subbands and the level of decomposition produces four subbands: low-low or image approximate (LL), high-low or diagonal details (HL), low-high or horizontal details (LH), and high-high or vertical details (HH).LL is lower scale of the image, whereas the other subbands are the image details.LL can be decomposed further to produce another level of subbands.The higher the level of the decomposition, the smaller the image compression size is; however, the image compression size does not improve when the decomposition level reaches 5-6.An example of 3 levels of DWT decomposition is shown in Figure 8.
(2) JPEG2000.JPEG2000 can be either lossy or lossless, depending on the wavelet transform and quantization method that are applied.It utilizes the Embedded Block Coding with Optimized Truncation (EBCOT) image compression technique.The difference between JPEG2000 and image compression cluster setup is completed, the CN sends each small image to the ICH.After receiving the image from the CN, the ICH applies the first level of DWT on the image and obtains subbands LL, HL, HL, and HL.The process continues by encoding HL, HL, and HL and sends the compressed data to its communication CH, whereas the remaining LL is sent to the nearest SN in the image compression cluster for further processing.The nearest SN performs the same steps as in the previous process.After receiving the LL, the nearest SN implements another level of DWT; encodes the new HL, HL, and HL; and then sends the compressed data to its ICH, whereas the new LL is sent to the next-nearest SN in the image compression cluster.The processes are repeated until the target compression is achieved.If there are not enough SNs in the image compression cluster, the last SN in the image compression cluster performs the remaining image compression tasks.In this case, there is no member in the image compression cluster, and the ICH performs all image compression tasks.After distributed image compression, the ICH aggregates the compressed image and sends it to its communication CH.Then, the CH forwards the compressed image via other CHs hop by hop to the BS based on the relay node selection algorithm that is presented in Section 4.5.2, until the compressed image reaches the BS.
Since there is a trade-off between compression and transmission complexity, to preserve the energy consumption of the SNs that are participating in compression tasks before processing their normal compression tasks as mentioned above, each SN is required to perform the following preprocessing calculations: (i) If the node is the ICH, it is required to calculate the energy consumption of implementing an entire compression task and forwarding the compressed image to its CH.(ii) If the node is a member node in the image compression cluster and is selected to participate in image compression tasks, it needs to calculate the energy consumption of processing all remaining image compression tasks and forwarding the compressed data to the ICH.
The SNs in the image compression cluster choose to implement the preprocessing task if this task consumes less energy than their normal tasks; otherwise, the SNs perform their normal tasks.

Relay Node Selection.
In this study, a relay node selection algorithm is used to select the next CHs to forward the compressed image hop by hop to the BS.
We describe the relay node algorithm, which is given in Algorithm 4, as follows: first, the source CH broadcasts a Relay-Msg, which contains its ID, to its neighboring CHs within its communication radius to find a relay CH.Once the neighboring CHs receive the broadcasting message, the CHs reply to the source CH by sending a Relay-Reply-Msg directly, which contains their IDs, remaining energies, and routing levels.After receiving the reply messages from the neighboring CHs, the source CH chooses the group of neighboring CHs that has lower routing level than itself to calculate the fuzzy cost using FIS, as described later.If there are no neighboring CHs that have lower routing levels, the source CH chooses those with the same routing level as itself.The selected neighboring CH who has the highest fuzzy cost is chosen as the relay CH to forward compressed image to the BS.This process is repeated until the compressed image reaches the BS.This relay node algorithm also uses FLS as a decision system for choosing the relay CH.In this part, the procedure for obtaining the fuzzy cost of the relay node algorithm is explained in detail.There are two fuzzy input variables for each fuzzy set.The first fuzzy input variable is the remaining energy of the neighboring CHs, which has three linguistic input values: low, medium, and high.For evaluation, the triangular membership function is also applied for medium, whereas the trapezoidal membership function is used with low and high, as shown in Figure 4.The second variable is the RSSI of the neighboring CHs, which has three linguistic input values: strong, medium, and weak.All of them use the triangular membership function, as shown in Figure 6.We also use Mamdani's method as a fuzzy inference technique.There are 9 fuzzy rules for relay node selection, as depicted in Table 3.The output fuzzy variable, as shown in Figure 11, is the fuzzy cost, which determines the next relay node.The highest-fuzzy-cost CH is selected to be the relay node.
A flowchart of the overall processes of DICA is shown in Figure 12.

Experimental Results and Discussion
5.1.Experimental Setting.Our algorithm is simulated using MATLAB.The SNs are randomly deployed in a topographical area of dimension 300 m × 300 m.To evaluate the efficiency of our methods, the experiments were conducted on both sparse and dense networks.The number of sensor nodes  (including the NN and the CN) is varied from 100 up to 200.Here, the number of CNs is set to 1 for comparative purposes (randomly placed) [19].The CN and NNs have initial energies of 15 J and 10 J, respectively.The communication radius   of all sensor nodes is 75 m [39,40].The CN captures grayscale images of 512 × 512 pixels, each of which is divided equally into 4 blocks before transmission.
Here, there are 5 levels of DWT.The quantization value of image compression is set to 10 [16].We compared our algorithm with a traditional WSN routing algorithm and the two state-of-the-art distributed image routing architectures, namely, LEACH, 2HCIT [19], and EEDIC [14].In the LEACH approach, the CN compresses a whole image and sends the compressed image to its communication CH.Then, the compressed image is forwarded to the BS.In other words, the traditional LEACH approach is unaware of multimedia transmission.The simulation parameters are summarized in Table 4.In our simulation, there are two scenarios.The first scenario is conducted with 100 SNs, whereas the second scenario is implemented with 200 SNs.We performed ten trials and averaged the results.

Results and Discussions.
In this section, we present and evaluate the results of simulations of our distributed image compression architecture over WMSNs.We compare the performance of our proposed method with those of EEIC, 2HCIT, and LEACH in terms of the energy consumption, network lifetime, and throughput in networks of different scales.

Hierarchical Routing Level Evaluation.
First, examples of the hierarchical routing algorithm in both spare and dense networks are shown Figure 13.In these examples, the whole networks are divided into 4 layers, which correspond to 3 routing levels.The closest SNs to the BS have routing level 1 and the furthest have routing level 3.All of the SNs, whether in sparse or dense networks, have their own routing levels.

Network Remaining Energy Evaluation.
The remaining energies of both the CN and NNs with respect to the number of rounds are shown in a set of subfigures (Figure 14).Our proposed method outperforms the LEACH, EEDIC, and 2HCIT approaches in terms of balancing the network energy consumption and prolonging the network lifetime.In Figure 14, as the number of rounds increases, our proposed method outperforms the other methods.The energies of both the CN and NNs were reduced slightly in our method, followed by those in the EEDIC and 2HCIT approaches, while in LEACH approach, the remaining energy of the SNs decreased dramatically, especially that of the CN.
These results indicate that our proposed method could distribute the compression and transmission tasks among the SNs and better balance the energy consumption of the SNs in the network compared to the other two approaches.Moreover, our multihop hierarchical routing algorithm performs well by reducing the transmission energies of the SNs.In both sparse and dense networks, our proposed method can yield SN energy savings of approximately 80%, 40%, and 10% compared to LEACH, EEDIC, and 2HCIT, respectively.

Network Lifetime Evaluation.
In WMSNs, the entire network lifetime evaluation is important for proving energy-efficient performance.Figure 15 provides an insight into the network lifetime in terms of the number of rounds with respect to the percentage of energy that remains in the CN.The results indicate that our proposed method can enhance the network lifetime for both sparse and dense SNs.As the number of NNs increases, our algorithm still performs well.Our proposed method improves the network lifetime by approximately 80% over LEACH.Comparing to 2HCIT and EEDIC, our method improves the network lifetime by approximately 20%-40% in both networks.

Throughput Evaluation.
In this subsection, we discuss the throughput of an overall network, which is one of the most important measures of network performance.Throughput is defined as the number of sequential packets that contain a full (complete) image that are sent to the BS successfully.As shown in Table 5, our proposed algorithm archives much better throughput than the other algorithms since our algorithm relies on minimizing the CN energy consumption by distributing the compression task and NN energy by (preferred) transmission over a short distance hop by hop to the BS.In both spare and dense networks, on average, our proposed method achieves 10%, 70%, and 80% higher throughput compared to 2HCIT, EDDIC, and LEACH, respectively.

Conclusions
A distributed image compression architecture (DICA) over WMSNs is proposed in this paper.Three main contributions  have been discussed.First, the optimal camera cluster is determined by using FLS.Second, image compression tasks are distributed among SNs, which are close to each other within the image compression cluster to save energy.Lastly, multihop hierarchical routing has been developed to preserve and balance energy in the network.According to simulation experiments, our algorithm can improve the energy consumption efficiency, on average, by 10%, 40%, and 80% compared to 2HCIT, EEDIC, and LEACH, respectively, thereby prolonging the network lifetime and increasing the throughput compared to the above-discussed algorithms for both sparse and dense networks.Even though DICA can achieve a high degree of energy efficiency and throughput, more investigations, assumptions, and constraints could be further explored, such as quality-ofservice awareness mechanisms and sophisticated data compression and aggregation techniques.With respect to other factors that likely affect the high volume of data transmission, comprehensive simulation and analysis could be intensively investigated, such as a scalability consideration, that is, network density and diversity, network dimension, routing selection, mobility, irregular topology, various signal propagation models, and heterogeneous data traffic considering additional transmission protocol overheads.In future work, we will focus on the modification of the image compression technique to reduce its computational complexity, memory usage, and energy consumption so that image compression can be better performed in resource-constrained wireless sensor networks.Furthermore, we plan to extend our proposed scheme to video compression and transmission over WMSNs.

3. 1 .
Network Model.In this paper, we make the following network assumptions:(i) All sensor nodes (SN) are deployed randomly and uniformly in a targeted area ( × ).

Figure 2 :
Figure 2: Phases of the proposed architecture.

Figure 3 :
Figure 3: Basic block diagram of a fuzzy system.

Figure 11 :
Figure 11: Fuzzy set for the fuzzy cost output variable in relay node selection.
Hierarchical routing of a dense network

Figure 13 :
Figure 13: Examples of hierarchical routing in sparse and dense networks.

Figure 14 :
Figure 14: Remaining energies of the CN and the NNs.
11 , SN 12 , SN 13 , and SN 14 ) for 1D of DWT decomposition (vertical decomposition).This group of SNs sends the result to CH 2 and then CH 2 sends this result to other sets of SNs (SN 21 , SN 22 , SN 23 , and SN 24 ) for the other 1D of DWT decomposition (horizontal decomposition).As a result, level 1 of the data is retrieved.Next, CH 3 chooses LL 1 and distributes it to a group of SNs (SN 31 , SN 32 , SN 33 , and SN 34 ) for 1D wavelet transform.
(1)el.While transmitting and receiving data, that is, packets that are based on the IEEE 802.15c framework, in WSNs or WMSNs, each SN consumes energy.The energy consumption is based on the size of the packet and the distance between sender and receiver.This paper adapts a simplified model that is used in LEACH for the communication energy consumption model.The energy consumption for transmitting and receiving  bits of data are given in(1)and (

Table 3 :
Relay node selection fuzzy rules.

Table 5 :
The throughput results (# of complete images).