Arrhythmia diagnosis system based on deep federal active learning

By collaboratively training arrhythmia diagnosis model on multiple IoT client devices and using lightweight convolutional neural networks for ECG feature extraction, the problem of inaccurate extraction of key features of ECG signals in traditional methods is solved, and more efficient arrhythmia diagnosis and user privacy protection are achieved.

CN119601220APending Publication Date: 2025-03-11ZHENGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411752908.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

Traditional arrhythmia diagnosis methods rely on manual extraction of features or the use of simpler signal processing algorithms, resulting in inaccuracy in extracting key features in ECG signals.

Method used

A heart rhythm disorder diagnosis system based on deep federated active learning is adopted, including data collection module, data preprocessing module, federated learning module and diagnostic module. The system uses lightweight convolutional neural network to perform ECG feature extraction by collaboratively training arrhythmia diagnostic model on multiple IoT client devices, and constructs a two-dimensional tensor as model input by combining heartbeat and RR interval vectors.

Benefits of technology

It improves the accuracy of key feature extraction in ECG signals, enhances the accuracy and efficiency of arrhythmia diagnosis, and effectively protects user privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119601220A_ABST
    Figure CN119601220A_ABST
Patent Text Reader

Abstract

The invention relates to the field of medical diagnosis, and particularly discloses an arrhythmia diagnosis system based on deep federal active learning, comprising: a data collection module for collecting electrocardiogram (ECG) data from a plurality of Internet of Things client devices, the Internet of Things client devices including but not limited to a wearable device and a mobile health monitoring application; the data preprocessing module is used for preprocessing the collected electrocardiogram data, including signal denoising, filtering and feature extraction; the lightweight convolutional neural network is adopted as an ECG feature extraction model, the two-dimensional tensor is constructed by combining heartbeat and RR interval vectors to serve as input, the system can more accurately extract key features in ECG signals, accordingly, the accuracy of arrhythmia diagnosis is improved, the problem of label distribution offset is effectively solved through the design of the limited softmax classifier, and the accuracy of arrhythmia diagnosis is improved. And the stability and the accuracy of the model between different clients are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical diagnosis, and specifically is an arrhythmia diagnosis system based on deep federated active learning. Background Art

[0002] Electrocardiogram is the gold standard for diagnosing arrhythmias. Arrhythmias can be accurately diagnosed through electrocardiogram. Electrocardiogram signals contain rich information, such as heart rate, heart rhythm, P wave, QRS wave and T wave, which are crucial for the diagnosis of arrhythmias.

[0003] Federated learning is a new type of distributed machine learning technology that allows multiple data holders to train models locally and send model parameters to a central server for aggregation, thereby jointly training a global model without sharing the original data. Federated learning solves the problems of data silos and data privacy protection, and is particularly suitable for sensitive data scenarios such as the medical field.

[0004] Traditional arrhythmia diagnosis methods rely on manual feature extraction or use relatively simple signal processing algorithms, which are inaccurate in extracting key features in ECG signals. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides an arrhythmia diagnosis system based on deep federated active learning to solve the problem that traditional arrhythmia diagnosis methods in the prior art rely on manual feature extraction or use relatively simple signal processing algorithms, which have inaccuracy in extracting key features from ECG signals.

[0006] A cardiac arrhythmia diagnosis system based on deep federated active learning, comprising:

[0007] a data collection module for collecting electrocardiogram (ECG) data from a plurality of IoT client devices, including but not limited to wearable devices and mobile health monitoring applications;

[0008] The data preprocessing module is used to preprocess the collected ECG data, including signal denoising, filtering and feature extraction;

[0009] A federated learning module for collaboratively training arrhythmia diagnosis models on multiple IoT client devices;

[0010] The diagnosis module is used to diagnose new electrocardiogram data using the trained arrhythmia diagnosis model and output the diagnosis results.

[0011] Preferably, the data preprocessing module further comprises a signal denoising step, using Butterworth bandpass filtering to remove noise and interference in the electrocardiogram signal.

[0012] Preferably, the feature extraction comprises processing the ECG signal into a two-dimensional tensor combining heart beat and RR interval vectors.

[0013] Preferably, during the feature extraction process, the model input consists of three parts: a heartbeat vector, a pre-RR ratio vector and a near-pre-RR ratio vector. Each heartbeat segment starts 0.14 seconds after the previous R peak and ends 0.28 seconds after the current R peak. The pre-RR ratio is the ratio of the RR time interval before the current heartbeat to the average of all previous RR time intervals, and the near-pre-RR ratio is the ratio of the current RR time interval to the average of the most recent 10 RR time intervals.

[0014] Preferably, the federated learning module specifically includes:

[0015] The central server initialization submodule is used to train an initial arrhythmia diagnosis model on the central server using a public electrocardiogram dataset and distribute the model to various IoT client devices;

[0016] The client local training submodule is used to train the local ECG data on each IoT client device using the distributed lightweight arrhythmia diagnosis model. The training process adopts personalized aggregation strategy, restricted softmax classification function and active learning strategy.

[0017] The central server-side personalized aggregation submodule is used to aggregate the base layer parameters received from each IoT client device, generate updated base layer parameters, and send the updated base layer parameters back to each IoT client device.

[0018] Preferably, the personalized aggregation strategy includes defining a base layer and a personalized layer, wherein the parameters of the base layer are sent to a central server for aggregation and global sharing during each round of communication, while the personalized layer is only trained locally; a restricted softmax classification function is used to limit the update of the classifier layer weights of classes not observed by the client to deal with the label distribution offset problem; an active learning strategy is used to select unlabeled samples with the largest amount of information for labeling during the local training process of the client to reduce the cost of manual labeling and increase the model convergence speed.

[0019] Preferably, the active learning strategy adopts the BvSB query strategy to select information-rich unlabeled samples. The smaller the value of BvSB, the more difficult it is for the current model to determine which category the sample belongs to, and thus indicates that the sample contains more information.

[0020] Preferably, the lightweight arrhythmia diagnosis model is a deep learning model with convolutional neural network (CNN) as its core, which has lower parameters and computational complexity and supports deployment in most resource-constrained IoT edge devices.

[0021] Compared with the prior art, the present invention has the following beneficial effects:

[0022] By using a lightweight convolutional neural network as the ECG feature extraction model and combining the heartbeat and RR interval vectors to construct a two-dimensional tensor as input, the system can more accurately extract key features from ECG signals, thereby improving the accuracy of arrhythmia diagnosis. The design of the restricted softmax classifier effectively solves the label distribution offset problem, which improves the stability and accuracy of the model between different clients.

[0023] The design of the federated learning module enables the system to collaboratively train arrhythmia diagnosis models on multiple IoT client devices without centralizing all data in a single location, thereby effectively protecting user privacy. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a system schematic diagram of the present invention;

[0025] Figure 2 is the number of preprocessed samples in the three databases;

[0026] Figure 3 are the pre-treated samples of DS1 and DS2;

[0027] Figure 4 The experimental results are for server DS1 and client DS2;

[0028] Figure 5 The experimental results are Mit-bih on the server side and incartdb on the client side;

[0029] Figure 6 The experimental results of server-side mith-bih and client-side SVDB are shown below;

[0030] Figure 7 For comparison with other methods on Ds2;

[0031] Figure 8 Deployment process of the client-side personalized model on the Raspberry Pi;

[0032] Fig. 9 are the parameters and flops of the model;

[0033] Fig.10 For ablation experiments based on different key modules;

[0034] Fig.11 The overall accuracy of each client based on DS2;

[0035] Fig.12 Accuracy and loss changes before and after using active learning during training for client 17;

[0036] Fig.13 This is the visualization effect of the fully connected layer features of client 15. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] like Figure 1 As shown:

[0039] Embodiment 1: The present invention provides an arrhythmia diagnosis system based on deep federated active learning, comprising:

[0040] a data collection module for collecting electrocardiogram (ECG) data from a plurality of IoT client devices, including but not limited to wearable devices and mobile health monitoring applications;

[0041] The data preprocessing module is used to preprocess the collected ECG data, including signal denoising, filtering and feature extraction;

[0042] A federated learning module for collaboratively training arrhythmia diagnosis models on multiple IoT client devices;

[0043] A diagnosis module, used to diagnose new electrocardiogram data using a trained arrhythmia diagnosis model and output a diagnosis result;

[0044] Wherein, the present invention comprises the following parts:

[0045] A. System Architecture

[0046] The system includes a server, multiple clients, an ECG feature extraction model, a restricted softmax classifier, a personalized aggregation module, and an active learning module. The server is responsible for initializing the model and aggregating client model parameters; the client is responsible for local data collection, model training, and parameter upload.

[0047] B. ECG feature extraction model

[0048] A lightweight convolutional neural network is used as the ECG feature extraction model, and a two-dimensional tensor is constructed as the model input by combining the heartbeat and RR interval vectors to extract spatiotemporal features. The model structure includes convolutional layers, maximum pooling layers, batch normalization layers, ReLU activation layers, and fully connected layers.

[0049] C. Restricted Softmax Classifier

[0050] To address the label distribution shift problem, a constrained softmax classifier is designed. By introducing a scaling factor to limit the update of the classifier layer weights of classes that are not observed by the client, the adverse effects of label distribution changes on model aggregation are alleviated.

[0051] D. Personalized aggregation module

[0052] The neural network model is divided into a basic layer and a personalized layer. The basic layer is aggregated on the server to achieve global sharing; the personalized layer is locally trained on the client to retain the personalized information of specific patient data. By reducing the number of transmission parameters and protecting the weights of the personalized layer, the communication cost is further reduced and privacy protection is enhanced.

[0053] E. Active Learning Module

[0054] An active learning strategy is introduced to select unlabeled samples with the largest amount of information for labeling during the local training process on the client side, so as to reduce the cost of manual labeling and improve the convergence speed of the model. The BvSB query strategy is adopted to select samples with rich information for labeling and model update based on the uncertainty of the samples.

[0055] F. Training Process

[0056] The training process includes four stages: server initialization model, client local initial training, server personalized aggregation, and client local training. These four stages are repeated until the model performance reaches the expected level. During the client training process, the strategy of reducing communication rounds is adopted to reduce communication costs.

[0057] Among them, the server is responsible for initializing the model and aggregating client model parameters;

[0058] The client is responsible for local data collection, model training, and parameter uploading;

[0059] The client refers to each user's IoT device, which has a separate local processing module to coordinate all activities such as ECG data collection, storage, and analysis. Assume that there are N client non-IID ECG datasets, let is the dataset of the i-th client, where xj is the j-th input data sample and yj is the corresponding label. The size of the dataset on the i-th client is represented by mi. The size of the dataset for all clients is The training goal is to collaboratively train personalized arrhythmia diagnosis among multiple clients while ensuring the privacy of local data. Let θi represent the model parameters of client i, the goal of personalized federated learning in this algorithm can be expressed as:

[0060]

[0061]

[0062] Among them, Θ * ={θ i ,...,θ n} is a personalized parameter for all clients. i For the dataset D i The loss function of the associated i-th client. L CE It is the difference function between the predicted value and the true label of the evaluation sample (cross entropy loss). The ECG feature extraction model, restricted softmax, personalized aggregation, active learning and training process are described in detail;

[0063] The ECG feature extraction model uses a lightweight convolutional neural network to construct a two-dimensional tensor as model input by combining heartbeat and RR interval vectors;

[0064] The restricted softmax classifier is used to deal with the label distribution offset problem. The personalized aggregation module divides the neural network model into a basic layer and a personalized layer to achieve global sharing and retention of personalized information;

[0065] The active learning module selects the unlabeled samples with the most information for labeling during the local training process on the client side, so as to reduce the cost of manual labeling and improve the convergence speed of the model;

[0066] The training process includes four stages: server initialization model, client local initial training, server personalized aggregation, and client local training. In the server initialization model stage, the initial model is trained using the public ECG database, and the model parameters are sent to each client. In the client local initial training stage, the client optimizes the local model based on the local arrhythmia unlabeled ECG data and active learning strategy, and sends the base layer parameters to the server. In the server personalized aggregation stage, according to the following formula:

[0067] in, and N and m represent the basic layer parameters of the server and client respectively. i They represent the number of clients and the amount of data of the i-th client respectively;

[0068] It is able to aggregate the base layer parameters received from each client and send the aggregated base layer parameters back to the client. In the client local training phase, the base layer of the local model parameters is updated, and the local model is further trained based on local unlabeled samples and active learning. These four phases are repeated until the model performance reaches the expected level.

[0069] As can be seen from the above, the system architecture of the present invention includes a server, multiple clients, and multiple key modules, such as an ECG feature extraction model, a restricted softmax classifier, a personalized aggregation module, and an active learning module;

[0070] After data collection, the system first uses the data preprocessing module to perform signal denoising, filtering and feature extraction on ECG data. Subsequently, the federated learning module collaboratively trains the arrhythmia diagnosis model on multiple IoT client devices, eliminating the need to centralize all data in a single location, thereby protecting user privacy.

[0071] The ECG feature extraction model uses a lightweight convolutional neural network and combines the heartbeat and RR interval vectors to construct a two-dimensional tensor as input, which improves the accuracy and efficiency of feature extraction. The restricted softmax classifier is optimized for the label distribution offset problem to ensure the stability and accuracy of the model between different clients;

[0072] The personalized aggregation module divides the neural network model into a basic layer and a personalized layer. The basic layer is globally shared on the server, while the personalized layer is locally trained on the client, which not only realizes the sharing of global knowledge but also retains the personalized information of specific patient data. The active learning module selects the unlabeled samples with the largest amount of information for labeling during the client training process, which reduces the cost of manual labeling and improves the model convergence speed;

[0073] The entire training process includes four stages: server initialization model, client local initial training, server personalized aggregation, and client local training. These four stages are continuously iterated until the model performance reaches the expected level. This system not only improves the accuracy and efficiency of arrhythmia diagnosis, but also strengthens the privacy protection of user data, providing strong support for the early detection and treatment of arrhythmia.

[0074] Embodiment 2: This embodiment is basically the same as the previous embodiment, except that the data preprocessing module further includes a signal denoising step, which uses Butterworth bandpass filtering to remove noise and interference in the electrocardiogram signal.

[0075] Specifically, feature extraction involves processing the ECG signal into a two-dimensional tensor that combines heartbeat and RR interval vectors.

[0076] Specifically, in the feature extraction process, the model input consists of three parts: heartbeat vector, pre-RR ratio vector and near-pre-RR ratio vector. Each heartbeat segment starts 0.14 seconds after the previous R peak and ends 0.28 seconds after the current R peak. The pre-RR ratio is the ratio of the RR time interval before the current heartbeat to the average of all previous RR time intervals, and the near-pre-RR ratio is the ratio of the current RR time interval to the average of the most recent 10 RR time intervals.

[0077] As can be seen from the above, this embodiment adds a step of using Butterworth bandpass filtering to remove noise and interference from the electrocardiogram signal in the data preprocessing module, thereby improving the data quality. In terms of feature extraction, the system further refines the processing flow, and processes the ECG signal into a two-dimensional tensor combining the heartbeat and RR interval vectors. This tensor consists of three parts: the heartbeat vector, the pre-RR ratio vector, and the near-pre-RR ratio vector. Each heartbeat segment starts 0.14 seconds after the previous R peak and ends 0.28 seconds after the current R peak to ensure that the complete heartbeat cycle is captured. The introduction of the pre-RR ratio and the near-pre-RR ratio respectively reflects the ratio of the RR time interval before the current heartbeat to the previous average RR time interval, and the ratio of the current RR time interval to the average of the most recent 10 RR time intervals, providing the model with richer spatiotemporal feature information. These improvements together improve the accuracy and reliability of arrhythmia diagnosis.

[0078] Embodiment 3: This embodiment is basically the same as the previous embodiment, except that the federated learning module specifically includes:

[0079] The central server initialization submodule is used to train an initial arrhythmia diagnosis model on the central server using a public electrocardiogram dataset and distribute the model to various IoT client devices;

[0080] The client local training submodule is used to train the local ECG data on each IoT client device using the distributed lightweight arrhythmia diagnosis model. The training process adopts personalized aggregation strategy, restricted softmax classification function and active learning strategy.

[0081] The central server-side personalized aggregation submodule is used to aggregate the base layer parameters received from each IoT client device, generate updated base layer parameters, and send the updated base layer parameters back to each IoT client device.

[0082] Specifically, the personalized aggregation strategy includes defining a base layer and a personalized layer. The parameters of the base layer are sent to the central server for aggregation and global sharing during each round of communication, while the personalized layer is only trained locally. The restricted softmax classification function is used to limit the update of the classifier layer weights of classes not observed by the client to deal with the label distribution offset problem. The active learning strategy is used to select the unlabeled samples with the largest amount of information for labeling during the local training process of the client to reduce the cost of manual labeling and improve the model convergence speed.

[0083] Specifically, the active learning strategy uses the BvSB query strategy to select information-rich unlabeled samples. The smaller the value of BvSB, the more difficult it is for the current model to determine which category the sample belongs to, and therefore indicates that the sample contains more information.

[0084] Specifically, the lightweight arrhythmia diagnosis model is a deep learning model with convolutional neural network (CNN) as its core, which has lower parameters and computational complexity and supports deployment in most resource-constrained IoT edge devices.

[0085] It can be seen from the above that the arrhythmia diagnosis system of this embodiment has been refined on the federated learning module, specifically including a central server-side initialization submodule, a client-side local training submodule and a central server-side personalized aggregation submodule. The central server first uses a public electrocardiogram data set to train the initial model and distributes it to the IoT client. The client uses a lightweight arrhythmia diagnosis model to train local data. During this period, a personalized aggregation strategy, a restricted softmax classification function and an active learning strategy are adopted. The personalized aggregation strategy distinguishes between the base layer and the personalized layer. The base layer parameters are globally shared, and the personalized layer is locally trained. The restricted softmax classification function handles the label distribution offset problem. The active learning strategy adopts the BvSB query strategy to select information-rich samples to reduce the annotation cost and increase the convergence speed. The lightweight model is based on a convolutional neural network and supports deployment on resource-constrained IoT edge devices. These improvements jointly improve the efficiency and accuracy of the system.

[0086] like Figures 2 to 13 As shown:

[0087] Embodiment 4:

[0088] In order to verify the performance of the proposed personalized federated learning (pFedAL) framework in the arrhythmia detection task, the following experiments were conducted:

[0089] Experimental setup

[0090] A. Dataset

[0091] Three publicly available arrhythmia databases were used to validate pFedAL, including the MIT-BIH Arrhythmia Database (MITDB), the Saint-Petersburg Institute of Cardiology and Technology 12-lead Arrhythmia Database (INCARTDB), and the MIT-BIH Supraventricular Arrhythmia Database (SVDB).

[0092] 1) MITDB: MITDB is one of the most commonly used databases for evaluating arrhythmia detection algorithms. It contains 48 half-hour two-lead ECG records with a sampling rate of 360Hz. Each ECG signal in this database has been independently annotated by at least two experts.

[0093] 2) INCARTDB: INCARTDB is a publicly available ECG database. The database contains records of 12-lead ECGs, covering a total of 75 records. Each record is about 30 minutes long, with a sampling rate of 257Hz. There are more than 175,000 heartbeats in the database.

[0094] 3) SVDB: SVDB contains 78 records with a duration of 30 minutes and a sampling frequency of 128 Hz.

[0095] The labels in the database were further divided based on the Association for Medical Advancement (AAMI) standard. All data were divided into four types: normal heartbeat (N), supraventricular ectopic heartbeat (S), ventricular ectopic heartbeat (V), and fusion heartbeat (F). Considering the different ECG sampling rates of different datasets, the sampling rate of all datasets was uniformly adjusted to 360Hz using the fast Fourier transform algorithm. The same single-lead ECG data was used in all databases. In addition, all ECG heartbeats were resampled to a fixed length of 128 to ensure the consistency and standardization of the input data. Figure 2 The number of samples in different categories after preprocessing of the three databases is summarized.

[0096] In the training process based on federated learning, the dataset needs to be divided into two parts. The first part of the dataset is saved on the server as a public initial training set for training the initial global model. The second part of the dataset represents the local data of each client. In this paper, the intra-database and inter-database experimental paradigms are conducted, which means that the data on the server and the client come from the same database or different databases. In the experiment based on the database, the 44 records from MITDB are split into DS1 (101, 106, 108, 109, 112, 114, 115, 116, 118, 119, 122, 124, 201, 203, 205, 207, 208, 209, 215, 220, 223, 230) and DS2 (100, 103, 105, 111, 113, 117, 121, 123, 200, 202, 210, 212, 213, 214, 219, 221, 222, 228, 231, 232, 233, 234), which are used for the server and 44 clients respectively. The sample information of DS1 and DS2 after preprocessing is shown in Figure 2. Figure 3 As shown. The intra-database based experiments are mainly used for result analysis, comparison with other methods, and ablation experiments. For the cross-database experimental paradigm, MITDB is used as the server data, INCARTDB and SVDB are the data of 75 clients and 78 clients respectively. The inter-database experimental paradigm is mainly used to verify the generalization ability of the method. In addition, since the number of F categories in the SVDB database is only 23, the classification information of F categories is not discussed in the cross-database experiment based on SVDB.

[0097] B. Configuration details

[0098] The proposed method is implemented based on the pytorch framework. Stochastic gradient descent (SGD) is used as the optimizer. During the training process, the initial learning rate is set to 0.0015. After each iteration, the learning rate is gradually reduced by multiplying a decay factor of 0.997. In order to prevent overfitting, a weight decay factor of 0.0001 is used, which helps to regularize the model parameters during training. The batch size is 32. The client communicates with the server after training 10 epochs locally, and the total number of communications is 30. For each client, the number of samples labeled based on active learning is capped at 80.

[0099] C. Evaluation Metrics

[0100] To evaluate the classification performance of the system, four standard metrics are used: overall accuracy (Acc), sensitivity (Se), positive predictivity (Pp), and F1 score. The definitions of these metrics are as follows:

[0101]

[0102]

[0103]

[0104]

[0105] TP, FP, TN, and FN stand for true positive, false positive, true negative, and false negative, respectively.

[0106] Results and Discussion

[0107] A. Experimental Results

[0108] 1) Experimental results of DS2: Figure 4 The diagnostic results of DS1 as the server and DS2 as the client are shown in Figure 2. The overall Acc reaches 98.87%. It can be seen that the detection result of class N is the best, with F1 of 99.52%. On the contrary, the recognition ability of class F needs to be further improved. Figure 3 From the distribution of , it can be inferred that occupational imbalance has a certain degree of negative impact. In order to further analyze the experimental results, the final Acc of each client is given. Except for client 13, other client models achieved excellent classification results, especially clients 1, 4, 6, 7 and 12 achieved 100% accuracy. By observing the number of classifications of these clients, the performance difference may be caused by two reasons: (1) Class N represents normal heartbeats, and N is the heartbeat with the best recognition effect among all abnormal ECG signals. Moreover, class N is least affected by individual differences, and even previous studies have proposed unsupervised detection algorithms for class N heartbeats. On the other hand, class F is a relatively complex heartbeat. As Figure 7 As shown in the figure, F is difficult to be identified in the previous methods. (2) Except for customer 13, the remaining customers have fewer F categories. Since the model has difficulty in accurately identifying F, customer 13 has the lowest Acc. Overall, this method achieves satisfactory results on the DS2 dataset.

[0109] 2) Experimental results based on INCARTDB and SVDB: Figure 5 and Figure 6These are the experimental results based on INCARTDB and SVDB respectively. Similarly, for class N, the model also obtained relatively good results. Since the ratio of the number of N to F in INCRATDB is about 698:1, it can be seen from Table 4 that the F1 of class F is only 33.99%. On the other hand, since the number of F classes in SVDB is only 23, class F is not considered in the experiments on this database. The overall Acc values ​​of the two databases in the experiment are 99.33% and 97.17% respectively, indicating that the difference between MITDB and INCRATDB is smaller than that between MITDB and SVDB. Although there may be large differences in ECG data between databases, the system is still able to maintain stable performance. Therefore, the system has strong generalization ability.

[0110] B. Lightweight Analysis

[0111] The lightweight arrhythmia diagnosis model has several major advantages: (1) It can run on resource-constrained edge devices and reduce dependence on cloud computing resources, thereby reducing data transmission latency and communication costs. (2) It can perform real-time ECG signal processing and diagnosis with low latency and provide immediate feedback to patients, which helps to detect and treat cardiac abnormalities in a timely manner. (3) It has low computing and storage requirements, thereby reducing hardware costs. Parameters and floating-point operations (FLOPs) reflect the size and computational complexity of deep learning models and affect the operating platform requirements and decision-making speed. The total parameters and computational complexity of the model are 1.61M and 52.97M, respectively, which means that it is fully capable of running on most edge devices.

[0112] To further demonstrate the model's ability to run on resource-constrained devices, the model was deployed on a Raspberry Pi for training and testing. As we all know, the Raspberry Pi is a classic embedded device that uses an ARM processor and has lower performance than most smartphones on the market. Therefore, it is very suitable for verifying the lightweight characteristics of this model. Figure 8 As shown in the figure, the pre-trained model and data are stored on the Raspberry Pi, completing the personalized training and testing process. Experiments show that the model takes an average of 0.005 seconds to predict the heartbeat of the Raspberry Pi. In the medical definition, the duration of a heartbeat is usually 0.6-1 seconds, which is less than the heartbeat classification time. Therefore, the model can complete real-time arrhythmia diagnosis in reality. In addition, the training process on the Raspberry Pi further demonstrates the lightweight performance

[0113] For the model, since the training process requires more computing resources than the testing process to optimize the weight parameters, it also proves that the model can be automatically updated and maintained on edge devices. In general, the model is lightweight and has great application potential in mobile medical diagnosis systems.

[0114] C. Communication Cost and Enhanced Privacy Analysis

[0115] Compared with the traditional federated learning framework, the proposed federated framework aims to further reduce the communication cost and enhance the privacy protection of client data. To this end, two main measures are implemented: (1) the base layer and the personalized layer are defined, and only the base layer parameters are shared between the server and the client. (2) The active learning strategy is adopted to accelerate the training of the client model.

[0116] 1) Communication cost analysis: In federated training, the server and client only share the base layer (convolutional layer), which means that only a small part of the model parameters need to be transferred between the server and the client. It can reduce network load and data transmission time, and is particularly suitable for IoT environments with limited bandwidth or limited resources. The total number of parameters in a round of communication between the client and the server is represented by TPC (total parameter communication). If the model is in a normal federated learning process, TPC is 1605636. In federation, only the convolutional layers are aggregated, so TPCpFfederal is as follows:

[0117] TPC pFedAL =Con1(128)+Con2(6208)+Con3(24704)=31040

[0118] Therefore, only 1.93% of the model parameters need to be transmitted between the server and the client in each round of communication. The high-efficiency optimization not only reduces the pressure on the network bandwidth, but also significantly improves the speed and efficiency of data transmission while maintaining the model performance. In addition, the active learning strategy is integrated into the federated learning training process. It can effectively improve the training efficiency of the local model on the client side, so that the model can achieve the expected effect faster. Therefore, active learning can reduce the number of communications between the server and the client, thereby reducing the communication cost.

[0119] 2) Enhanced Privacy Analysis: In traditional federated learning, client data never leaves the local device and only model parameters are transmitted to the network. This means that sensitive data is better protected and the risk of data leakage is reduced. However, traditional federated learning still faces the risk of privacy leakage. For example, an attacker can introduce some sensitive information about the training data through high-level model layer parameters because these layers contain more data-specific information. In the proposed pFedAL framework, only the convolutional layer parameters are shared at lower levels. The parameters of these layers are not sensitive to the data, and sharing only the convolutional layer parameters also reduces the possibility of reversely inferring the original data from these parameters. Therefore, client data privacy can be further enhanced.

[0120] D. Ablation Experiment

[0121] In order to demonstrate the role of restricted softmax, active learning and personalized aggregation, the ablation experiment results based on the DS1 and DS2 datasets are summarized. Personalized aggregation has a significant improvement effect on the system. The Acc without personalized aggregation is 96.26%, which is lower than the Acc of most clients. Therefore, two conclusions can be drawn: (1) The designed base layer and personalized layer can learn common and specific features on the server and local client, respectively. (2) The personalized federated learning strategy can alleviate the individual differences (Non-IID) between client ECG data. Although active learning and restricted softmax have a weak improvement on the overall Acc, they contribute significantly to the performance improvement of the other three categories except class N. Compared with personalized aggregation, the F1 of class F is improved by 28.43% and 28.3%, respectively. Fig.12 The changes in Acc and loss before and after the use of active learning in training for client 17 are shown. According to the trend of the results, it can be seen that the use of active learning can effectively improve the training efficiency of the model. This is because the training samples selected by the active learning process are informative. At the same time, in order to prove the role of restricted softmax, the t-distributed stochastic neighbor embedding (t-SNE) technique is used to demonstrate the visualization effect of the FC layer features in the personalized model of client 15. Client 15 has only two categories, N and v, and A and B are misjudged feature points. After restricting softmax, the erroneous feature point of A has been corrected, and the distance between the erroneous feature point B and the distance between cluster V has been reduced, which has been effectively improved. Therefore, restricted softmax can improve the label distribution shift problem existing in the client. In general, the three key components all play an important role, and their combination can effectively improve the arrhythmia detection performance of the system.

[0122] The standard parts used in the present invention can all be purchased from the market, and the special-shaped parts can be customized according to the description and the drawings. The specific connection methods of each part adopt conventional means such as mature bolts, rivets, welding, etc. in the prior art. The machinery, parts and equipment all adopt conventional models in the prior art, and the circuit connection adopts the conventional connection method in the prior art, which will not be described in detail here. The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.

[0123] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "Multiple" means two or more, unless otherwise clearly and specifically defined.

[0124] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0125] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.

[0126] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0127] In the drawings of the embodiments disclosed in the present invention, only the structures related to the embodiments disclosed in the present invention are involved, and other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of the present invention can be combined with each other.

[0128] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A cardiac arrhythmia diagnosis system based on deep federated active learning, characterized in that: include: a data collection module for collecting electrocardiogram (ECG) data from a plurality of IoT client devices, including but not limited to wearable devices and mobile health monitoring applications; The data preprocessing module is used to preprocess the collected ECG data, including signal denoising, filtering and feature extraction; A federated learning module for collaboratively training arrhythmia diagnosis models on multiple IoT client devices; The diagnosis module is used to diagnose new electrocardiogram data using the trained arrhythmia diagnosis model and output the diagnosis results.

2. The arrhythmia diagnosis system based on deep federated active learning as claimed in claim 1, characterized in that: The data preprocessing module also includes a signal denoising step, which uses Butterworth bandpass filtering to remove noise and interference in the electrocardiogram signal.

3. The arrhythmia diagnosis system based on deep federated active learning as claimed in claim 2, characterized in that: The feature extraction involves processing the ECG signal into a two-dimensional tensor that combines heart beat and RR interval vectors.

4. The arrhythmia diagnosis system based on deep federated active learning as claimed in claim 3, characterized in that: During the feature extraction process, the model input consists of three parts: heartbeat vector, pre-RR ratio vector and near-pre-RR ratio vector. Each heartbeat segment starts 0.14 seconds after the previous R peak and ends 0.28 seconds after the current R peak. The pre-RR ratio is the ratio of the RR time interval before the current heartbeat to the average of all previous RR time intervals, and the near-pre-RR ratio is the ratio of the current RR time interval to the average of the most recent 10 RR time intervals.

5. The arrhythmia diagnosis system based on deep federated active learning as claimed in claim 4, characterized in that: The federated learning module specifically includes: The central server initialization submodule is used to train an initial arrhythmia diagnosis model on the central server using a public electrocardiogram dataset and distribute the model to various IoT client devices; The client local training submodule is used to train the local ECG data on each IoT client device using the distributed lightweight arrhythmia diagnosis model. The training process adopts personalized aggregation strategy, restricted softmax classification function and active learning strategy. The central server-side personalized aggregation submodule is used to aggregate the base layer parameters received from each IoT client device, generate updated base layer parameters, and send the updated base layer parameters back to each IoT client device.

6. The arrhythmia diagnosis system based on deep federated active learning as claimed in claim 5, characterized in that: The personalized aggregation strategy includes defining a base layer and a personalized layer, wherein the parameters of the base layer are sent to a central server for aggregation and global sharing during each round of communication, while the personalized layer is only trained locally; The restricted softmax classification function is used to limit the update of the classifier layer weights of classes that are not observed by the client to deal with the label distribution offset problem; the active learning strategy is used to select the unlabeled samples with the largest amount of information for labeling during the local training process on the client to reduce the cost of manual labeling and improve the model convergence speed.

7. The arrhythmia diagnosis system based on deep federated active learning as claimed in claim 5, characterized in that: The active learning strategy adopts the BvSB query strategy to select information-rich unlabeled samples. The smaller the value of BvSB, the more difficult it is for the current model to determine which category the sample belongs to, and thus indicates that the sample contains more information.

8. The arrhythmia diagnosis system based on deep federated active learning as claimed in claim 5, characterized in that: The lightweight arrhythmia diagnosis model is a deep learning model with convolutional neural network (CNN) as its core, which has lower parameters and computational complexity and supports deployment in most resource-constrained IoT edge devices.