Antibiotic resistance was associated with an estimated 4.95 million deaths in 2019, 1.27 million of them directly attributable, and wastewater is one of its main environmental highways. Hospital effluent carries the carbapenem-resistance gene blaNDM-1 at 71% prevalence versus 12% in community sewage, and blaCTX-M at 7.96 log copies/mL versus 6.86 in urban wastewater (A Review on the Prevalence and Treatment of Antibiotic Resistance Genes in Hospital Wastewater). The only planetary-scale picture of this reservoir comes from metagenomic sequencing — reading all the DNA in a sample — across 575 treatment plants in 60 countries, which catalogued more than 70,000 resistance genes across 715 subtypes (Global wastewater microbiome reveals core bacterial community and viral diversity with regional antibiotic resistance patterns). But that coverage is skewed toward wealthy countries, exactly where the resistance burden is best characterized already. The plants where surveillance would change decisions most are the ones where full metagenomic profiling is least affordable.
The proposal is to treat each region's treatment plants as a domain — a distinct data distribution — and apply semi-supervised domain adaptation, or SSDA: train a predictive model on data-rich source regions, then adapt it to a data-poor target region using the region's many cheap, unlabeled records (operational metadata, climate and demographic data, partial microbial profiles) plus one to three gold-standard sequenced plants, which SSDA literature calls anchors. In one sentence: we predict resistance-gene risk at unsampled wastewater plants by transferring models from well-studied regions and calibrating them on a handful of fully sequenced local plants. This is not simply "run an existing SSDA method on new data." The SSDA literature itself lists prototype collapse under long-tailed class distributions as an open, unaddressed problem — and in resistance surveillance the long tail is the whole point: a few resistance subtypes are ubiquitous, while the rare ones are the last-resort genes (blaNDM, mcr, tet(X4)) that clinicians most need flagged (Global distribution of antimicrobial resistance genes in aquaculture). Our method contribution is a tail-corrected, measurement-noise-aware version of anchored adaptation built for exactly that regime.
Background and the Gap
Three lines of work define the gap. First, the global wastewater microbiome study motivates the problem and is the closest existing work: it showed that plant microbiomes carry strong regional signatures (it trained a LightGBM model to predict a sample's continent of origin from microbial feature tables and KEGG functional profiles), but it treats this as a standard single-distribution supervised problem, with no notion of domain shift and no attempt to transfer to the data-scarce regions where resistance prevalence is high but labeled samples are few (Global wastewater microbiome reveals core bacterial community and viral diversity with regional antibiotic resistance patterns). Second, the SSDA literature supplies the machinery but not the robustness we need. Minimax entropy (MME) uses sparse target labels as class prototypes and plays an adversarial game on the entropy of unlabeled target features, reaching 66.4% (1-shot) and 68.9% (3-shot) on DomainNet, roughly 10 points above naive source-plus-target fine-tuning (Semi-supervised Domain Adaptation via Minimax Entropy). Cross-domain adaptive clustering (CDAC) adds cluster-granularity alignment and pseudo-labeling, reaching 76.0% on DomainNet 3-shot with released code (Cross-Domain Adaptive Clustering for Semi-Supervised Domain Adaptation, lijichang/CVPR2021-SSDA). Selective pseudo-labeling (SPL) showed that naive pseudo-labels are badly noisy — restricting to the 20% of samples nearest a labeled anchor lifted pseudo-label accuracy from 35.2% to 61.6% (Semi-Supervised Domain Adaptation via Selective Pseudo Labeling and Progressive Self-Training) — and the two-stage CLMT approach identified gradient dilution, where 200:1 source-to-anchor ratios swamp the target signal, fixing it with source-free refinement for a 10.2-point gain over MME at 1-shot (Towards Realizing the Value of Labeled Target Samples: a Two-Stage Approach for Semi-Supervised Domain Adaptation). All of these were validated on balanced image benchmarks; none addresses long-tailed targets, and none has touched aquatic or metagenomic data, though related SSDA work on retinal vessel topology and wildfire imagery confirms sparse anchors help on non-standard biological and environmental signals (Topology-Aware Learning for Semi-supervised Cross-domain Retinal Artery/Vein Classification, Semi-Supervised Domain Adaptation for Wildfire Detection). Third, the chemistry side constrains the scope rather than competing: kinetic and QSAR models such as the coupled photocatalysis–biodegradation reactor study (95% ciprofloxacin removal, rate constant 0.15 h⁻¹) answer reactor design questions (Enhanced antibiotic wastewater degradation by intimately coupled B-Bi3O4Cl photocatalysis and biodegradation reactor: Elucidating degradation principle systematically), and the Bayesian-optimization reactor study, though it cleverly models catalyst fouling, learns a closed-loop, task-specific Gaussian process with no transferable representation (Machine-learning assisted optimisation during heterogeneous photocatalytic degradation utilising a static mixer under continuous flow). Neither can consume metagenomic or metadata features to predict resistance burden at unsampled plants. Meanwhile the field data tell us domain shift is real and large: industrial pharmaceutical effluent in Lahore runs up to 9.40 mg/L oxytetracycline with a 1,000-fold gradient into soil and groundwater (Estimation of Residual Antibiotics in Pharmaceutical Effluents and their Fate in Affected Areas), and hospital reviews document contradictory removal rates across disinfection methods, including negative removal of blaTEM-1 under chlorination — evidence that measurements themselves are noisy, not just shifted (A Review on the Prevalence and Treatment of Antibiotic Resistance Genes in Hospital Wastewater).
Research Program
We will build a cross-region adaptation benchmark and method on top of the global wastewater catalog's underlying reads (deposited in the European Nucleotide Archive; the study reports 12,758 reconstructed bacterial genomes and per-site geographic, meteorological, and demographic metadata). Features for each plant are microbial composition profiles, KEGG functional profiles, and the site metadata — all obtainable without full resistance annotation. Labels are per-subtype resistance-gene abundances, binned into low/medium/high risk tiers in the spirit of the risk-quotient tiers used for antibiotics in the Yellow River estuary, where medium risk is 0.1 < RQ < 1 (Distribution and Characterization of Typical Antibiotics in Water Bodies of the Yellow River Estuary and Their Ecological Risks). Domain definition is by region, clustered more coarsely than continent where plant counts are thin (a real limitation at 575 total sites). The deployment scenario we simulate — many cheap unlabeled records plus 1–3 fully profiled anchor plants — is created by withholding resistance annotations, since the raw reads exist publicly; we will verify the simulation is honest by confirming the unlabeled feature set contains nothing a low-resource plant could not cheaply obtain.
The method extends anchored SSDA with two ingredients aimed at the documented failure modes. Pseudo-labels are accepted only for unlabeled plants whose embeddings lie within a proximity threshold of a class prototype, SPL-style, and are additionally weighted by estimated class prevalence, which upweights rare subtypes; prevalence estimates are updated with momentum across epochs, following SPL's progressive self-training (Semi-Supervised Domain Adaptation via Selective Pseudo Labeling and Progressive Self-Training). Writing $z_i$ for the embedded profile of unlabeled target plant $i$, $p_{\hat{y}_i}$ for the prototype of its predicted risk tier $\hat{y}_i$, $d$ for cosine distance, $\tau$ for the proximity threshold, $\hat{\pi}_c$ for the estimated prevalence of tier $c$ among target plants, and $\beta \ge 0$ for the rare-class upweighting exponent:
$$\mathcal{L} = \mathcal{L}_{sup} + \lambda_e\, \mathcal{L}_{ent} + \lambda_p \sum_{i \in U_t} \mathbb{1}\!\left[d(z_i, p_{\hat{y}_i}) < \tau\right] \hat{\pi}_{\hat{y}_i}^{\,-\beta}\, \mathcal{L}_{ce}\big(f(x_i), \hat{y}_i\big)$$
Here $\mathcal{L}_{sup}$ is supervised cross-entropy on labeled source plants plus the anchors, and $\mathcal{L}_{ent}$ is MME's minimax-entropy term that pulls prototypes toward unlabeled target features (Semi-supervised Domain Adaptation via Minimax Entropy). Setting $\beta = 0$ and $\tau = \infty$ collapses the method to a CDAC-style baseline, which is exactly the ablation that isolates our ingredients. To handle the 200:1-style gradient dilution documented by CLMT, we cap the source gradient contribution and compare against a fully decoupled two-stage variant under matched compute (Towards Realizing the Value of Labeled Target Samples: a Two-Stage Approach for Semi-Supervised Domain Adaptation). A second ecosystem, cross-country transfer over the aquaculture resistance catalog of 23,165 resistance contigs across 75 countries, serves as an out-of-domain replication (Global distribution of antimicrobial resistance genes in aquaculture).
Baselines
The do-nothing reference is a source-only model: train on the dense source regions and apply it unchanged to the held-out target region, alongside a global-mean predictor that assigns each resistance subtype its worldwide average tier. These give the floor and quantify how much regional shift actually costs. The strongest existing method on this question is the pooled supervised gradient-boosting pipeline of the global wastewater study, which trained LightGBM on microbial feature tables and KEGG networks for continental-origin classification (Global wastewater microbiome reveals core bacterial community and viral diversity with regional antibiotic resistance patterns); we will retrain it pooled over source data plus the 1–3 target anchors, on identical features and splits. No reported result found on Lacuna for that model's origin-classification accuracy, so we must establish its number ourselves on the resistance-risk task. The strongest transplanted competitors are CDAC, run through its released implementation (Cross-Domain Adaptive Clustering for Semi-Supervised Domain Adaptation, lijichang/CVPR2021-SSDA), and a reimplementation of CLMT (Towards Realizing the Value of Labeled Target Samples: a Two-Stage Approach for Semi-Supervised Domain Adaptation). Their published numbers serve as implementation sanity checks: CDAC reports 76.0% mean 3-shot accuracy on DomainNet (ResNet-34) and 74.2% on Office-Home, and CLMT reports a 10.2-point 1-shot gain over MME's 66.4% on DomainNet, implying roughly 76.6%; if our reimplementation on those benchmarks lands far from these figures, our wastewater comparisons are not trustworthy. Finally, the key ablation is our own method with $\beta = 0$ and unrestricted pseudo-labeling, which isolates the tail-correction and noise-awareness ingredients. Every baseline gets the same splits, the same feature tables, the same label budgets (0, 1, 3, 5, and 10 anchor plants), and the same random-search tuning budget and compute. Beating the pooled supervised baseline means higher macro-F1 across resistance subtypes and higher recall on a pre-registered last-resort gene set, with confidence intervals over repeated region hold-outs; beating it only on micro-averaged accuracy while losing rare-subtype recall would not count.
Why not just…?
Why not just pool all the data and train one supervised model? This is the most serious objection, because the closest existing work does exactly that and pooling may suffice if regional shift is mild in feature space. Two pieces of evidence cut against it: the global study itself found strong regional microbiome and resistance signatures, which is precisely the condition under which a pooled conditional model degrades in under-represented regions, and the SSDA literature shows that when the target distribution differs at all, methods that also exploit unlabeled target data beat source-plus-target supervised training by large margins (MME's roughly 10-point gap on DomainNet). But we treat this as an empirical question, not a rhetorical one: if the pooled baseline matches anchored adaptation at every label budget in our leave-region-out protocol, the honest conclusion is that the adaptation machinery is unnecessary for this task, and we will report that.
Why not just fine-tune on the 1–3 labeled target plants? With a handful of plants and hundreds of resistance subtypes, supervised statistics have almost no support, and supervised adaptation discards the geometry of the unlabeled target plants entirely, a failure mode noted directly in the detection-adaptation literature (Bridging the Sim2Real gap with CARE: Supervised Detection Adaptation with Conditional Alignment and Reweighting). The ~10-point gap between MME and the source-plus-target baseline on DomainNet is the canonical evidence. Single-plant labels are also noisy — the hospital-wastewater review documents wildly varying and sometimes contradictory measurements across methods — so leaning on them alone compounds noise with sparsity (A Review on the Prevalence and Treatment of Antibiotic Resistance Genes in Hospital Wastewater).
Why not just use label-free unsupervised adaptation and skip the anchors? Anchors are the expensive part of the proposal — someone must sequence and fully profile 1–3 local plants — so if label-free alignment works, we should say so. Classical marginal alignment such as transfer component analysis matches feature distributions but cannot guarantee that predicted risk tiers line up with true ones (Domain Adaptation via Transfer Component Analysis), and in this domain a flipped conditional means calling a high-risk plant low-risk, the single most costly error for last-resort genes. MME additionally documented that naively mixing sparse labels into unsupervised pipelines can underperform plain target-only training. We will run unsupervised baselines (TCA-style and adversarial, in the spirit of AVATAR: Adversarial self-superVised domain Adaptation network for TARget domain) at every label budget precisely so the marginal value of each anchor is measured rather than assumed.
Why not stick to physicochemical kinetics and QSAR models? Those tools answer reactor questions, not surveillance questions. The coupled photocatalysis–biodegradation study resolves degradation pathways with fixed rate equations and ECOSAR toxicity tables for one reactor and one antibiotic (Enhanced antibiotic wastewater degradation by intimately coupled B-Bi3O4Cl photocatalysis and biodegradation reactor: Elucidating degradation principle systematically), and the Bayesian-optimization study optimizes a single static-mixer reactor, reaching 102% min⁻¹ conversion in 17 runs, but learns nothing transferable to another facility or feed chemistry (Machine-learning assisted optimisation during heterogeneous photocatalytic degradation utilising a static mixer under continuous flow). Neither consumes the composition or metadata features that are the only cheap signals available at unsampled plants.
Decisive Checks
Three results decide the proposal. First, the region-held-out comparison of anchored adaptation against pooled supervised training across label budgets 0, 1, 3, 5, and 10: if pooled training wins at every budget, the core claim is falsified. Second, the tail-correction claim: on both a long-tailed re-benchmarking of DomainNet using the released CDAC code (whose 76.0% 3-shot figure anchors the comparison) and the real resistance data, our method with $\beta = 0$ should lose rare-subtype recall relative to $\beta > 0$, directly demonstrating prototype collapse on long tails and its repair. Third, the anchor-value curve: adaptation with one anchor should beat every zero-anchor unsupervised baseline on macro-F1 and last-resort-gene recall; if it does not, the field measurement that anchors require is not worth its cost, and we will report that the cheap-data-only pipeline is the right recommendation. Positive results on all three checks would give wastewater surveillance a practical recipe — sequence one or two local plants, borrow everything else — and give the SSDA literature its first benchmark where the open problems of long tails and measurement noise are the main event rather than a caveat.
References
- A Review on the Prevalence and Treatment of Antibiotic Resistance Genes in Hospital Wastewater
- Global wastewater microbiome reveals core bacterial community and viral diversity with regional antibiotic resistance patterns
- Global distribution of antimicrobial resistance genes in aquaculture
- Semi-Supervised Domain Adaptation via Minimax Entropy
- Cross-Domain Adaptive Clustering for Semi-Supervised Domain Adaptation
- Semi-Supervised Domain Adaptation via Selective Pseudo Labeling and Progressive Self-Training
- Towards Realizing the Value of Labeled Target Samples: A Two-Stage Approach for Semi-Supervised Domain Adaptation
- Topology-Aware Learning for Semi-supervised Cross-domain Retinal Artery/Vein Classification
- Semi-Supervised Domain Adaptation for Wildfire Detection
- Enhanced antibiotic wastewater degradation by intimately coupled B-Bi3O4Cl photocatalysis and biodegradation reactor: Elucidating degradation principle systematically
- Machine-learning assisted optimisation during heterogeneous photocatalytic degradation utilising a static mixer under continuous flow
- Estimation of Residual Antibiotics in Pharmaceutical Effluents and their Fate in Affected Areas
- Distribution and Characterization of Typical Antibiotics in Water Bodies of the Yellow River Estuary and Their Ecological Risks
- Bridging the Sim2Real gap with CARE: Supervised Detection Adaptation with Conditional Alignment and Reweighting
- Domain Adaptation via Transfer Component Analysis
- AVATAR: Adversarial self-superVised domain Adaptation network for TARget domain