## 4 The Proposed Method
### Model Distributor  
Our method presents an alternative to the conventional federated learning paradigm, wherein clients are served identical models from the server. Our strategy allocates distinct model branches to various clients based on their computational capabilities and communication bandwidth. To facilitate this, we introduce a clustering algorithm that groups the clients into \(K+1\) clusters, where \(K\) denotes the number of additional branches incorporated into the model.  
The initial step in the tier clustering algorithm (Algorithm 1) involves assigning the overall training capability by considering each client's computation capability and communication bandwidth. It is worth noting that a coefficient \(\mu\) is introduced to the computation capability (Line 3), where \(\mu\) represents the ratio of computation capability to communication bandwidth. This coefficient determines the relative importance of computation capability concerning communication bandwidth, with \(\mu>1\) indicating a higher emphasis on computation capability and \(\mu<1\) indicating a higher emphasis on communication bandwidth. When \(\mu\) is equal to 1, both factors are considered equally important. Section 5 will explore the diverse outcomes achieved by employing different values of \(\mu\). Furthermore, the clients are sorted (Line 5 in Algorithm 1) based on their training capability after assigning the overall training ability. They are subsequently grouped (Line 8 in Algorithm 1) into K + 1 groups, arranged in ascending order according to their training times, starting from the clients with the lower training capability and progressing toward those with more substantial training capabilities.  
With the clustering set in place, the model distributor can assign different models based on the individual training capabilities of clients. The branch models \(\{M_{i}\}_{i=1}^{K+1}\) represent the initial neural network architecture's early exit points. Each \(M_{i}\) signifies a specific model configuration, where \(i=1\) corresponds to the most miniature model denoting the earliest exit of the network. Conversely, \(i=k+1\) represents the complete network without any early exits.  
Figure 4: The architecture of the proposed nine-branch ResNet34 network.  
Figure 3: The architecture of the original ResNet34 network.  
The model distributor systematically dispatches the corresponding model \(M_{i}\) to the clients within cluster \(G_{i}\) to optimize the training process. This sequential assignment ensures that clients receive a model tailored to their specific training requirements, ultimately maximizing the effectiveness and efficiency of the federated learning process.  
```
0: Clients set \(\boldsymbol{\mathcal{R}}=\{\boldsymbol{\mathcal{R}}_{i}\}_{i=1}^{N}\), computation capability set \(\boldsymbol{\mathsf{P}}=\{Pi_{i}\}_{i=1}^{N}\), communication bandwidth set \(\boldsymbol{\mathsf{S}}=\{\boldsymbol{\mathsf{S}}\}_{i=1}^{N}\), clustering set \(\boldsymbol{\mathsf{G}}=\varnothing\), ratio of computation capability to communication bandwidth \(\mu\), number of additional branches \(\boldsymbol{\mathsf{K}}\)
0: Clustering set \(\boldsymbol{G}\)
1: Training capability set \(\boldsymbol{T}\leftarrow\varnothing\)
2:for\(i=1\) to N do
3: Update Training capability set \(\boldsymbol{T}_{i}=\mu*P_{i}+\boldsymbol{\mathsf{S}}_{i}\)
4:endfor
5: Sort the set \(T\) and obtain the sorted set \(\boldsymbol{T}^{\prime}=\{T_{1}^{\prime}<T_{2}^{\prime},...,<T_{N}\}\) and corresponding client set \(\boldsymbol{\mathcal{R}}^{\prime}=\{\boldsymbol{\mathcal{R}}_{i}\}_{i=1}^{N}\)
6:for\(\boldsymbol{t}=1\) to K + 1
7:for\(\boldsymbol{j}=\boldsymbol{t}\) to \(\boldsymbol{t}+\boldsymbol{\mathsf{N}}/(\boldsymbol{\mathsf{K}}+1)\)do
8: Sequentially assign \(\boldsymbol{\mathcal{R}}^{\prime}_{j}\) to \(\boldsymbol{G}_{\boldsymbol{t}}\)
9:endfor
10:endfor
```  
**Algorithm 1**Tier Clustering Algorithm