## 3 Materials and Experiment Design
### Experiment Design  
The training task is divided into two stages: centralized pretraining and federated fine-tuning. In the pretraining stage, we used a subset of 329 subjects from the SHHS dataset (denoted as SHHS_pretrain) to initialize the global model in a centralized manner. This model includes a shared feature extractor and two task-specific heads (for sleep staging and SDB severity classification). The resulting parameters serve as the starting point for the subsequent federated training phase. In the federated setting, we simulated three institutional clients, each corresponding to one dataset: APPLES, HMC, and the remaining SHHS (denoted as SHHS_rest). For all clients (i.e., APPLES, HMC, SHHS_rest), the available subjects are randomly partitioned at the patient level into non-overlapping training, validation, and test subsets in an 8:1:1 ratio. Federated learning is conducted over \(T=100\) communication rounds, and in each round, a random subset of \(C=0.2\times K\) clients (with \(K=3\)) is selected to participate. Each selected client performs E = 5 epochs of local multi-task training using a batch size of \(B=32\) on its private PSG data. Model updates are computed and returned to the server, which aggregates only the shared encoder parameters using the weighted averaging strategy described in Section 2.1. Task-specific heads are retained locally on each client to allow for personalized adaptation. The validation set is used solely for early stopping and hyperparameter selection, with no access to test data at any stage of training. Early stopping is based on the validation loss of the sleep staging task, with a patience of 10 communication rounds. Model checkpoints yielding the lowest validation loss are retained for final evaluation. Evaluation results are reported separately under two settings. In the local evaluation setting, each client reports test performance using its own local model on its respective test set. In the cross-client evaluation setting, a model trained on one client is directly applied to the test set of a different client without further adaptation. To simulate realistic deployment scenarios, we introduced heterogeneity in computational and communication environments across clients. Each client is assigned a random training time budget \(\tau_{k}\in[60,180]\) seconds and an upload bandwidth \(b_{k}\in[50,500]\) KB/s. Furthermore, an independent stochastic dropout probability of \(p_{drop}=0.1\) is applied. These settings are consistent with the federated simulation protocol introduced in Section 2.1 and are designed to emulate real-world variability in institutional resources. To enable parameter optimization, training, and evaluation of models, we chose Python 3.10 as the programming language and TensorFlow 2.13.0 as the deep learning framework. Three NVIDIA RTX A5000 GPUs were used to perform computations. Weused the \"ReduceLROnPlateau\" method [40] to adjust the learning rate during training. The key training hyperparameters used in all experiments are summarized in Table 2. Each experiment was repeated five times with different random seeds, and results are reported as the average. The training hyperparameters listed in Table 2 were selected based on expert debugging and empirical validation to ensure stable convergence and effective optimization across tasks and clients. Specifically, the initial learning rate of \(1\times 10^{-3}\) was chosen as a commonly effective starting point for the Adam optimizer and further adjusted dynamically during training using the ReduceLROnPlateau strategy to avoid overfitting. The task loss weights (\(\lambda_{1}=\lambda_{2}=0.5\)) reflect equal emphasis on sleep staging and SDB classification tasks in the joint loss function, as both are clinically important and complementary. The choice of 5 local epochs per communication round ensures adequate local updates while preventing client drift, which is a common issue in non-IID federated settings.