PROJECT NOTES / FEDERATED LEARNING
Federated Learning
for Mask Recognition.
Starting from an existing mask recognition baseline, I helped build a Flower multi-client training simulation, then independently authored a paper exploring how client count and local training epochs affect accuracy and training time.
From local training to global evaluation.
- 01
Train locally
Each client trains a lightweight CNN on its own data partition
- 02
Aggregate on the server
A FedAvg-based strategy combines updates and saves the global model and metrics
- 03
Evaluate on held-out data
Measure global-model loss and accuracy on images excluded from training
01 / GROUP STAGE
Extending a mask recognition baseline into federated training.
The team started from an existing mask recognition project, using a lightweight PyTorch CNN to classify images as masked or unmasked. We used Flower to simulate distributed training locally. Each client trained on its own data partition and returned model parameters and metrics; the server aggregated updates through a custom FedAvg-based strategy, saved the global model and recorded training accuracy and loss.
The group-stage launcher ran one server and five client processes. After training, we evaluated the global model on a separate held-out test set, using cross-entropy loss to measure prediction error and classification accuracy to measure recognition performance. This was a local multi-process simulation, not a completed deployment across real devices.
The PPT’s CIFAR-10 non-IID experiments were a separate group-stage exploration of imbalanced data distributions and local training configurations. They are distinct from the mask recognition training records shown here and are not cited as mask recognition results.
Original titles, axes and ticks are preserved. On narrow screens, swipe within each chart (or focus it and use the arrow keys), or open the original image to zoom in.
02 / MY CONTRIBUTION
Connecting data, training, evaluation and local prediction.
As recorded on the presentation’s Division of Work slide (slide 21), I collected and processed training and testing data, wrote the major implementation of the mask recognition federated pipeline and presented the distributed training implementation. These were my main contributions within a collaborative project, not a claim of sole ownership of the team’s work.
Data preparation and model
I collected and processed the training and testing data, organising masked and unmasked images. I implemented data loading and equal client partitions in dataset.py, and the lightweight CNN in model.py, preparing a consistent input pipeline for local training and held-out evaluation.
Client training and server aggregation
I wrote the major implementation of client.py and server.py. Flower’s NumPyClient loads local data, trains the model and returns parameters and metrics. The server uses a FedAvg-based strategy to aggregate updates, save the global model each round, record accuracy and loss, and generate curves when training finishes.
Experiment launching and evaluation
I implemented run_all.py to launch the server and multiple clients with distinct CLIENT_IDs, connecting the local simulation workflow. I also implemented evaluate_model.py to calculate cross-entropy loss and classification accuracy on an independent test set, checking recognition on unseen images.
Local prediction interface
I implemented the local graphical interface in predict_gui.py, loading the trained model so users could upload an image and see its mask classification.
03 / FOLLOW-UP PAPER
From a training pipeline to configuration trade-offs.
Building on the group project, I independently authored the paper Federated Learning on Mask recognition with its local simulation and optimization, studying combinations of client count and local training epochs. Local epochs refer to passes through a client’s data before aggregation, rather than the server’s aggregation rounds.
As described in the project README, the follow-up analysis uses a Pareto frontier to present trade-offs between accuracy and training time: configurations that cannot improve one objective without sacrificing the other, rather than simply ranking by maximum accuracy. It uses the Friedman test and Nemenyi comparisons to compare configurations. This page describes the methods without quoting optimal settings, significance claims or numerical results that lack an explicit source.
The journal page lists the paper as published on 23 October 2025, in STECEP, Volume 3, Issue 5, with Liukai Tang as the author. Publication status follows the journal page; the README’s “Under Review” label is an earlier record.
04 / PROJECT LINKS
Read the paper and explore the implementation.
The paper page provides publication details and access to the full text. The repository README documents the workflow, Pareto analysis and statistical testing scripts. Check the repository’s licence and usage instructions before using its contents.