Spectrum Allocation and Device Association in Federated Learning-Enabled Industrial IoT via Hypergraph Matching

In this paper, a joint spectrum allocation and device association problem is investigated for a federated learning aided hierarchical Industrial Internet of Things (IIoT) system for smart factory. To achieve the optimization jointly, we design a weighted learning utility maximization problem, which is a 0-1 integer linear programming problem. To solve this problem, we convert it into a weighted 3D hypergraph model by capturing the 3D mapping relation for IIoT device, subchannel, and edge server. A local search algorithm is then presented to ﬁnd a 3D hypergraph matching with maximum total weights as the suboptimal solution. Simulation results demonstrate the superior performance of the proposed algorithm compared with the greedy algorithm in the system learning utility.

to send all of their sensing data to a remote cloud.To address the challenges, as a distributed learning framework, federated learning (FL) has been developed to allow the IIoT devices to cooperatively train an ML model locally without sharing their data to the server [6].
Based on the above motivations, we find that the exploration of FL for IIoT has become highly valuable.Several works are devoted to FL-enabled IIoT system.In [7], the authors studied the resource allocation problem for FL-enabled IIoT, and formulated a training latency minimization problem by jointly considering the active device selection and resource allocation.In [8], the authors explored the FL cost minimization problem in smart industries by capturing both the latency and packet error rate of FL.A communication-efficient FL framework in IIoT system was proposed in [9] for anomaly detection of IIoT devices.Moreover, the authors in [10] also developed a communication-efficient FL scheme in digital twin aided IIoT system.However, due to the power constraint of IIoT devices, the tradeoff between learning performance and energy consumption is significant to the overall system, which has not been fully addressed in literature.Therefore, in this paper, we consider a FL-aided hierarchical IIoT system for smart factory, and particularly, investigate a joint spectrum allocation and device association problem to maximize the weighted learning utility of the system.Main contributions of our work include: • We formulate the learning utility maximization problem as a 0-1 integer linear programming problem by jointly optimizing binary variables for subchannel allocation and IIoT device association.• By capturing a 3D mapping relation for IIoT device, subchannel, and edge server, this problem is transformed into a weighted 3D hypergraph model, wherein the hyperedge weight is modeled as the IIoT device's learning utility.• We convert the problem to find a 3D hypergraph matching with maximum total weights, and propose a local search (LS) based algorithm to obtain a suboptimal solution.The rest of the paper is organized as follows.We introduce the system model and formulate the optimization problem in Section II.Section III presents the problem transformation and algorithm design.Simulation results are provided in Section IV.Finally, Section V concludes this paper.

A. System Overview
As shown in Fig. 1, we consider a FL-enabled hierarchical IIoT system for smart factory, which consists of three layers with different functionalities and resources, i.e., end, edge, and cloud layers.In the end layer, N IIoT devices, denoted by a set As the core of the entire IIoT system, the cloud server is located at the core network in the cloud layer, to provide high-performance intelligent services and resources, e.g., computing, caching, security, etc.We focus on two kinds of data utilized in the IIoT system, i.e.: • Sensing data generated from the IIoT device has higher data volume but relatively smaller time sensitivity.With sensing data, IIoT devices cooperatively perform the FL for big data analysis in predictive maintenance.• Control data sent from the edge server has smaller data capacity with more time sensitivity.IIoT devices receive control data from edge servers for factory automation.

B. Transmission Model 1) Sensing Data Transmission via Uplink:
For uplink, N IIoT devices in the end layer send their sensing data to M edge servers in the edge layer over the available spectrum resource block.For simplicity, the orthogonal frequency division multiple access is adopted for scheduling the simultaneous access of IIoT devices.The interference between subchannels during the uplink transmission can be accordingly ignored.The available resource block is equally divided to K orthgonal subchannels, denoted by a set K = {1, • • • , K}.Let B be the bandwidth of each subchannel.We assume the channel state information (CSI) is perfectly known at each edge server.For convenience, let us define a binary variable as follows to show the subchannel assignment constraint for IIoT device n: Note that each subchannel is assigned to only one IIoT device and each IIoT device can occupy at most one subchannel.So we have 2) Control Data Transmission via Downlink: Due to higher transmit power of edge server and smaller data size of control data, we neglect the time consumed for sending the control data to IIoT devices via downlink.In this paper, we only consider the reliability requirement for control data transmission.The received SNR at IIoT device n from edge server m is given as γ m,n = P m h m,n /σ 2 n , where P m is the transmit power of edge server m, σ 2 n is the variance of AWGN at IIoT device n, h m,n is the channel gain from edge server m to IIoT device n, which is equal to h n,m due to the channel reciprocity.To ensure the reliable transmission of control data, we have: where γ min is the minimum SNR threshold.

C. FL Model 1) Local Training:
Each IIoT device n owns a local dataset D n = {(x j , y j )}, where x j is j-th input vector and y j is the corresponding labeled output of x j for the FL task of IIoT device n, for j = 1, • • • , |D n |.Note that IIoT device n needs to train a machine learning model ω n in an iterative manner until a predefined local accuracy θ.The model ω n captures the performance of learning task with loss function defined as: where f n (x j , y j , ω n ) is the loss function depending on the specific learning task.Moreover, the local iteration number is given by L (θ) = μ log 1 θ , where μ is a constant associated with the data size and learning task.In each iteration, IIoT device n needs to train its model according to the gradient descent algorithm which is given by ω ), where η is the learning rate.Therefore, we can derive the computation time of IIoT device n as: where Z (x) is the data size of x in bit, c n is the number of CPU cycles required for computing one bit data, and f n is the CPU frequency of IIoT device n.We assume that the edge server has perfect knowledge of computing capacity and energy state of IIoT devices.Therefore, the computation energy consumption of IIoT device n can be given by [11]: where ζ is the energy consumption coefficient depending on the chip architecture of IIoT device.
2) Model Transmission: After the training of ω n , IIoT device n will then transmit the model to its associated edge server, which will generates the delay and energy consumption.The delay and energy consumption of IIoT device n for model transmission can be respectively described as: Note that the unreliable IIoT channel condition has a significant effect on the model transmission, e.g., packet errors.When the received model contains the errors, edge server m will not use that model for aggregation.More sub-global round is needed to get convergence, resulting in more delay and energy consumption.Specifically, the packet error rate between IIoT device n and edge server m is determined by: where λ is the waterfall threshold.As in [12], the iteration number is thus specified by: where φ is a constant related to learning task.Since edge server has much higher transmit power, we ignore the downlink communication in the FL model.Thus the total energy consumption of IIoT device n in one global round is given as: After I (ε, θ) times iteration training of sub-global model, edge server m then sends ω m to the cloud server in the cloud layer for global model aggregation and obtain global model g.For simplicity, we ignore the delay and energy consumption in the edge and cloud servers due to their powerful transmission and computing capabilities.The total delay of IIoT device n takes for the FL in each sub-global round is written by: Due to the synchronous of the FL, the model aggregation depends on the last user which finishes the model training and transmission.Thus, each IIoT device must meet the delay constraint, given by t n,m ≤ ΔT, ∀n, where ΔT > 0 is a fixed value.Note that the increasing number of the participants in the FL will significantly improve the learning performance.As a result, we employ the involved number of the IIoT devices to characterize the learning speed of the FL as follows:

D. Problem Formulation
By applying the FL for the sensing data flow, more involved IIoT devices contributes to the improved learning performance of the FL, but resulting in the increased energy consumption of the IIoT devices.Moreover, the proper selection of the IIoT devices also impacts the packet error rate between IIoT devices and edge servers.Keeping this fact in mind, both the energy consumption and packet error rate are critical to the IIoT devices during the FL procedure.Our objective is thus to identify the balance among the learning performance of the FL, the energy consumption and packet error rate relevant to the IIoT devices by optimizing binary variables for subchannel allocation and IIoT device association in the IIoT system.
To capture such a balance, we design a weighted learning utility function of the system, which is specifically defined as: where E is total energy consumption in one global round, E error is the total packet error rate, and α 1 and α 2 are the weighting factors of energy consumption and packet error rate associated with the IIoT devices, respectively.Particularly, the total energy consumption in one global round is given by: Meanwhile, the total packet error rate can be calculated as: Under the above setup, we aim to maximize the weighted learning utility function of the system by jointly optimizing binary variables for subchannel allocation and IIoT device association.This optimization problem is formulated as: s.t.C1 : In (18), C1 and C2 reflect the binary constraints of subchannel allocation for each IIoT device.C3 shows that each IIoT device can associate at most one edge server.C4 is provided to indicate the maximum association constraint of each edge server.C5 is the reliable transmission requirement of control data flow.C6 is used for the delay constraint of each IIoT device in one sub-global round.C7 dictates the binary constraints for subchannel allocation variable and device association variable.

III. ALGORITHM DESIGN VIA HYPERGRAPH MATCHING
The problem in ( 18) is a pure 0-1 integer linear programming problem due to the binary variables involved in objective function and the linear constraints C1-C6.Therefore, problem (18) is NP-hard and computationally intractable.Especially, with the increasing scale of the IIoT system wherein N , M , K become very large, it is difficult to optimally solve the problem directly with low computational complexity via the traditional exhaustive method.However, we observe that there exists an inherent coupling constraint for subchannel allocation and device association in problem (18), which typically falls into a one-to-one-to-one (3D) mapping relation for IIoT device, subchannel, and edge server.To make it more tractable, we thus transform problem (18) into a weighted 3-uniform hypergraph model by jointly capturing such coupling constraints and the system-level weighted learning utility function.
To identify such a mapping relation, we develop the virtual elements for edge servers in the edge layer.Specifically, we devise N m − 1 virtual edge servers for edge server m to satisfy the binary variable requirement of device association due to the constraints C3 and C4, for N m > N. Thus, there are MN m edge servers and virtual edge servers in the edge layer to associate the IIoT devices in the end layer.Note that the conventional graph used to describe the pairwise relation between objects is not applicable for the 3D relation among objects.Therefore, we apply the hypergraph model in which every hyperedge can be formulated as a subset of the vertex set to characterize the 3D mapping among multiple objects.

A. Hypergraph Construction
, where V is a finite set of vertices, E is a family of non-empty subsets of V (i.e., hyperedge set), and l (E l ) is a positive real number associated with hyperedge For ease of exposition, let us utilize Q to represent the set of MN m edge servers and virtual edge servers in the edge layer.Combining the sets of IIoT devices and subchannels, an element in N , K, and Q stands for a vertex in weighted hypergraph H . Thus, the union of N , K, and Q refers to the vertex set V , i.e., V = N ∪ K ∪ Q.With this in mind, we employ the combination {n, k, q} to characterize a hyperedge E l in H , subject to constraints C1-C6 simultaneously, i.e., Note that such a combination {n, k, q} obviously captures the 3D mapping relation for IIoT device, subchannel, and edge server in the considered IIoT system.Additionally, the weight of hyperedge E l is defined as the learning utility function of IIoT device n in one global round, i.e.:

B. Algorithm Design
Based on the weighted hypergraph H , our target for the weighted learning utility maximization problem is converted to find a 3D hypergraph matching that is a collection of N vertex-disjoint hyperedges with the maximum total weights.Unfortunately, it is NP-hard to find a weight-maximum subset of vertex-disjoint hyperedges in the 3D hypergraph matching.Inspired by the LS strategy with an increasing approximation ratio in polynomial time [13], we thereby use the LS to design an efficient iterative algorithm for obtaining a suboptimal solution to problem (18).Definition 2. A representative graph G is an ordinary graph G = (V, E), where a vertex v l ∈ V in G denotes a hyperedge E l ∈ E of H , and an ordinary edge in E denotes the adjacent hyperedges in H if they intersect with each other at least one vertex of H .The weight of vertex v l ∈ V in G equals the weight of hyperedge E l of H , i.e., l (E l ).Definition 3.For a representative graph G , a -claw is an induced subgraph G , whose center vertex connects to independent vertices, called talons, which forms an independent set I G with vertices.
Let Φ (G ) and (Φ) be an initial independent set of G and the sum of weights for all the vertices in Φ (G ), respectively.Note that an initial independent set refers to an initial matching in original hypergraph H .To obtain an initial independent set Φ (G ), we first use a greedy algorithm to approximately derive an weight-maximum initial subset of edge-disjoint vertices in G1 .Then we propose an LS-based algorithm to search for -claw iteratively, aiming to improve the sum of weights of initial matching.Through the iterative searching, we thus obtain the weight-maximum 3D hypergraph matching result, including N vertex-disjoint hyperedges.
For tractability, let us use ψ (I G , Φ (G )) to denote the set of adjacent vertices of independent set I G with vertices in Φ (G ).The procedure of the proposed LS-based algorithm is summarized in Algorithm 1.Based on Algorithm 1, we obtain a weight-maximum subset E * which has N vertex-disjoint hyperedges.Thereby, the suboptimal solution to the weighted learning utility maximization problem is thus achieved, and the utility function can be given by U FL (a n,k , b n,m ) = (Φ).

IV. SIMULATION RESULTS
In this section, we validate the learning performance of the proposed LS-based algorithm with simulations.We consider Algorithm 1 LS-based Algorithm for Hypergraph Matching 1: Transform the initial hypergraph H into a representative graph G .2: Using greedy algorithm in [13] to obtain an initial independent set Φ (G ).Sort all the vertices of ψ Φ[l] in a descending order with vertex weight.

8:
Set l-th vertex Φ [l] as the center vertex of -claw G .9: end if 14: end for 15: Fig. 2 compares the learning utility performance between greedy algorithm and our proposed algorithm under the varying number of IIoT devices.We can observe that our proposed algorithm provides a higher utility than that of greedy algorithm.The reason is that by searching for -claw repeatedly, the proposed algorithm achieves a sub-optimal solution, which has better performance than greedy algorithm.When N ≤ 40, as the increasing number of IIoT devices, the utility increases rapidly for both algorithms.That is because more involved devices significantly improve the learning performance.When N > 40, the learning utility is growing slowly.This result further provides a hint to choose appropriate number of IIoT devices to further improve the system performance.

V. CONCLUSIONS
This paper studied the joint spectrum allocation and device association problem in FL-enabled IIoT system.We formulated the weighted learning utility maximization problem as the 0-1 integer linear programming problem.Based on the 3D mapping relation for IIoT device, subchannel, and edge server, this problem was transformed into the weighted hypergraph model.We proposed the LS-based algorithm to identify the hypergraph matching result for subchannel allocation and IIoT device association.Simulation results show that our proposed algorithm improves the learning utility of the system compared with the greedy algorithm.

Fig. 1 .
Fig. 1.An example of the hierarchical IIoT system for smart factory.N = {1, • • • , N}, are randomly deployed on the ground to collect real-time data (i.e., sensing data) for ubiquitous situation awareness.In the edge layer, M edge servers, denoted by a set M = {1, • • • , M}, are uniformly attached on the room ceiling of smart factory.The edge server not only serves as an access point to provide wireless access for IIoT devices via uplink, but also sends the URLLC control data to the associated IIoT devices via downlink.As the core of the entire IIoT system, the cloud server is located at the core network in the cloud layer, to provide high-performance intelligent services and resources, e.g., computing, caching, security, etc.We focus on two kinds of data utilized in the IIoT system, i.e.:

N 2 m, ( 3 )
n=1 a n,k ≤ 1, ∀k and K k=1 a n,k ≤ 1, ∀n.Assume that one IIoT device can associate at most one edge server, and edge server m can serve at most N m IIoT devices due to the hardware limitation.In order to represent the association relationship between IIoT device n and edge server m, a binary variable is also introduced, which can be defined by: b n,m = 1, if device n is associated with edge server m, n,m ≤ 1, ∀n, and N n=1 b n,m ≤ N m , ∀m.Then, the uplink achievable rate between IIoT device n and edge server m on subchannel k can be obtained as: k B log 2 1 + P n,m h n,m σ where P n,m is the transmit power of IIoT device n to edge server m, h n,m is the channel gain from IIoT device n to edge server m, and σ 2 m is the variance of AWGN at edge server m.As in [3], h n,m = 10 −P Ln,m[dB]/10 , where P L n,m [dB] = A log 10 (d n,m ) + B + E log 10 (f c /5) + X, where d n,m is the distance between IIoT device n and edge server m, f c is the carrier frequency, and A, B, E are the constants depending on the propagation model [3].

3 )
Model Aggregation: After receiving the local models from IIoT devices, edge server m performs the aggregations and generates an updated sub-global model ω m according to ω m = N n=1 b n,m ω n |D n | / N n=1 b n,m |D n |.Then edge server m broadcasts ω m to every associated IIoT device for the next sub-global round training.To achieve a sub-global accuracy ε, edge servers should perform I (ε, θ) times iteration training.

Fig. 2 .
Fig. 2. Learning utility of the system vs. number of the IIoT devices.