Predictive performance analysis
FedMediFormer-XAI demonstrated improved predictive performance compared with the evaluated unimodal and conventional baseline models. Diffusion-based augmentation improved minority-class representation, and the resulting predictive performance is summarized in Table 3. The repeated-run evaluation demonstrated stable predictive performance across the evaluated models. FedMediFormer-XAI achieved the highest overall performance, with an accuracy of 94.20 ± 0.34% (95% CI: 93.78–94.62), precision of 93.10 ± 0.30% (95% CI: 92.73–93.47), recall of 92.80 ± 0.28% (95% CI: 92.45–93.15), and F1-score of 92.90 ± 0.28% (95% CI: 92.55–93.25). The model achieved an MCC of 0.88 ± 0.02 (95% CI: 0.86–0.90) and AUC-ROC of 0.96 ± 0.01 (95% CI: 0.95–0.97). The centralized multimodal transformer provided the next-best overall performance, whereas the unimodal and conventional machine-learning models showed comparatively lower predictive performance. These results indicate that multimodal representation learning, combined with federated optimization, yields improved and more stable diabetes classification performance.
Ablation study
Component-wise ablation was used to assess the contribution of diffusion augmentation, federated learning, GraphSAGE-based drug recommendation, and multimodal fusion. The complete FedMediFormer-XAI framework achieved an accuracy of 94.20 ± 0.34%, precision of 93.10 ± 0.30%, recall of 92.80 ± 0.28%, F1-score of 92.90 ± 0.28%, MCC of 0.88 ± 0.02, and AUC-ROC of 0.96 ± 0.01 across five independent runs. Removing diffusion augmentation reduced accuracy to 91.80 ± 0.42%, corresponding to a 2.40 percentage-point decrease, while the F1-score and AUC-ROC decreased to 90.30 ± 0.38% and 0.94 ± 0.01, respectively. This reduction indicates the contribution of diffusion-based augmentation to minority-class representation and predictive robustness.
Removing federated learning resulted in an accuracy of 93.10 ± 0.37%, representing a 1.10 percentage-point decrease relative to the complete framework. Precision, recall, F1-score, MCC, and AUC-ROC were also reduced to 92.20 ± 0.34%, 91.80 ± 0.32%, 92.00 ± 0.33%, 0.86 ± 0.02, and 0.95 ± 0.01, respectively. This comparison demonstrates the contribution of the federated configuration to predictive performance.
Removing the GraphSAGE-based personalized drug-recommendation component resulted in a comparatively small change in diabetes prediction performance, with accuracy decreasing to 93.80 ± 0.35% and F1-score to 92.60 ± 0.30%. The corresponding MCC and AUC-ROC were 0.87 ± 0.02 and 0.96 ± 0.01, respectively. This result indicates that GraphSAGE primarily contributes to personalized medication recommendation rather than directly determining diabetes classification performance.
The largest reduction was observed when multimodal fusion was removed. Accuracy decreased to 87.60 ± 0.55%, representing a 6.60 percentage-point decrease, while precision, recall, F1-score, MCC, and AUC-ROC decreased to 86.80 ± 0.51%, 85.90 ± 0.54%, 86.30 ± 0.52%, 0.76 ± 0.03, and 0.91 ± 0.01, respectively. This finding demonstrates the importance of jointly modeling complementary information from clinical, CGM, and retinal modalities.
Federated learning analysis
The federated learning framework enabled collaborative model training across distributed clients while maintaining decentralized handling of raw patient data. During training, each client's local model was fine-tuned individually and combined via the Federated Averaging method. After 100 communication rounds, the global model converged, and its predictive performance remained consistent with centralized learning. The federated learning framework demonstrated stable convergence across communication rounds despite heterogeneous client data distributions. Protected parameter exchange preserved decentralized data handling, while the global model maintained competitive predictive performance relative to the centralized baseline. Table 4 compares the centralized and federated implementations. Federated learning required additional training time due to communication overhead, while maintaining predictive performance comparable to centralized learning.
Dataset-Level Performance Analysis
To evaluate generalizability across different healthcare modalities, we assessed performance on each dataset separately. The multimodal FedMediFormer-XAI model demonstrated strong and generally competitive performance across the evaluated datasets. It achieved an accuracy of 91.8%, 93.1%, 92.4%, and 94.2% on the Pima Indians Diabetes, CDC Diabetes Health Indicators, OhioT1DM, and APTOS 2019 datasets, respectively. Although the APTOS 2019 dataset achieved slightly higher accuracy (94.7%) and precision (93.9%) than the multimodal model, the proposed multimodal approach maintained competitive performance across all datasets and achieved an AUC-ROC of 0.96, comparable to the highest dataset-level AUC-ROC. The overall results at the dataset level are presented in Table 5. For single datasets, retinal image analysis achieved the best performance when used alone, whereas multimodal fusion yielded the most stable and well-balanced predictions.
Personalized drug recommendation analysis
The graph neural network-based recommendation component was evaluated using medication-effectiveness information and drug-interaction data, with candidate medications ranked according to learned patient-drug suitability scores and contraindicated combinations excluded during recommendation generation. The use of the heterogeneous graph format and the modeling of patient-drug and drug-drug interactions could be done thoroughly, thereby supporting personalized medication choices and safety assessment. The GraphSAGE recommendation model effectively captured complex relationships among patients, diseases, laboratory findings, and medications. Personalized recommendations demonstrated high ranking performance while maintaining clinically meaningful explanations through graph neighborhood analysis and feature attribution.
According to Table 6, the personalized drug recommendation module was evaluated using Precision@5, Recall@5, and NDCG@5. These metrics quantify the relevance and ranking quality of the top-five personalized medication recommendations generated by the GraphSAGE-based recommendation module. The recommendation system achieved strong ranking performance, with precision = 0.89, recall = 0.84, and NDCG = 0.91.
Explainability analysis
The framework incorporates SHAP, Integrated Gradients, attention visualization, and counterfactual explanations to support the interpretation of multimodal predictions. SHAP was used to quantify feature-level contributions, Integrated Gradients to attribute predictions to input features, attention visualization to examine model focus across modalities, and counterfactual explanations to identify feature changes associated with alternative predictions. Figure 8 presents a representative model-derived SHAP summary plot generated from the trained FedMediFormer-XAI model, whereas Figure 9 presents representative attention visualizations extracted from the trained transformer. These figures represent outputs obtained from model evaluation rather than schematic illustrations of the proposed architecture.
In Figure 8, the aggregate-level rankings of feature importance are presented. Features with higher absolute SHAP values had a greater influence on model predictions and also aligned well with existing clinical knowledge.
Figure 9 presents representative attention visualizations extracted directly from the trained FedMediFormer-XAI model for a randomly selected held-out test sample. The visualizations include clinical feature attention, CGM temporal attention, retinal spatial attention, and cross-modal attention between the three modalities. Attention visualization further demonstrated the model's learned allocation of attention across multiple modalities. The selected sample showed relatively closer attention to HbA1c, diabetes duration, and age among the clinical features, while the CGM attention map highlighted several periods with prominent glucose variability. The retinal attention map identified specific image regions contributing to the model representation, and the cross-modal attention matrix demonstrated both intra-modal and cross-modal attention patterns. As shown in Figure 9, the representative model-derived attention maps highlight selected temporal glucose patterns, influential clinical variables, and diagnostically relevant retinal image regions in a held-out test sample.
Human-centered evaluation results
A prospective human-centered evaluation protocol was designed to assess clinician trust, interpretability, usability, clinical utility, and explanation relevance under prediction-only and prediction-plus-explanation conditions. The proposed evaluation will involve endocrinologists, diabetes specialists, and clinical pharmacologists, with appropriate approval from the Institutional Ethics Committee and informed consent. Because this evaluation is intended for future prospective implementation, clinician-level outcome scores are not reported in the present protocol.
Table 7 summarizes the proposed prospective clinician-evaluation design and the predefined criteria for assessing the effects of explanations on clinician trust, interpretability, and perceived utility. The prospective evaluation will compare clinician assessments of model predictions with and without accompanying explanations using predefined Likert-scale criteria. The proposed prospective human-centered explainability evaluation framework is presented in Figure 10

Figure 1: Overall FedMediFormer-XAI framework architecture. Schematic overview of the FedMediFormer-XAI framework, showing multimodal data acquisition and preprocessing, diffusion-based augmentation, modality-specific transformer learning, federated model training, GraphSAGE-based personalized drug recommendation, and explainability analysis. The framework generates diabetes prediction, personalized medication recommendations, and interpretable model outputs. Please click here to view a larger version of this figure.

Figure 2: Multimodal dataset acquisition and preprocessing pipeline. Schematic workflow for acquiring and preprocessing the multimodal datasets used in FedMediFormer-XAI. Clinical and population health data, CGM records, retinal images, and pharmacological information undergo modality-specific quality control, preprocessing, normalization, encoding, and augmentation before being converted into model-ready representations for downstream analysis. Please click here to view a larger version of this figure.

Figure 3: Diffusion-based data augmentation workflow. Schematic workflow for diffusion-based augmentation of structured tabular training data using TabDDPM. Generated samples undergo quality and distribution-similarity assessments before being integrated with the original training data to improve class balance. Please click here to view a larger version of this figure.

Figure 4: Architecture of the proposed multimodal transformer framework. Schematic architecture comprising (A) a TabTransformer encoder for clinical data, (B) a temporal transformer encoder for CGM data, and (C) a Vision Transformer encoder for retinal images. (D) Modality-specific representations are integrated through cross-modal attention to generate a unified multimodal representation. (E) Task-specific prediction heads generate model outputs. (F) Regularization and optimization components support model training, and (G) classification, regression, and cross-modal consistency losses guide the optimization process. The resulting multimodal representation supports downstream prediction, recommendation, and explainability tasks. Please click here to view a larger version of this figure.

Figure 5: Federated learning communication framework. Schematic workflow for federated training across distributed hospital clients. Local multimodal models are trained using client-specific data, and protected model updates are transmitted to a central server for Federated Averaging. The aggregated global model is redistributed across clients for subsequent communication rounds. The framework also illustrates secure parameter exchange and evaluation of privacy, communication, and computational requirements. Please click here to view a larger version of this figure.

Figure 6: Graph-based personalized drug recommendation workflow. Schematic workflow for GraphSAGE-based personalized drug recommendation. Pharmacological and patient-representation data are organized into a heterogeneous graph that includes relevant healthcare entities and relationships. GraphSAGE learns patient and drug representations, which are used to calculate patient–drug suitability scores and rank candidate medications. Contraindicated or unsafe drug combinations are filtered before the generation of the final Top-K recommendations, with graph-based information supporting the interpretation of the recommendations. Please click here to view a larger version of this figure.

Figure 7: Explainability assessment framework. Schematic overview of the explainability workflow. (A) SHAP analysis evaluates global and local feature contributions; (B) Integrated Gradients provides attribution-based explanations; (C) attention visualization identifies influential features and modality interactions; and (D) counterfactual analysis identifies feature changes associated with altered predictions. The resulting explanation outputs support the interpretation of model predictions and personalized recommendations. Please click here to view a larger version of this figure.

Figure 8: Representative model-derived SHAP feature-importance analysis generated by the trained FedMediFormer-XAI model. The SHAP summary plot shows the distribution of SHAP values across the evaluated samples, with features ranked according to their mean absolute SHAP contribution. Positive SHAP values indicate contributions toward higher predicted diabetes risk, whereas negative values indicate contributions toward lower predicted risk. Color represents the corresponding feature value, with higher feature values shown in red and lower values shown in blue. The plot represents an actual model-derived explainability output rather than a schematic illustration. Please click here to view a larger version of this figure.

Figure 9: Representative attention outputs generated by the trained FedMediFormer-XAI model for one randomly selected held-out test sample. (A) Clinical feature attention obtained from an attention head of the multimodal transformer, showing the relative attention weights assigned to clinical features. (B) Temporal attention across the CGM sequence, illustrating time periods receiving higher model attention. (C) Spatial attention for the retinal fundus image, including the original image, attention heatmap, and attention overlay. (D) Cross-modal attention between clinical, CGM, and retinal modality tokens, showing intra-modal and cross-modal information weighting. The visualizations displayed are model-derived outputs generated by the trained model. Attention weights are shown for the selected test sample and should be interpreted as model attention patterns rather than as independent measures of clinical causality. Please click here to view a larger version of this figure.
| Dataset | Data Type | Samples/Records | Features/Content | Purpose | Public Availability |
| Pima Indians Diabetes Dataset | Clinical Tabular | 768 patients | 8 clinical variables | Diabetes risk prediction | Public |
| CDC Diabetes Health Indicators | Population Health | 253,680 records | Demographics, lifestyle, health indicators | Population risk analysis | Public |
| OhioT1DM Dataset | CGM Time-Series | 12 subjects | Glucose, insulin, meals, exercise, sleep | Temporal diabetes modeling | Public |
| APTOS 2019 Blindness Detection | Retinal Images | 3,662 images | Fundus photographs with severity labels | Diabetic retinopathy analysis | Public |
| Drug Review Dataset | Pharmacological | 215,063 reviews | Drug effectiveness, ratings, reviews | Drug recommendation | Public |
| DrugBank Open Data | Drug Knowledge Graph | Thousands of drugs | Drug-drug interactions, targets, pathways | Graph construction | Public/Academic Access |
Table 1: Dataset characteristics. Summary of publicly available datasets used in this study, including dataset type, sample size, data modality, feature content, intended purpose, and availability.
| Dataset | Modality | Prediction Target | Fusion Level |
| Pima Indians Diabetes | Clinical | Diabetes classification | Feature embedding |
| CDC Diabetes Health Indicators | Population health | Diabetes risk prediction | Feature embedding |
| OhioT1DM | Continuous glucose monitoring | Glucose trend prediction | Feature embedding |
| APTOS 2019 | Retinal fundus images | Diabetic retinopathy analysis | Feature embedding |
| Drug Review + DrugBank | Pharmacological | Drug recommendation | Graph embedding |
Table 2: Multimodal dataset integration strategy. Summary of the datasets used for multimodal diabetes intelligence, including the data modality, prediction target, and level at which modality-specific representations are integrated. Clinical, population health, continuous glucose monitoring, and retinal image data are represented as feature embeddings, whereas pharmacological information is integrated via graph embeddings for personalized drug recommendation.
| Model | Accuracy, Mean ± SD (95% CI) | Precision, Mean ± SD (95% CI) | Recall, Mean ± SD (95% CI) | F1-score, Mean ± SD (95% CI) | MCC, Mean ± SD (95% CI) | AUC-ROC, Mean ± SD (95% CI) |
| Random Forest | 83.60 ± 0.74 (82.68–84.52) | 82.70 ± 0.60 (81.96–83.44) | 81.90 ± 0.56 (81.21–82.59) | 82.30 ± 0.56 (81.61–82.99) | 0.67 ± 0.03 (0.63–0.71) | 0.88 ± 0.01 (0.87–0.89) |
| XGBoost | 85.30 ± 0.71 (84.42–86.18) | 84.70 ± 0.60 (83.96–85.44) | 83.80 ± 0.56 (83.11–84.49) | 84.20 ± 0.56 (83.51–84.89) | 0.70 ± 0.03 (0.66–0.74) | 0.90 ± 0.01 (0.89–0.91) |
| TabTransformer | 87.50 ± 0.52 (86.85–88.15) | 87.00 ± 0.60 (86.26–87.74) | 86.20 ± 0.56 (85.51–86.89) | 86.60 ± 0.56 (85.91–87.29) | 0.75 ± 0.03 (0.71–0.79) | 0.92 ± 0.01 (0.91–0.93) |
| Vision Transformer | 88.80 ± 0.50 (88.18–89.42) | 88.20 ± 0.60 (87.46–88.94) | 87.60 ± 0.56 (86.91–88.29) | 87.90 ± 0.56 (87.21–88.59) | 0.78 ± 0.03 (0.74–0.82) | 0.93 ± 0.01 (0.92–0.94) |
| Temporal Transformer | 87.20 ± 0.51 (86.57–87.83) | 86.60 ± 0.60 (85.86–87.34) | 85.90 ± 0.56 (85.21–86.59) | 86.20 ± 0.56 (85.51–86.89) | 0.74 ± 0.03 (0.70–0.78) | 0.91 ± 0.01 (0.90–0.92) |
| CNN-LSTM | 86.90 ± 0.58 (86.18–87.62) | 86.30 ± 0.60 (85.56–87.04) | 85.60 ± 0.55 (84.92–86.28) | 85.90 ± 0.56 (85.21–86.59) | 0.73 ± 0.03 (0.69–0.77) | 0.91 ± 0.01 (0.90–0.92) |
| Centralized Multimodal Transformer | 91.30 ± 0.12 (91.15–91.45) | 90.70 ± 0.60 (89.96–91.44) | 90.10 ± 0.56 (89.41–90.79) | 90.40 ± 0.56 (89.71–91.09) | 0.83 ± 0.03 (0.79–0.87) | 0.95 ± 0.01 (0.94–0.96) |
| FedMediFormer-XAI | 94.20 ± 0.34 (93.78–94.62) | 93.10 ± 0.30 (92.73–93.47) | 92.80 ± 0.28 (92.45–93.15) | 92.90 ± 0.28 (92.55–93.25) | 0.88 ± 0.02 (0.86–0.90) | 0.96 ± 0.01 (0.95–0.97) |
Table 3: Diabetes prediction performance. Comparative predictive performance of FedMediFormer-XAI and baseline machine learning and deep learning models using accuracy, precision, recall, F1-score, MCC, and AUC-ROC metrics.
| Metric | Centralized Learning | Federated Learning |
| Accuracy (%) | 94.7 | 94.2 |
| AUC-ROC | 0.97 | 0.96 |
| Privacy Preservation | No | Yes |
| Raw Data Sharing Required | Yes | No |
| Communication Rounds | N/A | 100 |
| Training Time (hours) | 4.8 | 5.6 |
| Regulatory Compliance | Moderate | High |
Table 4: Federated versus centralized learning performance. Comparison of centralized and federated learning implementations with respect to predictive performance, raw-data sharing requirements, communication rounds, and training time.
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | AUC-ROC |
| Pima Indians Diabetes Dataset | 91.8 | 90.5 | 89.8 | 0.93 |
| CDC Diabetes Health Indicators | 93.1 | 92.2 | 91.6 | 0.95 |
| OhioT1DM Dataset | 92.4 | 91.8 | 91.1 | 0.94 |
| APTOS 2019 Blindness Detection | 94.7 | 93.9 | 93.5 | 0.96 |
| Multimodal Fusion (FedMediFormer-XAI) | 94.2 | 93.1 | 92.8 | 0.96 |
Table 5: Dataset-level results. Performance analysis across individual datasets and multimodal fusion settings. Results illustrate the contribution of different data modalities to overall predictive performance.
| Metric | Value |
| Precision@5 | 0.89 |
| Recall@5 | 0.84 |
| NDCG@5 | 0.91 |
| Drug Interaction Detection Accuracy | 0.95 |
| Recommendation Coverage | 0.88 |
| Mean Reciprocal Rank (MRR) | 0.86 |
| Safety Compliance Score | 0.94 |
Table 6: Personalized drug recommendation performance. Evaluation of graph-based personalized drug recommendation using ranking metrics, interaction detection accuracy, recommendation coverage, and medication safety assessment.
| Evaluation criterion | Proposed evaluation design |
| Clinician trust | Five-point Likert-scale assessment |
| Interpretability | Five-point Likert-scale assessment |
| Clinical relevance | Five-point Likert-scale assessment |
| Explanation usefulness | Five-point Likert-scale assessment |
| Perceived utility | Five-point Likert-scale assessment |
| Inter-rater agreement | Fleiss' kappa, to be calculated after prospective evaluation |
| Statistical comparison | Paired statistical test, as appropriate after data collection |
| Participants | 12 clinicians, subject to ethics approval and informed consent |
| Evaluation status | Prospective/future evaluation |
Table 7: Proposed human-centered evaluation criteria. Proposed prospective clinician-centered evaluation framework for assessing the usefulness, clinical relevance, interpretability, trustworthiness, and usability of FedMediFormer-XAI explanations. The evaluation involves a standardized five-point Likert-scale assessment, inter-rater agreement using Fleiss' kappa, statistical comparison of prediction-only and prediction-plus-explanation conditions, and 95% confidence intervals. The clinician's evaluation should be conducted only after obtaining approval from the appropriate Institutional Ethics Committee and informed consent.
Supplementary Table 1: Dataset validation strategy. Dataset partitioning, validation procedures, class-balancing strategies, and quality-control measures were implemented to ensure reproducibility and reliable model evaluation. Please click here to download this file.
Supplementary Table 2: Diffusion model parameters. Configuration settings for the TabDDPM diffusion model, including training parameters, optimization settings, latent dimensions, noise scheduling strategy, and synthetic sample generation specifications. Please click here to download this file.
Supplementary Table 3: Multimodal transformer configuration. Configuration of the multimodal transformer architecture, including the clinical, temporal, and image encoders, embedding and fusion dimensions, attention heads, optimizer, learning rate, batch size, training epochs, early-stopping criterion, and combined training loss. Please click here to download this file.
Supplementary Table 4: Federated learning configuration. Parameters used for privacy-preserving federated training, including the number of participating hospitals, communication rounds, local training epochs, client participation rate, aggregation algorithm, optimizer, learning rate, encryption method, communication protocol, and raw-data sharing policy. Please click here to download this file.
Supplementary Table 5: GraphSAGE configuration. Configuration of the heterogeneous GraphSAGE-based personalized drug recommendation module, including graph type, hidden and embedding dimensions, number of graph layers, neighborhood sampling size, optimizer, learning rate, batch size, training epochs, Bayesian Personalized Ranking loss, and number of top medication recommendations. Please click here to download this file.
Supplementary Table 6: Explainability evaluation metrics. Quantitative and human-centered metrics used to evaluate the explainability of the FedMediFormer-XAI framework. The metrics assess explanation fidelity, stability, consistency, sparsity, completeness, sensitivity, infidelity, inter-rater agreement, and clinician-perceived explanation quality. Please click here to download this file.
Supplementary Table 7: Evaluation metrics. Predictive, federated learning, recommendation, and explainability metrics are used to evaluate framework performance, robustness, ranking quality, and interpretability. Please click here to download this file.
Supplementary Table 8: Human-centered evaluation design. Design of the clinician-centered evaluation study, including participant groups, evaluation conditions, assessment criteria, and statistical analysis procedures. Please click here to download this file.
Supplementary Table 9: Reproducibility assets. Summary of the datasets, implementation specifications, configuration files, evaluation procedures, documentation, and experimental records required to support reproducibility of the proposed FedMediFormer-XAI framework. Please click here to download this file.