Energy is a crucial resource that must be saved as much as possible in order to extend the sensor network lifetime. Considering the context of wireless image sensor networks, we propose a selective hop-by-hop retransmission mechanism that can save energy by avoiding retransmission of some packets by the cost of the quality of the received image at the sink. It is expected that sensor nodes may be interconnected by error-prone wireless links where burst of errors may be constant, but temporary. In such context, we argue that some visual monitoring applications can tolerate some loss of quality in the received images, since the energy resources of intermediate nodes are preserved. Moreover, we expect that such applications are delay-tolerant and immune to jitter, since all parts of an image must to be buffered at the sink to allow the decoding process and typical transmission rate of visual information collected from the monitored field should be one snapshot per second or lower. However, the decision not to retransmit some corrupted packet results in less than average end-to-end delay, but we do not consider it to be crucial for some types of applications.
The proposed selective hop-by-hop retransmission mechanism is based on the relevance of the data resulted when we apply DWT over original images, where only the packets that carry the most significant information are retransmitted if corrupted. Doing so, we achieve a tradeoff between energy consumption and image quality, bringing a valuable contribution to wireless image sensor networks.
4.1. DWT-Based QoS
There are many coding techniques suitable for wireless image sensor networks, each one bringing advantages and drawbacks [
10]. Among the possibilities, DWT has been considered by the academic community as a flexible option for image coding [
30], allowing a series of cross-layer optimizations for energy preservation with low impact on the application general quality. In fact, when applied over images, DWT can produce data with different priorities, and such priorities can be reflected into QoS levels that can be exploited for network optimizations. If packets carrying less relevant information are lost, the image quality is lower-bounded, and an acceptable played-out image quality is assured at the receiver size if more relevant packets successfully reach the sink.
Wavelet transforms provide data decomposition in multiple levels of resolution, where DWT is achieved discretely sampling the wavelets. DWT decomposes a signal (a series of digital samples) by passing it through two filters: a lowpass filter L and a highpass filter H [
30]. The lowpass subband represents a down-sampled low resolution version of the original signal, while the highpass subband contains residual information of the signal. For the perfect reconstruction of the original signal at the receiver side, all information from lowpass and highpass filters are necessary.
Digital images are two-dimensional signals, usually represented as a matrix of pixels. A 2D DWT processes such signal considering the rows and columns, generating four subbands: LL, LH, HL and HH. The LL subband represents the lowest resolution and a half-sized version of the original image. In fact, it is the most significant information for the decoding process (without it, the image cannot be rebuilt), while the remaining subbands contain vertical, horizontal and diagonal details for the decoding process. Such processing produces two groups of relevance, but the LL subband can be transformed again to generate more levels of resolution.
Figure 3 presents an original image that is processed by a DWT applied once and twice, resulting in two and three levels of resolution, respectively from left to right.
In
Figure 3 a grayscale 256 × 256 pixels image is transformed by DWT but the LL
(2) subband (64 × 64) could be processed again to generate more levels of resolution. Apart from being influenced by the number of times DWT is applied, the resulted subbands are influenced by the coefficients of the lowpass and highpass filters [
29,
30,
31], resulting in different discrete wavelet transforms.
Figure 3.
DWT processing generating two and three levels of resolution.
Figure 3.
DWT processing generating two and three levels of resolution.
The original image is obtained by performing an inverse DWT over the computed subbands. The lowest resolution representation of the image (the LL(n) subband) is required, while the other subbands will be used to increase the quality of the final image. If the other subbands are lost, the image quality decreases. In fact, the acceptable image quality depends on the application requirements and the expected uses of the retrieved images, but many applications support reduction in the image quality due to changes in the network conditions. We must consider the fact that each bit must be transmitted over the sensor network, which implies energy consumption in the source and over the path(s) toward the sink. Moreover, retransmissions increase such energy consumption. In short, higher quality of received images usually demands more energy resources of the sensor network.
Each packet will be assigned a QoS level according to the packet’s payload. As the original images will be processed by 2D DWT, the QoS of each packet depends on the relevance of the produced subbands. The packet’s QoS is represented by the Data Relevance (DR), an 8-bit field to be inserted in every transmitted packet, just after the fragmentation header f. The value of DR is computed depending on the number of times DWT is applied, which in our proposed solution can be once (1-level) or twice (2-level).
During packet transmission, intermediate nodes will check DR in order to verify the expected reliability level of the packet. In practical terms, the relaying node will check it to decide if a timeout must be set and if an ACK message is expected from the next hop toward the sink, while the receiving node relies on the value of DR to decide if an ACK message must be sent to the previous hop for positive acknowledgment purposes.
Table 1 presents the possible values of DR according to DWT subbands, and the corresponding transmission service. It is interesting to notice that packets carrying data of a single image may experience different reliability guarantees, according to the packet’s DR. An important remark is that the image header of the entire image (
io) must be transmitted with the same priority of LL
(n) subbands (highest priority), since it is mandatory for the proper reconstruction of the original image at the receiver side.
Table 1.
Values for the Data Relevance.
Table 1.
Values for the Data Relevance.
DR | DWT subbands | Expected level of reliability |
---|
0 | LL(1), LL(2) | Reliable transmission |
1–254 | HL(2), LH(2), HH(2) | Semi-reliable transmission |
255 | HL(1), LH(1), HH(1) | Unreliable transmission |
Table 1 gives us a clear notion that most information (75%) will be unreliably transmitted over the network (not retransmitted if corrupted), saving energy avoiding packet retransmissions and transmission of ACK messages. For a 1-level 2D DWT, the proposed solution assures reliable transmission for only 25% of the image information (LL
(1)), while for a 2-level 2D DWT, only 6.25% of the original visual information (LL
(2)) will be granted with full reliability guaranties. If packets carrying part of the remaining subbands are lost and not retransmitted, the sink can interpolate the received data to overcome the missing information or consider zeros to complete the subband.
After applying DWT over the original image, the resulting packets should be transmitted in a scrambled order according to their Data Relevance, alternating the packets of highest relevance with low relevant packets. As the occurrence of error bursts is unpredictable (it is estimated only the average errors occurrence), a scrambled transmission may reduce the probability of mass losses of least relevant packets in the worst cases, providing a fairer distribution of retransmission attempts across time.
As a final comment, DWT processing at source nodes demands energy that should be considered when computing the overall energy consumption. Such required energy,
Cpi, is a direct function of the type (coefficients of the L and H filters) of the employed DWT and it is consumed only in the source node, since we do not consider the energy consumption at the sink. As we are comparing the proposed solution with traditional hop-by-hop retransmission mechanisms, where original images will also need to be processed/coded at source nodes in most cases, we do not consider such energy crucial to the desired analyses. Nevertheless, we compute such energy adapting the corresponding equation in [
16], where DWT is performed using a integer 5-tap/3-tap filter. For a
m x
n image, and considering
eshift the energy required for a 1-byte shift operation,
eadd the energy for an 1-byte add operation,
eread the energy to read one byte from memory and
ewrite the energy to write one byte, the computation of
Cpi is defined in Equation (14), where
T is the number of times DWT is applied.
4.2. The Proposed DWT-Based Selective Retransmission Mechanism
We define three levels of reliability according to the value of DR: reliable, unreliable and semi-reliable. Based on the mapping in
Table 1, if a 1-level 2D DWT is applied over an original image, packets will be transmitted in a reliable or unreliable way. On the other hand, packets carrying data produced by a 2-level 2D DWT may be transmitted under any of the three reliability levels. The number of times DWT is applied over original images (defining possible values of DR) will indicate the transmission service that must be considered. We will extend the energy consumption model described in
Section 3 to incorporate these new definitions.
In reliable transmission, every corrupted packet is retransmitted. For unreliable transmission, no retransmission is performed for the corrupted packet. Finally, in semi-reliable transmission, corrupted packets may be retransmitted depending on where the event occurred.
Figure 4 depicts the three different reliability services.
Figure 4.
Reliable, semi-reliable and unreliable transmission services.
Figure 4.
Reliable, semi-reliable and unreliable transmission services.
It is considered that an original image i, i = 1, …, i = I, sizing Bi bytes may be decomposed by a 2D DWT applied once or twice. Whatever the case, 75% of the resulted data will correspond to the HL(1), LH(1) and HH(1) subbands, and packets containing such data will be unreliably transmitted. We can define Upi as the number of required packets with size s to transmit these three subbands and Lupi as the size of the payload of the last packet after fragmentation, if any, as expressed in Equation (15). We define l as the maximum payload size in bits of each packet, l = (s – k – f –8), considering the 8-bit Data Relevance field. The total number of packets carrying data of the HL(1), LH(1) and HH(1) subbands is Upi + 1, for Lupi > 0.
In average, each hop (h + 1) will transmit less packets with DR = 255 to the next hop than hop h transmitted to it, for the same path, since some of them will be lost and not retransmitted. Defining Ptuph as the packet error rate in hop h when n = (Lupi + s – l) in Equation (4), we can estimate the average number of bits to be transmitted from hop h as Tupih, as presented in Equation (16).
A 2D DWT is applied only after the LL(1) subband is produced, representing 25% of the size of the original image. We define Mpi as the number of packets for the LL(1) subband and the image header io considering that all packets are carrying data to their maximum capacity and Lmpi as the size of the last packet after fragmentation, if any, as presented in Equation (17). The total number of packets carrying data of the LL(1) subband is Mpi + 1, for Lmpi > 0.
Defining Ptmph as the packet error rate in hop h when n = (Lmpi + s – l) in Equation (4), we achieve the average number of transmissions of the last packet, Rtmph, when employing Ptmph in Equation (8), where Ptmph = 0 and Rtmph = 1 if Lmpi = 0. As packets with DR = 0 will be retransmitted if corrupted, Tmpih refers to the total amount of bit transmission (considering possible retransmissions) of subband LL(1) in path p and from hop h to (h + 1). As the probability of ACK transmissions is also affected by the possible smaller size of the last packet, we apply Ptmph to Equation (10), achieving the average number of ACK messages to acknowledge the transmission of the last packet after fragmentation in hop h of path p, Ramph, where Ramph = 0 if Lmpi = 0. The values of Tmpih and Ampih for the most relevant data (DR = 0) and for a 1-level 2D DWT are defined in Equation (18).
When source nodes process gathered images using a 1-level 2D DWT, packets can only be transmitted in a reliable or unreliable way. We can estimate the expected energy consumption in such a case, as presented in Equation (19). For transmission of multiple images, all one has to do is to sum the expected energy consumption in path p for each image i.
The final energy consumption model when images are processed by a 1-level 2D DWT, considering the energy costs of the source node, is presented in Equation (20).
When a 2-level 2D DWT is applied over a raw image, reliable, unreliable and semi-reliable transmission services may be provided according to the resulted subbands. The subbands HL(1), LH(1) and HH(1) present the same visual information of the equivalent subbands after a 1-level 2D DWT, thereby receiving the same treating by intermediate nodes. The subband LL(2) contains the most significant visual information to the reconstruction of the original image, and so the highest relevance (DR = 0) is assigned to it. As the LL(2) subband is only 6.25% of the size of original image, Mpi cannot be considered for energy consumption computation in this case. Thus, Zpi is defined as the number of packets for the LL(2) subband, and Lzpi as the size of the payload of the last packet after fragmentation, as presented in Equation (21).
Defining Ptzph as the packet error rate in hop h when n = (Lzpi + s – l) in Equation (4), we achieve the average number of transmissions of the last packet, Rtzph, when employing Ptzph in Equation (8), where Ptzph = 0 and Rtzph = 1 if Lzpi = 0. As the probability of ACK transmissions is also affected by the possible smaller size of the last packet, we apply Ptzph to Equation (10), achieving Razph, where Razph = 0 if Lzpi = 0. The values of Tzpih and Azpih are presented in Equation (22).
The subbands HL(2), LH(2) and HH(2) are obtained from a 2D DWT applied over the subband LL(1). We define Qpi as the number of packets with maximum size s for these subbands, and Lqpi as the size of the payload of the last packet after fragmentation, if any, expressed in Equation (23).
As defined in
Table 1, the packets containing part of subbands HL
(2), LH
(2) and HH
(2) will have a DR between 1 and 254. Moreover, they will be subject to a semi-reliable transmission mechanism. Such transmission mechanism assures reliability only when packets are being relaying by some of the intermediate nodes of the path. Considering a path
p with
Hp intermediate hops, packets will not be retransmitted if they are lost in any intermediate node from the source (
h = 0) to the hop DR, 0 < DR <=
Hp, and no ACK message has to be transmitted to acknowledge these packets. After hop DR, packets are reliably transmitted to the sink. The idea is to preserve packets that have already been relayed by some hops and consequently consumed energy, considering that such packets have an intermediate impact in the final image quality.
The value for DR may be defined deterministically before deployment or dynamically measuring the number of hops of the path and setting the better value for DR according to the application requirements. If DR > Hp, packets receive the same treatment as when DR = 255. One can notice that, for paths with more than 254 intermediate nodes, the proposed semi-reliable transmission approach cannot be applied. However, typical paths in most real-world wireless sensor networks are expected to be composed of less than 254 hops.
The value of DR will be directly related to the energy consumption and image quality, where higher DR means in average more energy saving at the cost of quality loss of the reconstructed images. In general cases where applications are not concerned with optimization of it, the DR should refer to the middle of the path.
During packet relaying, each intermediate node decrements the value of DR just before transmission to the next hop, when the value of Data Relevance is not 0 or 255. When DR reaches 0, it is assumed that the packet must be reliably transmitted, as is the case for packets carrying LL(1) and LL(2) subbands.
The transmission of Qpi packets requires a partially reliable communication approach, where packets are never retransmitted from h = 0 to h = DR and packets are always retransmitted if corrupted from hop h = DR to h = (Hp + 1), for 0 < DR <= Hp. The average number of bit transmission in hop h for packets with DR from 1 to 254, Tqpih, is presented in Equation (24). Ptqph represents the average packet error rate in hop h when n = (Lqpi + s – l) in Equation (4) and the average number of transmissions of the last packet after fragmentation is defined as Rtqph, when employing Ptqph in Equation (8). Note that Ptqph = 1 and Rtqph = 0 when Lqpi = 0.
The total number of bit transmission for acknowledgment is defined as Aqpih. The hop DR in path p receives ACK messages from hop (DR + 1), but does not transmit ACK to the previous hop (DR – 1). Applying the value of Ptqph in Equation (10), we achieve the average number of ACK messages to acknowledge the transmission of the last packet after fragmentation received from hop h, h > DR, that is Raqph. The definitions for Aqpih is presented in Equation (25), where Raqph = 0 if Lqpi = 0 and Aqpih = 0 for h < DR.
The computation of the energy consumption due to transmissions and receptions of an image i in hop h of path p, considering original images processed by a 2-level 2D DWT, is defined in Equation (26).
The energy consumption of the path is presented in Equation (27). Note that the value for Aqpi0 is zero for the source node.
When a 1-level 2D DWT is applied over the original image, the energy consumption can be estimated using Equation (20). For the 2-level 2D DWT, the equation in Equation (27) must be considered.
4.3. Measuring the Image Quality
When the two proposed DWT-based selective retransmission mechanism is employed in wireless image sensor networks, some packets containing visual information may be lost according to their Data Relevance and the packet error rate in each link from the source to the sink. The received payloads will be used to reconstruct an approximated version of the original image by an inverse DWT, where we consider that the lost information (if any) will be replaced by zeros for simplicity. As some less relevant packets may be corrupted and discarded during transmission, resulting in energy saving when those packets are not retransmitted and not acknowledged, the final image quality will be typically lower than the original image quality.
The simpler way to assess the quality of an image transmission is to count the number of packets received by the sink. The formulation in Equation (28) presents the average success ratio (S1) when a 2D DWT is applied only once, where the maximum attainable success ratio is 1.0 when all packets are always retransmitted if lost or no bit-errors occur during transmission. V0 e V255 are the proportion of data received for packets with DR = 0 and DR = 255, respectively.
When we apply a 2-level 2D DWT, we achieve the average success ratio S2, as presented in Equation (29). Note that we only count packets transmitted before hop DR for VDR (proportion of data received for packets transmitted in a semi-reliable way), since all packets after it are reliably transmitted to the sink.
S1 and S2 show the average percentage of received data when compared with the total visual information of the original image, but do not give us a good indication of the quality of the reconstructed image, since the packets’ payloads have different relevancies for the reconstruction of the original image. A common approach to measure such quality is the Peak Signal-to-Noise Ratio (PSNR), as defined in Equation (30). The value for x is the number of bits to represent a pixel: for example, every pixel in a grayscale image may be represented by 8 bits, but more bits are required for RGB color images.
The variable MSEpi is the mean squared error, considering an original m x n image i and a final m x n image v, where the last one is a noisy approximation of the original image. Considering that i(a,b) and v(a,b) return the value of the corresponding pixel in position (a,b) of the image, 0 < a < m and 0 < b < n, we have the definition of MSEpi in Equation (31).
The closer to the original is the reconstructed image, higher is the PSNRpi. In fact, PSNR is a good measure for comparing reconstruction results for the same image, but it is meaningless for comparisons between images, since one image with lower PSNR may look much better than another image with higher PSNR. In the improbable case that no packet is discarded in any link during the transmission of the image i from the source to the sink, due to the absence of error bursts, the value for MSEpi is 0, and the PSNRpi is undefined.