###### Abstract  
Electrocardiography (ECG)-based arrhythmia classification intends to have a massive role in cardiovascular disease monitoring and early diagnosis. However, ECG datasets are mostly imbalanced and have regularization to use real-time patient data due to privacy concerns. Traditional models do not generalize on unseen cases and are also unable to preserve data privacy. Which incentivizes performance degradation in existing models with privacy limitations. To tackle generalization and privacy issues together, we introduce the framework SF-ECG, a source-free domain adaptation approach for patient-specific ECG classification. This framework does not require source data during adaptation, which solves the privacy issue during adaptation. We adopt a generative model (GAN) that learns to synthesize patient-specific ECG data in data-inefficient classes to make additional source data for imbalanced classes. Then, we use the local structure clustering method to strongly align target ECG features with similar neighbors. After seizing clustered target features, we use a classifier that is trained on source data with generated source samples, which makes the model generalizable in classifying unseen data. Empirical results under different experimental conditions in various interdomain datasets prove that the proposed framework achieves 0.8% improvements in UDA settings, along with preserving privacy and generalizability. electrocardiography; source-free domain adaptation; generative adversarial networks +
Footnote †: journal: Applied  
ECG classification can be referred into two schemes, namely, intrasubject and intersubject. However, the training and test examples are differently distributed but belong to the same subject and can be referred to as intrasubject. The main limitation of developing the intrasubject scheme is that models are not well generalized in new subject cases; hence, there is a noticeable performance drop, whereas if the training and test examples are not overlapping and belong to different subjects, that can be referred to as intersubject. In the intersubject scheme, the samples have differences individually. Individual differences refer to differences in sex, age, physiological conditions, etc. In this case, the classification performance is based on being subject-to-subject. Therefore, differences in the training and testing examples make the whole learning generalizability difficult; hence, it is considered the most challenging and realistic setting for developing ECG classification models [5]. Even though DL methods have made great advances in the intrasubject scheme, they are still facing considerable performance degradation in the intersubject scheme, as the intersubject scheme is a more realistic setting for developing applications, since each subject/patient has different morphological characteristics in ECG signal data due to the variance in individual cases. Considering the application reliability, a method called subject-independent refers to the training of a model with labeled training samples and testing the model into the new test samples strictly. But in this case, the model performance deteriorates by a significant margin, which can not be relied on while building models. The problem can be solved via subject-specific training with a specific model, where the whole scheme can be divided into two phases, such as initial training and fine tuning [5]. Usually, in the initial training, the model uses the training samples to train, and in the next stage, the model is fine-tuned by partially labeled samples from test samples. The whole phase increases the adaptation capacity of intersubject variation. But this scheme is associated with various underlying issues, such as developing models for each individual subject or patient is not feasible for real-time deployment where computational resources are limited. Another major drawback is that annotating such a large amount of subject-wise data tends to be expensive and laborious.