Manuscript Offprint
arXiv:2611.01812Domain-Aware Hierarchical Federated Learning for UAV Swarms Across Heterogeneous Environments
Taha Mahmood, Mudassar Shakeel, Ahmed Naeem, El Mehdi Amhoud Senior Member, IEEE, Rizwan Ahmad Member, IEEE, Salman Ghafoor
This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.
Abstract—Hierarchical federated learning (HFL) enables communication-efficient training in unmanned aerial vehicle (UAV) swarms, but performance degrades under changing and heterogeneous environments. This paper proposes domain-aware HFL (DA-HFL), integrating mobility-informed clustering, cluster-level aggregation, cloud-based Fisher-weighted merging, a domain-adversarial shared backbone, environment-specific heads, and gated inference with local adaptation. A mission-weighted optimization formulation incorporates energy, latency, and cluster-head eligibility constraints. Theoretical analysis establishes resource feasibility, a conditional backbone-stationarity bound, the quadratic optimality of Fisher-weighted merging, and communication and computation complexity bounds. Simulations across four heterogeneous environments demonstrate faster convergence, improved accuracy during environmental transitions, and more stable, purer clusters than the evaluated baselines, with modest energy overhead over resource-aware HFL. Ablation studies validate the contributions of the proposed components.
Index Terms—Federated learning, Fisher-weighted aggregation, hierarchical federated learning, UAV swarms.
I. INTRODUCTION
Sixth generation (6G) wireless networks are envisioned to provide intelligent, distributed, and autonomous connectivity through low-latency communication, edge intelligence, and integrated sensing and communication (ISAC) [1]. Unmanned aerial vehicle (UAV) swarms are an important use case because of their flexible deployment, and distributed sensing capabilities. They support applications such as disaster response, surveillance, and environmental monitoring where UAVs must process sensor data and make decisions during flight. Transmitting these data to a remote server introduces communication overhead and latency [2] over intermittent or resource-constrained links. Enabling learning and inference at the network edge is therefore important for UAV operations.
Federated learning (FL) allows UAVs to retain raw data locally and exchange model parameters or updates with an aggregation server [3]. Hierarchical federated learning (HFL) introduces intermediate cluster-level aggregation between UAVs and the cloud to reduce direct server communication and support larger networks [2]. Resource-aware approaches use
energy, mobility, computation, and link conditions to guide clustering and dynamic cluster head (CH) selection [4]–[6]. Asynchronous aggregation further reduces synchronization delays caused by straggling participants [7], [8].
However, resource-aware organization alone does not address changes in the data distribution observed by a moving UAV. Statistical heterogeneity across clients can degrade the performance of a common federated model [9], while feature-distribution shifts further motivate domain-specific treatment [10]. During a mission, a UAV may move across urban, forest, rural, and lake regions, each associated with a different data distribution. Consequently, a model suited to one environment may become less effective after an environmental transition. Existing resource-aware clustering mechanisms [4]–[6] primarily organize UAVs according to communication, mobility, energy, and computation conditions, and therefore do not explicitly determine when an environmental-domain change requires model reassignment. Moreover, aggregating heterogeneous updates into a single model can dilute domain-specific knowledge, whereas a static model assignment may retain a predictor associated with a previously occupied environment.
The statistical heterogeneity in FL can impair global training [9], motivating clustered and optimization-based solutions. Clustered FL groups clients according to learning updates and maintains specialized models [11], while FedProx uses a proximal penalty to improve training under heterogeneous data [12]. SCAFFOLD uses control variates to reduce client drift and provides convergence guarantees under its stated assumptions [13]. These methods address heterogeneous optimization, but do not explicitly determine when a mobile UAV should switch between environment-specific models.
T. Mahmood, M. Shakeel, A. Naeem, R. Ahmad, and S. Ghafoor are with the School of Electrical Engineering and Computer Science, National University of Sciences and Technology, 44000, Islamabad, Pakistan. (email: {tmahmood.bee23seecs, mshakeel.bee23seecs, ahmed.naeem, rizwan.ahmad, salman.ghafoor}@seecs.edu.pk). E. M. Amhoud is with the College of Computing, University Mohammed VI Polytechnic, Benguerir 43150, Morocco (email: elmehdi.amhoud@um6p.ma).
Domain adaptation and personalized FL provide complementary mechanisms for heterogeneous observations. Federated batch normalization (FedBN) retains batch-normalization components locally to accommodate feature shift across clients [10], while Domain-adversarial neural network (DANN) uses a domain discriminator and gradient reversal to learn less domain-dependent representations [14]. Domain-generalization methods similarly seek transferable representations [15], whereas Ditto and Per-FedAvg learn client-specific models or adaptable initializations [16], [17]. These approaches support invariance or local specialization, but do not directly connect environmental transitions with hierarchical aggregation and model assignment.
Mixture-of-Experts (MoE) architectures maintain specialized models and use a gate to select or combine their outputs [18], with adaptive expert selection also explored in federated settings [19]. For mobile UAV hierarchies, however, expert selection must also account for model availability, communication, and environmental changes. Parameter-importance methods provide another mechanism for aggregation: Fisher-weighted merging assigns coordinate-dependent weights to model parameters [20], while Fisher-based regularization preserves previously learned knowledge [21]. These methods motivate importance-aware aggregation, but do not specify how environment-specific heads should be grouped, propagated across hierarchy levels, or selected after a UAV changes its environment. The remaining requirement is to coordinate mobility, aggregation, and inference so that environmental transitions inform network organization and model selection while domain-specific knowledge remains available across aggregation tiers. This motivates the proposed framework under the modeled energy and latency constraints.
B. Contributions
The main contributions of this paper are as follows:
-
We propose a mobility-based domain-drift measure that estimates whether a UAV will leave its current environmental zone before the next synchronization event and combines this estimate with entropy-based feedback and environment signatures to guide clustering and CH selection under energy and latency constraints.
-
We propose a domain-aware architecture comprising a shared backbone, environment-specific prediction heads, and local normalization components, with local training integrating domain-adversarial learning, proximal regularization, and SCAFFOLD correction while keeping all normalization components local to each UAV.
-
We develop a two-tier aggregation method that applies sample-weighted aggregation within clusters and Fisher-weighted merging at the cloud, while additive head statistics preserve the direct Fisher merge over accepted contributions and version checks prevent incompatible model updates from being combined.
-
We develop a signature-based gate that selects an environment-specific head or mixes the two most likely heads when the selection is uncertain, while entropy-based drift detection triggers limited adaptation of local normalization without modifying the shared backbone.
-
We derive resource-feasibility conditions, a conditional backbone-stationarity bound, and quadratic optimality of Fisher-weighted merging, and analyze complexity and evaluate classification, drift, clustering, and modeled energy use through feature-level simulations and component ablations.
II. SYSTEM MODEL
We consider an HFL system comprising a UAV swarm and cloud server, as shown in Fig. 1. Each UAV collects data and trains locally, while CHs aggregate and forward updates to the cloud. The swarm operates across zones with different data distributions, with UAV mobility inducing distribution shifts.
A. Network Topology
The network consists of a cloud server and a swarm of UAVs. Let denote the UAV-index set, where is the total number of UAVs and identifies the -th UAV. The FL process consists of learning rounds indexed by , where is the round-index set. Each round involves local model training, model exchange, and aggregation. At round , the swarm is organized into nonempty clusters, where denotes the number of active clusters. Let denote their index set and the set of UAV indices assigned to cluster . Since the clusters collectively cover the entire swarm, their union satisfies . Moreover, each UAV belongs to only one cluster, which requires the membership sets to satisfy
where identifies a cluster different from m and denotes the empty set. To represent these memberships in the subsequent problem formulation, the binary association variable is defined as
Accordingly, the requirement that each UAV belongs to exactly one cluster is expressed as . The association variables form the binary assignment matrix , whose rows correspond to UAVs and columns correspond to clusters. The number of members in cluster at round , denoted by , is obtained as
where denotes the number of elements in . Each active cluster is nonempty and therefore satisfies . Each cluster selects one member as its CH. Let denote the index of the selected CH of cluster at round . The corresponding binary selection variable is defined as

Fig. 1. Overall architecture of the proposed domain-aware hierarchical federated learning framework for mobile UAV swarms.
Selecting exactly one CH per cluster requires , , with cluster membership enforced by , , . Each UAV performs local training, while the CH aggregates member updates and forwards the cluster contribution to the cloud for inter-cluster aggregation. Since CH uploads are asynchronous, contributions may arrive at different times, with denoting their originating round. Cluster membership and CH selection are updated during reclustering to reflect mobility and resource changes.
B. Mobility and Data Model
The position of each UAV determines its occupied environmental zone. Let denote the 3D position and velocity of the -th UAV at round , respectively, and let denote the interval between successive mobility observations. With commanded acceleration assumed constant over this interval, the position evolves as
where represents the accumulated position disturbance due to wind and control errors. These disturbances are assumed independent across rounds and distributed as , , where denotes zero-mean Gaussian process noise with covariance matrix , and , , and are the per-interval position-error variances along the three coordinate axes. The trajectories are mission-specified and not optimized.
Let denote the ground-plane mission area, partitioned into known environmental zones indexed by , with denoting the -th zone. The complete coverage and exclusive zone membership require
where denotes a zone different from k, and boundary points are uniquely assigned. The ground-plane projection matrix retains horizontal coordinates and removes altitude. For positions projected within , the occupied-zone index is defined as if and only if . A transition may change the local data distribution. For each zone , let denote the joint input-label distribution over , where is the input space and the set of class labels. Each zone distribution is assumed fixed during the mission. The local dataset collected by the -th UAV at round is defined as
where is the local sample count, is the sample index, and and denote the -th input and its corresponding class label. Conditional on the occupied zone, samples within each round's dataset are assumed independent and identically distributed (i.i.d.) according to . This assumption does not require independence across rounds. UAVs in the same zone share a population distribution but may collect different datasets. Different zone distributions yield spatial heterogeneity, while transitions between zones with induce temporal shifts in input appearance, class frequencies, or both. To quantify these differences, let and denote joint input-label distributions with densities and , respectively, where and . For continuous inputs and discrete labels, their Kullback-Leibler (K-L) divergence is defined as
(8) which is infinite if assigns positive probability to a set assigned zero probability by . For zones and , let denote their equally weighted mixture distribution. The corresponding Jensen-Shannon (JS) divergence is defined as
This measure is symmetric, lies in , and equals zero if and only if the distributions coincide, characterizing population-level environmental dissimilarity. Since zone distributions are unknown, the framework identifies environments using signatures computed from local samples.
C. Channel and Energy Model
The communication cost of each UAV depends on its role in the hierarchy. Cluster members transmit local updates to their CH, while the CH forwards the aggregated contribution to the cloud. For a non-head member , the distance to its serving CH is expressed as , where is the position of the selected CH. The set difference excludes the CH, which incorporates its own update directly into aggregation. The member-to-CH air-to-air (A2A) channel coefficient is modeled using distance-dependent large-scale attenuation and small-scale Rician fading, following the standard UAV channel structure in [22], as
where m is the reference distance, is the average channel power gain at that distance, and is the path-loss exponent. The coefficient represents normalized Rician fading and satisfies . Its Rician factor is the ratio of specular to scattered power. Assuming negligible interference, the received signal-to-noise ratio (SNR) is , where is the transmit power of the i-th UAV, is the receiver noise power spectral density (PSD), and B is the allocated link bandwidth (BW). Accordingly, the Shannon transmission rate is expressed as .
Let denote the payload size, including the local update and accompanying learning information. Assuming constant rate and transmit power, the transmission time and energy are and , respectively. For cloud uploads, let , , and denote the aggregated payload size, effective rate, and CH transmit power, respectively. The upload time and energy are and . The cloud-link rate is treated as an input without applying the A2A propagation model. Thus, the transmit energy of the i-th UAV in cluster m is defined as
The energy model accounts only for uplink transmission energy and does not consider reception, downlink transmission, or radio-circuit energy.
In addition to communication, each UAV consumes energy for local training. Let denote the number of training steps per round and the mini-batch used by the -th UAV at step . The number of processed sample instances is calculated as , where is the mini-batch size. Repeated use of a sample is counted separately, so may differ from the local dataset size . Let denote the effective number of central processing unit (CPU) cycles per processed training sample and denote the processor frequency. The local computation time is expressed as . Using the effective switched-capacitance model, the computation energy is obtained as , where is the effective switched-capacitance coefficient of the processor. These expressions account for local training; aggregation and inference workloads are not explicitly modeled. The propulsion cost is approximated using the rotary-wing level-flight model in [23], [24]. Let denote the horizontal speed of the -th UAV, where is the ground-plane projection matrix defined in the mobility model. Approximating this speed as constant over , the flight energy is expressed as
(12)
where and denote blade-profile and induced hover power, respectively. and are the rotor-tip speed and mean induced velocity, while , , s, and A denote the fuselage drag ratio, air density, rotor solidity, and rotor-disc area. The approximation excludes propulsion costs from vertical motion and acceleration. Since trajectories are mission-specified, flight energy is not optimized. The total modeled energy attributed to the i-th UAV at round t is given by
The communication costs are assigned to the round generating the update. Since uploads may finish asynchronously, represents round-attributed energy rather than energy necessarily consumed within the same interval .
III. PROBLEM FORMULATION
Following the system model, the objective is to coordinate swarm learning under energy and latency constraints while addressing heterogeneity and mobility-induced distribution shifts. Environment signatures and transition risks guide clustering, while a shared backbone with environment-specific heads supports learning across environments.
A. Domain-Drift Risk
To guide clustering under mobility-induced distribution changes, domain-drift risk measures probability that the -th UAV lies outside its current zone at the next global synchronization. Let denote the synchronization interval in rounds and the remaining rounds, with .
Propagating (5) without disturbances gives the predicted mean position as
where indexes forecast intervals, and and are the nominal velocity and acceleration. Let contain the current position and nominal motion sequence, treated as known over the forecast horizon. Conditional on this information, independent position disturbances with distribution give the future-position distribution as . The ground-plane mean and covariance are and , respectively. The drift probability is defined by . For positive horizontal position-error variances, it is expressed as
where is a ground-plane location and denotes the Gaussian density with the specified mean and covariance. The probability in (15) is estimated using independent Monte Carlo samples , where indexes the sampled ground positions. The estimated probability is expressed as
where equals one when the enclosed condition holds and zero otherwise. To incorporate recent detector feedback, let denote the entropy-based drift flag at round , with one indicating detected drift. The preceding observation window is . The adjusted risk score is defined as
where controls the risk increase following detected drift. In implementation, replaces in (17). The resulting score guides clustering and CH eligibility.
B. Model Decomposition and Environment Signature
To retain knowledge shared across environments while preserving environment-specific information, the learning model comprises a shared backbone, environment-specific prediction heads, and local batch-normalization components. The complete collection of parameters and statistics is denoted , where contains shared backbone parameters and contains the prediction head parameters for zone . The quantities and denote the numbers of backbone and head parameters, respectively. For -th UAV, contains local normalization statistics and contains trainable normalization parameters. These local components are excluded from and .
Let denote the number of batch-normalization layers and their index. The local statistics and trainable parameters are defined as
where and denote the running mean and variance vectors, while and are the trainable scale and offset parameters at layer , with one entry per normalized feature channel. The backbone is trained across environments, whereas each head uses data from its corresponding zone. Following the local-normalization principle of FedBN, and remain local and are not aggregated.
Since the population distributions are unknown during operation, the JS divergence in (9) cannot be evaluated directly. Instead, the framework uses an environment signature computed from local input samples. Let denote a nonempty mini-batch collected by the -th UAV, with input dimension and . The empirical input mean is , where is mini-batch size and contains mean of each input component. The corresponding componentwise empirical variance is
where contains the componentwise variances and is elementwise squaring. Although the mini-batch contains input-label pairs, these statistics use only the inputs. The environment signature is formed by concatenating the mean and variance vectors as , where summarizes the observed input distribution of the -th UAV. Since the signature is computed from raw inputs, its calculation does not depend on the backbone parameters. The signature supports environment similarity clustering and prediction-head selection, while the adjusted risk accounts for anticipated transitions and recent drift observations.
C. Per-Environment and Aggregate Objectives
Following model decomposition, the learning objective trains the shared backbone and environment-specific prediction heads while accounting for local normalization. Let be supervised loss for input and label , evaluated using , , and of the -th UAV. For zone , the population risk under the -th UAV's normalization components is defined as , where denotes joint input-label distribution of zone . Since is unknown, the -th UAV estimates this risk from its local samples. For its occupied zone , the empirical risk is
(20) where is the local sample count. This supervised objective is optimized using mini-batch gradients together with the regularization and correction terms introduced later.
To characterize swarm-wide performance, let and denote the collections of local normalization statistics and trainable parameters. The population risk for zone is defined as . Let denote the mission weight assigned to zone , with , and let denote the collection of prediction heads, the aggregate learning objective is defined as
where is the mission-weighted population risk. For a fixed backbone and normalization components, an optimal head for zone is characterized by . Substituting these heads gives the reduced backbone objective, as
This objective gives the population risk with optimal heads for a fixed backbone and local normalization state. The method updates the model iteratively without exact head minimization.
D. Cluster-Level Federated Aggregation
Following local training, each CH combines the backbone updates produced by its cluster members. Let denote the backbone parameters of -th UAV after local training at round . To account for differences in local dataset sizes, the contribution of each member is weighted by its sample count. For , aggregation weight is defined as
where is the weight assigned to the i-th UAV, is its local sample count, and j indexes the UAVs in cluster m. Assuming positive sample counts, these weights are non-negative and satisfy . Using these weights, the aggregated backbone of cluster m is obtained as
where denotes the cluster-level backbone parameters, including the CH's local update since . The weighting follows the sample-based aggregation principle of [3]. The corresponding cluster-level empirical objective is , where is the weighted empirical risk, contains environment-specific heads, and and collect the local normalization statistics and trainable parameters, respectively. Each member's loss uses the shared backbone, its zone-specific head, and local normalization. Equation (24) averages trained backbones without exactly minimizing the cluster objective. Heads are grouped by zone as . Each nonempty group follows the Fisher-weighted rule in (40). Heads remain separate across zones, while and remain local and are not transmitted. The CH forwards the aggregated backbone and zone-specific head contributions to the cloud.
E. Learning Objective and Resource Constraints
Based on the learning objectives and aggregation structure, the framework trains the shared backbone and environment-specific heads while maintaining a resource-feasible network configuration. For fixed local normalization components and , the reference population learning objective is
where is the mission-weighted population risk in (21). At round , environmental similarity and drift risk guide clustering and CH selection, while energy and latency constraints govern CPU frequency allocation. Let and denote the per-round energy budget and maximum CPU frequency of the -th UAV. The energy cost in (13) includes training, role-dependent transmission, propulsion, and asynchronous uploads attributed to the round. Assuming successive training, member-transmission, and cloud-upload stages with parallel member transmissions, the cluster completion time is . The member-transmission term is zero for a cluster containing only its CH; aggregation processing and additional queueing delays are neglected. Let denote the cluster completion deadline from the round's start, allowing asynchronous arrivals, and the maximum adjusted drift risk permitted for a CH. The scores in (17) are evaluated before assignment and held fixed during the network decision. For practical network organization, environmental similarity and leadership drift risk are combined into a weighted scalar utility. Let satisfy . At each reclustering event, the network configuration is obtained from
Constraint (27a) limits each UAV's energy consumption, while (27b) bounds its CPU frequency. Constraints (27c) and (27d) enforce unique cluster assignment and nonempty active clusters. Constraints (27e) and (27f) select one CH per cluster, with (27g) defining binary decisions. Constraint (27h) limits cluster completion time, while (27i) bounds the selected CH's drift-risk score by . The objective in (25) defines the learning target, while (27) specifies feasible configurations.
F. Lagrangian Formulation and Stationarity
For a fixed feasible cluster configuration, the continuous variables are , , and . The normalization components, training workloads, payloads, link rates, and propulsion costs are held fixed. Using the training workload , let denote the frequency-independent energy cost. The energy constraint is expressed as . The communication time of cluster is defined as
where the first term is zero for a singleton cluster. Since is fixed, the cluster deadline is equivalently expressed through the member-level constraints as , , . Let , , and denote the nonnegative Lagrange multipliers for the energy, upper-frequency, and latency constraints, respectively. Writing , , , and , the Lagrangian is defined as
The domain requires , while the fixed configuration satisfies the membership, CH-selection, and risk constraints. For a differentiable objective and under a suitable constraint qualification, a local minimizer satisfies the Karush–Kuhn–Tucker conditions. A superscript denotes the candidate solution and its multipliers. Backbone stationarity is expressed as , where denotes the backbone gradient and is the zero vector of the corresponding dimension. Stationarity for each head is expressed as , , where denotes the gradient with respect to the -th head. For , this condition is identically satisfied. Differentiating (29) with respect to gives , . The complementary-slackness conditions are expressed as
for all applicable indices, together with primal feasibility and . These conditions do not guarantee global optimality for the nonconvex objective. Since is independent of , any feasible frequency allocation satisfies stationarity with zero resource multipliers; hence, energy-minimizing allocation requires a separate selection rule.
G. Feasibility
Following the fixed-configuration analysis, a feasible resource allocation requires each UAV to complete local training within the available time and energy budgets. Consider a cluster configuration satisfying the assignment, CH-selection, and risk constraints in (27). Using the communication time defined in (28), the time available for local computation in cluster m is expressed as , where is measured in seconds. Since the training workload is positive, feasibility requires . The minimum CPU frequency required to satisfy the latency constraint is therefore obtained as
where is the lowest frequency at which the i-th UAV can complete its training within the available time. The energy available for local training is obtained by subtracting the transmission and propulsion costs from assigned budget as , where is remaining training-energy allowance and is defined in preceding subsection. For , feasibility requires . The frequency upper bound imposed by the energy constraint
where is the maximum frequency permitted by the training-energy allowance. Combining this bound with the hardware limit, the maximum feasible frequency is obtained as , where is the largest frequency satisfying both limits. Accordingly, the fixed cluster configuration admits a feasible frequency allocation if and only if the following conditions hold
When these conditions hold, any frequency within satisfies the modeled latency, energy, and hardware constraints for the i-th UAV. In particular, selecting provides a feasible allocation and minimizes local training energy for the fixed workload and cluster configuration. These conditions ensure resource feasibility for a given assignment. Overall feasibility additionally requires at least one cluster configuration satisfying the membership and CH-risk constraints along with (35).
IV. PROPOSED METHODOLOGY
The proposed domain-aware hierarchical federated learning (DA-HFL) framework integrates environment-aware training, resource-feasible clustering, hierarchical aggregation, and local adaptation. The objective in (25) defines the learning target, while (27) specifies feasible configurations. Regularized updates, sample-weighted cluster backbones, and Fisher-weighted cloud aggregation enable learning without assuming exact minimization or stationarity.
A. Local Model Training
At round , the -th UAV trains the head associated with its occupied zone . Let , , and denote the latest received backbone, zone head, and domain discriminator parameters from one synchronized model version. The local backbone and head after steps are and , respectively, initialized as , . The normalization parameters retain their local initialization . Consistent with the workload definition in Section II-C, local training comprises steps indexed by , where step updates state using . For local parameters and , the supervised mini-batch loss is . To encourage shared features across zones through DANN, a domain discriminator assigns probabilities to the environments. Let denote the backbone feature vector of dimension , explicitly retaining local normalization dependence. The domain loss is defined as
where is the discriminator probability for zone , with domain label distinct from class label . The discriminator remains fixed at during local training and is updated at the cloud using contributions from multiple zones. The backbone combines supervised learning, a proximal penalty, and the reversed domain gradient through , where controls the proximal penalty. The adversarial weight increases gradually as , , where is the maximum weight, is the warm-up fraction, and is the warm-up duration. A SCAFFOLD-based correction reduces variation among local backbone updates. Let and denote the local and global control variates, respectively. Both are initialized to zero and fixed during local training. With learning rate , the updates are
(37)
All derivatives are evaluated at the pre-update local state; components outside the indicated differentiation are held fixed. The running statistics are maintained from local activations. The trained outputs are and , while is retained locally. The local control variate is then updated as , where is clipping threshold. For , clipping is
If training is deferred, the local model and control variate are retained, with .
B. Domain-Aware Clustering and CH Selection
At reclustering events separated by rounds, the framework selects memberships and leaders using environment signatures and adjusted drift risks, with the prescribed number of active clusters fixed during each selection. Let denote the leadership indicators and the frequency vector. The set contains pairs satisfying (27) for at least one frequency allocation. Membership, leadership, and risk constraints are checked directly, while resource feasibility follows (35). For an existing nonempty cluster, let denote its membership immediately before reclustering, with reference signature . At initialization or when the prescribed cluster count changes, the first feasible configuration under a fixed lexicographic ordering of binary assignment and leadership entries supplies the reference memberships. Reference signatures remain fixed during the search. For nonzero vectors, their cosine similarity is expressed as
where measures signature alignment. If either vector has zero norm, the similarity is set to zero. Using the utility in (26), the selected configuration satisfies . The finite search enumerates nonempty assignments and eligible member heads, rejects resource-infeasible candidates, and retains the highest-scoring pair. Ties follow the same fixed ordering. This specifies an exact selection procedure without assuming an efficient solution to the combinatorial search. For the selected configuration, frequencies are assigned as using (33). Between reclustering events, the current configuration is retained only while all constraints remain satisfied; otherwise, the search is repeated. If is empty, training is deferred and monitoring continues. The score guides network organization and is distinct from the population learning objective.
C. Hierarchical Aggregation and Synchronization
Each member update includes its round, cluster configuration, and synchronized source-model version. A CH merges only complete collections with a common round and source version, and computes the backbone using the weights in (23) and the rule in (24). Let denote a trained backbone or active-head parameter block. For a nonempty labeled sample set , its diagonal empirical Fisher estimate and regularized importance are , , where is the local class probability, is a strictly positive damping parameter, and is the all-ones vector. The estimate averages squared sample gradients while holding other model components fixed. For a nonempty contributor set V, the merge is
For each nonempty environment group , the CH computes the summed importance vector and importance-weighted parameter sum . The aggregated head is . The backbone remains sample-weighted, with cloud importance summary evaluated at member models rather than the aggregated backbone. The additive head statistics preserve the direct Fisher merge over member head contributions. The backbone importance summary instead supports a cluster-level Fisher merge of the sample-weighted cluster backbones. Let index cloud synchronization events, with denoting initialization. At event , only packets based on version are accepted. A newer round replaces the stored packet for an unchanged configuration, while a newer overlapping configuration replaces older packets sharing its members. Duplicates and packets conflicting with newer stored configurations are rejected, ensuring that each UAV appears in at most one accepted packet per event. Let denote the accepted packet set and its subset carrying head . Each packet contains backbone , importance vector , and head statistics . For nonempty contributing sets, the cloud updates are , . An empty contributing set leaves the corresponding backbone or head unchanged. The cloud stores each member's latest accepted control variate and computes . Older records are rejected, while members without accepted records retain zero vectors.
The sample-weighted domain gradient from local training is , evaluated using pre-update features and the fixed discriminator reference. Let contain the members represented in accepted packets, with denoting the originating round of member . Let denote the synchronization event preceding . All accepted gradients are evaluated using . If their domain labels span at least two environments, the cloud updates
where is the learning rate for the accepted domain loss; otherwise, the discriminator remains unchanged. At synchronization, the cloud broadcasts the backbone, heads, discriminator, gate, and global control variate as one versioned collection. Accepted packets are cleared, while control records persist. Payloads and contain transmitted parameters, statistics, signatures, sample counts, and provenance
metadata. Excluded contributions still incur transmission costs, while remain local.
D. Environment-Gated Inference and Local Adaptation
The input signature guides head selection through a softmax gate , where contains its parameters and denotes the probability assigned to zone , with . At synchronization event , let contain accepted signatures and their zone labels at collection time. For nonempty , the gate-training loss is expressed as
The cloud updates , where is the learning rate, and retains the previous gate if is empty. Using the available gate, the -th UAV selects , with ties resolved by the smallest zone index. Let denote the class-probability vector produced by its local backbone, head , and normalization components. Inference uses unless mixing is activated. For , let and index the two largest gate outputs under the same tie rule. Mixing activates when their probability difference is at most or the drift indicator defined below equals one. The normalized weights and mixed prediction are expressed as
(43)
where index the selected heads and is the weight of head . For , denotes the single head's prediction. Drift monitoring uses a nonempty local input batch . Let denote the probability of class y from head . Before mixing or adaptation, its batch entropy is calculated as
All entropy expressions use natural logarithms and . Let be the integer monitoring-window length and the number of available observations at round . The smoothed entropy is , where indexes monitoring rounds. The drift indicator is , where is calibrated using the same statistic on validation data from the training environments. This flag indicates elevated predictive uncertainty and supplies feedback to (17) in subsequent rounds. When , adaptation updates only the local normalization parameters . Let denote the mixed probability of class evaluated with candidate parameters . The adaptation loss is defined as
Starting from the retained , adaptation applies , where indexes the adaptation steps and is the learning rate. The backbone, heads, running statistics, gate, and mixing weights remain fixed. Adaptation uses unlabeled inputs, and the final normalization parameters are retained for subsequent inference and training.
V. PERFORMANCE ANALYSIS
This section analyzes backbone stationarity, Fisher-weighted merging, and the communication and computation requirements of DA-HFL.
A. Stationarity of the Aggregated Backbone
At synchronization event , all accepted packets originate from backbone . For packet , let denote its member set and the sample-count weight defined in (23). The average corrected direction for member is , where is the direction in (37). Its trained backbone is therefore , where . For a nonempty accepted packet set, the cloud assigns each packet the diagonal weight matrix
Positive Fisher damping ensures positive denominators and . Combining the cluster and cloud aggregation rules gives
where denotes the aggregated update direction. If no packet is accepted, and the backbone remains unchanged. The learning objective with heads and normalization states fixed at event is . The normalization states remain local; their appearance here does not require transmission. Assume that each is differentiable and has an -Lipschitz backbone gradient over the analyzed updates, with . The difference between the aggregated direction and the objective gradient is . This residual includes the effects of local training, regularization, control correction, participation, and Fisher weighting, and is not assumed to have zero mean. By -smoothness and (47), the backbone update satisfies
for . This follows from and omission of the nonpositive term . Changes in heads and normalization states introduce the objective variation . For synchronization events and a common lower bound , summing (48) and accounting for yields
For a fixed step size, the initial-gap term vanishes as increases. Average stationarity follows if the average squared residual and the average positive objective variation vanish; the protocol alone does not guarantee these conditions.
B. Optimality of Fisher-Weighted Merging
For a nonempty contributor set , let denote the regularized importance matrix for parameter block . The importance-weighted quadratic discrepancy is
Here, represents empirical parameter importance, not the loss Hessian. Since , the Hessian of , , is positive definite. Setting the gradient to zero therefore gives the unique minimizer in (40). Expanding around this minimizer yields, for any comparison block of the same dimension,
(51)
Thus, Fisher merging attains no greater quadratic discrepancy than a sample-weighted average, with equality exactly when the two merged blocks coincide. For environment heads, the additive statistics preserve this result over accepted member contributions. For the cloud backbone, it applies to cluster backbones and their importance summaries, since within-cluster averaging remains sample-weighted. This optimality concerns only and does not establish lower population loss or higher test accuracy.
C. Communication and Computation Requirements
Communication is counted in fixed-precision numerical values, excluding metadata, per cluster uplink and per receiver downlink. The analytical single-model FedAvg-HFL reference exchanges values in either direction; naive multi-head HFL exchanges and selects a head using a supplied zone label. For DA-HFL, uplink and downlink costs are and , respectively, where , are discriminator and gate parameter counts, and . The member-to-head payload is . These are per-exchange costs; dividing the DA-HFL downlink cost by gives its amortized per-round cost. Actual transmissions include metadata and incur costs even when contributions are discarded. Let , , and denote forward costs. Both references require for inference, while DA-HFL mixed inference requires for a precomputed signature. The term accounts for top-two

(a)

(b)

(c)
Fig. 2. (a) global test accuracy vs. communication rounds, (b) global training loss vs. communication rounds and (c) accuracy with temporal error bars.
head selection. Local training and Fisher estimation require and operations, where and are their per-sample gradient costs. Signature calculation and cluster aggregation cost and . Cloud merging and auxiliary updates require , where counts heads in packet . Gate training adds , with per-signature gradient cost . Activated adaptation costs , where is the per-sample forward and backward cost. The energy-model exclusions remain unchanged. Exact clustering considers at most labeled assignments and head selections per assignment. With precomputed similarities and fixed-dimensional link calculations, each candidate costs to score and test, giving the conservative bound , plus similarity computation. This exhaustive search does not establish real-time scalability for large swarms.
VI. SIMULATION AND RESULTS
The evaluation considers a feature-level simulation with UAVs operating across four environmental zones, namely city, village, forest, and lake. The classification task comprises five classes: person, vehicle, building, vegetation, and water. Each zone distribution is generated from a shared 24-dimensional class prototype that is shifted by a fixed zone-specific offset and corrupted by isotropic Gaussian noise of variance 0.05; mobility-induced transitions simply replace the active offset at the prescribed mission times, thereby producing controlled domain shifts without requiring a real UAV imagery dataset. Environmental ambiguity is introduced by moving selected class prototypes toward a common midpoint. The affected pairs are vehicle/building in city, building/vegetation in village, person/vegetation in forest, and person/water in lake. During the mission, 12 UAVs change zones at staggered times, while the remaining UAVs retain their initial zones. Resource profiles are sampled independently of zone identity. Each zone provides 400 held-out evaluation samples that are disjoint from the training data. The experiment uses synthetic input features and therefore evaluates classification rather than image-based object detection or localization. The reported training configuration uses rounds, local steps per round, a batch size of 32, and a local learning rate
of . Reclustering and synchronization intervals are both five rounds, with . The simulation uses clusters, with a mean configuration-search runtime of 0.18 seconds per reclustering event. The risk threshold and feedback increment are and , respectively. Entropy monitoring uses a five-round window, and the reported threshold is the 95th percentile of validation entropy. The adversarial weight reaches after a warm-up fraction of , corresponding to the first 20 rounds. The proximal coefficient is , Fisher estimation uses 10 batches, and the local adaptation learning rate is .
The comparison includes FedAvg [3], which maintains one synchronous global model; AsyncFL [7], [8], which uses staleness-weighted asynchronous updates; and a CFL variant [11] with fixed initial-environment assignments. The hierarchical baselines are HFL [2], with resource-aware reclustering, and RA-HFL [4], [5], with resource-aware organization and event-driven synchronization. The comparison uses a common swarm, data-generation scenario, local-step budget, and batch size. These baselines provide comparisons with global learning, asynchronous learning, fixed clustering, and resource-aware hierarchical organization.
Fig. 2(a)–(b) presents test accuracy and training loss over communication rounds. All methods improve with training, but DA-HFL achieves higher accuracy and lower loss after the common initial point. Its accuracy reaches approximately 90% by round 50 and 97% by round 100. The separation between the curves indicates that its advantage develops during training and persists at the final round. For heterogeneous environments, a shared representation can retain common information, while separate prediction heads accommodate environment-specific class relationships. The observed behavior is consistent with this design, although the global curves do not isolate the effect of either component. Fig. 2(c) summarizes accuracy over the last five rounds. The smaller error bars indicate lower temporal variation during this interval rather than variability across independent experimental runs. Fig. 3 compares precision, F1-score, recall, and ROC-AUC. DA-HFL achieves approximately 97.1%, 96.8%, 96.5%, and 98.8%, respectively, exceeding the compared methods across all four metrics. The precision and recall results show that the accuracy improvement is accompanied by a favorable balance between

(a)
(b)

(c)
(d)
Fig. 3. Classification performance: (a) precision, (b) F1-score, (c) recall, and (d) ROC-AUC.
false-positive and false-negative predictions. The higher F1-score summarizes this balance, while the ROC-AUC result indicates stronger discrimination across classification thresholds. Thus, the reported improvement extends beyond accuracy alone.
Fig. 4 examines class confusion within each environment. In city, the vehicle-to-building entry decreases from 29 for HFL to 18 for DA-HFL, while the reverse entry decreases from 21 to 13. In forest, person-to-vegetation decreases from 36 to 17, and water-to-person in lake decreases from 21 to 14. These are among the class pairs affected by the constructed environmental ambiguity. Their lower confusion entries are consistent with the intended role of environment-specific heads in retaining local class distinctions. The remaining errors show that specialization does not completely resolve overlapping class representations. These values are treated as displayed matrix entries rather than normalized percentages.
Fig. 5(a) compares accuracy across the four environments. DA-HFL achieves 95.6% in city, 96.2% in village, 97.1% in forest, and 96.5% in lake, showing that the aggregate gain is not confined to a single zone despite differing class ambiguity. Fig. 5(b) evaluates the forest-to-city transition at mission-time coordinate 5: DA-HFL retains approximately 96% accuracy at the transition and approaches 97%, while final accuracies are 82% (FedAvg), 87% (AsyncFL), 90% (CFL), 93% (HFL), and 95% (RA-HFL). Signature-based head selection, prediction mixing, and local normalization adaptation provide a rationale for this transition robustness, although the curve reflects their combined rather than individual effects.
Fig. 5(c)–(d) reports cluster purity and lifetime. DA-HFL achieves 97.3% purity and a 35.2-round lifetime, compared with 94.2% and 30.6 rounds for RA-HFL. The improvements are 3.1 percentage points and 4.6 rounds, respectively. Higher purity indicates stronger environmental agreement among clus-
tered members under the reported measure, while a longer lifetime indicates more persistent cluster organization. These observations are consistent with using environment signatures to guide membership and transition risk to guide CH selection.
Fig. 5(e) compares modeled energy consumption. DA-HFL consumes 8.9 J, compared with 8.5 J for RA-HFL, 12.6 J for FedAvg, and 11.5 J for AsyncFL. Its reported cost is therefore 0.4 J higher than RA-HFL but lower than the two flat baselines. Together with the accuracy and clustering results, this indicates a tradeoff between learning performance and modeled resource consumption. The comparison includes the modeled training, transmission, and propulsion costs; it does not quantify the energy required for gated inference. Finally, Fig. 5(f) examines cumulative component additions. Accuracy increases from 93.2% for HFL to 94.0% after adding environment similarity (ES), 94.8% with domain-drift risk (DDR), 95.6% with environment heads (EH), and 96.3% with the gate (GN). The complete framework achieves 96.8%. The progression supports the benefit of combining environment-aware clustering, specialized prediction, and adaptive inference. Because each component is added to the preceding configuration, the observed gains describe cumulative improvements rather than independent component effects.
VII. CONCLUSION
This paper presented DA-HFL for mobile UAV swarms, combining drift-aware clustering, a shared backbone with environment-specific heads, Fisher-weighted cloud aggregation, and gated inference with local adaptation. The analysis established conditional stationarity, the quadratic optimality of Fisher-weighted merging, and complexity bounds. Simulations showed faster learning, higher accuracy during environmental transitions, and purer, longer-lived clusters than the evaluated baselines, with modest energy overhead relative to resource-aware HFL. Future work will consider learned environment boundaries, unseen-environment discovery, and physical UAV validation.
REFERENCES
[1] W. Saad, M. Bennis, and M. Chen, "A vision of 6G wireless systems: Applications, trends, technologies, and open research problems," IEEE Network, vol. 34, no. 3, pp. 134–142, 2020.
[2] L. Liu et al., “Client-edge-cloud hierarchical federated learning,” in Proceedings of the IEEE International Conference on Communications (ICC). IEEE, 2020, pp. 1–6.
[3] H. B. McMahan et al., “Communication-efficient learning of deep networks from decentralized data,” in Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, ser. Proceedings of Machine Learning Research, vol. 54, 2017, pp. 1273–1282.
[4] W. He et al., “Three-stage stackelberg game enabled clustered federated learning in heterogeneous UAV swarms,” IEEE Transactions on Vehicular Technology, vol. 72, no. 10, pp. 13 309–13 322, 2023.
[5] T. Wang et al., “UAV swarm-assisted two-tier hierarchical federated learning,” IEEE Transactions on Network Science and Engineering, vol. 11, no. 5, pp. 4295–4310, 2024.
[6] Y. Shen, F. Shen, W. Wang et al., “Joint training and resource allocation optimization for federated learning in UAV swarm,” IEEE Internet of Things Journal, vol. 10, no. 2, pp. 1114–1128, 2023.
[7] Y. Kang and B. Li, “Polaris: Accelerating asynchronous federated learning with client selection,” IEEE Transactions on Cloud Computing, vol. 12, no. 2, pp. 446–458, 2024.
[8] W. Wu et al., “SAFA: A semi-asynchronous protocol for fast federated learning with low overhead,” IEEE Transactions on Computers, vol. 70, no. 5, pp. 655–668, 2021.




Fig. 4. Displayed confusion matrices for HFL (top row) and DA-HFL (bottom row) across the four zones.

(a)
(b)

(c)
(d)

(e)
(f)
Fig. 5. (a) Accuracy across environmental zones, (b) accuracy under domain drift, (c) cluster purity, (d) cluster lifetime, (e) energy consumption, and (f) ablation study.
[9] S. Zeng, Z. Li, H. Yu, Z. Zhang, L. Luo, B. Li, and D. Niyato, "Hfedms: Heterogeneous federated learning with memorable data semantics in industrial metaverse," IEEE Transactions on Cloud Computing, vol. 11, no. 3, pp. 3055–3069, 2023.
[10] X. Li et al., "FedBN: Federated learning on non-IID features via local batch normalization," in Proceedings of the 9th International Conference on Learning Representations (ICLR), 2021.
[11] F. Sattler et al., "Clustered federated learning: Model-agnostic distributed multitask optimization under privacy constraints," IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 8, pp. 3710–3722, 2021.
[12] T. Li et al., "Federated optimization in heterogeneous networks," in Proceedings of Machine Learning and Systems (MLSys), vol. 2, 2020, pp. 429–450.
[13] S. P. Karimireddy et al., "SCAFFOLD: Stochastic controlled averaging for federated learning," in Proceedings of the 37th International Conference on Machine Learning (ICML), ser. Proceedings of Machine Learning Research, vol. 119. PMLR, 2020, pp. 5132–5143.
[14] Y. Ganin et al., "Domain-adversarial training of neural networks," Journal of Machine Learning Research, vol. 17, no. 59, pp. 1–35, 2016.
[15] J. Wang et al., "Generalizing to unseen domains: A survey on domain generalization," IEEE Transactions on Knowledge and Data Engineering, vol. 35, no. 8, pp. 8052–8072, 2023.
[16] T. Li, S. Hu, A. Beirami, and V. Smith, "Ditto: Fair and robust federated learning through personalization," in Proceedings of the 38th International Conference on Machine Learning (ICML), ser. Proceedings of Machine Learning Research, vol. 139. PMLR, 2021, pp. 6357–6368.
[17] A. Fallah, A. Mokhtari, and A. Ozdaglar, "Personalized federated learning: A meta-learning approach," in Advances in Neural Information Processing Systems (NeurIPS), vol. 33, 2020, pp. 3557–3568.
[18] J. Li, S. Tripathi, L. Rastogi, Y. Lei, R. Pan, and Y. Xia, "Optimizing mixture-of-experts inference time via model deployment and communication scheduling," IEEE Transactions on Networking, vol. 34, pp. 2478–2497, 2026.
[19] L. Yi, H. Yu, G. Wang, X. Liu, and Q. Hu, "pFedMoE: Data-level personalization with mixture of experts for model-heterogeneous personalized federated learning," IEEE Transactions on Knowledge and Data Engineering, vol. 38, no. 3, pp. 1905–1918, 2026.
[20] M. S. Matena and C. Raffel, "Merging models with fisher-weighted averaging," in Advances in Neural Information Processing Systems (NeurIPS), vol. 35, 2022, pp. 17 703–17 716.
[21] J. Kirkpatrick et al., "Overcoming catastrophic forgetting in neural networks," Proceedings of the National Academy of Sciences, vol. 114, no. 13, pp. 3521–3526, 2017.
[22] G. Wang, X. Yu, F. Xu, and J. Cai, "Task offloading and resource allocation for uav-assisted mobile edge computing with imperfect channel estimation over rician fading channels," EURASIP Journal on Wireless Communications and Networking, vol. 2020, no. 1, p. 169, 2020.
[23] Y. Zeng, X. Xu, and R. Zhang, “Energy minimization for wireless communication with rotary-wing UAV,” IEEE Transactions on Wireless Communications, vol. 18, no. 4, pp. 2329–2345, 2019.
[24] X.-K. Dai et al., “Energy-efficient UAV communications: A generalized propulsion energy consumption model,” IEEE Wireless Communications Letters, vol. 11, no. 10, pp. 2100–2104, 2022.