Learning to Count and Locate Many Hidden Targets Through an Active Metasurface

An active metasurface is a flat panel of small antenna elements that each apply an adjustable phase shift and also amplify the wave they reflect. It can let a base station "see" targets behind a building by bouncing radar probes off the panel. Prior work shows this works for one target whose angle is already known. Real scenes contain many targets of unknown number, and the panel amplifies its own electronic noise along with the echoes. We propose to treat sensing through the panel as a set-prediction problem. A neural network outputs an unordered set of target hypotheses and is trained with a matching loss that pairs predictions to true targets in polynomial time. We also train the panel's amplification and phase pattern jointly with that network. The matching technique is the one that let speech separation scale to 20 simultaneous speakers.

The question underneath is physical. Turning the panel's gain up raises echo power but also raises a noise floor. That noise is radiated into the scene and comes back off every target. We hypothesize that the gain that is best for one target is too high for dense scenes. We also hypothesize that the same gain setting decides whether matching-based training is stable or keeps swapping labels. If both hold, the gain cannot be chosen by the usual signal-to-noise optimization and then handed to an estimator. Gain, estimator, and training loss have to be designed together, and this note proposes to test that directly.

Core Claim

Our central claim combines two parts that no work in the file puts together. First, multi-target sensing through an active metasurface becomes tractable at tens of targets, with unknown count, when posed as set prediction trained by Hungarian matching. The Hungarian algorithm pairs predictions to targets in cubic rather than factorial time. Second, the panel's amplification should be learned end to end against a multi-target error metric rather than set by maximizing received signal-to-noise ratio. The concrete, falsifiable prediction is about the gain that minimizes multi-target error. That optimal gain should fall as the number of targets grows, and fall below the gain chosen by signal-to-noise maximization. Assignment instability during training should rise sharply above that optimum.

What the Two Directions Contribute

Permutation-invariant training. The first direction is about training models whose outputs have no natural order. Yu et al. (2016) and Qian et al. (2017) introduced the original approach. It evaluates the loss under every pairing of outputs to targets and keeps the best one, which costs factorial time in the number of sources. Many-Speakers Single Channel Speech Separation with Optimal Permutation Training replaced that exhaustive search with Hungarian matching on a pairwise cost matrix. With this change, exhaustive training failed to finish an epoch at 15 or more speakers, while matching trained 20-speaker models. That paper supplies our method. It also names a weakness we inherit and test: matching was validated on clean mixtures, and assignments may become unstable at low signal-to-noise ratio.

Sortformer avoids matching by imposing a canonical order (speaker arrival time). It falls back to a hybrid loss when arrival times nearly coincide. Ordering by a sortable attribute is the main competitor to matching here, and we test it head on.

Active amplification. The second direction supplies the regime and its physics. Active RIS vs. Passive RIS: Which Will Prevail in 6G? shows that an active panel overcomes "multiplicative fading," the product of the two hop losses that cripples passive panels. A passive panel would need about 2.5 million elements to match an active one. Transmission Design for Active RIS-Aided SWIPT and Exploiting Active RIS in NOMA Networks with Hardware Impairments establish the constraint we care about. Raising gain or element count eventually degrades performance, because amplified thermal noise accumulates at the receiver. Beamforming Design for Active RIS-Aided Over-the-Air Computation adds self-interference, meaning leakage from each element's output back to its input. It reports heavy degradation as that leakage rises from −40 dB to −30 dB.

The closest prior work. Active-IRS-Enabled Target Detection is our nearest neighbor and our main motivation. It derives a Neyman–Pearson detector, the optimal detector for a fixed false-alarm rate. That detector treats the panel's amplified noise as a second, random probe that also illuminates the target. The paper jointly optimizes beamforming and gain. However, it handles a single target with known angle and reflectivity, so there is no label ambiguity and no counting.

Sensing for Free supplies the estimator design. It uses a transformer with no positional encoding across measurement snapshots. This lets it treat snapshots as an unordered set and localize more sources than antennas from higher-order signal statistics. Its own invariance is over snapshots, not over source identity, and it uses no metasurface. It also reports degraded higher-order statistics at small snapshot counts. That degradation is exactly what amplified panel noise should worsen.

Research Program

Simulator. We will build a differentiable simulator of non-line-of-sight sensing. A base station with $N$ antennas has a line-of-sight link to an active panel with $M$ elements, and the direct path to the scene is blocked. The scene holds $K$ point targets, with $K$ unknown and up to 20, each with an angle and range relative to the panel. In sensing slot $t$ the base station sends probe $s_t$, the panel applies configuration $\Phi_t$, and the base station receives

$$y_t = H_{RB}\,\Phi_t\Big(B\,\Phi_t\big(H_{BR}\,s_t + n^{(1)}_t\big) + n^{(2)}_t\Big) + n^{BS}_t .$$

The symbols are defined as follows. $\Phi_t$ is a diagonal matrix of per-element gains (magnitude at most $\beta_{\max}$) and phases. $H_{BR}$ and $H_{RB}$ are the base-station-to-panel and panel-to-base-station channels. $B=\sum_{k}\alpha_k a(\theta_k,r_k)a(\theta_k,r_k)^{T}$ is the round-trip response of the targets as seen from the panel, built from reflectivities $\alpha_k$ and near-field steering vectors $a(\cdot)$. $n^{(1)}_t$ and $n^{(2)}_t$ are the panel's thermal noise on the outgoing and returning passes, and $n^{BS}_t$ is receiver noise.

The equation makes the tension explicit. Outgoing-pass noise is multiplied by $B$, so it returns off every target and acts as a shared random probe. Returning-pass noise and its amplification add a floor. The simulator will also include self-interference between −40 and −30 dB, an output-power budget on the panel, and amplifier nonlinearity and phase noise following the impairment model of the NOMA hardware-impairments paper.

Estimator. The estimator is a transformer in the style of Sensing for Free. Each token is a pair $(y_t, \Phi_t)$, and the model uses no positional encoding over $t$. The measurements are exchangeable given their configurations, so the model treats them as a set. It emits $Q=32$ slots, each predicting an existence probability, angle, range, and reflectivity.

Training loss. Training follows the optimal-permutation recipe of Many-Speakers Single Channel Speech Separation, extended to unknown count. We build a $Q\times K$ cost matrix combining existence log-loss with an L1 parameter error. We match it with the Hungarian algorithm and push unmatched slots toward "no target." The cost matrix is only $Q\times K$, so the quadratic matrix-construction overhead that limits matching at hundreds of sources is negligible here.

Learned panel configuration. The configuration sequence $\Phi_1,\dots,\Phi_T$ is a learnable codebook. Phases are free. Gains are projected onto the magnitude bound and the output-power budget after each step. The codebook is trained through the simulator jointly with the estimator.

The central analysis. We sweep $\beta_{\max}$ and the panel power budget at each target count. For each setting we record three things: multi-target error, the gain chosen by classical signal-to-noise maximization, and a training-stability diagnostic. The diagnostic is the fraction of slot-to-target assignments that flip between consecutive epochs on a fixed probe set. The speech paper reports that matching gets cheaper and more stable as predictions sharpen. We ask whether amplified panel noise prevents that sharpening, and at what gain.

Baselines

Naive reference. A passive panel with a fixed discrete Fourier transform codebook (a standard set of evenly spaced beam patterns), followed by on-grid sparse recovery with peak picking to count and locate targets. Element count and total power are matched to the active system. This is what one gets without amplification or learning. It anchors whether the active panel matters for multi-target sensing at all, as Active RIS vs. Passive RIS found for communication rates.

Strongest existing method. The design of Active-IRS-Enabled Target Detection, extended to many targets in the most direct way. Panel gains and phases are set by its alternating optimization of detection signal-to-noise ratio. The scene is then scanned on an angle–range grid with that paper's noise-aware detector applied per cell, followed by thresholding at a fixed false-alarm rate. It is the strongest competitor because it already models the panel noise as a probe and optimizes gain under the same power constraints. Our claim is precisely that its per-target optimality does not carry over to dense scenes. Its operating points will be computed with the same simulator, channels, power budgets, and snapshot counts. Its threshold will be tuned on the same validation set we use. No reported result was found on Lacuna for multi-target active-panel sensing, and that paper's single-target detection probabilities are not quoted in the file. So the comparison will be against our reimplementation, validated at $K=1$ against its analytical detection-probability approximation, which it reports matches simulation for more than 5 sensing symbols.

Learned-estimator baseline. A Snap-TF-style network trained on the same data and given the same tuning budget. It is fed measurements from a fixed panel configuration and uses its original output scheme (outputs ordered by angle). Sensing for Free reports parameter and latency gains rather than accuracy figures in the file, so no reported accuracy number was found on Lacuna for it.

Ablations isolating the key ingredients. Two ablations separate the two parts of the claim.

The first freezes the panel codebook at the signal-to-noise-optimal configuration of the strongest baseline and trains only the estimator. This isolates joint design.

The second keeps everything else fixed and swaps the training loss among four options:

  • exhaustive permutation-invariant training, feasible only up to about 7 targets;
  • angle-sorted regression;
  • a Sortformer-style hybrid of sorted and permutation losses;
  • Hungarian matching.

This isolates the loss.

What counts as beating the baselines. "Beating" means two things.

  • Error: a lower OSPA distance at matched false-alarm rate, across target counts from 4 to 20 and at least two power budgets, with non-overlapping 95% confidence intervals over five seeds. OSPA is the optimal subpattern assignment distance, a standard metric that penalizes both location error and miscounting.
  • Training cost: matching must stay within a constant factor of sorted-loss training time while exhaustive training becomes infeasible. The speech analogue is the 9× per-epoch speedup at 10 speakers reported in Many-Speakers Single Channel Speech Separation.

Why not just…?

Why not just sort the targets by angle and regress, as Sortformer sorts speakers by arrival time? This is the most serious threat. For a single scalar attribute with a convex cost, sorted pairing is already the optimal assignment, so matching would add nothing. Our targets carry angle and range jointly. When two targets share nearly the same angle at different ranges, a tiny angle error flips their sorted order and the regression target jumps discontinuously. Sortformer needed a hybrid permutation loss for exactly this near-tie case. The loss ablation settles it by stratifying error by the minimum angular separation between targets. If sorted regression matches matching across all separations, we will report that matching is unnecessary in this regime. In that case the proposal's weight rests entirely on the joint gain design, which does not depend on the loss.

Why not just set the gain by signal-to-noise optimization and run a good classical estimator? That is our strongest baseline, and the gain sweep is the decisive test against it. If the error-minimizing gain coincides with the signal-to-noise-optimal gain at every target count, joint design buys nothing. We would then recommend the classical pipeline with a learned estimator only. Our hypothesis is that the two gains diverge. Outgoing-pass noise returns off every target, so its contribution grows with $K$. Meanwhile the output-power budget caps total amplified power as the number of echoes grows. Signal-to-noise optimization of a single target sees neither effect.

Why not just use a bigger passive panel and avoid amplified noise altogether? For communication, Active RIS vs. Passive RIS estimates about 2.5 million passive elements would be needed, and roughly 40 dB lower signal-to-noise ratio at 256 elements. Sensing through the panel is a round trip, which compounds the double loss, so the passive case should be worse still. We do not assume this. The passive reference is run at equal total power and at element counts up to the largest our simulator handles.

Why not just use exhaustive permutation-invariant training, since target counts are small? Below about 6 targets this is fine, and we include it there. Our regime of interest is dense scenes where counting itself is hard. The speech evidence shows exhaustive training becomes untenable well before 20 sources. The relevant question is not whether it works at small $K$ but whether matching loses any accuracy relative to it where both are feasible. We will check that equality directly.

Proposed Experiments

Implementation check (direct path). We first reproduce the direct-path setting of Sensing for Free, using its benchmark design:

  • 5- and 15-antenna minimum-redundancy arrays;
  • Gaussian, QPSK, and 16QAM payloads;
  • more sources than antennas;
  • 2 million training samples per source count.

We compare its angle-ordered outputs with our matching-trained slots. This confirms the estimator and loss behave sensibly before any panel is involved. The file reports no accuracy number for this benchmark, so the comparison is internal.

Main experiment. We then move to the active-panel simulator with these settings:

  • $M\in\{64,128,256\}$ elements;
  • 4 to 16 sensing slots;
  • $K$ drawn uniformly from 0 to 20;
  • self-interference at −40, −35, and −30 dB.

We report OSPA error, cardinality accuracy, per-target detection probability at fixed false-alarm rate, and training time per epoch, for every baseline and ablation above.

Decisive checks. Four results decide the outcome.

  • Gain-sweep curve: the proposal stands only if the error-minimizing gain decreases measurably with $K$ and sits below the signal-to-noise-optimal gain in dense scenes. A flat optimum falsifies the joint-design claim.
  • Assignment-flip diagnostic: it should rise sharply above that optimum. This would show that amplified noise destabilizes matching-based training, which the speech literature flagged but never measured.
  • Single-target sanity check: at $K=1$ the learned system must reach the detection probability of the reimplemented Neyman–Pearson design. Otherwise any multi-target advantage could come from a weak baseline rather than a better method.
  • Snapshot sweep down to small counts: this tests whether the higher-order-statistics degradation reported by Sensing for Free worsens with panel gain, which would connect the two failure modes directly.