# GHEFL: Grouping Based on Homomorphic Encryption Validates Federated Learning
## 4 The Proposed Scheme
### Correctness Verification of Aggregation Results

After receiving the results returned from the server, the participants perform the final aggregation locally by computing the global aggregation result

\[W=W^{x}+W^{y}, \tag{10}\]

encrypt the global aggregation result \(W\) with the key \(sk\) to obtain \(H(W)\), and compute the labeled value

\[w_{1}^{*}=w_{1}-r_{i},\]0

If equation

\[w_{1}^{*}=w_{1}-r_{i},\]1

holds, the verification is successful, and each participant accepts the aggregation result as its own local model parameter to start a new round of iteration; otherwise, it proves that the server has tampered with the participant's data or maliciously returned incorrect aggregation results to undermine the convergence of the model, and each participant rejects the aggregation result. ## 5 Evaluation

In this section, we experimentally evaluate the performance of GHEFL and compare its efficiency and accuracy with those of SASH and FedAvg. Both the GHEFL and SASH protocols perform secure aggregation using a dual-server architecture. Meanwhile, the FedAvg protocol, as a generalized protocol for basic federated learning scenarios, is simple, efficient, and easy to implement. Both the FedAvg and GHEFL protocols perform unweighted aggregation. ### Basic Configurations

The computer configuration was Intel Core i9-12900 CPU @ 5.00 GHz with 16 GB of RAM. The code environment was primarily based on the Python programming language version 3.9, with cryptographic algorithms implemented using the SecretFlow framework. The backend was implemented using PyTorch version 2.0 and federated learning aggregation was carried out using FedSGD. In our experiments, we mainly used the LeNet model, which consists of three convolutional layers, two pooling layers, one fully connected layer, and one output layer. The convolution kernel for all convolutional layers was 5 \(\times\) 5 with a stride of 1. The pooling method used was average pooling and the activation function was the ReLU function, which is commonly used today. ### Datasets

We evaluated the performance of GHEFL using the MNIST dataset, which is commonly used in machine learning. The dataset consists of a total of 70,000 handwritten images, divided into 60,000 training samples and 10,000 test samples. ### Experimental Results

We experimentally compared GHEFL with its similar schemes, SASH and FedAvg, on the MNIST dataset. The evaluation primarily focused on two aspects: the difference in model accuracy under the same number of training rounds and the time required to achieve model convergence during the training process. Subsequently, WVFL was introduced, and the resilience to attacks of these four schemes was compared. When evaluating model accuracy, since communication noise may be introduced during parameter transmission in practical scenarios, noise was added to the parameter transfer process on the client side and its intensity was adjusted to simulate real-world conditions as closely as possible. This approach was adopted to investigate the performance of different schemes under the influence of communication noise. As can be seen from Figure 4a,b, in the iterative training under the preset number of rounds, when the noise scale was small, the model accuracy convergence of GHEFL and the other two protocols was nearly identical; however, when the noise scale was large, the model accuracy convergence of GHEFL was significantly better than that of the other two protocols. In other words, the data protection technology adopted by GHEFL has no negative impact on its accuracy and meets the practical requirements. The original dataset was divided into a training set and a test set. The training set was used for local training on the client side, while the test set was employed to measure the accuracy of the global model. FedAvg and SASH were selected as comparative schemes for this study.