# FedRDS: Federated Learning on Non-IID Data via Regularization and Data Sharing
## 4 Experiments and Analysis
### Effect of the Number of Local Epochs  
Furthermore, we examined how varying numbers of local epochs affected the model's accuracy, with local epochs ranging from 10, 20, 40, to 80, as shown in Figure 5. When E = 10, the client executes fewer local epochs and is forced to stop before full training, thus affecting the accuracy of all methods. However, FedRDS performs exceptionally well on the CIFAR-10 dataset, achieving higher accuracy than other methods. This is because the optimized local loss function can use the global model as additional knowledge and is robust to insufficient local periods. As E gradually increases, the accuracy of most methods has improved due to more thorough training on local datasets. When E = 20, FedRDS gradually widens the gap with other methods. However, on MNIST, the accuracy of all methods is very close because MNIST has fewer data categories and can train quickly regardless of the size of E. FedRDS can rely on a small number of local epochs E to dynamically correct the local model via the regularization method to achieve a faster model performance. Therefore, increasing E has little benefit for local models, and the increase in accuracy tends to be gradual. When E = 40, FedRDS shows performance degradation on the Fashion MNIST and CIFAR-10 datasets. Excessive local epochs result in the overfitting of local models, exacerbating the issue of client drift caused by non-IID data. Therefore, selecting an appropriate number of local epochs can help the regularization method perform better. When E = 80, the accuracy of FedRDS on the SVHN dataset is even lower than that of MOON. However, other methods maintain a trend of continuously improving accuracy, as they rely on more local epochs to achieve the same accuracy.  
The above indicates that FedRDS can perform better than other methods with relatively sufficient local training. FedAvg, FedProx, and MOON require more local epochs than FedRDS for the same accuracy. In the actual application scenario of FL, the computing performance and connection stability of the client are uncertain and more local epochs mean longer connection times and more excellent dropout opportunities, which is a considerable challenge for large FL networks. FedRDS does not require too many local epochs, which is more advantageous in extreme cases of insufficient local epochs and can address dropout issues in FL due to network bandwidth and other reasons. However, FedRDS may also suffer from overfitting caused by too many local epochs. Hence, selecting the proper number of local epochs is crucial in FL.  
Figure 5: Effect of different numbers of local epochs E on the average accuracy. (**a**) Average accuracy on MNIST. (**b**) Average accuracy on Fashion-MNIST. (**c**) Average accuracy on SVHN. (**d**) Average accuracy on CIFAR-10.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{4}{c}{**Method**} \\ \cline{2-5}
**Dataset** & **FedAvg** & **FedProx** & **MOON** & **FedRDS** \\ \hline MNIST & 97.87\% & 97.94\% & 98.07\% & **98.23\%** \\ Fashion-MNIST & 88.18\% & 88.29\% & 88.45\% & **88.74**\% \\ SVHN & 82.62\% & 83.32\% & 83.98\% & **84.95**\% \\ CIFAR-10 & 53.03\% & 53.85\% & 54.88\% & **55.91**\% \\ \hline \hline \end{tabular}  
* The best results are marked in **bold**.  
\end{table}
Table 3: Performance comparisons with standard FL algorithms. Columns correspond to three scenes. The average accuracy of the 200 rounds is reported.