## 2 Materials and Methods
### Developing the Improved Federated RHLP Algorithm for Efficient Client Selection  
The Improved Federated RHLP algorithm exhibits enhanced efficiency by increasing the accuracy of global model aggregation and accelerating the convergence rate. The subsequent key assumptions underpin the analysis:  
(1) The selection of a predominant number of clients possessing extensive data samples and varied labels contributes positively to the updates of local models. (2) The identification of candidate clients that exhibit superior local model performance alongside a substantial and diverse dataset significantly improves the efficacy of global model aggregation. (3) The application of a dual-biased strategy in the roulette wheel selection process enhances the accuracy of the global model, expedites the convergence rate, and minimizes execution duration. This improvement is achieved through its dual-bias approach, consisting of Module 1 and Module 2. These modules incorporate factors such as the number of samples, label diversity, and the high performance of local models from clients into the processes of model updates and aggregation, as shown in Figure 3.  
Figure 3: Architecture of Improved RHLP algorithm. Explanation of the cycles : the green-colored section represents the local training samples of candidate clients (d_train\({}_{k1}\), d_train\({}_{k2}\), and d_train\({}_{k3}\)), and the sky-blue section represents the local testing samples of candidate clients (d_test\({}_{k1}\), d_test\({}_{k2}\), and d_test\({}_{k3}\)). In Figure 3, the architecture of the Improved RMLP algorithm is developed in two modules:  
Module 1: Candidate client selection  
The client selection process requires improvement to more effectively select a smaller set of candidate clients (Ct) in each communication round, prioritizing based on the number of samples (n\({}_{k}\)) and label diversity (L\({}_{k}\)). In the example (Figure 4), the probability of choosing each client (k) is calculated as \(\mathrm{P_{k}}=\frac{\mathrm{n_{k}\times\mathrm{l_{k}}}}{\sum_{k=1}^{K}\mathrm{ n_{k}\times\mathrm{l_{k}}}}\) For k\({}_{1}\), \(\mathrm{P_{k1}}=(300\times 1)/1000=0.3\); for k\({}_{2}\), \(\mathrm{P_{k2}}=(250\times 1)/1000=0.25\); for k\({}_{3}\), \(\mathrm{P_{k3}}=(150\times 3)/1000=0.45\). Consequently, k\({}_{3}\) exhibits the greatest probability of selection for local model updates and performance assessment, with k\({}_{1}\) following closely, possessing a higher likelihood than k\({}_{2}\). This proposed selection process ensures that clients with more diverse labels and larger datasets are prioritized, leading to a more diverse and robust aggregated global model. Module 2: High local model performance updates and aggregation  
The local model performance is measured in the algorithm by splitting each candidate's local dataset (d\({}_{k}\)) into training samples (d\({}_{\text{train}}\)), where (d\({}_{\text{train}}\)) is further split into batches of size B for locally updating the model (w\({}_{k}\)) by using the Stochastic Gradient Descent (SGD) technique, and small test samples (d\({}_{\text{test}}\)), which are used for testing local model performance of each client (LP\({}_{k}\)) with LP\({}_{k}\) = f(w\({}_{k}\)d\({}_{\text{test}}\)). High-performing local models, calculated from TotalLP = \(\sum_{k\in\mathrm{C}_{t}}\mathrm{LP}_{k}\) and using Equation (4) to determine the weight of local model performance (WLP\({}_{k}\)), are then randomly selected using a biased roulette wheel mechanism for global model aggregation. In the example of local model aggregation involving candidate clients (k\({}_{1}\), k\({}_{3}\), and k\({}_{\text{x}}\)), let us consider that client k\({}_{1}\) possesses local model parameters (w\({}_{k}\)) in the structural layers, which have been trained with d\({}_{\text{train}}\)\({}_{k1}\) = 1,1,1,.