# Max-times spectral erosion layer

- ID: 2618
- Canonical URL: https://synthcore.org/idea/2618/max-times-spectral-erosion-layer
- API JSON: https://synthcore.org/api/idea/2618.json
- API Markdown: https://synthcore.org/api/idea/2618.md
- Verification status: unverified
- Source: [arXiv:2608.20399](https://arxiv.org/abs/2608.20399)
- Category: architecture
- Solves: accuracy, stability, sample-efficiency
- ML areas: cnn, transformer, ssm
- Math tags: convex-analysis, harmonic-analysis, functional-analysis
- Ratings: usefulness 6/10; difficulty 5/10; novelty 7/10

## Idea description

Replace an unconstrained Fourier-domain linear mixer with a bank of positive spectral kernels and a max-times erosion aggregator. For a nonnegative Fourier magnitude f, each kernel produces a quotient response f/psi_k and the layer takes the pointwise supremum over kernels, giving exact positive homogeneity and monotonicity. This is most suitable as a drop-in spectral mixing block in a CNN, vision transformer, or state-space model.

## Mathematical statement

The paper defines an adjunction by epsilon(f) <=_2 g if and only if f <=_1 delta(g), where epsilon is an erosion and delta is its dilation. For an effective kernel psi, Definition 4.3 states Ker^eff(Psi) = {psi in hat L : epsilon_psi(hat f) <= Psi(hat f) for every hat f in hat L}; in the extracted text this is equivalently the pointwise condition hat f/psi <= Psi(hat f) for all nonnegative hat f. Theorem 4.4 assumes Psi is increasing, upper semicontinuous (USC), and positively homogeneous, Psi(lambda hat f) = lambda Psi(hat f) for lambda > 0, and represents Psi as a supremum of erosions indexed by minimal kernels Bas(Psi). In a finite implementation, f is a nonnegative Fourier-magnitude tensor, psi_k is a strictly positive learned kernel, epsilon_{psi_k}(f)(xi) = f(xi)/(psi_k(xi)+epsilon), and the adapted representation is Psi(f)(xi) = max_k epsilon_{psi_k}(f)(xi). Increasingness follows because division by a fixed positive psi_k preserves order; positive homogeneity follows exactly up to the small numerical epsilon. The layer should use log-parameterized kernels psi_k = softplus(theta_k) + psi_min to prevent invalid zero denominators.

## Key formulas

- $$\varepsilon(f)\leq_2 g\iff f\leq_1\delta(g)$$
- $$\mathrm{Ker}^{\mathrm{eff}}(\Psi)=\{\psi\in\hat{L}:\varepsilon_{\psi}(\hat{f})\leq\Psi(\hat{f})\;\;\forall\hat{f}\in\hat{L}\}$$
- $$\hat{f}/\psi\leq\Psi(\hat{f})\quad\text{pointwise for all }\hat{f}\geq0$$
- $$\Psi_{\mathrm{morph}}(f)(\xi)=\max_{k=1}^{K}\frac{f(\xi)}{\psi_k(\xi)+\epsilon},\qquad \psi_k(\xi)=\operatorname{softplus}(\theta_k(\xi))+\psi_{\min}$$

## Implementation notes

Integrate this at the Fourier-mixing point of a real CNN or ViT block. Given a real feature tensor x with shape [B,C,H,W], compute its 2-D FFT X = FFT2(x), retain the nonnegative magnitude f = abs(X), and either share one kernel across channels or use grouped channel kernels psi[k,c,h,w]. For K basis elements, store unconstrained parameters theta[k,c,h,w], construct psi = softplus(theta) + psi_min, and evaluate q[k] = f/(psi[k] + eps). Aggregate y_mag = max(q, dim=k). To preserve phase, set Y = y_mag * exp(i angle(X)); return real(IFFT2(Y)). A lower-cost variant applies the operation only to low-frequency bins or to channel groups. Pseudocode: `X=fft2(x); f=abs(X); phase=X/(f+eps); psi=softplus(theta)+psi_min; q=f[:,None]/(psi+eps); ymag=q.max(dim=1).values; y=real(ifft2(ymag*phase))`. The mathematical assumptions are enforced by construction: positivity gives a well-defined quotient, the max gives the supremum over the finite morphological basis, and scaling f by lambda scales the output by lambda. Estimate no theorem constants; empirically monitor monotonicity by checking `Psi(f2)-Psi(f1)>=0` for random tensors with f2>=f1 and homogeneity error `||Psi(lambda f)-lambda Psi(f)||`. First experiment: CIFAR-10 ResNet-18, replace one 3x3 convolutional block's channel mixer with the spectral layer using K=4 and compare equal-parameter and equal-FLOP baselines. Measure validation accuracy, training stability under amplitude scaling of inputs, and robustness to low-frequency corruption. Success is higher accuracy or corruption robustness at equal FLOPs without exploding activations; reject the layer if the FFT overhead eliminates any accuracy gain.

## Disclaimer

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