In the proposed system, each sensor node manages local knowledge of the photos in its local K-CoverPicTree. In the generation of a new photo, there are no redundant photos being stored with the same coverage conditions in accordance with the local set of existing photos within each sensor. The following sections describe how each sensor node manages its stored set of photos and how the sensor nodes share their local K-CoverPicTree between each other and prevent transmission of redundant photos.
3.3.1. Local Data Management
Each sensor node manages the local information of the existing set of photos using the proposed clustering scheme. Each node creates two local trees as follows:
Local K-CoverPicTree: The initial local K-CoverPicTree is produced with the application of Algorithm 2. This tree is used in the classification and clustering of the existing set of photos within the local storage of each sensor.
Local Boolean K-CoverPicTree: Prior to the addition of photos to the local K-CoverPicTree, the added value of each photo is examined by each sensor with the application of the local Boolean K-CoverPicTree. Within this tree, the index of each node comprises the sub-region ID, BoI ID, and sector ID.
Each node in the local Boolean K-CoverPicTree carries the value of 0 or 1, where 0 means no photo covering a specific sequence of (
s,
b,
k) while 1 denotes the existence of a photo covering a specific sequence of (
s,
b,
k). All nodes are initialized with the value of 0. If the local K-CoverPicTree has a child photo for Node(
s,
b,
k), then the value of the corresponding Boolean K-CoverPicTree node, Bool_Node(
s,
b,
k), will change from 0 to 1. Algorithm 3 shows how the added value for each photo is computed.
Algorithm 3 Counting the added value of a photo |
1: Extract the metadata of the photo |
2: Extract the sequence of coverage features values (s, b, k) of the photo |
3: Added value = 0; |
4: for each coverage sequence (s, b, k) in the local Boolean K-CoverPicTree do |
5: if Bool_Node(s, b, k) = 0 then |
6: Added value = Added value + 1 |
7: end if |
8: end for |
The application of the Boolean K-CoverPicTree begins with the examination of the added value of each photo prior to adding the photo to the local K-CoverPicTree. A photo is added to the local K-CoverPicTree when its added value is greater than zero. However, if the newly generated photo has an added value of zero, then each sensor will search within its local K-CoverPicTree and check whether there exists a photo with the same features of coverage values (sub-region ID, BoI ID, and sector ID) or whether the coverage features of the photo entails a sub-set of the coverage features of the existing photos. In this case, the sensor will exclude the photo and consider it redundant. On the other hand, if there is no other photo with the same features of coverage values or sub-set of the features of coverage values, the sensor will add the photo to the local K-CoverPicTree with the respective node index.
As an example, suppose that photo a covers the sequences (s = 1, b = 1, k = 1), (s = 1, b = 2, k = 1) and (s = 1, b = 3, k = 1). In addition, photo b, which resides within the local K-CoverPicTree, covers the sequences (s = 1, b = 1, k = 1), (s = 1, b = 2, k = 1), (s = 1, b = 3, k = 1) and (s = 1, b = 4, k = 1). It can be stated that photo a is redundant in relation to photo b. This owes to the fact that the sequences (1, 1, 1), (1, 2, 1) and (1, 3, 1) are subset of (1, 1, 1), (1, 2, 1), (1, 3, 1), and (1, 4, 1).
To demonstrate the advantages of the local trees, suppose that a new photo is created on the sensor each time.
Figure 4a shows the local K-CoverPicTree after adding four photos (
a,
b,
c, and
d). Here, Algorithm 2 is applied to form the initial local K-CoverPicTree and the initial local Boolean K-CoverPicTree is generated. The details are as follows:
A newly produced photo with ID = a (photo a) has the following coverage values sequence: (s = 1, b = 1, k = 1), (s = 1, b = 2, k = 1), and (s = 1, b = 3, k = 1). In this regard, utilizing Algorithm 3, the added value of photo a is 4. As the added value of the photo is higher than 0, the photo is appended to the local K-CoverPicTree. This is followed by the update of the value of the local Boolean K-CoverPicTree nodes (1, 1, 1), (1, 2, 1), and (1, 3, 1) to 1.
A newly produced photo with ID = b (photo b) has the following coverage values sequence: (s = 1, b = 1, k = 1), (s =1, b = 2, k = 1), and (s =1, b = 3, k = 1). Utilizing Algorithm 3, the added value becomes 0. In the next step, the sensor searches in its local K-CoverPicTree to ascertain whether there exists a photo sharing a similar sequence of coverage features. As photo b covers a similar sequence of coverage features (s, b, k) as photo a, it is regarded as redundant.
A newly produced photo with ID = c (photo c) has the following coverage sequence: (s = 1, b = 4, k = 1), (s = 1, b = 1, k = 1), and (s = 1, b = 2, k = 1). Utilizing Algorithm 3, the added value is 1. Photo c is appended to the local K-CoverPicTree, and following the new addition, the local Boolean K-CoverPicTree node (1, 4, 1) is revised as 1.
A newly produced photo with ID = d (photo d) has the following sequence of coverage features: (s = 1, b = 1, k = 1), (s = 1, b = 2, k = 1), (s = 1, b = 3, k = 1) and (s =1, b = 4, k = 1). For photo d, the added value is 0. However, a photo with similar sequence of coverage features does not exist, and thus, photo d is appended to the local K-CoverPicTree.
Adding photo
d makes the photo
a redundant because its coverage sequence values are a subset of the coverage sequence values of photo
d. Furthermore, this makes photo
c redundant because its coverage sequence values are a subset of the coverage sequence values of photo
d. Figure 4b shows the final state of the local K-CoverPicTree after removing photo
a and photo
c. Hence, each sensor can compute the redundant photos according to the full-view coverage area conditions.
The steps to remove redundant photos are shown in Algorithm 4. First, in line 3, photos are filtered to find those that cover sub-region s, Photos(s). Then, all photos that cover each BoI in sub-region s from the same sector view, Photos(s, b, k), are found, as stated in line 6. Then, in line 8, for each sector of value k, photos covering the entire sub-region (i.e., all BoIs within the sub-region) Photo(s, k) are found. Redundant photos are then determined by subtracting Photos(s, k) from Photos(s, b, k), as in line 11. This way, the sensor node keeps a log of photos with higher added value and deletes the photos that are redundant.
In
Figure 4, photo
d covers (
s = 1,
b = {1, 2, 3, 4},
k = 1), while photo
c covers (
s = 1,
b = {1, 2, 4},
k = 1). It appears that photo
c covers sub-region 1. However, the photo does not correspond to line 8 because it does not cover all BoIs of sub-region 1. Using lines 10 to 12, photo
a and photo
c are removed.
Algorithm 4 Removing redundant photos |
1: Input: Local K-CoverPicTree |
2: for s = 1:S do |
3: Find all photos that cover sub-region s (Photos(s)) |
4: for k = 1:K do |
5: for b = 1:B do |
6: Find photos that cover (s, b) from the same sector view (Photos(s, b, k)) |
7: end for |
8: Find photos that cover all BoIs of sub-region s from sector k (Photos(s, 1:B, k) = Photos(s, k)) |
9: end for |
10: if (size of Photos(s, k) > 0) do |
11: Redundant Photos = Photos(s, b, k) − Photos(s, k) |
12: Remove each redundant photo from the corresponding parent Node(s, b, k) in Local K-CoverPicTree |
13: end if |
14: end for |
Furthermore, each sensor node can compute the utility of its photos on the target area based on the final state of the local K-CoverPicTree. Accordingly, the steps to be taken in the computation of the utility value of the photos are shown in Algorithm 5. First, the initial value of the total utility is set to zero. Then, Algorithm 4 is called for finding the photos covering sub-region
s from the same sector view. For each sub-region
s inside the target area, if the size of Photos(
s,
k) > 0, the total utility is updated as shown in line 7, as the utility of Photos(
s,
k) is added to the total utility value. The utility of Photos(
s,
k) is the area of sub-region
s multiplied by
θ, where
θ is the effective angle. Steps 6 and 7 are repeated for each sub-region
s in the target area. As an example, sub-region 1 is regarded as full-view covered, providing that the utility of sub-region 1 reaches 2π × area of sub-region 1.
Algorithm 5 Calculating the utility of the photos |
1: Input: Local K-CoverPicTree |
2: Total utility = 0 |
3: Call Algorithm 4 |
4: for s = 1:S do |
5: for k = 1:K do |
6: if ((size of Photos(s, k) > 0)) then |
7: Total utility = Total utility + Area of sub-region × θ |
8: end if |
9: end for |
10: end for |
The following is the general sequence of the proposed framework within each sensor:
In accordance with Algorithm 3, using the Boolean K-CoverPicTree, the added value of each photo is computed.
The photo with the highest added value is appended to the local K-CoverPicTree. Then, the Boolean K-CoverPicTree is revised based on the new inclusion as updates to the values of s, b, and k of the photos from values 0 to 1 in the Boolean K-CoverPicTree.
In the situation where the highest added value is zero, the next step is to look for photos with a similar sequence of coverage values. Alternatively, the subset of the coverage values of other available photos within the local K-CoverPicTree can be searched. In this regard, if photos with a similar sequence of coverage values or the subset of the coverage values cannot be found, the photo should be appended to the local K-CoverPicTree.
Then, utilizing Algorithm 3, the added value of the remaining photos in the device storage is calculated again. The previous steps are repeated until the set of photos is empty.
Utilizing Algorithm 4, redundant photos are removed.
3.3.2. Communication between Two Nodes
Within disruption tolerant networks (DTN), there is no constant contact between all sensor nodes and the command center or server [
11]. The sensors leverage free links, including Wi-Fi and Bluetooth, to transfer photos between each other. When a sensor node detects a peer in its communication range, contact is happening between the two sensor nodes. The target of sharing photos between nodes is to increase the amounts of photos on each node. Hence, when communication occurs between any node and the server, more photos (i.e., more information) become available. An example of the communication pattern used in the proposed system is shown in
Figure 5. Sensor nodes
a,
b,
c, and
d are located within the target area. Only sensor node
c has access to the command center. However, sensor nodes
a and
b are in the communication range of each other, allowing photos to be shared between sensor node
a and sensor node
b. After receiving photos from sensor node
b, sensor node
a can send photos from its storage to the command center through sensor node
c. Sensor node
a can now store photos from sensor node
b in addition to its own. In this manner, the command center is able to obtain photos from any connected sensor node inside the target area.
To simulate the interrupted contact with the server, it was assumed that 15 randomly selected sensor nodes out of the total nodes could contact and transmit photos to the command center. When sensor node
a receives photos from other sensor nodes, it records the information of the source sensor node and the last time of contact with the source. Sensor node
a then estimates the probability that it has encountered another sensor node within time
t:
P(
Ta ≤
t) = 1 − e
−λat, where
Ta is the inter-contact time between sensor node
a and other sensor nodes and λ
a represents the contact frequency between sensor node
a and other sensor nodes [
11]. In the local K-CoverPicTree, photos are removed if
P(
Ta ≤
t) is higher than a specified threshold [
11]. Hence, each node should manage the cache memory of its photos. First, it calculates the time,
t, elapsed from the last contact with other sensors. This is followed by the calculation of the
P(
Tsensor ≤
t). If
P(
Tsensor ≤
t) is higher than a threshold of 0.8, a sensor removes all photo IDs from its local K-CoverPicTree. Algorithm 6 is applied to update the Boolean KCoverPicTree. This step is important to update the cache memory of each sensor node and prevent storing old photos.
When two sensor nodes
a and
b make contact, the sensor node’s delivery probability to the command center is computed, as defined in [
24]. The possibility of delivering photographs to the command center is increased if the communication between sensor node
a and the command center is frequent. We assume sensor node
a has the highest probability of delivering the photos to the command center, resulting in the following general sequence:
Sensor nodes a and b share the initial local K-CoverPicTree with each other without photos transmission.
Each sensor node then searches for Photo IDs that share similar sub-regions IDs between its local K-CoverPicTree and the local K-CoverPicTree of the other sensor nodes. In this regard, the sensor node processes only the photos with common sub-region IDs between the two sensors. In other words, within the target area, only certain photos from certain sub-region IDs are processed, resulting in the reduction of the overhead of transmission of photos associated with all sub-regions within the network. Each sensor node finds the common sub-regions (S-common) between its local K-CoverPicTree and local K-CoverPicTree of other sensor nodes.
Sensor node a applies Algorithm 6 to merge its local K-CoverPicTree with the local K-CoverPicTree of sensor node b according to the shared sub-regions (S-common). As shown in lines 5–7, all branches of common sensor nodes in the local K-CoverPicTree of sensor node b are merged by sensor node a to its local K-CoverPicTree, resulting in a new tree called New Combined Tree(a). As shown in line 9, sensor node a identifies the newly added photos through the identification of the difference between the New Combined Tree(a) and its local K-CoverPicTree. Sensor node a then requests the required photos from sensor node b and updates its local K-CoverPicTree as shown in line 10.
Sensor node b applies similar steps to Algorithm 6 to merge its local K-CoverPicTree with the local K-CoverPicTree of sensor node a according to the shared sub-regions (S-common). Sensor node b merges all branches of common sensor nodes of the local K-CoverPicTree of sensor node a to its local K-CoverPicTree, resulting in the New Combined Tree(b). The newly appended photos are computed by sensor node b through the difference identification between the New Combined Tree(b) and its local K-CoverPicTree. Sensor node b then requests the required photos from sensor node a and updates its local K-CoverPicTree.
Finally, sensor nodes a and b update their local Boolean K-CoverPicTree, after adding the requested photos from each other.
The previous steps are repeated when there is a contact between two sensor nodes until each sensor node reaches the maximum utility of the photos or the sensor nodes share the same final set of photos. Given that sensor node a has the highest probability of delivering photos to the command center, it first starts to request the needed photos from sensor node b to increase the photo’s utility on its storage. Based on that, 15 nodes, which can contact the command center, upload the photos that are received from other sensor nodes inside the target area to the command center.
Algorithm 6 Merging local K-CoverPicTrees on sensor a |
1: Tree(a) = Local K-CoverPicTree of sensor a |
2: Tree(b) = Local K-CoverPicTree of sensor b |
3: New Combined Tree(a) = [] |
4: New Combined Tree(a) = Tree(a) |
5: for S’ = 1:size(S-common) do |
6: Merge all child nodes of common Node(S’) of Tree(b) into the common Node(S’) of the New Combined Tree(a) |
7: end for |
8: Call Algorithm 4 to remove redundant photos in the New Combined Tree(a) |
9: Requested Photos from sensor b = Photos IDs that generated from subtracting Tree(a) from New Combined Tree(a) |
10: Local K-CoverPicTree of sensor a = New Combined Tree(a). |