# Efficient and Secure Federated Learning for Financial Applications
## 5 Experiments
### Communication Costs  
Assuming that the total parameters of the model are \(m\), only the space required to store its gradient vector was calculated, and the subsequent operations such as coding and compression were not considered. Assuming that each parameter is stored in a double-precision floating point, the space required for storing a non-sparse gradient vector update is \(m\cdot 64 bit\). For a sparse gradient update vector with a sparsity rate of \(s\), since there are a large number of 0 elements in the vector, it is not necessary to store these vector vacancies. Only the position index and corresponding value of the non-zero elements in the vector need to be stored. Therefore, the space required to store them is:  
\[m\cdot s\cdot 64 bit+m\cdot s\cdot 32 bit=ms\cdot 96 bit \tag{6}\]  
where \(64 bit\) represents the storage space of a double-precision floating point and \(32 bit\) represents the position index of the non-zero elements in the storage sparse vector in  
Figure 3: Experimental results under non-IID-4/6/8 distribution with different \(\beta\). the entire vector. Then, for the overall process of FL, the total communication overhead required to train a model is:  
\[c_{percent}=n_{percent}\cdot((C\cdot K)\cdot(c_{up}+c_{down})) \tag{7}\]  
where \(n_{percent}\) is the number of aggregation rounds required when the prediction accuracy of the model reaches the target convergence accuracy, \(C\cdot K\) is the number of clients selected in each aggregation iteration, and \(c_{up}\) and \(c_{down}\) represent the communication costs required for a single client to upload and download a gradient update, respectively:  
\[\begin{cases}c_{up}= \begin{cases}m\cdot s\cdot 96 bit,&ifsparse\\ m\cdot 64 bit,&else\\ c_{down}=m\cdot 64 bit\end{cases}  \tag{8}\]  
For the models used in the experiment, the parameter volumes of different models could be obtained according to the above calculation method. The specific data are shown in Table 1.  
According to the number of aggregation rounds required for convergence, the communication costs required for the different algorithms to complete an FL under different experimental conditions could be calculated. For simplicity, the upload communication costs required to make the aggregation model reach 95% of the final average convergence accuracy under the non-IID setting were calculated and the data are shown in Table 2.  
It can be seen that the compression of the uploaded data mainly came from the gradient and mask sparsification proposed in this paper, which increased compression by 5.3 to 34 times. Considering that in an actual scenario the upload bandwidth of a device is generally far less than the download bandwidth, the algorithm in this paper can reduce the upload communication overhead by dozens of times. This optimization is considerable. Since FedAvg and FedProx upload the whole model update during each communication round, the communication overhead of each participant in each round is considerably high. Moreover, FedAvg and FedProx require more rounds to converge compared to our proposed framework. Therefore, FedAvg and FedProx always require more communication overhead to achieve the targeted goal. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{2}{c}{**MNINST**} & \multicolumn{2}{c}{**Fashion-MNIST**} & \multicolumn{2}{c}{**CIFAR-10**} \\ \cline{2-7}  & **MLP** & **CNN** & **MLP** & **CNN** & **MLP** & **VGG16** \\ \hline parameter size & 159,010 & 582,026 & 159,010 & 582,026 & 5,852,170 & 14,728,266 \\ update volume & 1.2 M & 4.44 M & 1.2 M & 4.44 M & 44.6 M & 112 M \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Different model parameter sizes and update volumes.