Degree
Bachelor of Science (Computer Science)
Department
Department of Computer Science
School
School of Mathematics and Computer Science (SMCS)
Advisor
Ms. Tasbiha Fatima, Lecturer, School of Mathematics and Computer Science, IBA Karachi
Keywords
federated learning, differential privacy, chest X-ray classification, adaptive privacy budgets, transfer learning, non-IID data
Abstract
Hospitals in low-resource settings face a compounding dilemma: regulatory frameworks prohibit centralizing patient data, yet formal privacy guarantees for federated model training have, until now, required GPU infrastructure that most institutions do not possess. This project investigates whether a differentially private federated diagnostic model can be trained entirely on standard CPU hardware while simultaneously improving minority-class classification. We propose FedAdaPriv-CPU, a framework built around two interlocking ideas. First, a pretrained ResNet-50 backbone is frozen so that differential privacy noise is applied only to a lightweight three-layer MLP head of approximately 600K parameters rather than the full 7- million-parameter network. This reduces per-round CPU training time from over 40 hours to approximately 4 hours, making overnight federated training practically feasible. Second, each client receives a per-round privacy budget computed through a three-signal multiplicative formula driven by data volume (αvol), convergence state (αconv), and round progression (αround), with cumulative expenditure tracked via a Rényi DP accountant. Evaluated on four-class chest X-ray classification under severe non-IID conditions at a total privacy budget of ε=4.0, FedAdaPriv-CPU achieves accuracy of 85.99% and macro-F1 of 0.810, outperforming the fixed-noise baseline by +11.5 macro-F1 percentage points. Viral Pneumonia F1 recovers from 0.420 to 0.722, a 72% relative gain confirmed across five random seeds and five privacy budget levels. Ablation results show that the convergence-state signal αconv is responsible for virtually all minority-class recovery, identifying heterogeneity-aware budget allocation as a structural requirement rather than an optimization in federated clinical networks.
Tools and Technologies Used
Python, PyTorch, Opacus, torchvision, NumPy, scikit-learn, pandas, matplotlib, MobileNetV2, DenseNet121, Pillow (PIL), Jupyter Notebook, Kaggle, Rényi Differential Privacy (RDP) Accountant, ImageNet (pretrained weights), COVID-19 Radiography Database, Federated Learning, Differential Privacy (DP-SGD), CUDA (optional GPU acceleration)
Methodology
FedAdaPriv-CPU is a privacy-preserving federated learning framework designed for multi-class chest X-ray classification in resource-constrained healthcare environments. At the start of training, each hospital performs a one-time local feature extraction step using a frozen DenseNet121 backbone, generating 1024-dimensional feature vectors that remain stored on-device. Only a lightweight multilayer perceptron classification head is subsequently trained, significantly reducing computational requirements compared to full-model federated learning. During each communication round, clients evaluate the current global model on their local data and compute class-wise performance deficiency scores. These are combined with dataset volume and training progress signals to determine an adaptive privacy budget for each client through a three-signal allocation mechanism. Local training is performed using differentially private optimization with per-sample gradient clipping, Gaussian noise injection, focal loss, and FedProx regularization. A client-side Rényi Differential Privacy accountant tracks cumulative privacy expenditure and enforces a global privacy budget of ε = 4.0 at δ = 10⁻⁵. To further protect institutional information, aggregation weights derived from client data volume are privatized using the Laplace mechanism before transmission. The central server receives only the model update and privatized aggregation weight from each hospital and performs privacy-coupled weighted aggregation to produce the next global model. This architecture enables collaborative medical AI development while preserving patient privacy and remaining practical for deployment on standard CPU-based hospital infrastructure.
Document Type
Restricted Access
Submission Type
BSCS Final Year Project
Recommended Citation
Randhawa, A., Zaman, M., & Sharjeel, Z. (2026). FedAdaPriv-CPU: Adaptive Differential Privacy with Frozen Backbone for Resource-Constrained Federated Medical Imaging. Retrieved from https://ir.iba.edu.pk/fyp-bscs/41
Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 International License.
COinS
