## 1 Introduction  
Wearable medical devices provide remote solutions for patients to monitor their well-being and vital signs. These devices are designed to capture and collect various types of health data and, in recent years, coupled with data analytics, cloud computing, and artificial intelligence, even allow for early disease detection [1]. Many popular developments are related to the cardiology field, e.g., monitoring of the heart rate, and of the electrical activity of the heart through electrocardiograms (ECG). Such heart monitors are useful in detecting signs of atrial fibrillation, the most common type of cardiac arrhythmia. Atrial fibrillation causes irregular and abnormally fast heartbeats, representing the leading cause of stroke [2]. Early and precise identification of atrial fibrillation is therefore an active field of research aimed at improving the prevention of heart failure. Although an ECG can be used to detect irregularities in the heartbeat, atrial fibrillation is more difficult to trace because of the episodic nature of the symptoms. Wearable ECG devices can help track and record irregular heartbeats by facilitating low-cost ECG monitoring. Although not entirely a wearable, AliveCor's portable single-lead personal ECG device is one of the most widely used heart rate monitors. It has been FDA-cleared for the detection of atrial fibrillation and is currently widely used in research studies and clinical practice [3]. To detect atrial fibrillation using wearable devices, such as smartwatches or portable ECG devices, the acquired data are automatically sent to a cloud service and analyzed for atrial fibrillation using algorithms powered by artificial intelligence (AI). Within seconds, the smartphone application displays the results of the analysis. The information collected from several users may be stored in a centralized storage system and used to continuously improve AI-based detection systems. When personal health information is stored, shared, and manipulated, there is always an inherent risk of privacy breaches, and, hence, privacy and security issues arise. In recent years, considerable work has been expended on the creation of various privacy-preserving approaches capable of addressing the gap between data privacy and utility, as demanded by the recent focus on privacy-related aspects. Among these techniques, homomorphic encryption has made rapid progress. While sufficiently secure, many homomorphic encryption-based techniques exhibit suboptimal performance due to their high computational complexity, computations being several orders of magnitude slower than on plaintext. This clearly restrains their usability in real-world applications. To prevent any issues while employing AI to enhance the functionality of wearables and improve patient care, technical solutions have to simultaneously meet privacy and utility requirements [4]. Although many promising studies have been recently published on the use of homomorphic encryption in machine learning workflows, homomorphic encryption has not been broadly adopted in crowd-sensing systems. In this work, we address privacy issues related to wearable devices and propose a framework to ensure the privacy and integrity of personal medical data, with emphasis on performance analysis and demonstration in cardiac arrhythmia detection. We aim to address data privacy concerns in a way that enables the sharing of patient-related health information while ensuring the utility of AI in atrial fibrillation detection on real-world data. The paper focuses on both the training and deployment of AI-based atrial fibrillation models directly on homomorphically encrypted data without sharing or storing users' personal data in the cloud.