###### Abstract  
With the widespread application of unmanned aerial vehicle (UAV) formation technology, it is very important to maintain good communication quality with the limited power and spectrum resources that are available. To maximize the transmission rate and increase the successful data transfer probability simultaneously, the convolutional block attention module (CBAM) and value decomposition network (VDN) algorithm were introduced on the basis of a deep Q-network (DQN) for a UAV formation communication system. To make full use of the frequency, this manuscript considers both the UAV-to-base station (U2B) and the UAV-to-UAV (U2U) links, and the U2B links can be reused by the U2U communication links. In the DQN, the U2U links, which are treated as agents, can interact with the system and they intelligently learn how to choose the best power and spectrum. The CBAM affects the training results along both the channel and spatial aspects. Moreover, the VDN algorithm was introduced to solve the problem of partial observation in one UAV using distributed execution by decomposing the team q-function into agent-wise q-functions through the VDN. The experimental results showed that the improvement in data transfer rate and the successful data transfer probability was obvious. U 2023, 23, 2667. [[https://doi.org/10.3390/s23052667](https://doi.org/10.3390/s23052667)]([https://doi.org/10.3390/s23052667](https://doi.org/10.3390/s23052667))  
1  
class=MSC] [Primary ]05C10 [Primary ]05C20 [Primary ]05  
control, task assignment, flight path planning, communication networking and virtual and information perception. For a multi-UAV formation, multisource information fusion and information perception are the most important applications. The routing problem of multiple UAVs to realize remote sensing and area coverage in the shortest time was studied in [7]. To respond quickly to a disaster scenario, the authors of [8] evaluated open source and commercial software solutions for 3D reconstructions of disaster scenarios. The authors of Ref. [9] constructed a mobile sensing system based on multi-UAVs, which captured the variance of the air quality index at the meter level and plotted its corresponding fine-grained distribution. The authors of Ref. [10] solved the problem of cooperative control based on multi-UAV systems. Based on a multi-UAV wireless cache network, a new joint communication scheduling and trajectory method was proposed in [11]. To enhance the throughput of the network and minimize the data transmission time for a multi-hop UAV relay network, Ref. [12] addressed the packet routing problem. The authors of Ref. [13] solved the topology control problem for a UAV swarm network. Compared to other wireless networks, the topology of multi-UAV formation networks will always change as the positions of nodes, the amount of nodes and links are not fixed. The changes in position and speed can lead to intermittent connections between each one [1]. Both [14] and [15] agreed that the improvement of communication rate and the assurance of communication quality were necessary on account of the rapid different complexities and changing task surroundings. Reasonable resource allocation is an effective method to achieve these goals. To address the problem of resource allocation, the random method is one of the traditional methods and has recently been put into use in joint power and spectrum resource distribution by a number of researchers. In general, the random method serves as a baseline for comparison. For instance, powers are evenly assigned to every transmitter and the subchannels are distributed randomly to the devices in the literature [16]. In addition to the random method, in the work of [17], [PERSON] et al. randomly assigned channels to every device to device pair, and then chose one power from the candidate power list that could maximize the data transfer rate of the system. The random method is superior in working speed but inferior in improving the communication capacity and transmission quality of the system.