Medical models are increasingly trained on data pooled from many hospitals or scanners. Before pooling, practitioners "harmonize" the data, meaning they statistically remove each site's technical fingerprint, such as scanner brand or lab calibration, so that the model learns biology rather than site identity. Separately, fairness auditors check whether the finished model treats demographic groups equally. They routinely find that different fairness metrics give contradictory verdicts on the same model. This note proposes that, in multi-site biomedical data, an important and untested source of those contradictions is the harmonization step. Standard harmonizers assume a scanner distorts every patient the same way. If a scanner actually distorts women's or older patients' measurements differently, harmonization fixes the distortion for one group and over- or under-corrects it for the other. That shifts each group's error rates in ways that some fairness metrics register and others do not.
We propose to test this in a controlled setting where the true fairness profile is known. We take real multi-site brain MRI volumes and keep a clean reference subset. We then inject site effects whose strength we control, both in how much they depend on demographic group and in how strongly site membership is confounded with demographics. Finally we measure how far each harmonizer moves the downstream model's fairness metrics away from the profile of a model trained on clean data. We also test one narrow fix: estimating site effects separately per demographic group, with statistical shrinkage so that small groups borrow strength from large ones. The two-sentence version is that fairness audits on harmonized biomedical data may be auditing the harmonizer as much as the model, and a semi-synthetic testbed with a known fairness ground truth can measure how much.
Core Claim
Our claim is that when batch effects interact with demographic group, every harmonizer that models site effects as group-independent produces downstream fairness metrics that are biased away from the clean-data fairness profile. The error-rate metrics are affected differently from selection-rate metrics, so harmonizer choice alone can flip a fairness verdict. A group-stratified harmonizer with hierarchical shrinkage should remove most of this bias without reintroducing site leakage or spurious biological associations.
Three things would be new. The first is a fairness ground truth for harmonization, which no existing benchmark in this space provides. The second is an attribution of observed metric disagreement into three parts: sampling noise, the base-rate incompatibility that is mathematically unavoidable, and harmonization-induced shift. The third is evidence on whether site-by-group interaction actually exists in real multi-site cohorts.
Where This Sits
The fairness side supplies the motivation and one important constraint. Towards Gender Fairness for Mental Health Prediction shows that statistical parity and equalized odds clash whenever base rates differ by group. It also traces a gender bias on the D-Vlog depression dataset to a mundane preprocessing step: fixed-length truncation discarded more of the female vloggers' longer recordings. That is direct precedent for a data-preparation step, rather than the model, driving fairness failures. We generalize that observation from truncation to harmonization.
Is a Fairness Metric Score Enough to Assess Discrimination Biases in Machine Learning? supplies the constraint. It shows that metrics conditioned on outcomes, such as the true-positive-rate gap and predictive parity, have variance up to 0.1 to 0.2 at around 10k samples, while group parity stays near 0.01. Brain MRI cohorts are far smaller than that. Any claimed metric shift must therefore be separated from noise, and this is why our audit is built around bootstrap intervals and verdict-flip rates rather than point estimates. Trustworthy Social Bias Measurement motivates anchoring measurement to an external reference rather than to the metric being optimized. It reports that debiasing increased bias in 7 of 8 cases under its validated measurement. Our clean-data oracle plays the role of that external reference.
The harmonization side supplies the methods and the gap. DeepResBat works in three steps. It regresses out covariates such as age, sex and diagnosis, harmonizes the residuals with a conditional variational autoencoder (a neural network that compresses data into a latent code and reconstructs it given a condition such as site), and adds the covariate effects back. It keeps a 5% false-positive rate in permutation tests, whereas an unconstrained conditional autoencoder invents associations. However, its site correction is shared across demographic groups, and it never reports subgroup fairness. Distributed Harmonization clusters per-site ComBat parameters on a server. Fed-ComBat learns nonlinear covariate trajectories under federated averaging. Both optimize site invariance and regression error only.
Trade-off between conservation of biological variation and batch effect removal frames batch removal against biological signal as a Pareto problem in single-cell data. We adopt its view that batch removal destroys some biology, and we ask specifically whose biology is destroyed. Fairness without Demographics on EHRs is the closest clinical fairness method, but it operates within the single-center MIMIC-III cohort and so never faces site effects.
Research Program
The testbed starts from the 108 regional brain volumes in the ADNI, AIBL and MACC cohorts used by DeepResBat. MACC is a Singaporean cohort, so it adds ancestry differences that are confounded with site.
We take a single-scanner subset as the clean reference. We split it into pseudo-sites and inject site effects drawn from the location-and-scale family that ComBat assumes, plus a group-dependent component scaled by an interaction strength $\gamma$. When $\gamma = 0$, site effects are identical across groups. A second parameter, $\rho$, controls site–demographic confounding by shifting the sex ratio and age distribution of each pseudo-site. The downstream task is classifying Alzheimer's disease versus cognitively normal from the regional volumes. Sex and age tertile are the protected attributes.
For every point on a grid of $(\gamma, \rho)$ values, we run each harmonizer, train the same classifier, and compute statistical parity difference, equal opportunity difference, equalized odds difference, and predictive parity gap, each with bootstrap intervals over test resamples. The primary outcome is the distance between the harmonized model's fairness profile and the profile of the same classifier trained on the clean data. We also count verdict flips, meaning cases where a metric's interval excludes zero with the opposite sign from the oracle. This lets us separate harmonization-induced shift from Jourdan-style sampling noise.
The proposed fix is a group-stratified version of DeepResBat's residual stage. Site location and scale parameters are estimated per (site, group) cell and shrunk toward the site-level estimate with an empirical-Bayes prior, so that tiny cells do not produce noisy corrections. On real data without injection, we first test whether a site-by-sex interaction actually exists. We do this by checking whether a site classifier trained on ComBat-harmonized residuals is more accurate within one sex than the other. A null result here would itself be informative.
Baselines
The naive reference point is no harmonization: pooling the raw volumes and training the classifier directly. It shows how much fairness distortion site effects cause on their own. It is run on identical splits.
The first serious baseline is linear ComBat with sex, age and diagnosis included as protected covariates. This is the standard practice, and it already claims to preserve group differences in means.
The strongest existing method is DeepResBat. It is the only harmonizer in the file with an explicit guarantee against inventing biology, its 5% permutation false-positive rate reported in DeepResBat. It also handles nonlinear covariate effects. We will use its released architecture with the same covariates, the same tuning budget of an equal number of hyperparameter configurations selected on site-classification accuracy, and identical downstream classifiers and seeds.
We also include an unconstrained conditional autoencoder as the hallucination-prone contrast, and Fed-ComBat as the federated nonlinear option.
No reported result found on Lacuna for subgroup fairness metrics of any harmonizer on ADNI, AIBL or MACC. The bar is therefore defined internally. The stratified harmonizer beats DeepResBat if three conditions hold at $\gamma > 0$: it reduces oracle distance by a margin larger than the bootstrap interval width, it lowers the verdict-flip rate, and it keeps site classification near chance and the permutation false-positive rate at or below 5%.
The ablation that isolates the key ingredient is the stratified harmonizer run with shrinkage turned off. If gains vanish with shrinkage off in small-cell settings, shrinkage is doing the work. If gains vanish even with shrinkage on, then stratification is not the mechanism.
Why not just…?
Why not just include sex and age as covariates in ComBat and report confidence intervals? This is the most serious threat, and it is a primary baseline rather than a straw man. Including covariates protects group mean differences only under the assumption that the scanner's distortion is the same for all groups. The $\gamma$ sweep tests exactly where that assumption breaks. If covariate-adjusted ComBat with intervals stays on the oracle profile at realistic $\gamma$, and the real-data interaction test finds no site-by-sex effect, the proposal's main claim fails and we will report that.
Why not just rebalance demographics across sites by resampling or Mixup? Rebalancing addresses the confounding parameter $\rho$ but not the interaction $\gamma$, because a group-specific distortion survives any reweighting of who is at the site. The evidence from Towards Gender Fairness for Mental Health Prediction is that Mixup failed or worsened bias where the underlying problem was signal distortion rather than counts. The grid separates the two cases. Rebalancing should help along $\rho$ and do nothing along $\gamma$.
Why not skip careful harmonization and optimize several fairness metrics jointly, Pareto-style? Fairness penalties cannot tell a technical site artifact from a true group difference, so they may "fix" an injected distortion by distorting predictions instead. The base-rate incompatibility documented in the fairness literature also means no point on such a front equalizes all metrics. We will trace a Pareto front over equalized odds and statistical parity on unharmonized data, following Trade-off between conservation of biological variation and batch effect removal. We will then check whether any front point lies as close to the oracle profile as the stratified harmonizer does.
Decisive Checks
The cleanest prediction is a dose–response. At $\gamma = 0$, all group-independent harmonizers should match the oracle fairness profile within bootstrap noise. Their oracle distance and flip rate should then grow monotonically with $\gamma$, while the stratified harmonizer stays flat. If group-independent harmonizers drift even at $\gamma = 0$, the effect comes from confounding ($\rho$) rather than interaction, and the fix should shift toward demographic-aware site clustering. That would revise the claims made by Distributed Harmonization.
We expect error-rate metrics to cross the noise floor at lower $\gamma$ than statistical parity, given their larger variance. Confirming this would explain why auditors see metric disagreement specifically after harmonization.
Two further checks apply to real data. The first is the within-sex site-classifier test described above. The second is a leave-one-site-out comparison of how often the four harmonizers disagree on the sign of each fairness metric. If harmonizers flip verdicts on real ADNI, AIBL and MACC data, harmonizer choice should be reported alongside any clinical fairness audit.
References
- Towards Gender Fairness for Mental Health Prediction
- Is a Fairness Metric Score Enough to Assess Discrimination Biases in Machine Learning?
- Trustworthy Social Bias Measurement
- DeepResBat: deep residual batch harmonization accounting for covariate distribution differences
- Distributed Harmonization: Federated Clustered Batch Effect Adjustment and Generalization
- Fed-ComBat: A Generalized Federated Framework for Batch Effect Harmonization in Collaborative Studies
- Trade-off between conservation of biological variation and batch effect removal in deep generative modeling for single-cell transcriptomics
- Fairness without Demographics on Electronic Health Records