Federated and Centralized Machine Learning for Cell Segmentation: A Comparative Analysis
Abstract
:1. Introduction
- Identification of a heterogeneous dataset for cell segmentation with images coming from various source types (also including user-submitted images);
- Benchmark to determine the best cell segmentation model to be implemented in a federated framework;
- Overall evaluation of all classical metrics used for this task in both federated and centralized settings, providing a complete evaluation of all models;
- Performance comparison between multi-client distribution;
- Performance comparison between federated and centralized model.
2. Theoretical Background and Related Works
2.1. Traditional Cell Segmentation Techniques
2.2. Deep Learning Cell Segmentation Techniques
2.3. Federated Learning for Image Segmentation
- Sending the model to the client nodes: The cloud model shares its weights with each client so that they start local training using the same parameters.
- Local model training: The client model becomes locally trained on the client’s dataset.
- Sending the updated weights back: Each client sends the updates back to the cloud.
- Aggregation and global model update: The cloud aggregates all received weights to upgrade the server model.
3. Materials and Methods
3.1. Datasets
- “Cytoplasm”: a two-channel images dataset where the first channel is the cell segmentation channel and the second one is the nuclear channel (optional), consisting of training images and testing images;
- “Cytoplasm2”: an updated “Cytoplasm” dataset including user-submitted two-channel images, with the first as the channel to segment and the second as an optional nuclear channel, consisting of total training images.The initial “Cytoplasm” dataset was obtained by collecting images from a variety of sources, primarily through a search on the Internet for keywords such as “cytoplasm”, “cell microscopy”, “fluorescent cells”, and so on. The entire dataset consists of the following:
- −
- images of fluorescent-labeled proteins localized in the cytoplasm ( of the total dataset);
- −
- images of cells from bright-field microscopy ( of the total dataset);
- −
- images of membrane-labeled cells ( of the total dataset);
- −
- images from other types of microscopy ( of the total dataset);
- −
- non-microscopy images containing large numbers of repeated objects, e.g., fruits, rocks, jellyfish ( of the total dataset).
3.2. Models
- U-Net [8]: a standard architecture with an encoder–decoder structure and skip connections, widely used for biomedical image segmentation and trained here for cell segmentation.
- StarDist [25]: a deep learning model with a U-Net backbone that is very effective for segmenting overlapping cells.
- Cellpose [9]: a cell segmentation model originally trained on diverse datasets, capable of segmenting various cell types without extensive retraining. It is based on a U-Net and used to predict gradient flows.
3.3. Loss and Performance Evaluation Metrics
3.4. FL Testbench
Federated Learning Evaluation
- The starting model used by the clients and the server, previously referred to as the “baseline” model;
- The training function used by every client for the local training with their local dataset;
- A Flower Client that describes the client’s structure, its train, and its test datasets;
- The strategy implementing the FL algorithm, which for this use case is FedAvg;
- Simulation parameters: number of rounds, number of clients, and number of epochs per client.
- A fully “centralized” model, which is the baseline re-trained on the new data for 200 epochs;
- A series of federated models, corresponding to the baseline re-trained using a fully distributed approach where each client trains the model for 20 epochs over 10 rounds. In this case, the cyto2 dataset is randomly and equally divided among the clients considered for a given simulation (IID data distribution).
4. Results and Discussions
4.1. Baseline Model Evaluation
4.2. Models Loss Evaluation
4.3. Comparison Between Centralized and Federated Learning
4.3.1. Binary Segmentation Metrics
4.3.2. Multi-Class Segmentation Metrics
4.3.3. Computational Cost
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
AI | Artificial intelligence; |
DL | Deep learning; |
CNN | Convolutional neural network; |
FL | Federated learning; |
ML | Machine learning; |
DNN | Deep neural network; |
ROI | Region of interest; |
Non-IID | Non-independent and identically distributed; |
RNN | Recurrent neural network; |
ZeroCost | ZeroCostDL4Mic; |
GT | Ground truth; |
MSE | Mean squared error; |
BCE | Binary cross-entropy; |
TP | True positives; |
FP | False positives; |
TN | True negatives; |
FN | False negatives; |
IoU | Intersection over union; |
DICE2 | Ensemble dice; |
AJI | Aggregated Jaccard index; |
DQ | Detection quality; |
SQ | Segmentation quality; |
PQ | Panoptic quality; |
SI | Spindle Index; |
FedAvg | Federated averaging. |
References
- Liu, Z.; Jin, L.; Chen, J.; Fang, Q.; Ablameyko, S.; Yin, Z.; Xu, Y. A survey on applications of deep learning in microscopy image analysis. Comput. Biol. Med. 2021, 134, 104523. [Google Scholar] [CrossRef]
- Chalfoun, J.; Majurski, M.; Dima, A.; Stuelten, C.; Peskin, A.; Brady, M. FogBank: A single cell segmentation across multiple cell lines and image modalities. BMC Bioinform. 2014, 15, 431. [Google Scholar] [CrossRef]
- Xing, F.; Xie, Y.; Su, H.; Liu, F.; Yang, L. Deep learning in microscopy image analysis: A survey. IEEE Trans. Neural Netw. Learn. Syst. 2017, 29, 4550–4568. [Google Scholar] [CrossRef]
- von Chamier, L.; Laine, R.F.; Jukkala, J.; Spahn, C.; Krentzel, D.; Nehme, E.; Lerche, M.; Hernández-Pérez, S.; Mattila, P.K.; Karinou, E.; et al. Democratising deep learning for microscopy with ZeroCostDL4Mic. Nat. Commun. 2021, 12, 2276. [Google Scholar] [CrossRef] [PubMed]
- Liu, P.; Li, J.; Chang, J.; Hu, P.; Sun, Y.; Jiang, Y.; Zhang, F.; Shao, H. Software Tools for 2D Cell Segmentation. Cells 2024, 13, 352. [Google Scholar] [CrossRef]
- Carpenter, A.E.; Jones, T.R.; Lamprecht, M.R.; Clarke, C.; Kang, I.H.; Friman, O.; Guertin, D.A.; Chang, J.H.; Lindquist, R.A.; Moffat, J.; et al. CellProfiler: Image analysis software for identifying and quantifying cell phenotypes. Genome Biol. 2006, 7, R100. [Google Scholar] [CrossRef]
- Falk, T.; Mai, D.; Bensch, R.; Çiçek, Ö.; Abdulkadir, A.; Marrakchi, Y.; Böhm, A.; Deubner, J.; Jäckel., Z.; Seiwald, K.; et al. U-Net: Deep learning for cell counting, detection, and morphometry. Nat. Methods 2019, 16, 67–70. [Google Scholar] [CrossRef]
- Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, 5–9 October 2015; Proceedings, Part III 18; Springer International Publishing: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar]
- Stringer, C.; Wang, T.; Michaelos, M.; Pachitariu, M. Cellpose: A generalist algorithm for cellular segmentation. Nat. Methods 2021, 18, 100–106. [Google Scholar] [CrossRef]
- Pachitariu, M.; Stringer, C. Cellpose 2.0: How to train your own model. Nat. Methods 2022, 19, 1634–1641. [Google Scholar] [CrossRef]
- AbdulRahman, S.; Tout, H.; Ould-Slimane, H.; Mourad, A.; Talhi, C.; Guizani, M. A survey on federated learning: The journey from centralized to distributed on-site learning and beyond. IEEE Internet Things J. 2020, 8, 5476–5497. [Google Scholar] [CrossRef]
- Ullah, F.; Nadeem, M.; Abrar, M.; Amin, F.; Salam, A.; Khan, S. Enhancing brain tumor segmentation accuracy through scalable federated learning with advanced data privacy and security measures. Mathematics 2023, 11, 4189. [Google Scholar] [CrossRef]
- Yahiaoui, M.E.; Derdour., M.; Abdulghafor, R.; Turaev, S.; Gasmi, M.; Bennour, A.; Aborujilah, A.; Sarem, M.A. Federated Learning with Privacy Preserving for Multi-Institutional Three-Dimensional Brain Tumor Segmentation. Diagnostics 2024, 14, 2891. [Google Scholar] [CrossRef] [PubMed]
- McMahan, B.; Moore, E.; Ramage, D.; Hampson, S.; y Arcas, B.A. Communication-efficient learning of deep networks from decentralized data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, Fort Lauderdale, FL, USA, 20–22 April 2017. [Google Scholar]
- Wen, J.; Zhang, Z.; Lan, Y.; Cui, Z.; Cai, J.; Zhang, W. A survey on federated learning: Challenges and applications. Int. J. Mach. Learn. Cybern. 2023, 14, 513–535. [Google Scholar] [CrossRef] [PubMed]
- Nazir, S.; Kaleem, M. Federated learning for medical image analysis with deep neural networks. Diagnostics 2023, 13, 1532. [Google Scholar] [CrossRef]
- Saeedi, M.; Gorji, H.T.; Vasefi, F.; Tavakolian, K. Federated vs. Central Machine Learning on Diabetic Foot Ulcer Images: Comparative Simulations. IEEE Access 2024, 12, 58960–58971. [Google Scholar] [CrossRef]
- Alhafiz, F.; Basuhail, A. The Data Heterogeneity Issue Regarding COVID-19 Lung Imaging in Federated Learning: An Experimental Study. Big Data Cogn. Comput. 2025, 9, 11. [Google Scholar] [CrossRef]
- Beutel, D.J.; Topal, T.; Mathur, A.; Qiu, X.; Fernandez-Marques, J.; Gao, Y.; Sani, L.; Li, K.H.; Parcollet, T.; de Gusmão, P.P.B.; et al. Flower: A Friendly Federated Learning Framework. Open-Source, Mobile-Friendly Federated Learning Framework. 2022. Available online: https://hal.science/hal-03601230 (accessed on 19 March 2025).
- Vu, Q.D.; Graham, S.; Kurc, T.; To, M.N.N.; Shaban, M.; Qaiser, T.; Koohbanani, N.A.; Khurram, S.A.; Kalpathy-Cramer, J.; Zhao, T.; et al. Methods for segmentation and classification of digital microscopy tissue images. Front. Bioeng. Biotechnol. 2019, 7, 53. [Google Scholar] [CrossRef]
- Castro, S.; Pereira, V.; Silva, R. Improved Segmentation of Cellular Nuclei Using U-Net Architectures for Enhanced Pathology Imaging. Electronics 2024, 13, 3335. [Google Scholar] [CrossRef]
- Chen, H.; Murphy, R.F. Evaluation of cell segmentation methods without reference segmentations. Mol. Biol. Cell 2023, 34, ar50. [Google Scholar] [CrossRef]
- Ji, X.; Li, Y.; Cheng, J.; Yu, Y.; Wang, M. Cell image segmentation based on an improved watershed algorithm. In Proceedings of the 2015 8th International Congress on Image and Signal Processing (CISP), Shenyang, China, 14–16 October 2015. [Google Scholar]
- Wen, T.; Tong, B.; Liu, Y.; Pan, T.; Du, Y.; Chen, Y.; Zhang, S. Review of research on the instance segmentation of cell images. Comput. Methods Programs Biomed. 2022, 227, 107211. [Google Scholar] [CrossRef]
- Schmidt, U.; Weigert, M.; Broaddus, C.; Myers, G. Cell detection with star-convex polygons. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2018: 21st International Conference, Granada, Spain, 16–20 September 2018. [Google Scholar]
- Lalit, M.; Tomancak, P.; Jug, F. Embedding-based instance segmentation in microscopy. In Proceedings of the Medical Imaging with Deep Learning, PMLR, Lübeck, Germany, 7–9 July 2021; pp. 399–415. [Google Scholar]
- Lee, K.; Byun, H.; Shim, H. Cell Segmentation in Multi-modality High-Resolution Microscopy Images with Cellpose. In Proceedings of the Machine Learning Research, New Orleans, LA, USA, 28–29 December 2022. [Google Scholar]
- Lazaros, K.; Koumadorakis, D.E.; Vrahatis, A.G.; Kotsiantis, S. Federated Learning: Navigating the Landscape of Collaborative Intelligence. Electronics 2024, 13, 4744. [Google Scholar] [CrossRef]
- Marin Machado de Souza, R.; Holm, A.; Biczyk, M.; de Castro, L.N. A systematic literature review on the use of federated learning and bioinspired computing. Electronics 2024, 13, 3157. [Google Scholar] [CrossRef]
- What Is Federated Learning? Available online: https://flower.ai/docs/framework/tutorial-series-what-is-federated-learning.html (accessed on 8 January 2025).
- Shakor, M.Y.; Khaleel, M.I. Recent Advances in Big Medical Image Data Analysis Through Deep Learning and Cloud Computing. Electronics 2024, 13, 4860. [Google Scholar] [CrossRef]
- Models, Cellpose. Available online: https://cellpose.readthedocs.io/en/latest/models.html (accessed on 11 February 2025).
- Cellpose 2D ZeroCostDL4Mic. Available online: https://colab.research.google.com/github/HenriquesLab/ZeroCostDL4Mic/blob/master/Colab_notebooks/Cellpose_2D_ZeroCostDL4Mic.ipynb (accessed on 8 January 2025).
- Cellpose. Available online: https://www.cellpose.org/ (accessed on 17 January 2025).
- ZeroCostDL4Mic. Available online: https://github.com/HenriquesLab/ZeroCostDL4Mic/wiki (accessed on 11 February 2025).
- PyTorch: MSELoss. Available online: https://pytorch.org/docs/stable/generated/torch.nn.MSELoss.html (accessed on 5 February 2025).
- Pytorch: BCEWithLogitsLoss. Available online: https://pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html (accessed on 12 February 2025).
- Hossin, M.; Sulaiman, M.N. A review on evaluation metrics for data classification evaluations. Int. J. Data Min. Knowl. Manag. Process 2015, 5, 1–11. [Google Scholar]
- Müller, D.; Soto-Rey, I.; Kramer, F. Towards a guideline for evaluation metrics in medical image segmentation. BMC Res. Notes 2022, 15, 210. [Google Scholar] [CrossRef] [PubMed]
- Graham, S.; Vu, Q.D.; Raza, S.E.A.; Azam, A.; Tsang, Y.W.; Kwak, J.T.; Rajpoot, N. Hover-net: Simultaneous segmentation and classification of nuclei in multi-tissue histology images. Med. Image Anal. 2019, 58, 101563. [Google Scholar] [CrossRef]
- Kumar, N.; Verma, R.; Sharma, S.; Bhargava, S.; Vahadane, A.; Sethi, A. A dataset and a technique for generalized nuclear segmentation for computational pathology. IEEE Trans. Med. Imaging 2017, 36, 1550–1560. [Google Scholar] [CrossRef]
- Kirillov, A.; He, K.; Girshick, R.; Rother, C.; Dollár, P. Panoptic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 16–20 June 2019. [Google Scholar]
- Simultaneous Nuclear Instance Segmentation and Classification in H&E Histology Images. Available online: https://github.com/vqdang/hover_net (accessed on 19 January 2025).
- Koo, V.; El Mekabaty, A.; Hamilton, P.; Maxwell, P.; Sharaf, O.; Diamond, J.; Watson, J.; Williamson, K. Novel in vitro assays for the characterization of EMT in tumourigenesis. Anal. Cell. Pathol. 2010, 32, 67–76. [Google Scholar] [CrossRef]
- Lee, S.; Zhang, T.; Prakash, S.; Niu, Y.; Avestimehr, S. Embracing Federated Learning: Enabling Weak Client Participation via Partial Model Training. IEEE Trans. Mob. Comput. 2024, 23, 11133–11143. [Google Scholar] [CrossRef]
- Ajao, A.; Jonathan, O.; Adetiba, E. The Applications of Federated Learning Algorithm in the Federated Cloud Environment: A Systematic Review. In Proceedings of the 2024 International Conference on Science, Engineering and Business for Driving Sustainable Development Goals (SEB4SDG), Omu-Aran, Nigeria, 2–4 April 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 1–15. [Google Scholar]
- Kaggle: Understanding Evaluation Metrics in Segmentation. Available online: https://www.kaggle.com/code/nghihuynh/understanding-evaluation-metrics-in-segmentation (accessed on 19 March 2025).
- Jeremy Jordan: Evaluating Image Segmentation Models. Available online: https://www.jeremyjordan.me/evaluating-image-segmentation-models/ (accessed on 5 February 2025).
Study | Dataset | Methodology | FL Parameters | Shortcomings |
---|---|---|---|---|
[12] | BRATS | U-Net | FedAv Local epochs = 5 Clients = 10, 50, 100 | Performance dependent on quality of data Malicious clients |
[13] | BraTS2020 | 3D U-Net | FedAvg Local epochs = 3 Clients = 4 Rounds = 100 | Model generalizability |
[17] | Medetec Wound Database | U-Net | FedAvg Local epochs = 25–50 Clients = 2–50 Rounds = 200 | Not addressing real-world scenarios |
[18] | Seven COVID-19 Datasets | CNN | FedAvg Local epochs = 10 Clients = 4 Rounds = 15 | Data heterogeneity and skewness |
U-Net | StarDist | Cellpose | |
---|---|---|---|
Convolutional layers | 23 [8] | 24 [25] | 41 [9] |
Training epochs | 200 | 200 | 200 |
Learning rate | 0.0001 | 0.0001 | 0.0002 |
Batch size | 4 | 15 | 8 |
Binary Metrics | Definition |
---|---|
Precision | |
(how accurate positive detections are [38]) | |
Recall (or Sensitivity) | |
(the amount of positive predictions [38]) | |
Accuracy | |
(the percentage of correctly classified pixels [38]) | |
Dice Coefficient (or F1 Score) | |
(the armonic mean of precision and recall [39]) | |
IoU (or Jaccard Index) | |
(the overlap between detected “boxes” in predicted mask and GT [39]) |
Multi-Class Metrics | Definition |
---|---|
DICE2 | |
(computes and aggregates the dice coefficient per nucleus [20]) | |
Aggregated Jaccard Index (AJI) | |
(a unified evaluation metric [41]) | |
Detection Quality (DQ) | |
(F1 score used for instance detection) [42]) | |
Segmentation Quality (SQ) | |
(how close each correctly detected instance is to GT [42]) | |
Panoptic Quality (PQ) | |
(to assess nuclear instance segmentation performance [42]) | |
Paired IoU | |
(determines how well each predicted cell is segmented [42]) |
Hyper-Parameters | Values |
---|---|
Client number | 2, 4, 8, 16 |
Round number | 10 |
Local epoch number | 20 |
Batch size | 8 |
Learning rate | 0.001 |
Aggregation strategy | FedAvg |
Training dataset size | 256 |
Local dataset size | 128, 64, 32, 16 |
Test dataset size | 68 |
Baseline Model | Precision | Recall | Accuracy | Dice Coeff. | IoU |
---|---|---|---|---|---|
U-Net | 0.91 | 0.40 | 0.58 | 0.50 | 0.38 |
StarDist | 0.75 | 0.07 | 0.49 | 0.12 | 0.07 |
Cellpose | 0.90 | 0.81 | 0.87 | 0.84 | 0.75 |
Model | Training Loss | Test Loss |
---|---|---|
Federated (2 Clients) | 1.416 | 1.348 |
Federated (4 Clients) | 1.490 | 1.344 |
Federated (8 Clients) | 1.553 | 1.358 |
Federated (16 Clients) | 1.594 | 1.347 |
Centralized | 1.395 | 1.343 |
Model | Precision | Recall | Accuracy | Dice Coeff. | IoU |
---|---|---|---|---|---|
Federated (2 Clients) | 0.88 | 0.86 | 0.88 | 0.86 | 0.76 |
Federated (4 Clients) | 0.89 | 0.86 | 0.88 | 0.87 | 0.78 |
Federated (8 Clients) | 0.87 | 0.88 | 0.88 | 0.87 | 0.78 |
Federated (16 Clients) | 0.88 | 0.86 | 0.88 | 0.86 | 0.77 |
Centralized | 0.89 | 0.85 | 0.88 | 0.86 | 0.77 |
Model | DICE2 | AJI | AJI+ | DQ | SQ | PQ |
---|---|---|---|---|---|---|
Federated (2 Clients) | 0.436 | 0.628 | 0.701 | 0.783 | 0.801 | 0.642 |
Federated (4 Clients) | 0.439 | 0.636 | 0.706 | 0.784 | 0.804 | 0.645 |
Federated (8 Clients) | 0.429 | 0.633 | 0.701 | 0.777 | 0.80 | 0.638 |
Federated (16 Clients) | 0.437 | 0.629 | 0.695 | 0.778 | 0.796 | 0.633 |
Centralized | 0.440 | 0.629 | 0.698 | 0.775 | 0.801 | 0.636 |
Model | Circular Cells [%] | Elongated Cells [%] | Mean Number of Cells Error | Paired IoU |
---|---|---|---|---|
Federated (2 Clients) | 92.29 | 7.71 | 13 | 0.908 |
Federated (4 Clients) | 92.75 | 7.25 | 13 | 0.907 |
Federated (8 Clients) | 92.37 | 7.63 | 13 | 0.908 |
Federated (16 Clients) | 92.49 | 7.51 | 12 | 0.905 |
Centralized | 92.13 | 7.87 | 12 | 0.907 |
Ground truth | 89.45 | 10.55 | - | - |
Model | Simulation Time |
---|---|
Federated (2 Clients) | 2 h 10 min |
Federated (4 Clients) | 2 h 11 min |
Federated (8 Clients) | 2 h 18 min |
Federated (16 Clients) | 2 h 26 min |
Centralized | 42 min |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Bruschi, S.; Esposito, M.; Raggiunto, S.; Belli, A.; Pierleoni, P. Federated and Centralized Machine Learning for Cell Segmentation: A Comparative Analysis. Electronics 2025, 14, 1254. https://doi.org/10.3390/electronics14071254
Bruschi S, Esposito M, Raggiunto S, Belli A, Pierleoni P. Federated and Centralized Machine Learning for Cell Segmentation: A Comparative Analysis. Electronics. 2025; 14(7):1254. https://doi.org/10.3390/electronics14071254
Chicago/Turabian StyleBruschi, Sara, Marco Esposito, Sara Raggiunto, Alberto Belli, and Paola Pierleoni. 2025. "Federated and Centralized Machine Learning for Cell Segmentation: A Comparative Analysis" Electronics 14, no. 7: 1254. https://doi.org/10.3390/electronics14071254
APA StyleBruschi, S., Esposito, M., Raggiunto, S., Belli, A., & Pierleoni, P. (2025). Federated and Centralized Machine Learning for Cell Segmentation: A Comparative Analysis. Electronics, 14(7), 1254. https://doi.org/10.3390/electronics14071254