STAGE: Structured Test-Time Adaptation with Global Entropic Soft-coupling for Cross-Subject Brain-to-Image Retrieval
Organizations: South China University of Technology · Westlake University · Harbin Institute of Technology · The Chinese University of Hong Kong
Abstract
Cross-subject brain-to-image retrieval aims to identify viewed images from unseen subjects' brain signals. However, inter-subject variability hinders alignment of brain-image representations, while independent query ranking tends to concentrate predictions on a few candidates, making accurate retrieval difficult without target labels. We propose STAGE (Structured Test-Time Adaptation with Global Entropic Soft-coupling), a structured test-time adaptation framework for recovering cross-subject alignment from uncertain brain-image correspondences. Moment calibration reduces statistical discrepancies between features, while coupling-weighted initialization establishes initial alignment. Coupling-guided adaptation further refines residual feature mismatches, and soft-coupling ranking coordinates candidate competition across queries to prevent overly concentrated matching assignments. Using only unlabeled target batches, STAGE maintains consistent matching from feature calibration to image retrieval while keeping both encoders frozen. Experiments on three public datasets validate STAGE's retrieval performance. On THINGS-EEG2, STAGE achieves 68.25% Top-1 and 90.47% Top-5, improving Top-1 by 18.52 percentage points over SCORE recovery and CSLS on identical frozen NICE features. Calibrated on 200 queries and a 200-image gallery covering their identities, STAGE retains 42.05% Top-1 when ranking 1,854 images with the transform frozen.
Figures & tables
| Method | THINGS-EEG2 [ 8 ] | THINGS-MEG [ 11 ] | Alljoined-1.6M [ 33 ] | |||
|---|---|---|---|---|---|---|
| Top-1 | Top-5 | Top-1 | Top-5 | Top-1 | Top-5 | |
| SAMGA base (Unadapted) [ 14 ] | 26.22 | 57.98 | 3.88 | 14.00 | 6.08 | 20.55 |
| EA [ 10 ] | 27.45 | 59.37 | 4.00 | 15.88 | 6.31 | 20.47 |
| SAW [ 13 ] | 30.98 | 60.85 | 4.50 | 14.88 | 8.93 | 27.54 |
| SATTC [ 13 ] | 26.12 | 52.73 | 5.13 | 13.38 | 6.78 | 20.70 |
| CSLS [ 4 ] | 35.78 | 67.85 | 4.75 | 16.25 | 8.04 | 25.39 |
| Stage | SAMGA- TSConv [ 14 , 28 ] | EEGNet [ 18 ] | Shallow- FBCSP [ 24 ] | UBP [ 32 ] |
|---|---|---|---|---|
| None (raw) | 18.87 | 16.65 | 8.22 | 20.60 |
| Calibration | 44.25 | 29.70 | 17.43 | 36.75 |
| Init.+adapt. | 56.98 | 47.50 | 27.20 | 51.05 |
| Ranking | 66.30 | 56.25 | 33.10 | 61.65 |
| Moment | Coupled init. | Coupled adapt. | Coupling ranking | THINGS-EEG2 | THINGS-MEG | Alljoined-1.6M | |||
|---|---|---|---|---|---|---|---|---|---|
| Top-1 | Top-5 | Top-1 | Top-5 | Top-1 | Top-5 | ||||
| 26.80 | 58.45 | 3.13 | 14.00 | 6.20 | 20.60 | ||||
| 30.80 | 63.10 | 3.50 | 13.71 | 8.23 | 25.50 | ||||
| 53.03 | 81.90 | 5.00 | 17.42 | 9.95 | 29.92 | ||||
| 58.63 | 85.18 | 5.17 | 17.13 | 10.28 | 30.03 | ||||
| 68.25 | 90.47 | 6.25 | 20.17 | 12.89 | 34.74 | ||||
| Enabled stages | Row-wise | Coupled | |
|---|---|---|---|
| Moment calibration | 30.80 | 48.08 | +17.28 |
| + coupling-weighted init. | 53.03 | 65.68 | +12.65 |
| + coupling-guided adapt. | 58.63 | 68.25 | +9.62 |
| Initialization | Init. only | Init. + adapt. |
|---|---|---|
| Radial MNN | 58.40 | 63.07 |
| CSLS MNN | 62.93 | 66.52 |
| Soft correspondence | 65.20 | 68.02 |
| Objective | EEG2 | MEG | Alljoined |
|---|---|---|---|
| Direct OT ( ) | 61.48 | 5.29 | 10.93 |
| Direct OT ( ) | 52.53 | 5.58 | 10.43 |
| STAGE (soft teacher) | 68.25 | 6.25 | 12.89 |
Appendix figures & tables57 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Channels samples | Sampling and window | Preprocessing | Test-trial aggregation |
|---|---|---|---|---|
| THINGS-EEG2 [ 8 ] | 250 Hz; first post-stimulus second | Baseline correction and session-wise MVNN | Mean of 80 repetitions per image across four sessions | |
| THINGS-MEG [ 11 ] | 200 Hz; 0–1 s, both endpoints included | Released preprocessed MEG epochs; temporal crop | Mean of 12 repetitions per image across twelve sessions | |
| Alljoined-1.6M [ 33 ] | 250 Hz; first post-stimulus second | Baseline-corrected, MVNN-preprocessed EEG; released trial-retention mask | Mean of all retained trials per image across sessions |
| Setting | Value |
|---|---|
| Optimizer | AdamW, , |
| Weight decay | |
| Training epochs | 50 (20 + 30) |
| Learning rate | ; from epoch 21 |
| Batch size (EEG2/MEG/AJ) | 1,024 / 128 / 1,024 |
| Contrastive logit scale | , fixed |
| Stage | EEG2 | MEG | AJ |
|---|---|---|---|
| Moment calibration | 0.07 | 0.07 | 0.07 |
| Soft initialization | 5.37 | 0.36 | 0.82 |
| Feature-map setup | 0.09 | 0.09 | 0.09 |
| Feature adaptation | 6.99 | 0.47 | 0.95 |
| Coupling ranking | 1.55 | 0.14 | 0.08 |
| Total | 14.09 | 1.13 | 2.01 |
| Quantity | Maximum error or count |
|---|---|
| Moment scale/offset | 4.44e-16 |
| Initialization map/centroids | 6.63e-09 |
| Final pairwise cost | 3.77e-03 |
| Cases below | 28 / 30 |
| Direct truth-rank changes | 2 |
| CSLS truth-rank changes | 0 |
| Symbol | Meaning | Symbol | Meaning |
|---|---|---|---|
| number of queries and candidates (200 each in the closed set) | teacher, initialization, and final couplings | ||
| feature dimension (512) | features after calibration and initialization | ||
| row marginal of every coupling | confidence weight of query | ||
| upper bound on the mass a candidate may receive | orthogonal map fitted at initialization | ||
| feasible set of couplings | ridge coefficient of that fit | ||
| primal transport variable | weight of the anchoring term |
| Use | Solves | Coefficient | Updated object |
|---|---|---|---|
| Initialization | 12 | Procrustes map | |
| Teacher refresh | 4 | Detached target | |
| Student | 40 | Feature gradient | |
| Final ranking | 1 | Retrieval scores |
| Symbol | Meaning | Value |
| initialization rounds (EEG2 / MEG / Alljoined) | 12 / 2 / 5 | |
| entropy coefficient, teacher/ranking | 0.035 | |
| entropy coefficient, student | 0.07 | |
| rank of the adaptation subspace | 16 | |
| anchoring weight | 0.15 | |
| ridge of the initialization fit | 0.1 |
| Dataset | Direct | CSLS | GES |
|---|---|---|---|
| EEG2 | 58.63/85.18 | 63.15/87.67 | 68.25 / 90.47 |
| MEG | 5.00/16.75 | 6.13/19.63 | 7.25 / 20.38 |
| AJ | 10.65/30.18 | 11.80/32.83 | 13.25 / 35.00 |
| Stage | EEG2 | MEG | AJ |
|---|---|---|---|
| Encoder cosine | 27.65/59.52 | 3.88/14.00 | 5.90/20.90 |
| Encoder dot | 18.70/49.37 | 2.13/8.63 | 2.95/11.20 |
| Radial baseline | 26.80/58.45 | 3.13/14.00 | 6.20/20.60 |
| Moment calib. | 30.80/63.10 | 3.50/13.63 | 8.25/25.95 |
| Soft init. | 53.03/81.90 | 4.75/16.75 | 10.18/30.00 |
| Adaptation | 58.63/85.18 | 5.00/16.75 | 10.65/30.18 |
| Subject | Direct | CSLS | Coupling |
|---|---|---|---|
| 01 | 66.67 | 72.67 | 77.67 |
| 02 | 64.33 | 68.83 | 76.67 |
| 03 | 56.17 | 57.67 | 59.33 |
| 04 | 49.00 | 52.00 | 53.83 |
| 05 | 54.33 | 61.33 | 65.83 |
| 06 | 63.83 | 71.00 | 80.33 |
| Seed | Direct | CSLS | Coupling |
|---|---|---|---|
| 0 | 58.40 | 62.60 | 68.40 |
| 1 | 58.70 | 63.45 | 67.80 |
| 2 | 58.80 | 63.40 | 68.55 |
| Subject | Direct | CSLS | Coupling |
|---|---|---|---|
| 01 | 2.50 | 5.00 | 7.00 |
| 02 | 9.00 | 9.00 | 8.50 |
| 03 | 6.00 | 7.50 | 8.00 |
| 04 | 2.50 | 3.00 | 5.50 |
| Subject | Direct | CSLS | Coupling |
|---|---|---|---|
| 01 | 12.00 | 13.00 | 13.50 |
| 02 | 17.00 | 21.00 | 27.50 |
| 03 | 16.50 | 20.00 | 25.00 |
| 04 | 14.00 | 16.50 | 12.00 |
| 05 | 15.50 | 16.00 | 18.00 |
| 06 | 13.50 | 15.00 | 15.00 |
| Dataset | Ranking | Top-1 | Top-5 | |
|---|---|---|---|---|
| EEG2 | 10 | Direct | 58.63 7.20 | 85.18 5.77 |
| EEG2 | 10 | CSLS | 63.15 8.43 | 87.67 5.58 |
| EEG2 | 10 | Coupling | 68.25 10.65 | 90.47 5.20 |
| MEG | 4 | Direct | 5.00 3.14 | 16.75 8.86 |
| MEG | 4 | CSLS | 6.13 2.66 | 19.63 8.54 |
| MEG | 4 | Coupling | 7.25 1.32 | 20.38 9.76 |
| Pairs | Direct | CSLS | GES |
|---|---|---|---|
| Row-hard | 58.37/84.38 | 62.32/86.77 | 66.53/89.90 |
| Assignment | 56.30/83.42 | 60.35/86.07 | 64.42/89.08 |
| Row-softmax | 48.38/79.50 | 57.35/85.48 | 65.78/89.42 |
| Soft coupling | 58.63 / 85.18 | 63.15 / 87.67 | 68.25 / 90.47 |
| Control | Mean | 95% interval | + / = / - |
|---|---|---|---|
| Row-hard | 1.72 | [0.85, 2.65] | 9 / 1 / 0 |
| Assignment | 3.83 | [2.15, 5.45] | 9 / 0 / 1 |
| Row-softmax | 2.47 | [1.62, 3.63] | 10 / 0 / 0 |
| Row-confidence source | Top-1 | Top-5 |
|---|---|---|
| Coupling entropy | 68.25 | 90.47 |
| Uniform | 68.02 | 90.28 |
| Similarity row | 68.03 | 90.32 |
| Row-softmax entropy | 68.02 | 90.32 |
| Initialization | Updates | Top-1 | Top-5 |
|---|---|---|---|
| K12 | 0 | 65.68 | 89.68 |
| K12 | 5 | 67.48 | 90.70 |
| K12 | 10 | 67.30 | 90.52 |
| K12 | 20 | 67.85 | 90.43 |
| K12 | 30 | 68.20 | 90.53 |
| K12 | 40 | 68.25 | 90.47 |
| Objective | Top-1 | Top-5 |
|---|---|---|
| Initialization only (0) | 65.68 | 89.68 |
| Scaled attraction (40) | 65.03 | 88.55 |
| Row cross-entropy (40) | 67.75 | 89.47 |
| Coupling matching (40) | 68.25 | 90.47 |
| Weighted objective | Top-1 | Top-5 |
|---|---|---|
| Attraction (40) | 66.62 | 89.62 |
| Attraction (80) | 66.32 | 89.67 |
| Row cross-entropy (40) | 67.50 | 89.48 |
| Row cross-entropy (80) | 66.58 | 88.97 |
| Setting | Value | Top-1 | Top-5 |
|---|---|---|---|
| Default | K12 / 40 | 68.25 | 90.47 |
| Refresh | 1 | 67.57 | 90.07 |
| Refresh | 5 | 68.73 | 90.30 |
| Refresh | 20 | 68.00 | 90.53 |
| Refresh | 40 | 67.35 | 90.50 |
| Anchor | 0.0 | 68.28 | 90.42 |
| Setting | Value | Top-1 | Top-5 |
|---|---|---|---|
| Learning rate | 0.003 | 68.78 | 90.63 |
| Learning rate | 0.005 | 68.55 | 90.60 |
| Learning rate | 0.01 | 68.25 | 90.47 |
| Learning rate | 0.02 | 68.55 | 90.62 |
| Learning rate | 0.03 | 68.63 | 90.50 |
| Learning rate | 0.1 | 67.50 | 89.88 |
| Dataset | Row only | Ratio 1 | Ratio 10 | Exact balance | |
|---|---|---|---|---|---|
| EEG2 | 0.0175 | 58.63/85.18 | 61.52/87.50 | 67.38/89.63 | 68.25 / 90.03 |
| EEG2 | 0.035 | 58.63/85.18 | 63.20/88.07 | 67.95/90.17 | 68.25 / 90.47 |
| EEG2 | 0.07 | 58.63/85.18 | 64.22/88.02 | 66.92/89.83 | 67.27 / 89.97 |
| MEG | 0.0175 | 5.00/16.75 | 5.63/18.63 | 6.88/20.00 | 7.00 / 20.13 |
| MEG | 0.035 | 5.00/16.75 | 6.00/19.00 | 7.13/20.25 | 7.25 / 20.38 |
| MEG | 0.07 | 5.00/16.75 | 6.00/19.13 | 7.00/ 20.88 | 7.25 /20.63 |
| Data | From | Corr. | Harm | Both+ | Both– | Net |
|---|---|---|---|---|---|---|
| EEG2 | Direct | 795 | 218 | 3300 | 1687 | 9.62 |
| EEG2 | CSLS | 495 | 189 | 3600 | 1716 | 5.10 |
| MEG | Direct | 32 | 14 | 26 | 728 | 2.25 |
| MEG | CSLS | 18 | 9 | 40 | 733 | 1.13 |
| AJ | Direct | 266 | 162 | 264 | 3308 | 2.60 |
| AJ | CSLS | 185 | 127 | 345 | 3343 | 1.45 |
| Ranking | EEG2 | MEG | AJ |
|---|---|---|---|
| Direct | 58.63/85.18 | 5.00/16.75 | 10.65/30.18 |
| CSLS | 63.15/87.67 | 6.13/19.63 | 11.80/32.83 |
| Batch IS, | 63.52/88.43 | 7.13/ 20.75 | 12.58/33.60 |
| IS, | 63.17/88.30 | 6.88/20.00 | 12.48/33.53 |
| GES | 68.25 / 90.47 | 7.25 /20.38 | 13.25 / 35.00 |
| Top-1 | Top-5 | Coupling cost | Coverage | |
|---|---|---|---|---|
| 0 | 67.32 | — | 0.4915 | 100.00 |
| 0.001 | 67.18 | 89.63 | 0.4915 | 99.83 |
| 0.005 | 67.28 | 89.87 | 0.4919 | 98.73 |
| 0.014 | 68.18 | 89.98 | 0.4938 | 96.22 |
| 0.02 | 68.37 | 90.18 | 0.4962 | 94.87 |
| 0.035 | 68.25 | 90.47 | 0.5081 | 91.95 |
| Preferred set | Top-1 | Top-5 | Edges | Outside |
|---|---|---|---|---|
| Full | 68.25 | 90.47 | 100.00 | 0.00e+00 |
| MNN | 63.22 | 83.65 | 0.27 | 4.70e-01 |
| Top-5 union | 67.78 | 88.03 | 3.68 | 8.43e-07 |
| Top-10 union | 68.28 | 89.95 | 7.19 | 2.83e-08 |
| Top-20 union | 68.30 | 90.42 | 13.81 | 3.49e-09 |
| Top-50 union | 68.25 | 90.47 | 32.19 | 7.55e-11 |
| Candidates | Direct | CSLS | Equal mass | Capacity |
|---|---|---|---|---|
| 200 | 58.63/85.18 | 63.15/87.67 | 68.25 / 90.47 | 68.25 / 90.47 |
| 700 | 50.30/74.63 | 51.62/ 75.70 | 42.13/68.83 | 52.22 /75.45 |
| 1200 | 45.42/69.63 | 45.58/ 70.22 | 34.65/61.08 | 46.30 /70.03 |
| 1854 | 41.55/65.78 | 41.40/65.63 | 29.18/54.43 | 42.05 / 65.93 |
| Candidates | Column rule | True pairs | Direct winners | Unvisited |
|---|---|---|---|---|
| 200 | Equal mass | 57.17 | 59.32 | 26.23 |
| 200 | Capacity | 57.17 | 59.32 | 26.23 |
| 700 | Equal mass | 14.97 | 17.45 | 76.36 |
| 700 | Capacity | 38.75 | 53.51 | 32.64 |
| 1200 | Equal mass | 8.71 | 10.59 | 85.63 |
| 1200 | Capacity | 31.98 | 47.63 | 40.24 |
| Candidates | Direct | CSLS | Equal mass | Capacity |
|---|---|---|---|---|
| 100 | 57.37/88.57 | 64.67/92.33 | 75.47 / 95.43 | 75.47 / 95.43 |
| 200 | 51.07/83.03 | 54.23/ 85.33 | 50.83/84.70 | 57.37 /85.07 |
| 700 | 37.00/67.57 | 38.50 /68.00 | 26.20/57.03 | 38.23/ 68.13 |
| 1754 | 25.57/53.20 | 26.03 / 53.47 | 15.57/38.40 | 25.80/53.27 |
| Candidates | SCORE | STAGE |
|---|---|---|
| 700 | 27.83/ 57.48 | 30.08 /53.95 |
| 1854 | 17.02 / 38.50 | 16.97/33.23 |
| Query batch size | SCORE | STAGE |
|---|---|---|
| 10 | 31.37 | 28.68 |
| 25 | 38.03 | 36.87 |
| 50 | 41.22 | 41.67 |
| 100 | 44.48 | 48.82 |
| Identities | SCORE | STAGE |
|---|---|---|
| 150 | 46.68/79.89 | 51.79 / 82.54 |
| 100 | 42.20 / 75.83 | 40.78/71.20 |
| Row-only adaptation | Global adaptation | |||
|---|---|---|---|---|
| Final ranking | Top-1 | Top-5 | Top-1 | Top-5 |
| Direct | 49.10 | 77.10 | 58.63 | 85.18 |
| CSLS | 55.12 | 83.57 | 63.15 | 87.67 |
| GES | 66.25 | 89.48 | 68.25 | 90.47 |
| Data | Encoder dot | Direct | CSLS | GES |
|---|---|---|---|---|
| EEG2 | 18.87/49.58 | 56.98/83.20 | 60.80/86.00 | 66.30 / 88.95 |
| MEG | 2.38/10.75 | 5.75/16.88 | 6.13 / 18.25 | 5.75/17.00 |
| AJ | 3.50/12.75 | 10.03/27.55 | 11.10/29.15 | 11.38 / 30.83 |
| Dataset | Encoder | Seed 0 | Seed 1 | Seed 2 |
|---|---|---|---|---|
| EEG2 | NICE | 68.40/90.50 | 67.80/90.60 | 68.55/90.30 |
| EEG2 | TSConv | 67.65/90.80 | 66.75/87.90 | 64.50/88.15 |
| MEG | NICE | 5.63/18.88 | 5.00/17.50 | 5.00/19.50 |
| MEG | TSConv | 5.75/17.00 | 7.13/17.00 | 6.00/18.13 |
| AJ | NICE | 12.43/33.75 | 12.03/32.20 | 12.70/34.13 |
| AJ | TSConv | 11.38/30.83 | 11.65/32.55 | 11.40/30.70 |
| Method | EEG2 | MEG | Alljoined |
|---|---|---|---|
| SCORE + CSLS [ 5 ] | 49.73 | 5.00 | 10.18 |
| SCORE + SN (cosine) | 53.25 | 6.25 | 10.39 |
| SCORE + SN (radial) | 58.20 | 5.63 | 11.78 |
| STAGE init. + SN | 65.68 | 6.21 | 12.67 |
| Complete STAGE + SN | 68.25 | 6.25 | 12.89 |
| Dataset | Subjects | Top-1 | 95% interval |
|---|---|---|---|
| EEG2 | 10 | [16.32, 20.68] | |
| MEG | 4 | [-0.13, 2.58] | |
| Alljoined | 20 | [1.73, 3.73] |
| Dataset | Initialization | None | Row | Global |
|---|---|---|---|---|
| EEG2 | Radial MNN | 58.40 | 57.22 | 63.07 |
| CSLS MNN | 62.93 | 62.90 | 66.52 | |
| Soft coupling | 65.20 | 66.17 | 68.02 | |
| MEG | Radial MNN | 5.79 | 5.58 | 5.75 |
| CSLS MNN | 5.67 | 5.63 | 5.58 | |
| Soft coupling | 6.00 | 6.25 | 6.13 |
| Adaptation | Top-1 |
|---|---|
| None (initialization) | 65.68 |
| Full (rotation, scale, translation) | 68.25 |
| Rotation | 68.30 |
| Scale | 66.00 |
| Rotation + scale | 68.38 |
| Rotation + translation (fixed scale) | 68.25 |
| Subsequent update | EEG2 | MEG | Alljoined |
|---|---|---|---|
| No further update | 65.68 | 6.21 | 12.67 |
| WP-style projected updates | 50.00 | 5.92 | 12.53 |
| Hard alternating Procrustes | 65.00 | 6.04 | 12.12 |
| Entropic OT–Procrustes | 68.08 | 5.71 | 10.22 |
| Hard-teacher adaptation | 67.02 | 5.88 | 12.39 |
| STAGE (soft teacher) | 68.25 | 6.25 | 12.89 |
| Ranking rule | Top-1 | Top-5 | Selected-pair cost |
|---|---|---|---|
| Ground-truth matching | 100.00 | – | 0.5165 |
| Max-cost matching | 0.00 | – | 1.8559 |
| Row-wise | 58.63 | 85.18 | 0.4681 |
| Hard assignment | 67.32 | – | 0.4915 |
| Coupling (ours) | 68.25 | 90.47 | 0.4854 |
| Adaptation objective | EEG2 | MEG | Alljoined |
|---|---|---|---|
| Direct OT ( ) | 61.48 | 5.29 | 10.93 |
| Direct OT ( ) | 52.53 | 5.58 | 10.43 |
| STAGE (soft teacher) | 68.25 | 6.25 | 12.89 |
| EEG2 | MEG | Alljoined | ||||
|---|---|---|---|---|---|---|
| Subsequent update | Fit | GES | Fit | GES | Fit | GES |
| Direct OT ( ) | 28.90 | 1.01 | 2.03 | 0.33 | 1.58 | 0.24 |
| Direct OT ( ) | 2.58 | 0.67 | 0.31 | 0.18 | 0.71 | 0.25 |
| Hard teacher | 3.37 | 4.24 | 0.32 | 0.35 | 0.75 | 0.25 |
| OT–Procrustes | 425.54 | 10.11 | 46.61 | 9.21 | 60.56 | 9.69 |
| OT–Procrustes + confidence/ridge | 39.22 | 4.51 | 2.89 | 0.84 | 2.12 | 0.26 |
Cross-Modal Retrieval
Cross-modal retrieval matches queries and items across different data types, such as text, images, video, audio, and sensor signals.
See all 209 papers