## 2 Materials and Methods
### Developing the Improved Federated RHLP Algorithm for Efficient Client Selection
The MNIST dataset consists of handwritten digit images (ranging from 0 to 9) [28], while the FMNIST dataset contains fashion item images categorized into 10 classes [29]. Both datasets are split into 60,000 training images and 10,000 test images. To demonstrate the resilience of the improved Federated RMLP algorithm, we constructed Non-IID challenges to assess the algorithm's robustness at two distinct levels: (1) High Non-IID Challenge: Each client was assigned 1-2 classes for local model updates,

Figure 5: Online datasets in this experiment. (**a**) MNIST dataset. (**b**) FMNIST dataset. and (2) Low Non-IID Challenge: Each client was assigned 5-6 classes for local model updates. The datasets were distributed among 100 clients, with each client receiving a varying proportion of data samples, ranging from 10% to 30%, to support the training of their local models. #### 2.3.2 Setting up Algorithms, CNN Model Structures, and Hardware Specifications

1. Setting Up Algorithms

The algorithms will be executed over 200 communication rounds to consolidate the global model. The SGD optimization technique is employed within the CNNs framework for local model updates across five local epochs (E). The batch size is established at 64, with a learning rate of 0.01 for the SGD [30; 31; 32; 33]. During each communication iteration, the Improved Federated RHLP, PoC, and FedChoice algorithms select a subset of candidate clients (Ct), which constitutes 10% (C = 0.1) of the overall pool of 100 clients. Following this, a smaller group of clients (St) is chosen in varying proportions of 2%, 4%, 6%, 8%, and 10% [34]. When the selection for St reaches 10%, the number of candidate clients is augmented by 15% (adding 15 additional candidates) to facilitate a sufficiently random selection process. Furthermore, in the Improved Federated RHLP methodology, each client's local dataset is partitioned into local testing samples, randomly varying between 3% and 5%, while the remaining data is designated for training during local model updates and performance assessment. In contrast, the FedAvg method does not predefine candidate clients but instead directly selects fractions of 2%, 4%, 6%, 8%, and 10% of clients for the purpose of model training. 2. Setting Up CNN Model Structures

The structure of the CNN model is configured for training on the MNIST and FMNIST datasets, as outlined below:

(1) MNIST Dataset:

The CMM model architecture comprises two convolutional layers. In the first layer, 10 feature maps are produced using 5 \(\times\) 5 filters. The second layer increases the number of feature maps to 20, also employing 5 \(\times\) 5 filters. To reduce the risk of overfitting, a dropout layer with a rate of 0.5 is applied after the second convolutional layer. The network architecture further includes two fully connected layers: the first layer reduces 320 features to 50 neurons, and the second layer maps these 50 neurons to 10 output classes, representing the digits 0 to 9. (2) FMNIST Dataset:

The CNN model architecture comprises two convolutional layers. The initial layer generates 32 feature maps using 3 \(\times\) 3 filters with a padding of 1. A max pooling layer with a 2 \(\times\) 2 kernel and a stride of 2 follows this first layer. The subsequent convolutional layer increases the number of feature maps to 64, again employing a 3 \(\times\) 3 filter size. This is followed by another max pooling layer, utilizing the same 2 \(\times\) 2 kernel and stride of 2. The model further incorporates three fully connected layers: The first layer transforms 2304 features into 600 neurons. A dropout layer with a rate of 0.25 is introduced after this layer to mitigate the risk of overfitting. The second fully connected layer reduces the 600 features to 120 neurons. The final layer maps the 120 features to 10 output classes, representing various fashion items. 3.