Federated learning via over-the-air computation in IRS-assisted UAV communications

Intelligent reflective surface (IRS) and unmanned aerial vehicle (UAV) communication are two key technologies in the sixth generation of mobile communication (6G). In this paper, IRS is equipped on UAV to form aerial IRS, which can achieve 360° panoramic full-angle reflection and flexible deployment of IRS. In order to achieve high-quality and ubiquitous network coverage under data privacy and low latency requirements, we propose an Federated learning (FL) network via Over-the-Air computation (AirComp) in IRS-assisted UAV communications. Our goal is to minimize the worst-case mean square error (MSE) by jointly optimizing the IRS phase shift, denoising factor for noise suppression, the user’s transmission power, and UAV trajectory. Optimizing and quickly adjusting the UAV position and IRS phase shift, it flexibly assists the signal transmission between users and base stations (BS). In order to solve this complex non-convex problem, we propose a low-complexity iterative algorithm, which divides the original problem into four sub-problems, respectively using the semi-definite programming (SDP) method, slack variable introduction method, successive convex approximation (SCA) method to solve each sub-problem. Through the analysis of simulation results, our proposed design scheme is obviously better than other benchmark schemes.

The fundamental requirements of 6G include a mobile communication network that integrates intelligence, perception, and security with Communication as the main function and achieves air-sky-earth-sea seamless coverage with human-centered and multi-network integration. UAV mainly performs communication functions at the air base network level in 6G. In order to effectively improve the quality of wireless communication networks, UAVs can be deployed to assist communication and achieve expansion at the wireless communication network level. The basic communication of the ground-based network is expanded to the space-based network. Then it can be interconnected with the space-based or sea-based satellite to achieve the 6G's macro requirements of global coverage and scene interconnection. As a small flight device, UAV has many advantages, such as line-ofsight (LoS) channel, low cost, high mobility, and high controllability, making the 6G network more convenient. Therefore, UAV-assisted communication is an indispensable potential technology in 6G networks.
In recent years, IRS has become a research hotspot. IRS is a device consisting of a large number of low-cost passive reflection elements. Different elements of IRS can independently reflect the incident signal by controlling their amplitude and phase, with negligible power loss [1][2][3] . Therefore, IRS is deployed in wireless networks to provide an intelligent and reconfigurable wireless channel environment for 6G systems. However, relevant studies mainly focus on the ground IRS, including single IRS and multiple IRS. Yang et al. 4 studied the resource allocation problem of a multi-IRS-assisted wireless communication network, which is a joint optimization problem of transmission beamforming and IRS control. The goal is to maximize energy efficiency under the user's minimum rate constraint. Mu et al. 5 studied the basic capacity limit of IRS-assisted multi-user wireless communication systems and adopted non-orthogonal multiple access (NOMA) and orthogonal multiple access (OMA) transmission schemes for capacity realization. Ground IRS has the following characteristics: ① Ground IRS needs to be fixed on the ground building, and it is difficult to find a suitable building and installation position in practical application; ② Ground IRS can only perform 180° reflection, which requires the transmitter and receiver must be on the same side of IRS; ③ In the complex urban environment, multiple IRSs are often required to perform multiple reflections, which will lead to serious signal attenuation.
Studies have shown that where IRS is deployed can significantly affect system performance 6 . Due to its small size, portability, and low power consumption, IRS can be conveniently installed on aerial platforms such as UAVs to form aerial IRS 7,8  www.nature.com/scientificreports/ has the following advantages: ① UAV is located at a high altitude and increases the transmission probability of LoS by raising altitude; ② IRS-UAV has higher deployment flexibility, which can simultaneously optimize UAV trajectory and IRS phase; ③ IRS-UAV can achieve 360° panoramic full-angle reflection; ④ Even in the complex urban environment, it is often only necessary to pass through a reflection to complete the signal transmission. The above characteristics make aerial IRSs have better signal channel quality. Cai et al. 9 studied the IRS-assisted UAV communication system to minimize the average total power consumption by jointly optimizing the UAV trajectory design and resource allocation strategy. Wei et al. 10 studied the IRS-assisted UAV's orthogonal frequency division multiple access (OFDMA) communication system, taking advantage of the significant beamforming gains from the IRS and the high mobility of UAV to improve the system's sum speed. Cai et al. 9 , Wei et al. 10 did not equip the IRS on UAVs to replace the traditional ground IRS to assist UAV communication. The research on IRS-UAV mainly adopted the traditional multiple-access method. Mao et al. 11 studied an IRS-assisted UAV low-altitude passive aerial relay system and found that the flexibility of IRS-UAV can provide a better signalto-noise ratio (SNR) for the system. Jiao et al. 12 studied an IRS based UAV assisted multiple input single output (MISO) NOMA downlink communication network, first found the optimal horizontal position of the UAV, and then jointly optimized the beamforming vector and IRS phase shift matrix to maximize the data rate of the strong user in the system. Traditional multiple access adopts the architecture of communication and computing separation. First, recover the signal of each transmitting node at the receiving end. And then calculate the objective function. This method will lead to serious energy consumption and delay. AirComp is based on "communication-computing integration" and utilizes the waveform superposition properties of signals during transmission to achieve fast data collection [13][14][15] . However, AirComp cannot complete all tasks, only simple tasks like summing, averaging, and finding maximum and minimum values. FL is a machine learning (ML) framework that can effectively help multiple institutions with data usage and ML modeling while meeting the requirements of user privacy protection, data security, and government regulations 16 . Only the trained model is uploaded during FL training, and the data is kept locally, solving two challenges of data privacy and communication transmission pressure in ML tasks 17 . Due to its outstanding characteristics, FL is widely used in various industries such as finance, healthcare, education, urban computing,and smart cities. Wang et al. 18 proposed a safety-enhanced FL to predict the energy needs of electric vehicles (EVs) while considering the effectiveness of energy management in EVs and the potential risks to FL. Lian et al. 19 proposed a decentralized, efficient and privacy-enhanced federal edge learning (FEL) system, which enables medical devices from different institutions to collaborate to train global models without exchanging raw data, and solves the privacy and security issues caused by patient data leakage for disease prediction or diagnostic models.
The FL training process generally uses the federated averaging (FedAvg) algorithm to aggregate the local models. Therefore, the combination of FL and AirComp can achieve fast data collection and complete the calculation in Communication, prevent the server from understanding the calculation process, and have better confidentiality. Yang et al. 14 studied a fast FL global model aggregation method based on the AirComp principle to ensure the system's strict requirements of low latency and privacy. Fu et al. 20 studied a low-cost UAV as a mobile BS to assist the AirComp system and analyze the AirComp performance by calculating the time average MSE. There are few studies on the combination of IRS-UAV and AirComp. In order to achieve high-quality and ubiquitous network coverage under data privacy and low latency requirements, we propose an FL network via AirComp in IRS-assisted UAV communications. The main contributions of the research work are summarized as follows: • In this paper, IRS is equipped on a UAV to form an aerial IRS, which can achieve 360° panoramic full-angle reflection and flexible deployment of IRS. Optimizing and quickly adjusting the UAV position and IRS phase shift, it flexibly assists the signal transmission between users and BS. • This paper proposes an FL network architecture via AirComp in IRS-assisted UAV communications. With the assistance of IRS-UAV, adopting AirComp's global aggregation method for FL, which achieves high-quality and ubiquitous network coverage under data privacy and low latency requirements. • Our goal is to minimize the worst-case MSE by jointly optimizing the IRS phase shift , denoising factor for noise suppression η[m] , the transmission power of user p n [m] , and UAV trajectory q[m] . In order to solve this complex non-convex problem, we propose a low-complexity iterative algorithm, which divides the original problem into four sub-problems, respectively using the SDP method, slack variable introduction method, and SCA method to solve each sub-problem.

System model
We consider an FL network via AirComp in IRS-assisted UAV communications. The system model is shown in Fig. 1a, which includes a single antenna BS, a single antenna UAV, and N single antenna equipment users. The user set is N = {1, 2, . . . , N} . Assuming that the direct link communication between the users and BS is interrupted, an IRS-loaded rotorcraft UAV acts as a relay node to establish additional communication links between the users and BS, in which the IRS is equipped with K phase shift reflex elements, the phase shift reflex elements set is K = {1, 2, . . . , K} . The rotorcraft UAV flies at a fixed altitude and operates from a fixed charging point.
Optimizing and quickly adjusting the UAV position and IRS phase shift, it flexibly assists the signal transmission between the users and BS.
FL model. This paper conducts FL in the IRS-assisted UAV communication network. Figure 1b shows the FL training process in detail. Suppose w n i, j represents the n-th user's local model parameter for the j-th local iteration in the i-th global iteration, where j ∈ {1, 2, . . . , J} , D n represents the local training data set of the n-th user.
Step 1: Global model broadcast. BS broadcasts global model parameters w(i) to each user via IRS-UAV. www.nature.com/scientificreports/ Step 2: Local model training. The user combines the received w(i) with the local training data set D n and uses the gradient descent method w n i, j = w n i, j − 1 − ζ n ∇F n w n i, j − 1 to train the local model parameters w n (i, J) , where ζ represents the learning rate.
Step 3: Local model upload. The client transmits the local model parameters w 1 (i, J), w 2 (i, J), . . . , w N (i, J) to BS via IRS-UAV. The AirComp method aggregates the model during the model upload process. The BS end directly receives the aggregated model parameters w(i + 1).
Repeat the above three steps until the model parameters converge. That is, complete the FL model training.
Channel model. We use time-discrete technology to deal with continuous UAV trajectory design, widely used in existing UAV communication research 21  , ∀m ∈ M . The user is on the horizontal ground, and the horizontal coordinate of the nth user (U n ) is represented by r n = x n , y n , ∀n ∈ N . Therefore, the distance between the U n and IRS-UAV is: The distance between the IRS-UAV and BS is Assume that the UAV starts the task at predetermined position q 0 and ends the task at predetermined position q F . This work ignores the flight power consumption of the UAV. The maximum velocity of the UAV during the task is represented by V max (m/s) , which must satisfy the constraint ẋ IRS-UAV is used as the air relay to transmit information, and the wireless signal is transmitted to the receiver through the air-to-ground (AtG) channel or multi-hop air channel. Compared with the ground channel, the AtG channel or air channel has a higher probability of generating LoS transmission conditions, which helps improve users' quality of service (QoS) by reducing signal attenuation. In addition, the flexibility of the UAV and IRS also enables them to relocate by sensing channel characteristics to obtain better channel conditions actively. Therefore, the channel conditions are more actively adjusted compared with fixed infrastructure communication. This paper assumes that LoS channels dominate each communication link in the system. IRS is equipped with K phase shift reflex elements to establish a reflection communication link between the user and BS by regulating the phase shift of IRS. Let h U n I [m] ∈ C K×1 and h IB [m] ∈ C 1×K represent the channel from U n to IRS-UAV and from IRS-UAV to BS in the m-th time slot, respectively. Therefore, the cascade channel of the m-th time slot U n -IRS-BS is expressed as: (3) Assume that {x n [m], ∀n ∈ N} is independent, the mean is zero, and the unit variance, that is, where η[m] represents the denoising factor for noise suppression. The aggregated AirComp performance in the FedAvg algorithm is measured by MSE, which is defined as: Substituting Eqs. (5) and (7) into Eq. (8), we can get: The total time for the UAV to complete work tasks is divided into M time slots. In order to meet the requirements of AirComp performance of each time slot aggregation in the FedAvg algorithm, this paper considers the worst-case MSE.
Problem formulation. We aim to minimize the worst-case MSE by jointly optimizing the U n 's transmission power p n [m] , denoising factor for noise suppression η[m] , IRS phase shift , and UAV trajectory q[m] . According to the system model in the previous section, the optimization problem can be expressed as follows: where C1 is the transmission power constraint of the client, and p max is the maximum transmission power of the client. C2 is a non-negative constraint on the denoising factor for noise suppression. C3 is the IRS phase     2 .
(9) www.nature.com/scientificreports/ shift constraint. C4 and C5 are the start and end positions of the UAV, respectively. C6 is the UAV flight speed constraint, and V max is the maximum UAV flight speed. Due to the variable coupling between the objective function and the constraint, the optimal solution to the optimization problem (10) cannot be obtained directly.

Proposed algorithm
In order to deal with the non-convexity of the optimization problem (10), this section proposes an iterative algorithm to decompose the problem (10)  We choose to minimize an upper bound of the objective function to optimize problem (12), and transform the objective function of problem (12) as follows: , β is the β solution obtained by the previous iteration in the alternating iteration algorithm. Problem (12) can be simplified as follows: From the constraint of the problem (14), we can get �β� 2 = K . When phase β k is equal to ξ k , R β H ξ gets the maximum value, where ξ k represents the k-th entrance of ξ . Therefore, the optimal solution to the problem (14) can be obtained as follows: The optimized solution β * is a closed form, which is easier to implement and has less computational complexity than the semi definite relaxation (SDR) method.
Denoising factor optimization. Using the optimized and the given optimization variables p n [m] and q[m] , problem (10) can be simplified to a sub-problem about the denoising factor optimization: , the optimization problem (16) is rewritten as: The objective function in problem (17) is a quadratic function of one variable with respect to variable γ [m] . By introducing variable χ , problem (17) can be transformed into: (15) β * = e j arg (ξ1) , e j arg (ξ2) , . . . , e j arg (ξK ) T .  (18) is co-convex with respect to the optimization variables γ [m] and χ , which is a quadratic constrained quadratic programming (QCQP) problem. Therefore, Problem (18)  The objective function and constraint conditions of problem (23) are still non-convex, so solving problem (23) has a significant challenge. Using the SCA algorithm to approximate the non-convexity of the problem (23).   , which is a QCQP problem. Therefore, problem (26) can be solved directly by the convex optimization toolkit. See algorithm 1 for the specific algorithm steps.
The transformed problems (18), (20), and (26) are convex and solved by the convex optimization solver CVX. The optimal solutions to problems (16), (19), and (21) are obtained, respectively. The closed solution to the problem (11) is obtained by transformation. Then the optimal solution to the optimization problem (10) is finally obtained through the iterative algorithm. In summary, the iterative algorithm of the proposed problem (10) can be presented in algorithm 2.

Results analysis
In this section, we analyze the performance of the proposed algorithm through simulation results. An IRS-loaded UAV flies at an altitude of 100 m, and 12 users are randomly distributed in a circular area with (150,0) as the center and 50 m as the radius. Assume that the channels between the user and IRS-UAV and between the IRS-UAV and BS are both LoS. For large-scale fading, the path loss index α = 2 ; For small-scale fading, Rice fading channel is selected. Table 1 shows other relevant parameter settings. In Fig. 2, we analyze the convergence of the proposed algorithm. It can be seen from Fig. 2 that the minimum value of MSE in the worst case (Min-Max MSE) decreases rapidly first and then reaches convergence gradually and steadily with the increase of the iteration numbers, which proves the effectiveness of the proposed algorithm jointly optimizing the U n 's transmission power p n [m] , denoising factor for noise suppression η[m] , IRS phase shift , and UAV trajectory q[m].
To analyze the performance of the proposed algorithm, we design three different methods to compare the Min-Max MSE: ① SDP algorithm; ② Random phase; ③SDR algorithm. Figure 3 shows the relationship between the Min-Max MSE and task time, and the Min-Max MSE of all schemes decreases significantly with the increase in task time. The performance of our proposed algorithm is significantly better than that of the random phase and SDR algorithm under different task times. Figure 4 shows the relationship between the Min-Max MSE and the number of IRS elements K. With the increase of K, the Min-Max MSE in all cases decreases significantly, indicating that the increase in the number of IRS elements will promote the performance of the system. However, in different optimization algorithms, the optimized phase algorithm at K = 50 is much superior to the random phase algorithm at K = 100. This indicates the importance of the optimized phase in practical applications. Figure 5 shows the relationship between the Min-Max MSE and the number of users N, and compares three optimization algorithms: ① Optimize the UAV trajectory; ② Straight flight: the UAV flies from q 0 to q F in a straight line at 100 m; ③ Static UAV: the UAV is deployed at (150,0,100) and remains stationary, which is equivalent to fixing IRS at a certain height. It can be seen from Fig. 5 that the Min-Max MSE in all cases increases significantly with the increase of N, indicating that the increase in users will reduce the system performance.     www.nature.com/scientificreports/ As can be observed in both Figs. 4 and 5, our proposed design scheme is obviously better than the other two benchmark schemes. The performance gains are more significant as the number of IRS elements increases or the number of users decreases. This is because UAV has many advantages such as LoS channel, low cost, high mobility, and high controllability. By optimizing the trajectory of UAV and the phase of IRS, the IRS-UAV can achieve an optimal balance with the BS and users, and enhance the channels of all links, thus improving the Aircomp performance of the system.

Conclusion
FL solves two challenges of data privacy and communication transmission pressure in ML tasks. AirComp provides a promising method for the ultra-fast model aggregation of FL. The combination of FL and AirComp can not only achieve fast data collection, but also complete the calculation in communication can avoid the server from understanding the calculation process, and has better confidentiality. This paper proposes a new threedimensional network architecture: FL network architecture via AirComp in IRS-assisted UAV communications.
With the assistance of IRS-UAV, we are adopting AirComp's global aggregation method for FL, which achieves high-quality and ubiquitous network coverage under data privacy and low latency requirements. Due to the variable coupling between the objective function and the constraint, the optimal solution cannot be obtained directly. We propose a low-complexity iterative algorithm to decompose the original problem into four sub-problems. Specifically, for the optimization variables p n [m] , η[m] , and q[m] , we optimize one of the variables and fix the others, using alternate optimization until the convergence condition is reached.

Data availability
The data used to support the findings of this study are available from the corresponding author on reasonable request.