ISSN: 2685-9572 Buletin Ilmiah Sarjana Teknik Elektro
Vol. 8, No. 3, June 2026, pp. 901-912
Enhancing Federated Learning for Imbalanced Medical Image Classification through Adaptive Tuning and Autoencoder-Based Reconstruction
Nadzurah Zainal Abidin 1, Amelia Ritahani Ismail 2, Cut Amalia Saffiera 3, Nurul A. Emran 4, Zammarah Nuha Abdullah 5
1,2 Department of Computer Science, International Islamic University Malaysia, Malaysia
3 Fakultas Komputer dan Multimedia, Universitas Islam Kebangsaan Indonesia, Indonesia
4 Fakulti Teknologi Maklumat dan Komunikasi, Universiti Teknikal Malaysia Melaka, Malaysia
5 Department of Computer and Information Science, Applied College, Taibahu University, Saudi Arabia
ARTICLE INFORMATION | ABSTRACT | |
Article History: Received 10 November 2025 Revised 22 February 2026 Accepted 29 June 2026 | Medical image classification has advanced significantly through deep learning techniques, yet its performance remains limited by class imbalance and decentralized data silos commonly found in healthcare settings. These issues reduce model sensitivity to rare but clinically important cases, and standard Federated Learning (FL) further struggles under non-independent and identically distributed (non-IID) data. To address this, an enhanced federated model integrating unsupervised autoencoder-based reconstruction and adaptive tuning is proposed. The research contribution is an enhanced FL model that improves minority-class detection and overall classification performance under imbalanced medical image distributions, while remaining applicable across decentralized healthcare data sources. The method incorporates an autoencoder to compute reconstruction error, enabling emphasis on underrepresented samples, while adaptive tuning dynamically adjusts local hyperparameters and global aggregation weights based on sample difficulty. This integration strengthens minority-class learning without requiring additional labels or altering the decentralized structure. Experimental evaluations were conducted using two benchmark medical image datasets across three induced imbalance ratios (1:10, 1:5, 1:2) for RetinaMNIST and naturally induced imbalance for PneumoniaMNIST dataset. Results show that under severe imbalance (1:10), the enhanced model improves minority-class recall by 59.6%, F1-score by 33.9%, and AUC-ROC by 13.3% compared to standard FL. At 1:5 imbalance, recall increases by 41.3% and F1-score by 26.5%, with accuracy gains up to 6.0%. Even under mild imbalance (1:2), the model maintains consistent improvements, achieving a 26.4% recall gain and 18.9% increase in F1-score. The performance of the enhanced model was further evaluated against three baseline FL models such as standard federated learning (FedAvg), FL with GAN augmentation, and FL with standalone autoencoder-based reconstruction. The results consistently confirm that federated learning integrating adaptive tuning and autoencoder-based reconstruction outperform the three baselines FL-models for accuracy, recall, and F1-score. These findings also demonstrate that the enhanced model provides scalable, coordination-free improvement in imbalanced federated medical image classification, offering stronger performance and stability across real-world heterogeneous settings. | |
Keywords: Federated Learning; Class Imbalance; Medical Image Classification; Adaptive Tuning; Autoencoder | ||
Corresponding Author: Nadzurah Zainal Abidin, Department of Computer Science, International Islamic University Malaysia, Malaysia. | ||
This work is open access under a Creative Commons Attribution-Share Alike 4.0 | ||
Document Citation: N. Z. Abidin, A. R. Ismail, C. A. Saffiera, N. A. Emran, and Z. N. Abdullah, “Adaptive Federated Learning Model with Unsupervised Autoencoder-based Reconstruction for Imbalanced Medical Image Classification,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 8, no. 3, pp. 901-912, 2026, DOI: 10.12928/biste.v8i3.15266. | ||
Though AI-based medical imaging systems have proven successful, their performance often hinges on the availability of large and balanced datasets. In real-world clinical scenarios, however, medical image datasets are frequently imbalanced, where minority classes, typically representing rare but critical diseases, are significantly underrepresented [1][2]. For instance, severe diabetic retinopathy cases constitute a small proportion of retinal screening datasets, malignant melanoma cases are far fewer than benign lesions in dermatological datasets, and rare pulmonary conditions such pneumothorax appear infrequently in chest X-ray collections. This imbalance biases the model predictions, where the classifier tends to favor the majority class, resulting low sensitivity towards the clinically relevant class of interest, which is rare cases. Standard deep learning approaches, which assume uniform class distribution, therefore struggle to generalize well in such settings [3][4].
Federated learning (FL) has emerged as a decentralized paradigm that enables collaborative model training across medical multiple data sources or institutions without centralizing data or sharing their local datasets [5]-[10]. This approach leverages the diversity of distributed medical data while allowing each data source, such as hospitals, clinics, and medical institutions, to retain control of its own dataset and leads to improved model generalization across different populations. However, despite these advantages, FL faces two key significant challenges in medical image analysis: (1) non-IID (non-independent and identically distributed) data distributions across clients, where different data sources hold varies class ratios or distinct feature distributions, and (2) class imbalance within local datasets, where uneven sample proportions across classes within each dataset [11][12], which both can negatively impact classification performance, especially on rare or underrepresented medical conditions [13]. This work primarily addresses the latter challenge by enhancing federated learning to improve minority-class recognition under imbalanced data conditions.
Standard FL struggles under these conditions due to its inability to adapt to data skewness and distributional differences, leading to poor convergence and reduced sensitivity on underrepresented classes [14][15]. Consequently, researchers have explored several enhancements approaches to enhance FL performance under these challenges, broadly categorizing into contribution-based aggregation schemes and optimization-based methods. Contribution-based approaches adjust aggregation weights based on client reliability and performance [16]-[19], while optimization-based methods modify the training objective to improve convergence under heterogenous data [19][20]. Another common approach is Generative Adversarial Networks (GANs)-based augmentation, which attempts to balance training sample by synthesizing realistic samples of minority classes under federated settings [21]-[23]. Similarly, autoencoder-based approaches, particularly autoencoders, have also been explored to identify rare or abnormal patterns in medical images, improving recognition of minority class instances [24][25]. Although GAN-based augmentation has shown effectiveness in centralized settings, its adversarial training process introduces instability and additional computational overhead in federated environments, particularly when minority samples are scarce across clients. In contrast, autoencoder-based reconstruction provides a stable, unsupervised mechanism for identifying rare samples through reconstruction error without generating synthetic data, making it more suitable for decentralized imbalance handling.
While these approaches show promise, they are typically applied separately and therefore do not fully address the combined challenges of class imbalance and decentralized learning [26]. Moreover, many existing approaches overlook the importance of dynamic training adjustments, training settings that adjust automatically during training rather than remain fixed, which have been shown to improve convergence and stability in non-IID settings. However, their integration with imbalance-handling techniques remains underexplored.
This research aims to address the challenge of class imbalance in federated medical image classification by enhancing standard federated learning model that integrates two complementary approaches: (1) autoencoder-based reconstruction to improve recognition of minority class samples, and (2) adaptive tuning to adjust training behavior based on reconstruction error signals.
The research contribution of this work is the development of an integrated federated learning model that systematically evaluated against standard FedAvg, FL with GAN-based augmentation, and FL with standalone autoencoder-based reconstruction on RetinaMNIST and PneumoniaMNIST datasets. The experimental results demonstrate consistent improvements in minority-class detection across multiple imbalance ratios, confirming the effectiveness of the enhanced design without altering the core federated aggregation structure.
Federated learning (FL) has emerged as a promising decentralized paradigm for training models collaboratively across multiple medical data sources while retaining local data. By combining knowledge or pattern from multiple medical data sources, FL has the potential to improve generalization across diverse populations. However, FL presents unique challenges when applied to imbalanced medical image classification [27][28]. The decentralized and non-IID (non-independent and identically distributed) nature of FL data often amplifies class imbalance, as many medical data sources naturally contain insufficient samples from minority classes. As a result, the aggregated global model tends to underperform on rare conditions [29].
Existing solutions remain insufficient for addressing class imbalance in federated medical image classification. Data-level approaches, such as GAN-based augmentation, can generate synthetic samples but are often struggled to maintain stability and consistent quality in generating images in federated environments [14],[30]-[33]. Although several FL enhancement techniques have been proposed, many of these require substantial modifications to local training procedures [34][35]. This makes them impractical in real-world deployments, especially in smaller or resource-constrained medical data sources. Therefore, a method that can adaptively improve learning under imbalance and non-IID conditions without requiring major changes to local model at each data source is still needed.
This gap underscores the urgent need for an approach that improve FL’s ability to recognize minority classes under imbalanced conditions, while preserving its advantages of decentralization and maintaining full control over local data.
The research is designed as an experimental and comparative study that evaluates federated learning (FL) under class imbalance using two medical imaging datasets. Three baseline FL configurations are implemented for comparison against our enhanced federated learning model: standard Federated Averaging (FedAvg), FL with GAN-based augmentation, and FL with standalone autoencoder-based reconstruction.
This research employs two benchmarking datasets under a subset of the MedMNIST v2 collection, which are RetinaMNIST and PneumoniaMNIST datasets, representing induced (severe imbalance -1:10, moderate imbalance -1:5, mild imbalance -1:2) and natural imbalance settings respectively. These datasets are lightweight, standardized, and widely used for medical image classification tasks under constrained conditions.
The dataset consists of 1600 retina fundus images, that are labeled for five levels of diabetic retinopathy severity (ranging from normal to severe), making the task an ordinal regression problem. Imbalance ratios of 1:10, 1:5, and 1:2, were artificially induced by downsampling minority-class samples to reflect realistic clinical scenarios [36][37]. These imbalance ratios represent severe, moderate, and mild imbalance conditions, respectively, enabling systematic evaluation of model robustness under different levels of class distribution.
The original fundus images have a resolution of 1736 x 1824 pixels with three color channels. For computational efficiency and consistency in training, all images are center-cropped and resized to 3 x 28 x 28. This preprocessing step ensures uniform input dimensions across all models while preserving essential diagnostic features.
The dataset derived from chest X-ray images for the task of binary classification, distinguishing between normal cases and pneumonia-positive cases. It consists of 5856 grayscale images, reflecting a more natural imbalance in real-world clinical settings, where pneumonia cases are often less frequent compared to normal scans [36],[38]. Each image in PneumoniaMNIST dataset is standardized to a resolution of 1×28×28 (grayscale), aligning with the MedMNIST format. This ensures compatibility with lightweight neural networks and efficient training in federated settings. Table 1 summarizes the datasets used.
Table 1. Summary of Dataset
Dataset | Task Type | Imbalance Type | Training | Validation | Testing | Image Size |
Retina | Multi-class (5 classes) | Induce | 1080 | 120 | 400 | 3 x 28 x 28 (RGB) |
Pneumonia | Binary classification | Natural | 4708 | 524 | 624 | 1 x 28 x 28 (Grayscale) |
To simulate federated learning, the datasets were distributed across 10 healthcare institutions, in a non-IID (non-independent and identically distributed) manner. Each data source receives training data with biased class distribution towards 2 or 3 dominant classes, simulating realistic scenarios in federated medical settings. By enforcing this decentralized and non-IID partitioning, the research establishes a challenging yet practical testbed for assessing the robustness and generalization capability of federated learning under both data imbalance and client heterogeneity.
All experiments were conducted using Google Colab with GPU acceleration using PyTorch and Flower federated learning framework (FL library). Experiments were conducted by distributing both datasets to 10 different data sources over 50 global communication rounds, each performing 5 epochs with a batch size of 32 per round. These experiments used Adam optimizer, with a learning rate initially set to 0.01 and adaptively tuned in the enhanced model. Each experiment is repeated across the three imbalance settings to evaluate performance consistency and robustness.
Three baseline FL configurations were implemented for comparison:
All baseline models were trained under identical settings across the three imbalance ratios to ensure fair comparison.
The enhanced model aims to address the limitations of standard federated learning under class imbalance by integrating two enhancement strategies: adaptive tuning and unsupervised autoencoder-based reconstruction.
Autoencoder-based reconstruction has been widely applied for rare-event recognition [39][40]. In highly imbalanced datasets, the minority class can be treated as a form of anomalies since they are both are underrepresented and statistically deviant from the majority [41][42]. Autoencoders learn compressed representations of dominant patterns and highlight deviations through reconstruction error, thereby enabling better detection of minority instances without requiring balanced training data [43][44].
In federated learning, the appeal of autoencoder-based reconstruction is amplified [45][46]. Since autoencoders can be trained locally on each institutional data, they do not rely on global label statistics or inter-client coordination [12],[47]. Each institution can independently emphasize rare patterns during local training, and reconstruction signals can be incorporated into the global aggregation process [48]-[51].
An unsupervised autoencoder is deployed at each data source to learn compact representations of local medical images. The autoencoder operates independently at each data source without sharing parameters across data sources [52][53]. For each input sample, a reconstruction error is computed locally and used as a signal to identify rare or difficult instances during training [12],[54]. This reconstruction-based signal is incorporated into the local optimization process to emphasize minority or underrepresented classes within each data source’s dataset, while preserving the decentralized structure of federated learning. The reconstruction error is defined as the difference between the input image and its reconstructed output, computed independently at each data source during training [52][53].
Adaptive tuning in federated learning refers to strategies that dynamically adjust training process to handle client heterogeneity, non-IID data, and unstable convergence [55]-[57]. In standard federated learning, a fixed learning rate is used throughout all communication rounds and across all participating data sources [44]-[46]. However, this static approach often leads to suboptimal convergence, particularly when data distributions are non-identical (non-IID) and imbalanced across data sources [16],[58][59].
To mitigate this, the enhanced model introduces an adaptive learning rate tuning strategy, which dynamically adjusts each data source learning rate based on local validation loss feedback [16],[58][59]. The principle is straightforward:
By combining these two enhancements, the enhanced federated learning model aims to improve the robustness under real-world non-IID and imbalanced data conditions, ensuring the local updates are both reliable for global aggregation.
Algorithm: Federated Learning with Autoencoder-based Reconstruction and Adaptive Tuning |
Input: Set of client devices Global model initialization Number of communication rounds Local mini-batch size Number of local epochs Initial learning rate Pre-trained autoencoder Adaptive learning Initialize the global model: for Select subset of client devices for each client Receive the current global model Apply autoencoder-based reconstruction to the local dataset using the autoencoder Divide the reconstruction local data into mini batches of size B Compute adaptive learning rate for each local epoch for each mini batch b do: Update the local model: Send the updated global model Aggregate the local models: where and Send the updated global model Output: Final global model |
By incorporating both an adaptive tuning mechanism and an unsupervised autoencoder-based reconstruction module as illustrated in Figure 1, the model aims to achieve better classification performance, particularly on underrepresented classes, without compromising the federated learning structure.
All model performance is evaluated using five performance metrics: accuracy, precision, macro recall, macro F1-score, and AUC-ROC. While accuracy measures overall correctness, macro-averaged metrics assign equal importance to all classes and are therefore more appropriate under imbalanced conditions. In medical diagnosis, recall is particularly critical as it reflects the ability to correctly detect rare but clinically significant cases. AUC-ROC further evaluates the model’s discrimination capability across decision thresholds.
Figure 1. Workflow of the Enhanced Federated Learning
This subsection presents a general performance summary of the baseline models, (1) standard Federated Learning (FL), (2) FL with Generative Adversarial Networks (FL + GAN), and (3) FL with Unsupervised autoencoder-based reconstruction (FL + AE). The results are evaluated on two datasets: RetinaMNIST (Table 2) (with induced imbalance) and PneumoniaMNIST (Table 3) (natural imbalance) using common performance metrics including accuracy, precision, recall, F1-score and AUC-ROC.
Under the low imbalance condition (1:2), the enhanced model demonstrate strong performance across all evaluation metrics, including accuracy (0.90), macro recall (0.91), and macro F1-score (0.88). Notably, it maintains a high recall for the minority class, indicating that the model is still able to correctly identify a large portion of the underrepresented cases. This indicates that the effectiveness of autoencoder-based reconstruction and adaptive tuning remains robust even when the data distribution becomes moderately skewed. The model does not suffer a substantial drop in its ability to detect rare or less frequent class instances, which is critical in medical diagnosis scenarios where missing such cases could have serious implications.
As the imbalance increases to 1:5, the performance of the model remains stable, with only a slight drop in macro recall and F1-score. This suggests that the adaptive tuning mechanism helps maintain balance learning dynamics even when the minority class becomes less frequent. The autoencoder-based reconstruction further ensures that noisy or low-quality samples do not dominate the learning process, preserving the model’s ability to generalize effectively.
Under the most severe imbalance (1:10), while a decline is observed in some metrics, particularly in recall, the enhanced model still outperforms all baseline models (as discussed in section 5.2). Macro recall remains around 0.80, indicating the model’s continued attention to minority class detection, which is critical for medical diagnostic tasks, where missing rare conditions can be costly. The AUC-ROC also remains relatively high (0.85), indicating strong overall ability to distinguish between classes.
Overall, as illustrated in Figure 2, the most substantial improvements were observed under severe imbalance (1:10), where the enhanced federated learning model increased macro recall by 59.6 percent, F1-score by 33.9 percent, and AUC-ROC by 13.3 percent compared to standard FL. These results confirm that the combination of autoencoder-based reconstruction and adaptive tuning control enables the enhanced model to effectively manage data heterogeneity and class imbalance. The model achieves better robustness and fairness, and sensitivity to minority classes than baseline models.
Even though PneumoniaMNIST does not involve induced imbalance ratios, the enhanced model still achieves the strongest results across all metrics, including accuracy, recall, and AUC-ROC. The gains are particularly clear in recall and AUC-ROC as shown in Figure 3, which are crucial for identifying pneumonia-positive cases without excessive false alarms. Baselines show reasonable accuracy but lower sensitivity to positive cases, highlighting the enhanced model’s advantage in real-world, naturally skewed datasets. Especially results on PneumoniaMNIST with natural imbalance, the enhanced model improved recall by 23.6 percent, F1-score by 18.7 percent, and accuracy by 8.3 percent.
These improvements are not just small numerical gains. They represent stronger generalization, better rare-case detection, and higher overall reliability across diverse data distributions. For practical deployment in medical settings, where errors in handling non-representative cases can lead to harmful consequences, the enhanced model provides consistent effectiveness for both artificially induced imbalance (RetinaMNIST) and natural imbalance (PneumoniaMNIST).
Consequently, performance metrics alone cannot determine whether observed improvements occur consistently across runs or simply by chance, particularly in federated learning, where variability arises from non-IID data distributions and data source-modification training dynamics. Therefore, statistical significance testing, Wilcoxon-signed rank test is performed to validate the reliability of the enhancement approaches.
Across all imbalance ratios in RetinaMNIST and on the naturally imbalanced PneumoniaMNIST dataset:
This demonstrates that the enhanced model improvements in macro recall, macro F1-score, and AUC-ROC are statistically significant, and not the result of random variation.
The strongest significance was observed under the 1:10 imbalance ratio, where baseline models show high variability, but the enhanced model produces consistently high minority-class performance.
In conclusion, compared to prior imbalance-handling strategies in federated learning that rely on synthetic data augmentation or static optimization adjustments, the enhanced integration of reconstruction-based emphasis and adaptive tuning demonstrates stronger minority-class recall under severe imbalance. This can be mainly because augmentation-based model only artificially increases minority classes, and may introduce noise or unrealistic medical features, while the enhanced model recalibrates the learning process to ensure minority classes are not ignored during decentralized training.
Table 2. Performance Results on RetinaMNIST
Model | Imbalance Ratio | Accuracy | Precision | Macro Recall | F1-Score | AUC-ROC |
FL | 1:10 | 0.81 | 0.70 | 0.52 | 0.59 | 0.75 |
1:5 | 0.83 | 0.76 | 0.63 | 0.68 | 0.80 | |
1:2 | 0.85 | 0.80 | 0.72 | 0.74 | 0.83 | |
FL + GAN | 1:10 | 0.83 | 0.75 | 0.56 | 0.61 | 0.79 |
1:5 | 0.85 | 0.80 | 0.68 | 0.71 | 0.84 | |
1:2 | 0.87 | 0.85 | 0.78 | 0.80 | 0.88 | |
FL + AE | 1:10 | 0.84 | 0.74 | 0.60 | 0.66 | 0.81 |
1:5 | 0.86 | 0.79 | 0.72 | 0.75 | 0.86 | |
1:2 | 0.88 | 0.83 | 0.80 | 0.81 | 0.89 | |
Enhanced Model | 1:10 | 0.81 | 0.77 | 0.83 | 0.79 | 0.85 |
1:5 | 0.88 | 0.84 | 0.89 | 0.86 | 0.91 | |
1:2 | 0.90 | 0.86 | 0.91 | 0.88 | 0.93 |
Table 3. Performance Results on PneumoniaMNIST
Model | Accuracy | Precision | Macro Recall | F1-Score | AUC-ROC |
FL | 0.84 | 0.79 | 0.72 | 0.75 | 0.82 |
FL + GAN | 0.86 | 0.82 | 0.76 | 0.78 | 0.85 |
FL + AE | 0.87 | 0.84 | 0.78 | 0.80 | 0.87 |
Enhanced Model | 0.91 | 0.90 | 0.89 | 0.89 | 0.93 |
Figure 2. Enhanced Model Performance for RetinaMNIST
Figure 3. Enhanced Model Performance for PneumoniaMNIST
This research proposed an enhanced federated learning model integrating adaptive tuning and autoencoder-based reconstruction to address class imbalance in medical image classification. The performance of the enhanced model delivers clear advantages in classification performance and robustness under class imbalance and generalization compared to baseline FL based methods on both RetinaMNIST and PneumoniaMNIST. In RetinaMNIST, the enhancements mitigate the impact of increasing imbalance ratios. In PneumoniaMNIST, the model handles naturally imbalanced binary data more effectively than the baselines. This dual validation across datasets strengthens the case for the enhanced model as a general solution for imbalanced medical image classification in federated environments. The enhanced model also demonstrates superior minority-class recognition compared to baseline FL-based imbalance mitigation strategies. Under severe imbalance (1:10), the enhanced federated learning model improved macro recall by 59.6 percent, F1-score by 33.9 percent, and AUC-ROC by 13.3 percent compared to standard federated learning, which also similarly observed under moderate and mild imbalance settings, as well as in naturally imbalanced binary classification tasks.
Nevertheless, the research was conducted using lightweight MedMNIST datasets within a simulated federated setting, which may not fully reflect large-scale, real-world multi-institutional deployments. Future work will extend validation to higher-resolution and clinically diverse datasets to further enhance robustness and scalability.
Overall, the enhanced federated learning demonstrates superior performance across varying imbalance medical representations against standard federated learning model, improve diagnostic sensitivity for rare medical conditions, and contributing to more reliable and equitable AI-driven healthcare systems.
DECLARATION
Author Contribution
All authors contributed equally to the main contributor to this paper. All authors read and approved the final paper.
Funding
This research received no external funding.
Acknowledgement
Write a thank you to those who have helped in this research who are not listed in the author's list.
Conflicts of Interest
The authors declare no conflict of interest.
ABBREVIATIONS
The following abbreviations are used in this manuscript.
FL | : | Federated Learning |
FedAvg | : | Federated Averaging |
Non-IID | : | Non-Independent and Identically Distributed |
AT | : | Adaptive Tuning |
AE | : | Auto-encoder |
GAN | : | Generative Adversarial Network |
AUC-ROC | : | Area under the Receiver Operating Characteristic Curve |
REFERENCES
Nadzurah Zainal Abidin (Adaptive Federated Learning Model with Unsupervised Autoencoder-based Reconstruction for Imbalanced Medical Image Classification)