## 2 Materials and Methods
### Developing the Improved Federated RHLP Algorithm for Efficient Client Selection
In Reference [23], a technique was introduced in which clients share their label distributions to allocate biased weights for model updates and aggregation, thereby further optimizing model efficiency. 3. Local Model Performance: The precision of the model developed from the local dataset of each data repository is of paramount importance. A repository that excels in assimilating knowledge from its own data is likely to contribute positively to the overall performance of the model when updates are made. Therefore, selecting repositories that demonstrate strong local performance will significantly enhance both the accuracy and efficiency of global model training within the Federated Learning (FL) framework. In the context of Genetic Algorithms (GA), the process of choosing solutions with high fitness is essential for fostering the development of optimal solutions by selecting and refining the most advantageous genes across generations [24]. The application of a fitness function to assess the quality of each solution facilitates an ongoing pursuit of the most effective outcomes. Robust Security Against Attacks on the Network: Concentrating on a reduced subset of clients while ensuring the overall accuracy of the global model can enhance the detection and validation of adversarial attacks or clients exhibiting harmful behavior. This strategy proves to be more effective than the inclusion of all clients for model updates and communications within the network. The enhanced Fed-RHLP algorithm refrains from transmitting raw data or values that are directly associated with the actual dataset, thereby increasing its resilience against adversarial threats or malicious clients that may arise in practical situations. ```
1:ServerExecute:
2:\(W_{0}\) = Initial parameters of the CNNs model
3:N = Total number of clients
4:C1 = Fraction of candidate clients
5:C2 = Fraction of selected clients
6:m1 = Number of candidate clients
7:m2 = Number of selected clients
8:n\({}_{k}\) = Number of samples of client k
9:l\({}_{k}\) = Label diversity of client k
10:d\({}_{train}\)_proportion = Proportion of local training samples
11:d\({}_{test}\)_proportion = Proportion of local testing samples
12:For t = 1 to T do
13:m1 = N-C1 \(\text{C}_{\text{t}}\) = {random set of candidate (m1) clients based on \(\text{P}_{k}\)= \(\frac{\text{n}_{k}{}_{k}}{



Furthermore, Algorithm 1 illustrates the pseudocode of the Enhanced RMLP algorithm, highlighting its scalability in relation to the increasing number of clients. As additional clients engage in local model updates, the algorithm is capable of concurrently assessing the probability of each candidate client by considering various factors, including the volume of data samples, diversity of labels, local model training, and performance evaluation of the local model. The efficacy of parallel processing within the proposed algorithm is particularly noticeable in Lines 15-18 and 26-35. ### Experiment Setup

This study employs CNNs, recognized as a highly effective deep learning algorithm suitable for tasks involving image classification [25]. The experimental procedure is organized into three distinct phases, which are outlined in the following sections. #### 2.3.1 Dataset Preparation

In this study, we address the challenge posed by imbalanced and Non-IID datasets that are distributed among clients, a critical concern in the realm of FL [26]. Such imbalances have a profound impact on the efficacy of model training [27]. The effectiveness of the improved Fed-RMLP algorithm was evaluated through comparisons with FedAvg, PoC, and FedChoice, specifically focusing on Non-IID scenarios utilizing the MNIST and Fashion-MNIST (FMNIST) datasets. The structures of these datasets are described and illustrated in Figure 5.

Figure 5 shows the use of two datasets: (a) the MNIST dataset and (b) the FMNIST dataset. Both datasets contain a total of 70,000 images, each being a 28 \(\times\) 28 grayscale image.