Edge Federated Optimization for Heterogeneous Data

: This study focuses on optimizing federated learning in heterogeneous data environments. We implement the FedProx and a baseline algorithm (i.e., the FedAvg) with advanced optimization strategies to tackle non-IID data issues in distributed learning. Model freezing and pruning techniques are explored to showcase the effective operations of deep learning models on resource-constrained edge devices. Experimental results show that at a pruning rate of 10%, the FedProx with structured pruning in the MIT-BIH and ST databases achieved the best F1 scores, reaching 96.01% and 77.81%, respectively, which achieves a good balance between system efﬁciency and model accuracy compared to those of the FedProx with the original conﬁguration, reaching F1 scores of 66.12% and 89.90%, respectively. Similarly, with layer freezing technique, unstructured pruning method, and a pruning rate of 20%, the FedAvg algorithm effectively balances classiﬁcation performance and degradation of pruned model accuracy, achieving F1 scores of 88.75% and 72.75%, respectively, compared to those of the FedAvg with the original conﬁguration, reaching 56.82% and 85.80%, respectively. By adopting model optimization strategies, a practical solution is developed for deploying complex models in edge federated learning, vital for its efﬁcient implementation.


Introduction
With the rapid advancements in data science and artificial intelligence technologies, machine learning has found widespread applications in various fields.For instance, in the healthcare domain, machine learning techniques are gradually being integrated into the healthcare diagnostic workflow, particularly in the analysis of medical images and clinical data to assist physicians in making more precise diagnoses.However, with the exponential growth of data, traditional centralized machine learning approaches face significant challenges in handling sensitive medical data, especially in terms of privacy protection and data storage.Given the abundance of personal health information in medical data, ensuring patient privacy becomes of paramount importance.
In this context, federated learning, as an emerging distributed machine learning approach, demonstrates its unique advantages in handling sensitive data.By conducting model training locally and sharing only the model updates rather than raw data, federated learning can simultaneously ensure data privacy and enable effective learning.This approach is particularly suitable for applications in the healthcare domain, as it allows learning from medical institutions distributed across various locations without the need for centralized storage of sensitive data.
In the implementation of federated learning, it is generally expected that the datasets among nodes are IID.However, the training data collected by nodes often exhibits non-IID characteristics, posing challenges to traditional federated learning approaches.To address this, federated learning has been further subdivided into Horizontal Federated Learning (HFL) (Figure 1a) and Vertical Federated Learning (VFL) (Figure 1b).In HFL, there is a high overlap in the feature space, but the sample identities a different.An example can be seen in different hospitals having patients with similar hea data features.HFL allows these hospitals to share the knowledge of the learned mod while protecting individual privacy, facilitating cross-institutional collaborative learnin On the other hand, VFL is applicable in scenarios where the same sample ID space shared but the feature spaces are different, such as the common customer groups amo different banks in the same region.This enables banks to jointly build comprehensi credit assessment models without directly sharing detailed customer information [1].
Nevertheless, federated learning still faces a series of challenges in practical applic tions, especially the issue of data heterogeneity.Heterogeneous data distributions, su as the non-independently and identically distributed (non-IID) phenomenon, can ha adverse effects on the accuracy and stability of models.Referring to [2], the main a proaches to dealing with non-IID problems in HFL can be categorized from data, alg rithm, and system perspectives.With data-based approaches, this issue can be address by modifying the distributions (e.g., data sharing [3] and augmentation [4]), which sign icantly improves the learning performance.Nonetheless, most of these techniques c only be implemented with the help of the aforementioned data sharing, which may i crease the risk of data privacy leakage.With algorithm-based approaches, personalizati approaches may be applied to adjust the model according to the local tasks, includi performing local fine-tuning [5-7] (e.g., personalization via regularization and interpo tion, or meta learning), having personalized layers in the neural network models [ multi-task learning [9][10][11], and knowledge distillation [12][13][14][15].Note that although perso alization layers are able to enhance the learning performance on non-IID data and redu communication costs by only sharing the base layers between the server and clients, ea client may need to permanently store the personalization layers without releasing the With system-based approaches, client clustering is proposed to construct a multi-cen framework by grouping those clients with similar local training data into the same clust introducing the concept of secure data similarity evaluation with respect to the loss val [16][17][18][19] and model weights [11,20,21].However, these methods may consume addition computation and communication resources for both model training and testing.
This work applies an algorithm-based approach and focuses on exploring how address the problem of data heterogeneity in federated learning by leveraging t FedProx algorithm [22] along with advanced optimization techniques.The FedProx alg rithm effectively handles heterogeneous datasets by introducing additional local upda steps, thereby enhancing the model's generalization ability across different data distrib In HFL, there is a high overlap in the feature space, but the sample identities are different.An example can be seen in different hospitals having patients with similar health data features.HFL allows these hospitals to share the knowledge of the learned model while protecting individual privacy, facilitating cross-institutional collaborative learning.On the other hand, VFL is applicable in scenarios where the same sample ID space is shared but the feature spaces are different, such as the common customer groups among different banks in the same region.This enables banks to jointly build comprehensive credit assessment models without directly sharing detailed customer information [1].
Nevertheless, federated learning still faces a series of challenges in practical applications, especially the issue of data heterogeneity.Heterogeneous data distributions, such as the non-independently and identically distributed (non-IID) phenomenon, can have adverse effects on the accuracy and stability of models.Referring to [2], the main approaches to dealing with non-IID problems in HFL can be categorized from data, algorithm, and system perspectives.With data-based approaches, this issue can be addressed by modifying the distributions (e.g., data sharing [3] and augmentation [4]), which significantly improves the learning performance.Nonetheless, most of these techniques can only be implemented with the help of the aforementioned data sharing, which may increase the risk of data privacy leakage.With algorithm-based approaches, personalization approaches may be applied to adjust the model according to the local tasks, including performing local finetuning [5-7] (e.g., personalization via regularization and interpolation, or meta learning), having personalized layers in the neural network models [8], multi-task learning [9][10][11], and knowledge distillation [12][13][14][15].Note that although personalization layers are able to enhance the learning performance on non-IID data and reduce communication costs by only sharing the base layers between the server and clients, each client may need to permanently store the personalization layers without releasing them.With system-based approaches, client clustering is proposed to construct a multi-center framework by grouping those clients with similar local training data into the same cluster, introducing the concept of secure data similarity evaluation with respect to the loss value [16][17][18][19] and model weights [11,20,21].However, these methods may consume additional computation and communication resources for both model training and testing.
This work applies an algorithm-based approach and focuses on exploring how to address the problem of data heterogeneity in federated learning by leveraging the FedProx algorithm [22] along with advanced optimization techniques.The FedProx algorithm effectively handles heterogeneous datasets by introducing additional local update steps, thereby enhancing the model's generalization ability across different data distributions.The research also focuses on the feasibility of implementing federated learning models in resource-constrained environments, utilizing the Nvidia Jetson Nano as the experimental platform.Its balanced performance and computational capabilities make it an ideal choice for edge computing applications.Leveraging the Flower federated learning framework, this study effectively deploys and manages federated learning tasks on the Jetson Nano.Flower, being a flexible and lightweight open-source federated learning framework, is wellsuited for running on embedded systems like the Jetson Nano.It enhances the efficiency of coordinating model training across multiple devices while reducing communication costs and computational resource consumption.
Additionally, this study delves into model optimization strategies, particularly the application of freezing and pruning techniques.Model freezing involves fixing certain layers in a deep learning model, reducing the computational burden significantly, which is especially important for devices with limited computational capabilities.Concurrently, pruning techniques, by removing unimportant weights or neurons from the model, help reduce model size and improve operational efficiency.These techniques not only enhance model performance on devices like the Jetson Nano but also boost the efficiency and scalability of the entire federated learning system.
The research in this work covers several key areas: • Exploration of sensible practices for implementing federated learning on the Jetson Nano.

•
Evaluation of the performance of the FedProx algorithm in handling heterogeneous data.

•
Model optimization involves pruning and layer freezing techniques for improving accuracy and efficiency.
This research aims to make contributions to the field of federated learning by providing empirical studies on how to effectively utilize FedProx in a heterogeneous data environment.It also explores and demonstrates the feasibility and efficiency of deploying complex machine learning models on resource-constrained edge computing devices.
The structure of this work is as follows: Section 2 reviews recent works related to federated learning in the context of the Internet of Things (IoT).Section 3 discusses the key technologies used in this study.Section 4 describes the system architecture and optimization methods employed.Section 5 comprehensively discusses the experimental results.Finally, Section 6 summarizes the findings of this research and explores future research directions.

Related Works
With the development of big data and IoT technologies, the healthcare sector has begun to extensively utilize various sensors, wearable devices, mobile applications, and remote monitoring equipment for the collection of health and medical data.These innovative technologies enable real-time monitoring of patients' health status, provide personalized health recommendations, and rapidly respond in emergency situations.However, with the proliferation of these technologies, data privacy and security issues have become increasingly significant.Therefore, federated learning has emerged as a promising solution for handling data in the medical IoT context.This concept, initially proposed by Google [23], aims to address key challenges in distributed data processing, including communication costs, data privacy, and regulatory compliance.Federated learning allows multiple devices or data centers to collaboratively train a shared model without sharing the raw data, thereby effectively protecting individual privacy.This approach has seen further research and development in various areas, demonstrating its vast potential applications in fields ranging from healthcare to financial services, the Internet of Vehicles (IoV), and personalized services.
In recent years, conducting federated learning on edge devices has become a popular research trend in both academia and industry.Pioneering research in this field is continuously propelling advancements and practical applications of this technology.

Microcontroller Unit
In [24][25][26], the feasibility of implementing federated learning on microcontrollers (MCUs) using MCUs as client devices is demonstrated.Wulfert et al. [24] introduce TinyFL, a federated learning approach using only MCUs for communication and aggregation, which demonstrates feasible federated learning communication and aggregation on MCUs via integrated circuits (I 2 C), showing speed advantages over centralized training.It validates its effectiveness with a gesture recognition case, achieving comparable accuracy to centralized training even with non-IID data.Kopparapu et al. [25] merge federated learning and transfer learning for resource-constrained IoT devices with less than 1 MB of memory.It features federated transfer learning for binary image classification on MCUs, utilizing pre-trained CNNs for feature extraction.Llisterri giménez et al. [26] employ federated learning on three Arduino Nano 33 BLE Sense boards to train a fully connected neural network (FCNN) for keyword spotting (KWS).The study notes communication bandwidth limitations between MCUs and the server due to serial port usage, which highlights the potential of federated learning on low-cost, low-power devices but acknowledges performance and capability limitations, particularly with complex models or large datasets, and accuracy decreases with more device participation.

Main Approaches to Handling Non-IID Data
The current main approaches to dealing with non-IID problems in HFL can be categorized from data, algorithm, and system perspectives.

Data-Driven Approach
There are two main data-driven approaches: data sharing and data augmentation.Data sharing [27] is an effective way to deal with non-IID data in HFL.The global model is built up by training a globally shared dataset.For the client model, the connected clients download a random percentage of the shared global data, such that the client model is updated by both local training data and the shared global data.Data augmentation [4] techniques handle the imbalance issue of the local data, which can be further categorized as follows: the vanilla method [28], the mixup method [29], and the generative adversarial network (GAN) [30]-based method.Note that data augmentation techniques, incorporating data sharing, can effectively improve the model's learning performance with non-IID data.However, these data processing techniques may increase the risk of data privacy leakage [2].

Algorithm-Driven Approach
This subsection describes several major types of personalization methods, including conducting local fine-tuning, multi-task learning, and knowledge distillation [13].The clients perform local fine-tuning to adjust the local models based on the global model from the server [7].Note that FedAvg [23] is the basic form of local fine-tuning, which includes the procedures of finding a suitable initial shared model and combining local and global information.With meta-learning methods, a high-quality initial global model is developed with fine-tuning (e.g., Personalized FedAvg (Per-FedAvg) [5]).This method [5] achieves first-order optimality with convergence guarantees and better performance on heterogeneous data than FedAvg, but the approximate gradient of Per-FedAvg will significantly affect the results.An alternative to solving the personalization problem is to treat it as a multi-task learning problem [9], considering issues of communication cost, stragglers, and fault tolerance [10].
Besides local fine-tuning and multi-task learning, knowledge distillation [12,14,15] is also a promising method for personalized federated learning.Hinton et al. [15] extend the concept of information transfer from large models to small ones [12] to knowledge distillation techniques.To deal with non-IID data, two types of strategies may be applied, namely federated transfer learning and domain adaptation.For federated transfer learning, Chang et al. [31] propose a collaborative, robust learning method by uploading learned features instead of local models to implement local personalization.Li et al. [32] propose a framework called decentralized federated learning via mutual knowledge transfer (Def-KT), in which local clients exchange messages directly in a peer-to-peer manner without the participation of the cloud server.Another knowledge distillation strategy is domain adaptation, which emphasizes eliminating the differences between data shards between clients.Peng et al. [33] propose a federated adversarial domain adaptation (FADA) algorithm that handles the domain shift problem with adversarial adaptation techniques.Li et al. [34] present the FedMD algorithm to transfer knowledge from a public dataset and enable clients to train their unique models on local data without privacy leakage risk.

System-Driven Approach
For system-driven approaches, two main kinds of secure data similarity evaluation methods are introduced in the literature, namely evaluating the similarity of the loss value and the similarity of model weights.With the first approach, the authors in [16][17][18][19] execute the similarity evaluation by comparing the loss values of different cluster models, where multiple global models are constructed in clusters.Each connected client receives the cluster models for local empirical loss computation.Accordingly, for cluster model aggregation, each client refurbishes the smallest loss-value cluster model, and the server collects these updated models.Instead of considering the loss value, the second approach evaluates the local data similarity and does clustering based on the local model weights.In [11,20], before clustering the clients, the standard FedAvg algorithm is applied to train the global model.Afterwards, the clients receive the warmed-up global model, perform local updates, and return these local models to the server for calculating the similarity scores of model weights.Thus, based on the received local updated models and the calculated similarity scores, the server can group the clients into clusters.
Note that client clustering may be applied to handle the issues concerning negative knowledge transfer and performance degradation due to local model aggregation with considerably different training data.Furthermore, generating multiple global models provides a sensible way to enhance the scalability and flexibility of federated learning systems, considering the specific task requirements, at the cost of more communication and computational resource utilization.

Mode Optimization
Malan et al. [35] introduced a federated learning with gradual layer freezing (FedGLF) strategy.This approach, validated in two image classification tasks under varying data distributions, has demonstrated its effectiveness by significantly reducing communication volumes during training while maintaining or even enhancing model accuracy, which is particularly crucial for resource-limited edge devices.Lee et al. [36] proposed a grouping method based on data distribution and the physical locations of nodes, coupled with the FedAvg-IC optimization algorithm.This approach enhanced the accuracy and communication efficiency of federated learning.

Sparse Learning and Pruning
Derrmers et al. [37] demonstrated the feasibility of what is termed sparse learning introducing an innovative sparse momentum algorithm.This algorithm employs exponentially smoothed gradients (momentum) for precise identification and optimization of layers and weights that significantly reduce error rates, thereby enhancing the efficiency and accuracy of federated learning applications on edge devices.Ullah et al. [38] presented a federated learning approach for embedded edge computing using sparse-adaptive model selection.This method leverages sparse learning for local model training and smart model selection and aggregation on a central server.On the client side, stronger nodes are frozen, while weaker nodes are retrained to better capture features relevant to new categories, enhancing overall model adaptability and efficiency.
Refs. [39][40][41] explored how pruning techniques can enhance the efficiency and effectiveness of federated learning in handling non-IID data and edge devices.Jiang et al. [39] introduced a federated learning method called "PruneFL", which reduces model complexity through pruning techniques, making it more suitable for running on edge devices with limited computational capabilities.Vahidian et al. [40] proposed a novel strategy that combines structured and unstructured pruning to improve model performance under non-IID data distributions, enabling it to adapt more effectively to diverse client data.Yu et al. [41] introduced an adaptive dynamic pruning technique that incorporates global gradient control variables to optimize federated learning.This method specifically addresses non-IID data issues on edge devices by dynamically pruning the model to reduce complexity while maintaining high accuracy.

Comparative Summary
Most of the research integrating federated learning with embedded devices primarily aims at conducting model training in constrained environments or implementing local data processing and model training in edge environments for accelerated data processing and real-time responses.These innovative studies are gradually overcoming challenges in the processing capabilities and communication efficiency of edge devices, invigorating the development in fields such as the IoT and smart devices, thereby demonstrating the potential and possibilities in this domain.Table 1 lists various embedded devices used for different federated learning training tasks.
It is worth mentioning that finding a proper target density for pruning is nontrivial.Adaptive pruning models have been designed in [39,41], while [40] combines structured and unstructured pruning.In [39], training was conducted separately on different datasets under both IID and non-IID settings.In the non-IID setting, a single dataset was trained in a non-IID manner by classifying it differently.Note that the above three works use different pruning methods to integrate their proposed algorithms.In contrast, our study employed two entirely distinct datasets for non-IID training with the partial node training strategy proposed in [38], which focuses on retraining weaker nodes in the network.However, when applying this method to our data model, it did not yield the expected results due to the non-IID nature of our dataset, which significantly differs from the independent and IID datasets used in [38].Despite these challenges, we found the iterative structured pruning strategy mentioned in [40] to be effective during the training process.Therefore, we chose to use a structured pruning method, specifically employing the sparse optimization framework provided by [42], pruning 20% of the nodes, and focusing on training the remaining 80%.Table 2 compares the experimental methods and data formats in the literature.

Methodology
This section elucidates the data preprocessing and implementation methods used in this work, which explicates the architecture of federated learning, the algorithms associated with deep learning, and the pertinent formulas and techniques utilized in this study.

Dataset Description
The datasets utilized in this study are sourced from PhysioNet [46], a publicly available resource for ECG data.We apply two distinct arrhythmia databases: the MIT-BIH Arrhythmia Database (MIT-BIH database) [47] and the St Petersburg INCART 12-lead Arrhythmia Database (St database) [48].Note that the MIT-BIH database comprises ECG recordings from 48 patients, each lasting 30 min.Each recording includes 2 standard ECG leads, sampled at a rate of 360 Hz to ensure high-quality data collection.The St database, encompassing ECG recordings from 32 patients, comprises 75 half-hour ECG recordings, with each record lasting 30 min.Each recording includes 12 standard ECG leads, sampled at a rate of 257 Hz to ensure high-quality data collection.
The choice of these datasets is based on their wide availability and significance in ECG research.The MIT-BIH database is highly regarded as it provides extensive, longduration ECG records from multiple patients, making it suitable for a wide range of arrhythmia studies.

Model Architecture
The architecture of Convolutional Neural Network (CNN) consists of two convolutional operations, two pooling operations, and two fully connected operations.Typically, CNNs add pooling layers after convolutional layers to reduce the dimension of feature maps.Through multiple rounds of convolution and pooling, low-level features gradually combine to form higher-level features.Ultimately, the neural network performs classification based on the extracted high-level features.CNN's convolution operation exhibits characteristics of local connectivity and weight sharing, enabling it to effectively capture local features within the signal, making it particularly advantageous for processing electrocardiogram data with spatial structure.

Pruning
Structured pruning is a technique employed to prune structural elements of a model, such as neurons or convolutional kernels within a neural network.This pruning method typically adheres to the structure and topology of the model to ensure that the connectivity and hierarchical structure of the network remain unchanged.The structured pruning used in this work involves setting the weights of certain neurons to zero, thereby disabling the associated connections.On the other hand, unstructured pruning involves pruning individual weights within the model, regardless of their location or structure.In this scenario, pruning is typically achieved by setting weights with smaller values to zero.This may result in some weights within the model being entirely eliminated, thereby reducing the model's size.Unstructured pruning is often used to further reduce the model's storage requirements and computational costs, but it may require sophisticated techniques to minimize its impact on model performance.In this work, we utilized the sparse optimization framework provided by DessiLB [14] to transform the original unstructured architecture into a structured one and make it iteratively adapt to our model.
Figure 2a shows the initial network.The unstructured (weight) pruning (Figure 2b) and structured (filter) pruning (Figure 2c) approaches are techniques for reducing the size of deep learning models, improving efficiency, and mitigating overfitting.Structured pruning cuts out full filters and kernel rows, leading to fewer intermediate feature maps, unlike just pruning connections [49].The primary distinction between them lies in their focus on pruning different types of elements within the model (Figure 3).In [10], it is mentioned that conventional training is applied to specific parameters (weak nodes), while non-specific parameters (strong nodes) are not subjected to training.Similar to iterative structured pruning, pruning is applied to strong nodes while iteratively training weak nodes.
Structured pruning is a technique employed to prune structural elements of a model, such as neurons or convolutional kernels within a neural network.This pruning method typically adheres to the structure and topology of the model to ensure that the connectivity and hierarchical structure of the network remain unchanged.The structured pruning used in this work involves setting the weights of certain neurons to zero, thereby disabling the associated connections.On the other hand, unstructured pruning involves pruning individual weights within the model, regardless of their location or structure.In this scenario, pruning is typically achieved by setting weights with smaller values to zero.This may result in some weights within the model being entirely eliminated, thereby reducing the model's size.Unstructured pruning is often used to further reduce the model's storage requirements and computational costs, but it may require sophisticated techniques to minimize its impact on model performance.In this work, we utilized the sparse optimization framework provided by DessiLB [14] to transform the original unstructured architecture into a structured one and make it iteratively adapt to our model.
Figure 2a shows the initial network.The unstructured (weight) pruning (Figure 2b) and structured (filter) pruning (Figure 2c) approaches are techniques for reducing the size of deep learning models, improving efficiency, and mitigating overfitting.Structured pruning cuts out full filters and kernel rows, leading to fewer intermediate feature maps, unlike just pruning connections [49].The primary distinction between them lies in their focus on pruning different types of elements within the model (Figure 3).In [10], it is mentioned that conventional training is applied to specific parameters (weak nodes), while non-specific parameters (strong nodes) are not subjected to training.Similar to iterative structured pruning, pruning is applied to strong nodes while iteratively training weak nodes.

Layer Freezing
Layer freezing refers to the practice of setting certain layers or weights in a pretrained model to an untrainable state.This means that during the fine-tuning stage, the weights of these frozen layers remain unchanged and do not obtain updated.The frozen layers technique is particularly applicable when you already possess a pre-trained model that has been trained on large-scale data relevant to your new task.Such a pre-trained model can provide valuable features and knowledge, and you only need to fine-tune it to adapt it to your specific requirements.
In the field of deep learning, the layer freezing technique is an important strategy for effectively leveraging prior model knowledge.By freezing a subset of the model's layers or weights, we ensure that these layers will not undergo retraining, thus preserving the knowledge they acquired from previous tasks.This helps expedite the model fine-tuning

Layer Freezing
Layer freezing refers to the practice of setting certain layers or weights in a pre-trained model to an untrainable state.This means that during the fine-tuning stage, the weights of these frozen layers remain unchanged and do not obtain updated.The frozen layers technique is particularly applicable when you already possess a pre-trained model that has been trained on large-scale data relevant to your new task.Such a pre-trained model can provide valuable features and knowledge, and you only need to fine-tune it to adapt it to your specific requirements.
In the field of deep learning, the layer freezing technique is an important strategy for effectively leveraging prior model knowledge.By freezing a subset of the model's layers or weights, we ensure that these layers will not undergo retraining, thus preserving the knowledge they acquired from previous tasks.This helps expedite the model fine-tuning process, reduces reliance on large-scale data, and enhances the model's generalization capabilities.In summary, the layer freezing technique is a powerful tool in deep learning that streamlines transfer learning and the adaptation of models to new tasks, making the process more efficient and feasible.

Early Stopping
Early stopping is employed to prevent model overfitting and improve the model's generalization ability.Its principle lies in periodically evaluating the model's performance during training, and once the performance reaches a specified criterion, the training process is halted, preventing further training beyond the convergence of the training error.By terminating unnecessary training prematurely, early stopping can save time and computational resources, particularly in the training of large-scale deep learning models.

Model Evaluation
Model evaluation is the process of using various evaluation metrics to understand the performance strengths, and weaknesses of a machine learning model.This process is crucial for assessing the model's efficacy in the early stages of research.It also plays a vital role in model monitoring, ensuring that the model continues to progress towards its intended goals while preventing unnecessary retraining.After the model completes training, it is essential to evaluate its usability and effectiveness in real-world applications.To assess how well the model performs on new data, various evaluation metrics can be employed.In this work, the F1 score and the confusion matrix are used as the primary evaluation metrics.

System Description
This section presents the federated learning system architecture, including a compact embedded computing device (i.e., The Jetson Nano from NVIDIA Corporate, Santa Clara, CA, USA [50]), a framework for federated learning, heterogeneous datasets, federated learning algorithms, and an optimization approach.We utilized the commonly used Linux operating system as the computational platform and integrated it with the Flower federated learning framework along with two Jetson Nano devices to establish a federated learning environment.Furthermore, this section will also describe the optimization methods used in this study.

Flower FL
Flower [51] is an open-source framework designed specifically for federated learning, aimed at addressing the challenges of machine learning in multi-node environments.The design of the Flower framework is both flexible and scalable, supporting a variety of mainstream machine learning frameworks, such as TensorFlow and PyTorch [52].This enables developers to experiment with and deploy federated learning in diverse hardware environments and software platforms.Due to its open-source nature, Flower facilitates collaboration between academia and industry, thereby accelerating the innovation and application of federated learning technologies.
Especially in embedded systems, mobile devices, or edge computing environments [45], Flower demonstrates its unique advantages.In scenarios like the one presented in this paper, where data volume can be massive and dispersed, Flower effectively coordinates the computational resources of these devices, facilitating efficient model training and updates across different nodes.

Data Heterogeneity
In this study, we confront the challenge of statistical heterogeneity.Specifically, this heterogeneity refers to the fact that the data held by different devices is not independently and identically distributed, and there is an imbalance in the data.Due to the isolation of patient data from different hospitals, the data sources used on the two embedded boards are completely different.In this study, the data we collected originates from various sources of arrhythmia data, as detailed in Section 3.1, and the data preprocessing procedures are outlined in Section 3.2.Under a normal scenario, the number of instances representing normal heartbeats significantly outweighs those representing abnormal heartbeats.We categorized the classes into three categories: Normal beat (N), Atrial premature contraction (A), and Premature ventricular contraction (V).In the MIT-BIH database, the ratio between each class is 5.28:1:1.1, while in the St database, the ratio is 5.45:1:1.15.Table 3 depicts the proportion distribution of N, A, and V data.In traditional federated learning methods such as federated averaging (FedAvg) [23], while they demonstrate effectiveness in distributed data processing, their performance is often limited when dealing with data heterogeneity.To address these limitations of the FedAvg algorithm, Ref. [22] introduced improvements and proposed the federated proximal (FedProx) algorithm, which aims to solve system heterogeneity while providing theoretical guarantees.
The FedProx algorithm is an enhanced version of FedAvg, with a key innovation being the introduction of a proximal term during the local update process.The introduction of this regularization term is primarily aimed at mitigating model bias arising from data heterogeneity and plays a crucial role in reconciling differences in model updates across different devices.Through this approach, FedProx not only enhances the stability of the model in data-heterogeneous environments but also accelerates convergence, effectively reducing the adverse effects of data heterogeneity.The local model update formulas of FedProx are described as follows: where min w h k w; w t means γ t k -intexact solution and γ is a variable for different devices and at different iterations.F k (w) means the local objective function for device k, µ represents the regularization parameter for the proximal term, controlling the extent of the proximal term's impact. 1  2 w − w t 2 means the proximal term itself, which is half the squared norm of the difference between the current model parameters w and the model parameters w t after the last global update.The purpose of this term is to prevent the model parameters updated locally from deviating too far from the global model parameters w t .
In this system, each participating node (such as Jetson Nano) performs model training locally and then uploads the model updates to the central server.After collecting all the model update data from the nodes, the FedProx algorithm is applied to construct a more accurate and updated global model on the server.This design not only improves the overall model accuracy but also ensures the privacy and security of user data, as the data does not need to leave the local device to complete the training process.ters  .

Model Optimization
In this system, each participating node (such as Jetson Nano) performs model training locally and then uploads the model updates to the central server.After collecting all the model update data from the nodes, the FedProx algorithm is applied to construct a more accurate and updated global model on the server.This design not only improves the overall model accuracy but also ensures the privacy and security of user data, as the data does not need to leave the local device to complete the training process.

•
Step 1: Global Model Download • Step 1: Global Model Download In this work, we employed a deep learning model trained on the MIT-BIH database with an impressive accuracy of up to 99% on the PC platform.This CNN model was initially trained on the MIT-BIH database and subsequently tested on an embedded system within the context of federated learning.The CNN architecture of the model is depicted in the accompanying Figure 5 and is categorized into three classes.Note that the numbers 300/150/75/38/3 represent the input feature size for each layer, the numbers 1/4/16/32/64 represent the filter size, and the conceptual widths with grey and cadet grey are related to the size of individual layers.This phase involves the download of the current global model from the central server, which is implemented using the Flower framework (Section 4.1).This marks the commencement of the federated learning process, involving clients downloading the global model from the central server.In this work, we employed a deep learning model trained on the MIT-BIH database with an impressive accuracy of up to 99% on the PC platform.This CNN model was initially trained on the MIT-BIH database and subsequently tested on an embedded system within the context of federated learning.The CNN architecture of the model is depicted in the accompanying Figure 5 and is categorized into three classes.Note that the numbers 300/150/75/38/3 represent the input feature size for each layer, the numbers 1/4/16/32/64 represent the filter size, and the conceptual widths with grey and cadet grey are related to the size of individual layers.This phase involves the download of the current global model from the central server, which is implemented using the Flower framework (Section 4.1).This marks the commencement of the federated learning process, involving clients downloading the global model from the central server.

2: Local Training
In this stage, each client locally trains the downloaded global model on its local data to update model parameters.To address system failures, computational resource constraints, and external disturbances, we save model checkpoints every two training cycles, facilitating rapid recovery in case of interruptions and thereby minimizing time and resource waste.Additionally, we incorporate the use of early stopping (Section 3.5) to prevent overfitting.Referring to Figure 6, Client 1 focuses on enhancing local training by freezing the first two convolutional layers, which adopts a strategy of freezing the first two convolutional layers of the model (Section 3.4).The primary objective of this approach is to maintain accuracy in recognizing existing classes while strengthening the learning capacity of the remaining layers for new tasks.Freezing the first two layers reduces the demand for computational resources, which is particularly important for devices with limited computing capabilities, such as embedded systems.Moreover, it aids in rapid adaptation to new datasets, as this portion of the model has stabilized during previous training and performs well on diverse datasets.
on actual performance and requirements, reducing the risk of overfitting while maintaining high accuracy.
In summary, the application of the above two steps in the local training phase contributes to enhancing the model's generalization ability when dealing with data from different sources.It also maintains efficiency and stability in embedded systems and federated learning environments.

•
Step 3: Uploading a Local Model Update Upon completing local training, clients upload their locally trained model updates to the central server.This process ensures that all clients participate in the overall model update and optimization, promoting the efficiency and effectiveness of the collective learning process.

•
Step 4: Model Aggregation After receiving model updates from all clients, the server aggregates the models using the FedProx algorithm (Section 4.2.1).In this step, updates from each client are combined to form a new global model.This iterative process is repeated to create a more refined and efficient global model.This stage is at the core of federated learning, allowing different clients to collaborate while preserving the privacy of their respective data.
These four steps collectively constitute a complete federated learning process, from global model download to local training, model update upload, and aggregation, ultimately resulting in an efficient, stable, and highly generalized deep learning model.

Experimental Results
This section aims to compare and evaluate the deep learning model optimization techniques applied in this study for the heartbeat classification task.After multiple rounds of experimental data, this research identifies the most suitable optimization methods for handling data heterogeneity.In addition to presenting the specific results of each experiment, this section will delve into the performance and characteristics of the model as a whole.

Experimental Environment
To construct the federated learning environment, we combined a local PC and two ReComputer Jetson Nano J1010 devices from NVIDIA Corporate, Santa Clara, CA, USA.The local PC is used to create a virtual machine (VM) for controlling and coordinating the For Client 2, it employs L2 regularization to prune internal nodes within fully connected layers [42], where the choice is made to implement pruning techniques (Section 3.3) rather than Sparse Learning, based on several considerations.Firstly, pruning, as a posttraining model optimization technique, allows for more precise model adjustments after training.By removing weights or neurons with minimal contribution to predictions, pruning reduces model complexity and computational burden, which is critical for devices with limited computational capabilities, such as embedded devices.Additionally, compared to sparse learning, pruning provides greater flexibility and adaptability.Sparse learning fixes the model structure during training and may be constrained when handling vastly different datasets.In contrast, pruning allows for fine-tuning after training based on actual performance and requirements, reducing the risk of overfitting while maintaining high accuracy.
In summary, the application of the above two steps in the local training phase contributes to enhancing the model's generalization ability when dealing with data from different sources.It also maintains efficiency and stability in embedded systems and federated learning environments.

•
Step 3: Uploading a Local Model Update Upon completing local training, clients upload their locally trained model updates to the central server.This process ensures that all clients participate in the overall model update and optimization, promoting the efficiency and effectiveness of the collective learning process.

•
Step 4: Model Aggregation After receiving model updates from all clients, the server aggregates the models using the FedProx algorithm (Section 4.2.1).In this step, updates from each client are combined to form a new global model.This iterative process is repeated to create a more refined and efficient global model.This stage is at the core of federated learning, allowing different clients to collaborate while preserving the privacy of their respective data.
These four steps collectively constitute a complete federated learning process, from global model download to local training, model update upload, and aggregation, ultimately resulting in an efficient, stable, and highly generalized deep learning model.

Experimental Results
This section aims to compare and evaluate the deep learning model optimization techniques applied in this study for the heartbeat classification task.After multiple rounds of experimental data, this research identifies the most suitable optimization methods for handling data heterogeneity.In addition to presenting the specific results of each experiment, this section will delve into the performance and characteristics of the model as a whole.

Experimental Environment
To construct the federated learning environment, we combined a local PC and two ReComputer Jetson Nano J1010 devices from NVIDIA Corporate, Santa Clara, CA, USA.The local PC is used to create a virtual machine (VM) for controlling and coordinating the entire system's operation.The hardware configuration includes an Intel(R) Core (TM) i9-10900KF CPU @ 3.70GHz, 128GB RAM, and a Nvidia RTX 3080 graphics card.The embedded device, the ReComputer Jetson Nano J1010 device, is equipped with a quad-core ARM ® Cortex ® -A57 MPCore processor designed for edge computing to support efficient data processing and machine learning tasks at the device's edge.Due to the requirements of the Flower development environment, we configured a PyTorch software environment compatible with Python 3.8 on this device.Note that, due to the support limitations of Nvidia JetPack 4.6.1,Python versions above 3.6 are not supported for GPU acceleration.Therefore, in our experimental setup, although the Jetson Nano device has GPU computing capabilities, we could only utilize the CPU for computations in this environment.
Figure 6 shows the federated learning architecture employed in this experiment, which includes a central server and two clients.Communication between each client and the server is facilitated through gRPC [54], which is a high-performance, open-source, and general-purpose RPC framework led by Google, allowing for remote procedure calls.The following are the steps in the operation process: (1) Server: On the server side, we have deployed the FedProx algorithm, which is a federated learning algorithm designed to handle heterogeneous data distributions from different clients.The primary responsibility of the server is to coordinate the entire learning process, including receiving model updates from clients, aggregating them, and distributing the updated global model back to the clients.(3) Model Update and Aggregation: As the server receives updates and performs aggregation, the global model gradually evolves.The aggregated model is then redistributed to all clients, which subsequently commence the next round of local training using the new parameters.This iterative learning cycle enhances the model's generalization capabilities and enables it to better handle data from different sources.
To evaluate the system performance, a baseline algorithm (i.e., the FedAvg) and the proposed FedProx algorithm are examined with the following model optimization strategies for Clients 1 and 2:

Performance Evaluation
This subsection compares and contrasts the FedAvg and FedProx algorithms, considering the five above-mentioned model optimization strategies.

FedAvg/FedProx with Strategy 1
The confusion matrices presented in Figure 7  The confusion matrices presented in Figure 7 reflect the classification results obtained by applying the FedAvg and FedProx algorithms with initial configurations to two different datasets.Based on the experimental data in this study, we examine the F1 score and confusion matrix for a comprehensive performance evaluation.The F1 score reveals that the classification results are superior when employing the FedProx algorithm compared to FedAvg.Such comparative results indicate the superiority of FedProx over FedAvg in model performance when handling heterogeneous datasets.

FedAvg/FedProx with Strategy 2
To enhance the stability of the model on the MIT-BIH database, we introduced the freeze layer technique.To ensure controlled variables in the experiments, we retained the original configuration of the model on the ST database.As depicted in Figure 8, the experimental results indicate that for the application of freeze layers in the MIT-BIH database, the FedProx algorithm demonstrates excellent performance with an F1 score of 97.31%, compared to that of the FedAvg with an F1 score of 79.76%.In the ST database without the use of the freeze layer technique, category A was not accurately classified with the FedProx algorithm (i.e., yet an overall F1 score of 62.15% was still obtained).In contrast, comparing the classification results of the FedAvg with Strategy 1 (Figure 7), the FedAvg

FedAvg/FedProx with Strategy 2
To enhance the stability of the model on the MIT-BIH database, we introduced the freeze layer technique.To ensure controlled variables in the experiments, we retained the original configuration of the model on the ST database.As depicted in Figure 8, the experimental results indicate that for the application of freeze layers in the MIT-BIH database, the FedProx algorithm demonstrates excellent performance with an F1 score of 97.31%, compared to that of the FedAvg with an F1 score of 79.76%.In the ST database without the use of the freeze layer technique, category A was not accurately classified with the FedProx algorithm (i.e., yet an overall F1 score of 62.15% was still obtained).In contrast, comparing the classification results of the FedAvg with Strategy 1 (Figure 7), the FedAvg algorithm with Strategy 2 achieves significant performance improvements of 40.37% and 9.46% in the MIT-BIH and ST databases, respectively.

FedAvg/FedProx with Strategy 3
In Figure 9, we applied freezing to two layers (conv1 and conv2) of the model on both clients and evaluated the impact of this operation on the model's performance.While theoretically, freezing the initial layers might contribute to maintaining the stability of feature extraction, experimental results of both the FedAvg and FedProx algorithms reveal that the models failed to accurately extract features distinguishing different categories, thereby affecting their classification accuracy.In specific federated learning contexts, we hypothesize that freezing the initial layers may be disadvantageous for the model to capture sufficient discriminative power to handle more fine-grained classification tasks.In order to enhance the adaptability and gener-

FedAvg/FedProx with Strategy 3
In Figure 9, we applied freezing to two layers (conv1 and conv2) of the model on both clients and evaluated the impact of this operation on the model's performance.While theoretically, freezing the initial layers might contribute to maintaining the stability of feature extraction, experimental results of both the FedAvg and FedProx algorithms reveal that the models failed to accurately extract features distinguishing different categories, thereby affecting their classification accuracy.In Figure 9, we applied freezing to two layers (conv1 and conv2) of the model on both clients and evaluated the impact of this operation on the model's performance.While theoretically, freezing the initial layers might contribute to maintaining the stability of feature extraction, experimental results of both the FedAvg and FedProx algorithms reveal that the models failed to accurately extract features distinguishing different categories, thereby affecting their classification accuracy.In specific federated learning contexts, we hypothesize that freezing the initial layers may be disadvantageous for the model to capture sufficient discriminative power to handle more fine-grained classification tasks.In order to enhance the adaptability and gener-  In specific federated learning contexts, we hypothesize that freezing the initial layers may be disadvantageous for the model to capture sufficient discriminative power to handle more fine-grained classification tasks.In order to enhance the adaptability and generalization capabilities of the model across different datasets, we introduced the open-source tool DessiLB for implementing unstructured pruning in this study.Figure 10 presents the corresponding confusion matrix, following the approach outlined in [38] with tests conducted at three different pruning percentages (i.e., 10% (Figure 10a), 20% (Figure 10b), and 80% (Figure 10c) pruning percentages).For the FedProx algorithm, experimental results indicate that, across various pruning percentages, 10% pruning (95.58% and 63.47%) achieves the most competitive performance, compared to the results in Figure 8 (97.31% and 62.15%).However, even with a 10% pruning percentage, the pruning strategy still falls short of accurately classifying category A. Despite the simplicity and flexibility inherent in unstructured pruning and its ability to rapidly compress models in certain contexts, this pruning strategy did not significantly improve the model's classification performance in this experiment.
Nonetheless, for the FedAvg algorithm, Strategy 4 with 20% and 80% pruning percentages achieves better classification performance, respectively, with (88.75% and 72.75%) and (71.13% and 86.56%), compared to the results of the FedProx algorithm respectively with (90.40% and 51.94%) and (79.23% and 47.69%), which implies that compared with those of the FedAvg with Strategy 1 (Figure 7) and the FedProx, implementing optimization Strategy 4 (i.e., unstructured pruning and layer freezing) may achieve effective balance between model complexity and classification accuracy of the FedAvg algorithm.For the FedProx algorithm, experimental results indicate that, across various pruning percentages, 10% pruning (95.58% and 63.47%) achieves the most competitive performance, compared to the results in Figure 8 (97.31% and 62.15%).However, even with a 10% pruning percentage, the pruning strategy still falls short of accurately classifying category A. Despite the simplicity and flexibility inherent in unstructured pruning and its ability to rapidly compress models in certain contexts, this pruning strategy did not significantly improve the model's classification performance in this experiment.
Nonetheless, for the FedAvg algorithm, Strategy 4 with 20% and 80% pruning percentages achieves better classification performance, respectively, with (88.75% and 72.75%) and (71.13% and 86.56%), compared to the results of the FedProx algorithm respectively with (90.40% and 51.94%) and (79.23% and 47.69%), which implies that compared with those of the FedAvg with Strategy 1 (Figure 7) and the FedProx, implementing optimization Strategy 4 (i.e., unstructured pruning and layer freezing) may achieve effective balance between model complexity and classification accuracy of the FedAvg algorithm.

FedAvg/FedProx with Strategy 5
To further enhance the model's performance, we subsequently modified the opensource code DessiLB to implement a structured pruning strategy, conducting experiments with multiple pruning percentages (i.e., 10% (Figure 11a), 20% (Figure 11b), 40% (Figure 11c), and 80% (Figure 11d) pruning percentages).Based on the experimental results in Figure 11, we observed that the FedAvg with structured pruning has performance deterioration compared to the classification performance of the FedAvg with unstructured pruning.To further enhance the model's performance, we subsequently modified the opensource code DessiLB to implement a structured pruning strategy, conducting experiments with multiple pruning percentages (i.e., 10% (Figure 11a), 20% (Figure 11b), 40% (Figure 11c), and 80% (Figure 11d) pruning percentages).Based on the experimental results in Figure 11, we observed that the FedAvg with structured pruning has performance deterioration compared to the classification performance of the FedAvg with unstructured pruning.
On the other hand, at a pruning rate of 10%, the FedProx with structured pruning achieved the best F1 scores, reaching 96.01%and 77.81% (Figure 11a), respectively, which is superior to those of the FedProx with unstructured pruning, reaching 95.58% and 63.47% (Figure 10a), respectively.However, with an increasing pruning percentage, the F1 scores exhibited a decreasing trend, reaching a minimum at the 40% pruning rate, followed by a subsequent rising trend.This phenomenon may be attributed to the substantial pruning of nodes, leading the model to undergo a near-retraining process, thereby highlighting the impact of structured pruning on model performance within specific contexts.On the other hand, at a pruning rate of 10%, the FedProx with structured pruning achieved the best F1 scores, reaching 96.01%and 77.81% (Figure 11a), respectively, which is superior to those of the FedProx with unstructured pruning, reaching 95.58% and 63.47% (Figure 10a), respectively.However, with an increasing pruning percentage, the F1 scores exhibited a decreasing trend, reaching a minimum at the 40% pruning rate, followed by a subsequent rising trend.This phenomenon may be attributed to the substantial pruning of nodes, leading the model to undergo a near-retraining process, thereby highlighting the impact of structured pruning on model performance within specific contexts.
To assess the training efficiency, Figure 12 depicts the F1 score with respect to the number of epochs using the FedProx algorithm with Strategy 5 at a pruning rate of 10% and an early stopping mechanism.Note that in this typical run, with the pruning operation, the model size and parameters are reduced by removing connections, leading to improved generalization.Moreover, given that the training process consists of three rounds with 10 epochs at each round.Observe that Figure 12 provides an example where the training process with the proposed approach stops 12 epochs earlier than that without early stopping (which stops with a 30 epoch delay To assess the training efficiency, Figure 12 depicts the F1 score with respect to number of epochs using the FedProx algorithm with Strategy 5 at a pruning rate of 1 and an early stopping mechanism.Note that in this typical run, with the pruning op tion, the model size and parameters are reduced by removing connections, leading to proved generalization.Moreover, given that the training process consists of three rou with 10 epochs at each round.Observe that Figure 12 provides an example where training process with the proposed approach stops 12 epochs earlier than that with early stopping (which stops with a 30 epoch delay).Accordingly, the training efficienc Fl has improved.The series of experimental results underscores the sensitivity of st tured pruning to model performance at different pruning levels, providing valuable sights for further exploration of optimized pruning strategies.
Figure 12.The F1 score with respect to the number of epochs on the ST dataset using the FedP algorithm at a pruning rate of 10%.

Comparative Analysis
As mentioned in [22], while FedAvg has demonstrated empirical success in het geneous settings, it does not fully address the underlying challenges when learning o data from non-IID data distributions (i.e., statistical heterogeneity).Accordingly, to ta heterogeneity in federated networks with the FedAvg algorithm, this work applies layer freezing technique and the unstructured pruning method to effectively strike right balance between model complexity and classification performance, compared w the performance of the FedAvg with the optimization strategies proposed in Section 5 For the FedProx algorithm, this series of research results strongly demonstrates significant advantages of structured pruning in improving the overall performance of FedProx model, particularly in enhancing the model's capability to recognize specific egories.By selectively removing entire channels or filters, structured pruning system cally reduces the complexity of the model, showcasing better adaptability to heteroge ous datasets while effectively improving computational efficiency.This holds particu significance for resource-constrained application environments.Therefore, in this stu structured pruning technology is identified as a superior model optimization method summary, structured pruning successfully enhances the model's performance on het geneous datasets, confirming its feasibility in maintaining model accuracy and open new possibilities for resource-efficient optimization.

Comparative Analysis
As mentioned in [22], while FedAvg has demonstrated empirical success in heterogeneous settings, it does not fully address the underlying challenges when learning over data from non-IID data distributions (i.e., statistical heterogeneity).Accordingly, to tackle heterogeneity in federated networks with the FedAvg algorithm, this work applies the layer freezing technique and the unstructured pruning method to effectively strike the right balance between model complexity and classification performance, compared with the performance of the FedAvg with the optimization strategies proposed in Section 5.1.
For the FedProx algorithm, this series of research results strongly demonstrates the significant advantages of structured pruning in improving the overall performance of the FedProx model, particularly in enhancing the model's capability to recognize specific categories.By selectively removing entire channels or filters, structured pruning systematically reduces the complexity of the model, showcasing better adaptability to heterogeneous datasets while effectively improving computational efficiency.This holds particular significance for resource-constrained application environments.Therefore, in this study, structured pruning technology is identified as a superior model optimization method.In summary, structured pruning successfully enhances the model's performance on heterogeneous datasets, confirming its feasibility in maintaining model accuracy and opening new possibilities for resource-efficient optimization.
By combining the FedProx algorithm, layer freezing technique, and structured pruning method, this study successfully demonstrates the practical effectiveness of these methods in optimizing deep learning models in a federated learning environment.Importantly, federated learning aims to enhance the overall network performance rather than focusing solely on the accuracy of individual nodes.This discovery points to new research directions and methodological pathways for future exploration and application in the field of federated learning.Table 4 summarizes the classification performance of the FedAvg and FedProx algorithms with optimized operations.To further assess the robustness of the pruned models, here we explore system performance with respect to imbalanced class distribution by increasing the distribution variation in the datasets (i.e., changing the ratio among each class 5.28:1:1.1 (the MIT-BIH database) and 5.45:1:1.15(the St database) in Table 3 to the ratio 4.5:1:1.1 and 7.5:1:1.01,as shown in Table 5).Referring to the experimental results with a less imbalanced class distribution (e.g., Table 3), the FedProx with structured pruning at a pruning rate of 10% achieves the best F1 scores, reaching 96.01%and 77.81% (Figure 11a), respectively.In contrast, Figure 13 depicts that with a more imbalanced class distribution (e.g., Table 5), at a pruning rate of 20%, the FedProx with structured pruning achieved the best F1 scores, reaching 98.46% and 64.14%, respectively.Thus, considering the scenario of an imbalanced class distribution, the results suggest that we may adaptively adjust the pruning ratio to suppress the degradation of pruned model accuracy.Table 6 presents a comparison of model accuracy for MIT-BIH and ST with the FedProx given an imbalanced class distribution.

Conclusions
This work employs the Flower federated learning framework and Jetson Nano devices to deeply explore and optimize federated learning for heterogeneous data at the edge.It improves the FedProx algorithm to effectively address non-IID data distribution challenges and enhances training efficiency through layer freezing and data pruning tech-

Conclusions
This work employs the Flower federated learning framework and Jetson Nano devices to deeply explore and optimize federated learning for heterogeneous data at the edge.It improves the FedProx algorithm to effectively address non-IID data distribution challenges and enhances training efficiency through layer freezing and data pruning techniques.The research demonstrated the viability of federated learning across various datasets, offering a new solution for privacy protection in sensitive areas like healthcare.By parallel processing across multiple nodes, the study optimized medical data distributed across different healthcare institutions and devices, devising strategies for resource-constrained devices like the Nvidia Jetson Nano to boost the practicality of federated learning in edge computing environments.This study establishes a solid foundation for the application of federated learning technology in healthcare and other data-sensitive domains, which provides crucial technical support for the development of big data and artificial intelligence technologies in the future, allowing more people to benefit from intelligent healthcare systems.These advancements not only drive technological innovation but also offer new possibilities for improving the quality of global healthcare.
Based on the system architecture and experimental results of the proposed framework, the future directions of research include (1) introductions of classic datasets (e.g., MNIST, Cifar10/100, and Tiny-ImageNet) and system heterogeneity (e.g., considering the systems characteristics on heterogeneous devices in the network), weight adjustments or the utilization of more advanced methods for handling class imbalance, aiming to enhance the model's performance on rare classes; (2) data security assessment and model applicability (e.g., introducing more advanced encryption techniques and privacy protection mechanisms to further safeguard the data of participating nodes); (3) balancing model complexity and performance (e.g., improving computational efficiency while maintaining model performance with limited network resources).Through the comprehensive application of these approaches, federated learning models will become more suitable for edge computing environments, making a greater contribution to future healthcare systems.

Figure 1 .
Figure 1.The comparison of (a) horizontal and (b) vertical federated learning (modified and rep duced from [1]).

Figure 1 .
Figure 1.The comparison of (a) horizontal and (b) vertical federated learning (modified and reproduced from [1]).

Figure 4
Figure 4 illustrates a workflow diagram for federated learning, providing a detailed depiction of the complete process, from global model download to local training, and then from local training to ultimate model aggregation.The specific steps are as follows:

Figure 4
Figure 4 illustrates a workflow diagram for federated learning, providing a detailed depiction of the complete process, from global model download to local training, and then from local training to ultimate model aggregation.The specific steps are as follows:

Figure 4 .
Figure 4. System architecture of federated learning in experiments.

Figure 4 .
Figure 4. System architecture of federated learning in experiments.

Future
Internet 2024, 16, x FOR PEER REVIEW 12 of 24

Figure 5 .
Figure 5. CNN network architecture.• Step 2: Local Training In this stage, each client locally trains the downloaded global model on its local data to update model parameters.To address system failures, computational resource constraints, and external disturbances, we save model checkpoints every two training cycles,

( 2 )
Client 1 and Client 2: Each client (such as Client 1 and Client 2 in Figure 6) has its own dataset for local model training.Clients utilize their hardware to perform local computations.Once a client completes local model training, it sends model updates back to the server via gRPC.

24 5. 2 . 1 .
reflect the classification results obtained by applying the FedAvg and FedProx algorithms with initial configurations to two different datasets.Based on the experimental data in this study, we examine the F1 score and confusion matrix for a comprehensive performance evaluation.The F1 score reveals that the classification results are superior when employing the FedProx algorithm compared to FedAvg.Such comparative results indicate the superiority of FedProx over FedAvg in model performance when handling heterogeneous datasets.Future Internet 2024, 16, x FOR PEER REVIEW 15 of FedAvg/FedProx with Strategy 1

Figure 7 .
Figure 7. Confusion matrix for comparison between FedAvg and FedProx algorithms.

Figure 7 .
Figure 7. Confusion matrix for comparison between FedAvg and FedProx algorithms.

Future 24 Figure 8 .
Figure 8.The confusion matrix is frozen in the MIT-BIH database only.

Figure 9 .
Figure 9. Confusion matrix with both frozen in the MIT-BIH and St databases.

Figure 8 .
Figure 8.The confusion matrix is frozen in the MIT-BIH database only.

Future 24 Figure 8 .
Figure 8.The confusion matrix is frozen in the MIT-BIH database only.

Figure 9 .
Figure 9. Confusion matrix with both frozen in the MIT-BIH and St databases.

Figure 9 .
Figure 9. Confusion matrix with both frozen in the MIT-BIH and St databases.

Figure 12 .
Figure12.The F1 score with respect to the number of epochs on the ST dataset using the FedProx algorithm at a pruning rate of 10%.

Table 1 .
The comparison of different sensors used in FL.
[39]g et al.[39]Raspberry Pi Introduces a method called "PruneFL", which reduces model complexity through pruning techniques, enabling its efficient execution on edge devices.

Table 2 .
The comparison of experimental methods and data formats in the literature.

Table 3 .
The proportion distribution of N, A, and V data.
). Accordingly, the training efficiency of Fl has improved.The series of experimental results underscores the sensitivity of structured pruning to model performance at different pruning levels, providing valuable insights for further exploration of optimized pruning strategies.

Table 4 .
Comparison of model optimization for MIT-BIH and ST databases.

Table 5 .
The proportion distribution of N, A, and V data with an imbalanced dataset.

Table 6 .
Comparison of model optimization for MIT-BIH and ST with an imbalanced dataset.

Table 6 .
Comparison of model optimization for MIT-BIH and ST with an imbalanced dataset.