Inferensys

Glossary

Federated F1-Score

The harmonic mean of federated precision and federated recall, providing a single balanced performance metric for a classification model evaluated across a distributed network of data silos without centralizing test data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
Federated Model Evaluation

What is Federated F1-Score?

A privacy-preserving metric for evaluating the balanced performance of a classification model across a decentralized network without centralizing raw data.

The Federated F1-Score is the harmonic mean of federated precision and federated recall, providing a single balanced performance metric for a classification model evaluated across a distributed network of data silos. It is computed by securely aggregating true positive, false positive, and false negative counts from each client without sharing individual patient predictions or labels.

This metric is critical in healthcare federated learning where class imbalance is common, as it penalizes models that achieve high accuracy by simply predicting the majority class. The computation relies on a federated confusion matrix, where local counts are summed via a secure aggregation protocol, ensuring the global F1-Score reflects true model performance while maintaining strict patient privacy.

Balanced Decentralized Evaluation

Key Characteristics of Federated F1-Score

The Federated F1-Score provides a single, harmonized metric for classification performance across a distributed network, balancing the trade-off between precision and recall without centralizing sensitive validation data.

01

Harmonic Mean of Precision and Recall

The Federated F1-Score is defined as the harmonic mean of federated precision and federated recall, giving equal weight to both metrics. Unlike a simple arithmetic mean, the harmonic mean penalizes extreme imbalances, ensuring a high F1-Score is only achieved when both precision and recall are high.

  • Formula: 2 * (Federated Precision * Federated Recall) / (Federated Precision + Federated Recall)
  • Penalizes Extremes: A model with perfect recall but near-zero precision will have a very low F1-Score, preventing misleadingly optimistic evaluations.
  • Single Metric: It distills the trade-off between false positives and false negatives into one interpretable value for model selection.
02

Secure Aggregation of Global Counts

The global F1-Score is not computed by averaging local F1-Scores, which is mathematically incorrect. Instead, it relies on the federated confusion matrix to securely aggregate the raw components: True Positives (TP), False Positives (FP), and False Negatives (FN) from each client.

  • Privacy-Preserving Summation: Techniques like Secure Aggregation (SecAgg) are used to sum TP, FP, and FN counts across institutions without revealing any single institution's values.
  • Global Calculation: The central server computes Global Precision = ΣTP / (ΣTP + ΣFP) and Global Recall = ΣTP / (ΣTP + ΣFN), then derives the F1-Score.
  • Avoids Averaging Pitfalls: This method correctly accounts for varying dataset sizes and class distributions across silos.
03

Handling Class Imbalance Across Silos

In healthcare federated learning, disease prevalence often varies dramatically between institutions. The Federated F1-Score is particularly sensitive to this non-IID class distribution.

  • Macro vs. Micro Averaging: A macro-averaged F1-Score calculates the metric for each class independently and then takes the unweighted mean, treating rare and common diseases equally. A micro-averaged F1-Score aggregates contributions from all classes globally, which can be dominated by high-prevalence conditions.
  • Weighted Strategies: A weighted F1-Score can be computed by weighting each client's contribution by its total number of samples, ensuring larger hospitals don't skew the metric unfairly.
  • Bias Detection: A significant discrepancy between macro and micro F1-Scores is a strong signal of class imbalance that requires investigation.
04

Differential Privacy and Metric Fidelity

To prevent membership inference attacks from the aggregated counts, noise is often added to the TP, FP, and FN tallies using Differential Privacy (DP). This introduces a critical trade-off between privacy and metric accuracy.

  • Privacy Budget (Epsilon): A lower epsilon value adds more noise, providing stronger privacy guarantees but potentially distorting the true F1-Score.
  • Noise Calibration: The noise scale is calibrated to the sensitivity of the count queries. Since adding a single patient can change a count by at most 1, the sensitivity is 1.
  • Confidence Intervals: Instead of reporting a single noisy F1-Score, a confidence interval should be provided to quantify the uncertainty introduced by the DP mechanism.
05

Threshold-Dependent Evaluation

The F1-Score is a threshold-dependent metric, meaning its value is tied to a specific classification threshold (usually 0.5 for predicted probabilities). This is a critical limitation in federated settings where optimal thresholds may vary per site.

  • Site-Specific Thresholds: A model might need a higher threshold at a community clinic (prioritizing precision to avoid false alarms) and a lower threshold at a research hospital (prioritizing recall for screening).
  • Complement with Federated AUC: For a threshold-agnostic view of model performance, the Federated F1-Score should be reported alongside the Federated AUC, which evaluates performance across all possible thresholds.
  • Federated Threshold Tuning: A separate federated process may be required to find the optimal global or personalized threshold that maximizes the F1-Score for a specific clinical objective.
06

Auditing for Equalized Odds

The Federated F1-Score can be decomposed to audit for fairness across protected demographic groups. Equalized Odds requires that the True Positive Rate (Recall) and False Positive Rate are equal across groups.

  • Group-Specific F1: Compute the Federated F1-Score independently for each demographic subgroup by securely aggregating TP, FP, and FN counts stratified by group membership.
  • Fairness Gap: A significant difference in F1-Scores between groups indicates a violation of predictive equality, which is a critical regulatory risk in clinical AI.
  • Intersectional Analysis: The same technique can be extended to intersectional subgroups (e.g., race and gender) to detect compounded biases that might be hidden in aggregate metrics.
FEDERATED F1-SCORE

Frequently Asked Questions

Clear answers to common questions about computing the harmonic mean of precision and recall across decentralized data silos, including privacy-preserving aggregation, handling class imbalance, and interpreting results in clinical contexts.

A Federated F1-Score is the harmonic mean of federated precision and federated recall, providing a single balanced metric for evaluating a classification model's performance across a distributed network without centralizing raw data. It is calculated by first securely aggregating the global counts of true positives (TP), false positives (FP), and false negatives (FN) from each participating client using a protocol like Secure Aggregation (SecAgg). The central server then computes global precision as TP / (TP + FP) and global recall as TP / (TP + FN), and finally derives the F1-Score as 2 * (Precision * Recall) / (Precision + Recall). This macro-level, count-based approach is mathematically equivalent to computing the metric on pooled data but preserves patient privacy by never exposing individual client's raw predictions or labels. For multi-class problems, the F1-Score is typically macro-averaged or micro-averaged across classes using the same federated counting mechanism.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.