TinyFed-XAI: Explainable Federated TinyML for Early Arrhythmia Detection on Wearable IoT Devices
Keywords:
Federated Learning, TinyML, Explainable AI (XAI), Arrhythmia Detection, Wearable IoT, Edge Intelligence, ECG Classification, Model Quantization, SHAP, Non-IID Data.Abstract
Wearable Internet of Things (IoT) devices are promising tools to help detect fatal cardiac arrhythmia, which is a common cause of sudden heart events. The challenge still exists when deploying deep learning models on resource-limited wearables without compromising the patient’s data privacy. The designed framework called TinyFed-XAI, helps to establish the relationship between Federated Learning (FL), TinyML compression, and Explainable AI (XAI) is developed in this paper. Using this, early detection of arrhythmia in wearable devices can be possible. Utilizing the MIT-BIH along with PTB derived ECG heartbeat dataset to simulate a realistic non-IID deployment, we take the help of Dirichlet-based partitioning to carry out training on ten clients. We use a lightweight (7,013 parameters) 1D Convolutional Neural Network (CNN) trained through Federated Averaging (FedAvg). In order to tackle the big class imbalance problem in the arrhythmia data, we consider a global class-weighting strategy in combination with extended local training. By using this combination, we can boost the Macro F1-score (federated model) from 0.446 to 0.538, while keeping the classification accuracy at 85.3%. The post-training INT8 quantization compresses the trained model and reduces its size from 33.8 KB to 17.2 KB with a negligible loss of accuracy confirming it can be deployed on microcontroller-class wearable hardware. Ultimately, SHAP was applied to the federated and centralized models to explain classification decisions at the waveform level. This shows that both models pay attention to clinically meaningful parts of ECG such as the QRS complex, and the P-wave shape. The trade-offs between federated and centralized training are analysed. The federated model achieves higher accuracy on the majority classes while the centralized model performs better than the federated model on minority arrhythmias, with Macro F1 of 0.592, highlighting a long-standing challenge of federated learning under extreme non-IID and long-tailed class distribution. Our results show that wearable IoT arrhythmia detection can be privacy-preserving, computationally efficient and interpretable. Moreover, we identify rare-class representation as a key open challenge for future federated healthcare applications.
Downloads
Downloads
Published
Issue
Section
License
You are free to:
- Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
- Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation .
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

