Mobile Wireless Multimedia Sensor Networks Image Compression Task Collaboration Based on Dynamic Alliance

In mobile wireless multimedia sensor networks’ image compression task collaborations, the existing methods do not consider the dynamic changes in the processing ability and the locations of the cooperative nodes. when processing the image compression tasks, these methods will cause frequent interruptions and result in data re-transmission for those tasks. in this paper, an image compression task collaboration algorithm based on dynamic alliance is proposed to solve this problem in mobile wireless multimedia sensor networks. ﬁrst, a dynamic task alliance is established by the camera node based on the location, computing capability and resource usage of ordinary nodes. then, the location and average moving velocity of the camera nodes and ordinary nodes are considered to calculate the task stable execution time. the image compression task is divided into an image transfer sub task and an image compression sub task based on the task stable execution time. ﬁnally, an image compression task collaboration allocation optimization model is established according to the transmission time, the execution time, the execution cost, and the network energy consumption. the gradient method is used to realize the cooperative allocation of image compression tasks. simulation results show that the proposed algorithm can realize task load balancing, reduce the execution time, and network energy consumption.


I. INTRODUCTION
At present, with the complex and changeable monitoring environment, the simple data obtained by traditional wireless sensor networks cannot meet the overall needs of environmental monitoring. It is urgent to introduce the image, audio, video, and other multimedia information data into the environment monitoring activities based on wireless sensor networks. Thus, wireless multimedia sensor networks (WMSN) have emerged. The WMSN is a new type of sensor network that is composed of sensors equipped with the camera, microphone, and other environmental data acquisition functions The associate editor coordinating the review of this manuscript and approving it for publication was Eyuphan Bulut . [1]. Mobile multimedia sensor networks (MWMSN) adds mobile modules on the basis of the WMSN, attaching multimedia sensor nodes to movable objects, such as wildlife, robots, and drones. Mobile wireless multimedia sensor networks have been applied in various monitoring applications, such as battlefield environments [2], intelligent transportation [3], smart homes [4], ecological environment monitoring [5], [6], and medical health monitoring [7]- [12]. The literature review includes the routing, energy efficient, image compression and task collaboration.

A. ROUTING SCHEMES OF WMSN
The transmission of multimedia information in wireless sensor networks is a challenging task and is an important factor that affects its widespread. The literature [13] proposes a collaborative multipath routing protocol for image transmission in wireless multimedia sensor networks. This method defines a bandwidth-power aware cooperative multi-path routing problem (BP-CMPR), and proposes a polynomial heuristic algorithm to solve this problem. This algorithm can effectively reduce the energy consumption through multi-node cooperation and resource allocation. To reduce the energy consumption, clustering routing algorithms are proposed in literature [14]- [16]. The literature [14] proposes the lowenergy adaptive clustering hierarchy (LEACH) protocol to evenly distribute the energy load among the sensors in the network. This method uses localized coordination to enable scalability and robustness for dynamic networks. It incorporates data fusion into the routing protocol to reduce the amount of information that must be transmitted to the base station. Simulation results show that LEACH can distribute energy dissipation evenly throughout the sensors. In the literature [15], an improved low-energy adaptive clustering hierarchy protocol for mobile sensor networks has been proposed. The method not only prolongs the network lifetime, but also reduces the packet loss using fuzzy inference systems. To save energy in wireless sensor networks, the literature [16] proposes hierarchical protocols based on a clustering hierarchy. In this method, the nodes with higher remaining energy could be used to collect data and transmit it to a base station. Simulation results show the effectiveness of this approach.
To ensure the real-time performance of QoS, an improved real-time routing protocol (SPEED-RR) with a QoS guarantee based on the SPEED protocol is designed in the literature [17]. This protocol takes full account of the residual energy of two-hop neighbor nodes. For different services, a control method based on the node sending, receiving data rate and cache queue length is adopted to distinguish the congestion control. It is observed that the proposed SPEED-RR protocol can reduce the energy consumption and the transmission delay. To efficiently realize cloud storage, processing and transmission of multimedia data, the literature [18] develops a quality of service (QoS) multimedia applications guarantee protocol for WMSN. First, an opportunistic dynamic multimedia cloud platform is proposed based on the changes in the packet error rate, decodable frame ratio and peak signal to noise ratio (PSNR) of the channel quality. Then, the optimal multi-relay hierarchical collaborative multimedia transmission scheme is designed and implemented based on the collaborative multimedia stream. It is observed that the proposed protocol can meet the QoS requirements of wireless sensor networks (WSN) multimedia applications.

B. ENERGY EFFICIENT SCHEMES OF WMSN
To ensure quality of service (QoS) and minimize energy consumption, the literature [19] proposes the design of a cross-layer multipath routing (CLMR) scheme. The CLMR is designed to determine a suitable multipath and to send the multimedia packets according to their importance.
A cross-layer design between application, network, and physical layers is adapted to obtain optimal routing decisions. The simulation results show that the CLMR has an improvement in performance. The literature [20] proposes an intelligent video packet scheduling protocol based on power efficient multimedia routing (PEMuR). To maximize the QoS of WMSN and minimize the energy consumption in the video communication, the PEMuR protocol is used to select the most energy-efficient routing path. It manages the network load according to the residual energy of the nodes, and uses an energy threshold to prevent useless data transmission. In the case of limited available channel bandwidth, the protocol can selectively discard unimportant packets before transmission. The simulation results show the effectiveness of the protocol. The literature [21] proposes an adaptive routing protocol, which considers a mobility parameter during route establishment to meet the QoS and energy efficiency. The remaining energy, hop count, link quality index and mobility factor for path formation are used in this protocol. The multi-objective approach for dynamic routing in WMSN is proposed in this research. The experimentation results show that mobility parameter extensions improve the network performance.
The energy consumption of wireless transmission in ordinary sensor networks is relatively high. Thus, the energy consumption of collection and processing can be ignored. However, the WMSN collects rich information and larger amounts data. The literature [22] conducts energy consumption experiments on wireless sensor nodes. The experimental results show that the energy consumption obeys a uniform distribution. It means that the energy consumption of node image acquisition, fast Fourier transformation (FFT) processing and wireless transmission is basically same. Therefore, WMSN must also reduce the network energy consumption when meeting high quality of service (QoS) requirements. However, a single multimedia sensor node has weak data processing capability, less computing resources, and less energy resources. When processing image compression tasks, it is necessary to achieve efficient task processing by means of cooperation between sensors.

C. IMGE/VIDEO COMPRESSION EFFICIENT SCHEMES
A low-complexity energy efficient scheme is proposed in literature [23] to improve the transmission quality of compressed images. The images are compressed by the embedded zerotrees of wavelet transforms and the set partitioning in hierarchical trees algorithms in the WMSN. A simple postinverse discrete Fourier transform modified mu nonlinear transformation (mu-MNLT) is used in this scheme. Simulation results show the effectiveness of the proposed scheme. A distributed video coding scheme and its improvements are present based on distributed video codec and its associated knowledge in the literature [24]. This algorithm can enhance the coding efficiency of the severe motion region and improve the decoded image. To solve the problem of limited energy and computing ability in wireless multimedia sensor networks, a method of image compression is proposed based on multi-node cooperation in the literature [25]. The camera nodes are connected to ordinary neighbor nodes and then to cluster-heads to construct a network structure in this method. The process of image compression and transmission is distributed in cooperative clusters. A cooperative method is used to implement the multi-node cooperation in the compression process. It is observed that the method can prolong the network lifetime and balance the network energy consumption. However, the overlapping transformation is used to compress the image in this method. The energy consumption is unbalanced when the cooperative nodes are too few. To reduce the energy costs of communication, the literature [26] propose a scheme H-K compression. A simple lightweight image compression algorithm combines the ideas of Huffman coding and K-means clustering. The H-K compression applies K-means clustering for pixel color grouping and Huffman coding for the group color encoding. The method combines the two schemes into one algorithm which can reduce the computational cost. It is observed that the proposed schemes can improve image compression and reduce power usage.

D. TASK COLLABORATION SCHEMES OF MWMSN
Currently, task collaboration for wireless multimedia sensor networks is in its infancy. In the literature [27], a visual processing task allocation framework is proposed for lowspeed (such as pedestrian speed) MWMSN. It can realize visual task processing and multi hop resource sharing in lowspeed MWMSN. The evolutionary self-learning mechanism of genetic algorithm is used to adapt to the system parameters. It is observed that the process reduces network delay and prolong network lifetime. In the literature [28], the computing missions from edge cloud are offloaded and executed cooperatively by vehicles in vehicular cloud (VC). To solve the problem of computation offloading through the vehicular cloud (VC), the computing missions are further divided into computing tasks with interdependency. The computing tasks are executed in different vehicles in the VC to minimize the overall response time. A task load based stability analysis of the VCC system is presented for the cases where some vehicles within the VC are offline. Numerical results demonstrate that the proposed scheme can improve the utilization of computing resources. In the literature [29], a novel approach is proposed to minimize energy consumption of processing an application in MWSN. By introducing the concept of cooperation, the logics and related computation tasks can be optimally partitioned. The solution can be treated as a joint optimization of computing and networking resources. An energy efficient cooperation node selection strategy is proposed to offer a tradeoff between fairness and energy consumption. Simulation results to show the significant energy saving of the proposed solution. In the literature [30], a centralized optimal task allocation algorithm for multihop wireless networks (COTAM) is proposed to extend the network lifetime. To extend the usability of the approach, a distributed optimal task allocation algorithm (DOTAM) is proposed based on Dantzig-Wolf decomposition. It is observed that the proposed algorithm can extend the network lifetime. In the literature [31], to balance network load, a task allocation algorithm is proposed based on score incentive mechanism (TASIM) for WSNs. In TASIM, the score is proposed to reward or punish sensor nodes' task execution in clusterbased WSNs. The cluster heads are responsible for task allocation and scores' calculation. It is observed that the TASIM can balance network load and reduce the network lifetime.
Most of the existing task allocation algorithms are based on multi-objective optimization methods, while accounting for the task completion time [31], [32], energy consumption [30], [33], [34], load balancing degree [33], [35], and service reliability [36], [37]. Most of these solutions adopt heuristic methods, which are deterministic and non-retrospective. Even if the task is found to be inappropriate later in the algorithm's execution, the task assignment decision cannot be changed [38]. These existing methods do not take into account the dynamic changes in the processing capabilities and the locations of the cooperative nodes in the image compression task allocation. Applying these methods directly to the moving scene will cause frequent interruptions of image compression tasks and task data re-transmission.

E. CONTRIBUTION AND ORGANIZATION
To reduce the amount of the task data re-transmission in the MWMSN, we design an image compression task cooperation algorithm based on dynamic alliance (ATDA). The image compression task is divided into an image transfer subtask and an image compression subtask based on the task stable execution time, the principles, and the constraints of task decomposition. The simulation results show that the proposed algorithm can achieve better performance compared with the average distribution algorithm (ADA) and the TASIM. Compared with existing image compression task coordination algorithms, our proposed algorithm contributes through the following aspects: 1) The dynamic coordination alliance is used to process the image transmission and compression tasks. According to the location, processing capacity and resource usage of the union cooperative nodes, the dynamic coordination alliance is established by union leader nodes.
2) The task stable execution time is used to decompose the image compression tasks into the image transmission subtasks and the image compression subtasks. The location and average moving speed of the nodes are considered to calculate the task stable execution time. 3) To solve the problem of task retransmission caused by node movements, a multi-round task decomposition mechanism is adopted to decompose the image compression tasks by considering the task stable execution time. 4) The image compression task is assigned by dynamic alliance. According to the execution time, the execution cost and network energy consumption of the image compression sub-task, a dynamic task allocation algorithm is proposed. This paper is organized as follows. Section 2 introduces the assumptions, definitions, task collaboration alliance, and topology of the task collaboration network. Section 3 describes the algorithm for the image compression tasks decomposition. The Section 4 shows the algorithm for the dynamic task allocation. Simulation results and analysis of the algorithms are presented in Section 5. Finally, the conclusions are drawn in Section 6.

II. TASK COORDINATION NETWORK MODEL A. TOPOLOGY OF TASK COLLABORATION NETWORK
The topology of the network is shown in figure 1. It is a cluster networks and there are two task collaboration alliances in the network in figure 1. The nodes in the task collaboration network are divided into union leader nodes and union cooperative nodes. The union leader node (ULN) is the camera node that is initiating a task allocation actively. The set that consists of these nodes is called the union leader set (ULS). The union cooperative node (UCN) is the common node that acquires the tasks from ULN and performing tasks. The set that consists of these nodes is called the union cooperative set (UCS). The task collaboration alliance (TCA) consists of a union leader node and its union cooperative nodes. The union leader nodes are mainly responsible for image data acquisition, and they send the original image data to the alliance collaboration nodes. The union cooperative nodes cooperate in image compression and send these data to the Sink node after the image compression task is completed.
The set of ULS in an image compression task collaboration network is assumed to be S I = {s i : 1, 2, .., m}, and the set of UCS is s iJ = {s ij : 1, 2, .., n}. The communication radius of the union cooperative node s ij is r c,ij . The space distance between the s i and the other union cooperative nodes is ζ (s i , s iJ ). The location of the union leader node s i is l i = (x i , y i ), and the location of the union cooperative node s ij is l ij = (x j , y j ). In this model, the nodes can obtain their neighbor nodes' locations in their communication radius through an existing localization technique at any given time. The average moving velocity of the s i and s ij are v i , and v ij respectively. The relative average moving velocity between the s i and its union cooperative nodes is denoted v i,ij , and their relative direction angle is θ . It is assumed that ach sensor can move and obtain the moving direction and speed of its neighboring nodes.
The task stable processing time (TSPT) means that all of the union cooperative nodes will not leave from the TCA because of their mobility at that time. The task stable execution time T i,sd of TCA (s i , s iJ ) is described as in figure 2 and formula (1).
In figure 2, the solid line arrows denote the average moving velocity and the direction of s i and s ij . The dotted arrows denote the relative average moving velocity v i,ij and their relative directions between the s i and its union cooperative node s ij . The relative velocity between the node s i and the other nodes is denoted as v i,I ∪J . In figure 2, the moving distance of the union cooperative node s ij moves away from the communication range of the union leader node s i , and it is denoted s ij s ib . Therefore, the union leader node s i can calculate the residence time of the union cooperative node s ij in the communication range of the union leader node s i , and it also can calculate the task stable execution time T i,sd of the TCA.

B. TASK COLLABORATION ALLIANCE
When task collaboration is needed by camera node s i , it will send the task collaboration request message (C-request) as the VOLUME 8, 2020 ULN to its neighboring nodes. The task collaboration request message of • P i,max denotes the maximum cost of the union leader node s i that is willing to pay for the UCS.
• C i denotes the total number of image compression subtasks of the union leader node s i that must be completed.
• c i,j denotes the total number of image compression subtasks of the union cooperative node s i,j distributed by the union leader node s i .
• T i,j denotes the task execution time for the union cooperative node s i,j to complete task c i,j . It is estimated by s i,j and will be sent to the s i .
• T i,sd denotes the maximum time of the union cooperative node s i,j completing the task c i,j that the s i can endure. We let T i,sd be equal to TSPT.
• pr ij denotes the penalty rate of the union leader node s i to the union cooperative node s i,j . If T i,j is larger than T i,sd , then the union cooperative node s i,j failed to complete the image compression task c i,j as required. Then, the union leader node s i must pay a fine to the union cooperative node s i,j based on this penalty rate.
The formation process of TCA is shown in figure 3.The camera node s i send the C-request to its neighboring nodes 4 . After these nodes received the C-request, they will consider whether to join the alliance according to their own power, calculation ability, task quantity, task completion time, and cost. In figure 3, s i,3 , s i,4 refuse to join the alliance according to their own ability and send the C-reject message to s i . Nodes s i,1 , s i,2 agree to join the alliance and send the ask collaboration accept message C-accept to s i . The C-accept message is designed as < p j,0 , c j,max , t c,j , v j , l j >.
• P j,0 denotes the cost of completing an image compression subtask, which is assessed by the union cooperative node s ij according to its own ability.
• c j,max denotes the maximum number of image compression subtasks that can be completed by the union cooperative node s ij .
• t c,j denotes the time of completing an image compression subtask, which is assessed by the union cooperative node s ij according to its own ability.
• v ij denotes the average moving speed of the union cooperative node s i,j .
• l ij denotes the geographical position of the union cooperative node s i,j .
The TCA consists of camera node s i and sensor nodes s i,1 , s i,2 . If all of the sensor nodes refuse to join the TCA and there is only s i in TCA, then the camera node must complete the task alone.

III. IMAGE COMPRESSION TASKS DECOMPOSITION A. TASK DECOMPOSITION PRINCIPLE
In the process of complex task decomposition, it is necessary to define the execution conditions of the tasks. When a complex task is divided into several simple subtasks, the subtasks are independent and are coupled with each other [39]. When the number of subtasks is too small, because the granularity of decomposition is not sufficient, more resources are still needed, and the execution is difficult, which affects the execution efficiency. When the number of subtasks is too large, the difficulty of summarizing the execution results will also affect the execution efficiency. To improve the efficiency of task execution, certain principles should be followed in the process of task decomposition. The main task decomposition principles include independence, reducibility, hierarchy, equilibrium, and termination, which are as follows.
1) The principle of independence refers to the criterion that the sensor nodes should be able to complete the decomposed subtasks independently without relying on other sensor nodes.
2) The principle of hierarchy refers to the decomposition of complex tasks into moderately complex tasks, and then the decomposition of moderately complex tasks into less complex tasks.
3) The principle of reducibility refers the criterion to that after a complex task is divided into multiple subtasks, the execution results of each subtask should be consistent with the results of the individual execution of the complex task. 4) The principle of balance refers to the criterion that the granularity of these subtasks cannot be too large when the complex tasks are decomposed into multiple subtasks. 5) The termination principle refers to the criterion that the task decomposition should be terminated when they can be executed by sensor nodes alone.

B. TASK DECOMPOSITION CONSTRAINTS
Compared with other communication networks with fixed infrastructure, a mobile sensor network has limited network communication capability. Therefore, a task cannot be decomposed infinitely solely to reduce the complexity of the task. Otherwise, the precious energy, computing and communication resources of the sensor network will be wasted. Even due to the limitations of the network environment and communication resources, a large number of lag tasks cannot be executed, which affects the efficiency of the task execution. The subtasks of the task decomposition should meet the following main objective constraints: 1) A time sequence constraint means that it is necessary to execute task a i first and then task a j at the beginning of the task when the execution time of task a i is earlier than that of task a j . 2) A synchronization constraint means that task a i and task a j can execute at the same time when they have no temporal constraints and no information interaction. 3) Serial constraint means that task a i and task a j must be executed one by one in order when the completion of task a i is the premise of task a j . 4) The parent child constraint means that the parent task a i is completed when n subtasks are completed, and task a i consists of n (n > 2) subtasks. 5) A Coupling constraints means that the executions of task a i and task a j need information interaction, and they are prerequisites for each other.

C. IMAGE COMPRESSION BASED ON SVD
The efficient singular value decomposition (SVD) method in literature [8] is adopted in image compression. The SVD image approach has attracted much attention due to its suitability for segmentation [8]. It is a commonly used numerical analysis tool for matrices [40]. The decomposition of any matrix A (m × n) can be calculated in formula (2).
where, U is the orthogonal matrix of m×m, and its column vector is the left singular vector. V is an orthogonal matrix of n×n whose column vector is a right singular vector. is a singular diagonal matrix m×n, and its values on the diagonal are singular values, where the values outside the diagonal are zero. The can be expressed by formula (3).
In formula (3), 1 is the diagonal matrix, and 1 = diag(σ 1 , σ 2 , . . . , σ r ). Where, σ 1 ≥ σ 1 ≥ . . . ≥ σ r ≥ 0, σ is the singular value, and r is the rank of A of the matrix. σ is similar to the eigenvalue and decreases rapidly. In general, the singular values of the top 10% (or even 1%) account for more than 99% of the sum of all singular values. Therefore, the matrix can be approximated by the first k singular values. Digital image has the property of matrix structure, and SVD method can be applied to image compression. Thus, the image compression rate ρ can be calculated in formula (4).

D. IMAGE COMPRESSION TASKS DECOMPOSITION MODEL
According to the time sequence constraint, the s i should transmit the image data to the union cooperative node first when the image compression task cooperates. Then, the union cooperative nodes compress the image. Therefore, the image compression task is divided into an image transmission subtask and an image compression subtask.
Suppose that the number of image transmission subtasks assigned by the union leader node s i to the union cooperative node s ij is c ij . We assume that the data length of an image transmission subtask is D ij , and then, the data size of the image transmission subtask assigned to the union cooperative node s ij is c ij D ij . When the union cooperative node s ij receives the image transmission subtasks c ij from the union leader node s i , the number of image compression subtasks received by the union cooperative node s ij is c ij .
The time for completing the task c ij and the TSPT are equal in the collaboration alliance (s i , s ij ) in that the c ij can be solved by formula (5).
The number of image compression subtasks c ij allocated to the union cooperative node s ij by union leader node s i in the stable execution time can be calculated in formula (6).
Here, c ij is the number of image transmission subtasks assigned to the union cooperative node s ij by the union leader node s i . T i,j is the task stable execution time of the task collaboration alliance (s i , s ij ). r t,i is the data transmission rate of the union leader node s i , and t c,j is the time for the union cooperative node s ij to process an image compression subtask. It is evaluated by its own ability for evaluation when the task collaboration alliance is established. The time t c,j is transmitted from the union cooperative node s ij to the union leader node s i . After the task collaboration alliance is established by the union leader node s i , first, the union cooperative nodes are sorted in ascending order according to the time for processing an image compression subtask. Second, considering the timing of the image transmission subtask execution, the number of image compression subtasks c i1 of the first union cooperative node s i1 (the union cooperative node with the smallest processing time for an image compression subtask) is calculated according to formula (6). Finally, the number of image compression subtasks of the union cooperative node from s i1 to s in is calculated in order.
When n j=1 c ij < C i , the union cooperative node cannot complete in a task stable processing time and the task must be decomposed. C i is the total number of image compression subtasks that the union leader node s i should be transmitting. In this paper, the task decomposition is based on the TSPT, and the method of multiple rounds is used to decompose the task according to the time sequence constraint. Here, (k) c ij can be solved by formula (7).
(k) T i,sd is the image compression task stable processing time of the k th task collaboration alliance. (k) t c,j is the time of an image compression subtask processed by the union cooperative node s ij in the k th task collaboration alliance. The number of image compression subtasks (k) c ij in the k th task collaboration alliance is assigned to the union cooperative node s ij by the union leader node s i .
The maximum number of image compression subtasks (k) C ij in the k th task collaboration alliance is assigned to all of the union cooperative nodes by the union leader node s i . Here, the (k) C ij can be calculated by formula (8).
When n j=1 c ij ≥ C i , the union cooperative nodes can complete in a task stable processing time. The task execution time T i,J estimated by the union leader node s i should be less than or equal to the task stable execution time T i,sd . At this time, the union leader node s i can calculate the task execution time T i,J according to formula (9). Then, we replace the T i,J with T i,sd in formula (6) and recalculate the number of image compression subtasks c ij assigned to the union cooperative node s ij by the union leader node s i .

E. MTDA-T ALGORITHM SUMMARY
The multi-round task decomposition algorithm based on TSPT (MTDA-T) is shown in algorithm 1.

IV. IMAGE COMPRESSION TASKS ALLOCATION A. TARGET OF TASK ALLOCATION
The targets of mobile multimedia sensor network image compression task allocation are reducing the image compression task execution time, reducing the network energy consumption, and realizing the load balance.
Algorithm 1 MTDA-T 1:Initialize < P i,max , C, c i,j , T i,j , T sd,ij , pr ij >; 2: The s i sends the < P i,max , C, c i,j , T i,j , T sd,ij , pr ij > to the s ij 3: The s ij sends the t c,j to the s ij 4: for (k = 1; k + +; k ≤ a) do 5: s i calculates T i,sd according to formula (1); 6: if( n j=1 c ij ≥ C i ) do 7: s i calculates T iJ according to formula (6); 8: s i replaces the T i,J with T i,sd in formula (3) and recalculates c ij of s ij ; 9: end if 10:

12:
s i calculates (k) T i,J according to formula (6); 13: s i replaces T i,J with T i,sd in formula (3) and recalculates (k) c ij of s ij ; 14: end if 15: end for T i,j is the image compression task execution time of the union cooperative node s i,j for completing the task c i,j . In addition, T i,j can be calculated by formula (10).
t c,j is the time for an image compression subtask to be processed by the union cooperative node s ij . E j is the energy consumption of the union cooperative node s i,j . It includes the energy consumption of the image compression task processing E pr,j and the energy consumption of the image compression task transmission E T ,j . In addition, E pr,j can be calculated by formula (11).
Here, e c,j is the energy consumption of an image compression subtask processed by the union cooperative node s ij . We consider the radio model and the related parameters referenced in the literature [41]. The energy consumption of the union cooperative node s ij receives an image compression subtask and sends an image compressed subtask, which is defined in formula (12). E T ,j = (1 + ρ)D c,j e elec + ρD c,j ε fs r 2 c,j c ij (12) where, D c,j is the data length of sending an image transmission subtask, and ρ is the image compression ratio. Here, e elec is the energy consumption of the electronic equipment of l bit, and ε fs is the energy consumption of the wireless antenna amplifier. Additionally, r c,ij is the communication radius of the union cooperative node s ij . The total energy consumption of the TCA can be defined as in formula (13), as follows: The network task load balancing degree is the range of difference between the image compression task execution time and the total image compression task completion time for all union cooperative nodes. The mean value of the ratio (the ratio of the difference value to the total task completion time) is used to evaluate the load balance degree of the WSNs. The load balance degree of network task L b can be calculated by formula (14).
where T i,J is the total time for actually completing the image compression task C i , and T i,J = max m c=1 (T ij ). T i,j is the time for the union cooperative node s ij to process the number of image compression tasks c ij . According to the formula (14), the smaller the value of L b is, the better the loads balancing is. So the optimum task load balance ratio is 0 in the optimal case of task allocation. In this case, T i,j = T i,J , it means that the actual time for all the union cooperative nodes to complete the task is T i,J .

B. TASK ALLOCATION PROBLEM MODEL
The cost of image compression is different due to having different amounts of power, computing power, and resource usage of nodes. For the union leader node, the most advantageous aspect is that the lower the energy consumption is, the better the outcome. The lower the profit is, the better the outcome, while the higher the task balance is, the better the outcome.
Suppose that the size of the total image compression task assigned by the union leader node s i is C i , and the union cooperative set of TCA is assumed to be as s iJ (s i1 , s i2 , . . . s in ). The image compression task allocation vector of the union cooperative node is C N (c i1 , c i2 , . . . , c in ). The cost vector of completing an image compression subtask for the union cooperative node is P n (p 1 , p 2 , . . . p n ). The utility function of the k th task collaboration alliance generated by s iJ is (k) U i,J . Suppose that the total cost of the number of image compression subtasks (k) C i is (k) P N in the k th task collaboration alliance. In addition, (k) P N = (k) C i P S /C i , and P S is the total cost paid by the union leader node s i for task C i . Here, (k) c ij is the number of image compression subtasks of the union cooperative node s i,j . It is distributed by the union leader node s i according to the utility function of the union cooperative node set s iJ . The number vector of the image compression subtask is (k) i1, c i2 , . . . , (k) c in ). It is assigned to the union cooperative nodes by the union leader node s i in the k th task collaboration alliance. To obtain the task in the k th task collaboration alliance, the union cooperative node s i,j will submit the cost of completing an image compression subtask (k) p j,0 to the union leader node s i . The number of image compression subtasks obtained by the union cooperative node s i,j is (k) c ij . In addition, the energy consumption of the union cooperative node s i,j is E j . The problem model of the task allocation is as follows: In formula (18), (k) T i,sd is the image compression task stable execution time in the k th task collaboration alliance. Here, (k) c (k) ij t c,j is the task execution time for completing the image compression subtask (k) c ij , and it is assessed by the union cooperative node s ij according to its own ability. In formula (15), the utility function generated by the union cooperative node s ij in the k th task collaboration alliance is defined as Different values the unit of income, energy consumption, and load balancing degree will lead to unreasonable distribution results. Therefore, dimensionless treatment is required, and the treatment is in formula (19), (20).
In formula (19), (k) p j (k) c ij is the actual value of the income obtained by the union cooperative node s ij , and (k) p (k) j c ij is the dimensionless value. Here, (k) p i,max is the total cost paid by s i for task (k) C i in the k th task collaboration alliance. In formula (20), (k) E j is the actual energy consumption value of the union cooperative node s i,j , and (k) E j is the dimensionless value. (k) E A is the average energy consumption of the union cooperative nodes. In addition, (k) E A = n j=1 (k) E j (k) n, where (k) n is the number of union cooperative nodes in the k th task collaboration alliance.

C. TASK ALLOCATION PROBLEM SOLVING
The Lagrange function is constructed as follows: The Karush-Kuhn-Tucker conditions are as follows: The number of image compression subtasks assigned to the union cooperative node s i,j is calculated as follows: (23), as shown at the bottom of the next page.
However, to determine the (k) c i,j , we should know the Lagrange multiplier vector λ i , µ i , and δ j . The dual problem VOLUME 8, 2020 is used to obtain the Lagrange multiplier vector. The dual problem of the original problem is as follows: The dual problem function is differentiable. The gradient iteration method is used to obtain the Lagrange multiplier vector and the method is as follows: The number of iterations using the gradient descent method is t. (k) λ i , (k) µ i , and (k) δ j are the values after iteration t in the k th task collaboration alliance. (k) t is the default gradient descent iteration step size in the k th task collaboration alliance, and it decides the convergence of the algorithm.

D. IMAGE COMPRESSION TASK ALLOCATION ALGORITHM
The image compression task allocation algorithm based on dynamic alliance (ATDA) is shown in algorithm 2.
The time complexity of ATDA algorithm is O(n 2 ). The number of sensors n and the number of iteration t are the problem size. The time frequency (execution times) of the algorithm with the number of sensors n problem size big is T(n) = 5n. The time frequency of the algorithm with the number of iteration t problem size big is T(n) = 5nt. So the time complexity of the algorithm is O(n 2 ).

V. SIMULATION RESULTS AND ANALYSIS
In this section, the proposed algorithms are validated by comparing their performances with other task coordination mechanisms in terms of the cost, task processing time, energy consumption, and network task load balance degree. The task collaboration alliance is composed of a union leader node to decompose and allocate the image compression tasks. There is a union leader node to decompose and allocate the image compression tasks in our simulation model. Simulink in Matlab is used to test the algorithm's performance. transmission subtask is D ij = 128 × 128 × 8 bit. The detailed simulation parameters are shown in Table 1.
The energy consumption of the data compression processing and task data transmission is mainly considered in this paper. The image compression algorithm (SVD) in the literature [8] is used to process the image compression task. The energy consumption model of the data processing in the literature [44], [45] is selected.
In formula (25), N is the number of clock cycles to complete an image compression subtask. C T is the periodic conversion capacitance, C T = 0.67 nF. V dd is the processor supply voltage. In the literature [44], [45], the Strong ARM SA-1100 processor is used to test the energy consumption at the working frequency of 206 MHz. The average clock period of 1 bit data processing in the SVD algorithm can be estimated as 50 (clock/bit). The time of 1 bit processing can be calculated to be approximately 0.24 µs. According to formula 25, the energy consumption of 1bit data processing is approximately 364.8 nj.
The two experiments are designed to verify the convergence and performance of the ATDA algorithm. The first experiment mainly verifies the convergence of the ATDA algorithm. The second experiment mainly verifies the performance of the ATDA algorithm and compares it with TASM and the average distribution algorithm (ADA). Figure 4 shows the allocation of image compression subtasks compared with the five nodes of the UCS. The five union cooperative nodes of TCA are selected to evaluate the performance of the ATDA algorithm. The maximum cost that  the union leader node s i is willing to pay for the UCS is P i,max = 800. The cost of completing an image compression subtask estimated by the five union cooperative nodes is assumed to be p 1,0 = 11.84, p 2,0 = 10.72, p 3,0 = 9.60, p 4,0 = 8.64, and p 5,0 = 7.52. The union leader node s i distributes approximately 13 image compression subtasks to the UCN1 and UCN2 in the first task collaboration alliance. Approximately 25 image compression subtasks is distributed to the UCN3 and UCN4. Approximately about 52 image compression subtasks is distributed to the UCN5. The ATDA algorithm in the iteration is stabilized after approximately 18 times. Figure 5 shows that the cost of an image compression subtask is completed by the union leader node, with the number of iterations increasing along the x-axis. The cost, energy consumption and load balance of the union cooperative nodes are considered by the union leader node in the image compression task allocation. The costs of the two nodes (UCN1 and UCN2) are stabilized at 8.96 and 9.60 in the iteration after approximately 18 times. The union leader node s i distributes approximately 13 image compression subtasks to the UCN1  and UCN2 in the first task collaboration alliance. The reason is that their cost of completing an image compression subtask is higher, and thus, the number of image compression subtasks assigned is small. The costs of the UCN3, UCN4, and UCN5 are stabilized at 5.60, 5.28, and 4.96 in iterations above approximately 18 times. The union leader node s i distributes approximately 25 image compression subtasks to the UCN3 and UCN4, approximately 52 image compression subtasks to the UCN5 in the first task collaboration alliance. Therefore, more image compression subtasks are assigned to UCN5. Figure 6 displays the assigned image compression subtasks of five union cooperative nodes by using the algorithms of ATDA, TASIM, and ADA. The image compression subtasks are distributed equally by using the ADA algorithm. Thus, the assigned image compression subtasks of five union cooperative nodes are the same. The ATDA algorithm distributes the image compression subtasks based on the cost, energy consumption, and completion time. Thus, the image compression task allocation of the ATDA algorithm is inclined to the union cooperative nodes with low cost, low energy consumption, and high task execution time efficiency.  Figure 7 displays the benefit comparison of five union cooperative nodes by using the ATDA, TASIM, and ADA algorithms. The image compression subtasks are distributed equally by using the ADA algorithm. Thus, the benefit of the five union cooperative nodes is the same. The image compression subtasks are distributed evenly by using the TASIM algorithm. The image compression task is distributed evenly by using the TASIM algorithms and the benefit of the five union cooperative nodes is different. The task allocation of the five union cooperative nodes is different when using the ATDA algorithm. The benefit of the five union cooperative nodes is also different. Figure 8 shows that the average task processing time of ATDA is slower than that of ADA and TASIM in different average speeds of the sensors. When the average speed increases, the average task processing time also increases. The average task processing time of ATDA is 15.10% lower than that of ADA and 10.46% lower than that of TASIM. The reason is that the ATDA algorithm adopts the multi-round allocation mechanism based on the task stable processing time. This method reduces the repeated transmission of the image compression task data caused by the movement of the union cooperative nodes away from the task collaboration alliance. Figure 9 shows that the average task processing time of ATDA is slower than that of ADA and TASIM when the number of sensors increasing.

C. TASK PROCESSING TIME ANALYSIS OF ALGORITHM
The average task processing time of all of the algorithms decreases when the number of sensors increases. The reason is that the increase in the number of union cooperative nodes reduces the number of image compression subtasks for each node. Thus, the repeated transmission of the image compression task data caused by the movement of union cooperative nodes away from the task collaboration alliance is reduced.  The average task processing time of the ATDA is 9.22% lower than the ADA and 1.26% lower than TASIM for in different numbers of union cooperative nodes.

D. ENERGY CONSUMPTION ANALYSIS OF THE ALGORITHM
Figure10 shows the total energy consumption under different average speeds of sensors using the algorithms of ADA, TASIM, and ATDA. When the average speed increases, the total energy consumption also increases. The total energy consumption of task collaboration alliance of the ATDA is 9.45% lower than that of ADA and 4.77% lower than that of TASIM in different average moving speed of sensors. The reason is that the ATDA algorithm adopts the multi-round allocation mechanism. This method reduces the interruption of the image compression task and the retransmission of part  of task data caused by the movement of the union cooperative nodes away from the task collaboration alliance. Figure 11 shows the total energy consumption under different numbers of union cooperative nodes using the ADA, TASIM, and ATDA algorithms. When the average speed increases, the total energy consumption decreases. The reason is that the increase in the number of union cooperative nodes reduces the number of image compression subtasks for each node. The repeated transmission of the image compression task data caused by the movement of union cooperative nodes away from the task collaboration alliance is reduced. Thus, the total energy consumption of the task collaboration alliance is also reduced. The total energy consumption of task collaboration alliance of the ATDA is 7.08% lower than that of ADA and 3.81% lower than TASIM for different numbers of union cooperative nodes. Compared with the TASIM and ADA algorithms, the ATDA algorithm has an advantage in terms of the energy consumption. VOLUME 8, 2020

E. TASK LOAD BALANCE DEGREE ANALYSIS OF THE ALGORITHM
Figure12 displays the image compression task load balance ratio under different average speeds of sensors using the ADA, TASIM, and ATDA algorithms.
The time to transfer and process an image subtask (128 × 128 × 8bit) can be calculated according to the simulation parameters. The transfer time (62.50ms) is about twice as long as the processing time (31.46ms). With the increase of movement speed of the union cooperative nodes, the possibility of union cooperative nodes leaving the task collaboration alliance increases. It will cause the image compression task data to be transmitted repeatedly when the nodes leaving the task collaboration alliance. Data retransmission will increase the actual time to complete the image compression task. Therefore, as the node speed increases, the value of load balancing degree L b also increases. The union cooperative nodes move slower, the value of load balancing degree L b increases less. The load balancing is optimal when nodes are not moving. The loads balancing degree L b is about 0.80 when all the nodes speeds are 0.The Figure12 shows that the proposed algorithm can achieve a better load balance ratio than that of ADA and TASIM with an increase of the average speed of sensors.

VI. CONCLUSIONS
An image compression task cooperation algorithm for MWMSN is proposed to solve the problem of frequent interruptions of image compression tasks. In this paper, the MTDA-T and ATDA algorithms are proposed to process the image compression tasks. The MTDA-T algorithm is used to divide the image compression task into an image transmission sub task and an image compression sub task. The ATDA algorithm is used to realize the cooperative allocation of image compression tasks. Simulation results show that the proposed algorithm can improve the load balancing ratio, energy consumption, and execution time of the image compression task. However, the proposed multiround schemes need more control information. The time complexity of ATDA algorithm is still high for the union leader nodes. The proposed algorithm may increase the response time in the task allocation of image compression. The image reconstruction is not considered in our work.
In future research, it is planned to reduce the control information and the response time of the image compression task collaboration by using more detailed information of cooperative nodes (such as location prediction, communication resources, and their individual capabilities). In addition, the multiple sinks and autonomous moving for sensors will be considered to distribute the image compression task for MWMSN. Another possible direction for future work is the image reconstruction of MWMSNs. It is important to solve the random error code, sudden error code, packet loss in the process of MWMSNs transmission.