# Lunar Color-Connectivity Regularizer

- ID: 223
- Canonical URL: https://synthcore.org/idea/223/lunar-color-connectivity-regularizer
- API JSON: https://synthcore.org/api/idea/223.json
- API Markdown: https://synthcore.org/api/idea/223.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2608.27118](https://arxiv.org/abs/2608.27118)
- Category: regularization
- Solves: accuracy, generalization, stability
- ML areas: embedding, regularization, graph-nn
- Math tags: metric-geometry, topology, combinatorics, optimization
- Ratings: usefulness 6/10; difficulty 6/10; novelty 6/10

## Idea description

Add a regularizer that penalizes expensive component births and merges in an embedding when points are partitioned into multiple colors, such as classes, modalities, or augmentation identities. Unlike ordinary contrastive learning, it encourages local regions to contain all required colors and uses the full merge hierarchy rather than only selected positive and negative pairs.

## Mathematical statement

For color sets \(A_0,\ldots,A_s\subset\mathbb R^2\), define the max-nearest-color field \(f_{\max}(x)=\max_{0\le i\le s}\min_{a\in A_i}\|x-a\|_2\). Its sublevel set is \(f_{\max}^{-1}[0,r]=\{x:f_{\max}(x)\le r\}\), equivalently the union of radius-\(r\) intersections of one disk around a point from each color, called colorful lunes. Let \(b_0\le\cdots\le b_m\) be radii at which connected components are born and \(d_1\le\cdots\le d_m\) be radii at which components merge. The lunar cost is \({\rm Cost}=2\sum_{i=1}^m d_i-2\sum_{i=1}^m b_i\), with \(b_0\) deliberately omitted. For a neural implementation, approximate the continuous plane by a graph or hypergraph of embedding samples. A colorful hyperedge \(H=(a_0,\ldots,a_s)\) has radius \(\rho(H)=\min_x\max_i\|z_{a_i}-x\|_2\), the smallest radius at which all corresponding disks intersect. Activate hyperedges in increasing \(\rho(H)\), record component births and merges, and use the same birth-minus-death expression as the loss. The exact filtration cost comes from the paper; graph restriction, soft extrema, and differentiable sorting are adaptations.

## Key formulas

- $$f_{\max}(x)=\max_{0\leq i\leq s}\min_{a\in A_i}\|x-a\|_2$$
- $${\rm Cost}(A_0,\ldots,A_s)=2\sum_{i=1}^{m}d_i-2\sum_{i=1}^{m}b_i$$
- $$f_{\max}^{-1}[0,r]=\{x:f_{\max}(x)\le r\}=\bigcup_{a_i\in A_i}\bigcap_{i=0}^{s}B(a_i,r)$$
- $$\rho(H)=\min_x\max_{0\le i\le s}\|z_{a_i}-x\|_2,\qquad L_{\rm lunar}=2\sum_i\widetilde d_i-2\sum_{i\ge1}\widetilde b_i$$

## Implementation notes

(1) Integrate the regularizer after a projection head of a metric-learning or classification network. For each minibatch, compute embeddings \(z_j\in\mathbb R^2\) or a learned two-dimensional projection of a higher-dimensional embedding, and assign colors \(c_j\in\{0,\ldots,s\}\). Colors can represent semantic classes, augmentation identities, or modalities. (2) Construct candidate colorful hyperedges using at most \(K\) nearest neighbors from every color for each anchor. For \(s=1\), use cross-color pairs; for \(s=2\), enumerate restricted triples. Estimate each hyperedge radius by initializing \(x\) at the mean of its vertices and running \(T\) gradient steps on a smooth maximum: \(x\leftarrow x-\eta\nabla_x[\beta^{-1}\log\sum_i\exp(\beta\|x-z_{a_i}\|_2)]\). Use the final smooth maximum as \(\rho(H)\). (3) Sort candidate radii, activate hyperedges in ascending order, and maintain connected components with union-find. Record the radius when a new vertex or hyperedge creates a component and the radius when an activated hyperedge joins two existing components. Compute \(L_{\rm lunar}=2\sum_i\widetilde d_i-2\sum_{i\ge1}\widetilde b_i\), normalize by the minibatch diameter, and add \(\lambda L_{\rm lunar}\) to cross-entropy or supervised contrastive loss. Union-find decisions may be stop-gradient routing decisions while gradients flow through the selected radii; a softer alternative uses edge probabilities \(p_H(r)=\sigma((r-\rho(H))/\tau)\) and a differentiable connectivity surrogate. The mathematical quantities are the colorful lune radii and birth/death cost; \(K,T,\beta,\tau\) are engineering approximations. First test CIFAR-10 with ResNet-18, a two-dimensional projection head, and \(s=1\) using two augmentation colors. Compare cross-entropy, supervised contrastive learning, and the combined objective at equal FLOPs. Measure test accuracy, embedding k-NN accuracy, normalized lunar cost, missing-color component count, and collapse indicators. Success means better k-NN or few-shot accuracy at equal classification accuracy, reduced cross-color connection radii, and stable optimization.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: no_effect
- Verdict: Built a two-color lunar EMST cost verifier using exact brute-force minimum enclosing circles, plus a small PyTorch classification experiment with a differentiable nearest cross-color surrogate. The math check produced nonnegative costs for 20 random configurations, and at identical 100% classification and 3-NN accuracy the regularizer reduced cross-color nearest distance from 0.426 to 0.156 and normalized lunar cost from 0.750 to 0.687. This is a promising connectivity signal, but not an accuracy win; the experiment is too small to establish generalization gains.

### Mechanism check

- Verdict: Built a two-color lunar EMST cost verifier using exact brute-force minimum enclosing circles, plus a small PyTorch classification experiment with a differentiable nearest cross-color surrogate. The math check produced nonnegative costs for 20 random configurations, and at identical 100% classification and 3-NN accuracy the regularizer reduced cross-color nearest distance from 0.426 to 0.156 and normalized lunar cost from 0.750 to 0.687. This is a promising connectivity signal, but not an accuracy win; the experiment is too small to establish generalization gains.
- Confidence: 7/10
- Limitations: No CIFAR-10 or ResNet experiment, no multi-seed statistics, and no full differentiable hierarchy implementation. The training penalty is a nearest cross-color approximation rather than the exact lunar cost; the toy data are linearly structured and classification is already saturated.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.6628
- Paired wins: 4/8
- Benchmark verdict: no measurable effect

## Artifacts

- [bench_report.json](https://synthcore.org/code/1206/bench_report.json)
- [lunar_experiment.py](https://synthcore.org/code/1206/lunar_experiment.py)
- [report.md](https://synthcore.org/code/1206/report.md)
- [report_bench_2026-09-03T042044.md](https://synthcore.org/code/1206/report_bench_2026-09-03T042044.md)
- [results.json](https://synthcore.org/code/1206/results.json)
- [stage2_bench.py](https://synthcore.org/code/1206/stage2_bench.py)
- [Download all files as ZIP](https://synthcore.org/download/1206)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
