HamVision: Hamiltonian Dynamics as Inductive Bias for Medical Image Analysis

Mohamed Mabrok · 2026

Read HamVision: Hamiltonian Dynamics as Inductive Bias for Medical Image Analysis by Mohamed Mabrok (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-21377.txt.

Introduction

Mabrok presents HamVision, a framework for medical image analysis built on the damped harmonic oscillator. The oscillator's phase space gives three representations: position for feature content, momentum for boundary and texture gradients, and energy as a parameter-free saliency map. For segmentation, energy gates skip connections while momentum adds boundary detail at each decoder level. For classification, the three are pooled into one feature vector. Across ten benchmarks, the segmentation head sets state-of-the-art Dice scores on four data sets with few parameters.

Catalog record

CREATORMohamed Mabrok
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE60369
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2603.21377

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

HamVision: Hamiltonian Dynamics as Inductive Bias for Medical Image Analysis Mohamed Mabrok Abstract We present HamVision, a framework for medical image analysis that uses the damped harmonic oscillator, a fundamental building block of signal processing, as a structured inductive bias for both segmentation and classification tasks. The oscillator’s phase-space decomposition yields three functionally distinct representations: position q q (feature content), momentum p p (spatial gradients that encode boundary and texture information), and energy H = 1 2 ​ | z | 2 H=\tfrac{1}{2}|z|^{2} (a parameter-free saliency map). These representations emerge from the dynamics, not from supervision, and can be exploited by different task-specific heads without any modification to the oscillator itself. For segmentation, energy gates the skip connections while momentum injects boundary information at every decoder level (HamSeg). For classification, the three representations are globally pooled and concatenated into a phase-space feature vector (HamCls). We evaluate HamVision across ten medical imaging benchmarks spanning five imaging modalities. On segmentation, HamSeg achieves state-of-the-art Dice scores on ISIC 2018 (89.38%), ISIC 2017 (88.40%), TN3K (87.05%), and ACDC (92.40%), outperforming most baselines with only 8.57M parameters. On classification, HamCls achieves state-of-the-art accuracy on BloodMNIST (98.85%) and PathMNIST (96.65%), and competitive results on the remaining MedMNIST datasets against MedMamba and MedViT. Diagnostic analysis confirms that the oscillator’s momentum consistently encodes an interior > \,{>}\, boundary > \,{>}\, exterior gradient for segmentation and that the energy map correlates with discriminative regions for classification, properties that emerge entirely from the Hamiltonian dynamics. Code is available at https://github.com/Minds-R-Lab/hamvision . 1 Introduction Medical image analysis encompasses a broad range of tasks, from pixel-level segmentation of anatomical structures to image-level classification of pathological conditions. These tasks differ in their outputs, dense spatial maps versus scalar labels, but share a fundamental requirement: the ability to extract discriminative features from complex, noisy images where the relevant information may be subtle gradients at tissue boundaries, textural patterns indicative of disease, or spatial distributions of intensity. The dominant paradigm addresses each task with specialized architectures: U-Nets with skip connections for segmentation [ 23 ] , convolutional or transformer-based backbones with pooling heads for classification [ 11 , 7 ] . Both paradigms learn generic feature transformations from data, relying on model capacity rather than structural priors to discover what computations are useful. This paper takes a different approach. We observe that the damped harmonic oscillator is a universal signal analyzer whose intrinsic dynamics produce three representations that are useful for any medical image analysis task. When a spatially varying signal, a row or column of an image feature map, drives an oscillator with natural frequency \omega and damping \nu , the oscillator’s response decomposes into position q (filtered signal content), momentum p=\dot{q} (the rate of spatial change, which peaks at boundaries and vanishes in homogeneous regions), and energy H=\tfrac{1}{2}(q^{2}+p^{2}) (a scalar measure of local excitation that integrates both signals into a spatial saliency map). None of these properties are learned; they are intrinsic to the dynamics. A bank of oscillators at different frequencies forms a neural filterbank [ 18 ] , decomposing features into frequency bands with per-channel momentum and energy as structured byproducts. The key insight of this work is that these three representations, position, momentum, energy, are sufficient to build both a segmentation head and a classification head, without modifying the oscillator itself. For segmentation, boundaries are the critical information: momentum detects them (large |p| at transitions), energy gates them (highlighting salient regions), and both propagate through the decoder at all resolutions. For classification, discriminative power lies in global statistics: the distribution of momentum magnitudes captures texture complexity, energy captures overall image activity, and position captures content, all pooled into a compact classification vector. The oscillator bottleneck is a shared computational primitive; only the downstream head changes between tasks. This constitutes a structured inductive bias in the same sense that convolutions impose translation equivariance or graph networks impose permutation equivariance. Our bias is that features should evolve according to damped oscillator dynamics, which implicitly encodes the prior that spatially varying signals contain boundary, frequency, and saliency information that is useful for medical image analysis. The analogy to Hamiltonian Monte Carlo [ 21 ] is instructive: that method uses oscillator dynamics not because sampling is a physical process, but because the dynamics have useful exploration properties. We use Hamiltonian dynamics not because images are physical systems, but because the resulting phase-space decomposition provides precisely the representations that both segmentation and classification require. Mamba-3 [ 15 ] has independently validated that complex-valued state transitions enable capabilities that real-valued SSMs provably lack, confirming the algebraic necessity of rotational dynamics for certain computational tasks. Our work leverages this validation by showing that the physical interpretation of the complex state, the decomposition into position, momentum, and energy, provides practical and interpretable structured representations for both segmentation and classification in vision tasks. This paper makes four contributions. First, we introduce a Hamiltonian bottleneck that produces position, momentum, and energy as structured intermediate representations from a single dynamical process. Second, we design two task-specific heads that exploit these representations: energy-gated skip connections with momentum injection for segmentation, and phase-space pooling for classification. Third, we demonstrate that HamVision, a single architecture with a shared oscillator bottleneck, achieves state-of-the-art results across ten benchmarks spanning five imaging modalities and two distinct tasks, with only 7–9M parameters. Fourth, we provide diagnostic evidence that the oscillator’s outputs carry interpretable, task-relevant information that emerges from the dynamics without explicit supervision. 2 Related Work The U-Net [ 23 ] established the encoder–decoder paradigm with skip connections for biomedical segmentation, subsequently extended by attention gates [ 22 ] , dense connections [ 14 ] , and vision transformers that provide global context at the cost of quadratic complexity [ 4 , 3 ] . For classification, ResNets [ 11 ] remain the standard backbone, with MedViT [ 20 ] adapting vision transformers for medical imaging and MedMamba [ 28 ] introducing state-space models for efficient classification. Our framework, HamVision, preserves the U-Net topology for segmentation and a simple pooling head for classification, replacing the generic bottleneck with a physics-structured alternative. Structured state-space models, beginning with S4 [ 10 ] and culminating in Mamba [ 9 ] , have emerged as efficient alternatives to attention for modeling long-range dependencies. VMamba [ 16 ] extended this to two-dimensional data through multi-directional scanning. In medical imaging, VM-UNet [ 24 ] , U-Mamba [ 19 ] , and FreqConvMamba [ 25 ] embed generic state-space blocks within U-Net variants for segmentation, while MedMamba [ 28 ] uses them for classification. These methods all treat the state transition as a learned diagonal with no structural constraints. Our work constrains the transition to follow oscillator dynamics, exploiting the rich physical structure of the resulting phase space. The use of dynamical systems as computational primitives has a long history. Neural ODEs [ 5 ] parameterize hidden state evolution as continuous dynamics. Hamiltonian Neural Networks [ 8 ] learn energy-conserving systems from data. Oscillatory networks have been studied for synchronization-based grouping [ 26 ] and pattern recognition [ 12 ] , while unitary RNNs [ 1 ] use rotation matrices, a special case of oscillator dynamics, to combat vanishing gradients. Mamba-3 [ 15 ] independently

Read the complete text