This is a subcomponent experiment for the larger scene classification experiments. Coming full circle back to the original geometric vocabulary soon.
A prototype system for geometric primitive classification and text–geometry alignment. A voxel classifier learns to identify 38 shape classes from 5×5×5 binary occupancy grids using capacity cascades, curvature analysis, differentiation gates, and a rectified flow arbiter. A cross-contrast module then aligns the classifier's learned features with Qwen 2.5-1.5B text embeddings via InfoNCE, producing a shared latent space where geometric structure and natural language descriptions are jointly represented.
This is a research prototype exploring whether a geometric vocabulary learned from pure structure can meaningfully align with linguistic semantics.
Input is a 5×5×5 binary voxel grid. The forward pass has four stages:
1. Tracer Attention — 5 learned tracer tokens attend over 125 voxel embeddings (occupancy + normalized 3D position → 64-dim via MLP). All C(5,2)=10 tracer pairs compute interaction features and edge detection scores via SwiGLU heads. Pool dimension: 320 (5 tracers × 64-dim).
2. Capacity Cascade — Four CapacityHead modules with learned capacities (initialized at 0.5, 1.0, 1.5, 2.0) process features sequentially. Each outputs a fill ratio (sigmoid), overflow signal, and residual features. The cascade partitions representation capacity across intrinsic dimensions (0D→3D), with fill ratios serving as soft dimensionality indicators.
3. Curvature Analysis — A DifferentiationGate computes radial distance profiles binned into 5 shells, producing sigmoid gates and additive directional features that differentiate convex/concave curvature. A CurvatureHead combines rigid features with gated curvature features to predict: is_curved (binary), curvature_type (8-class), and a curvature embedding used downstream.
4. Rectified Flow Arbiter — For ambiguous cases, a RectifiedFlowArbiter integrates a learned velocity field over 4 flow-matching steps from noise to class prototypes. Produces refined logits, trajectory logits at each step, confidence scores, and a blend weight that gates between initial and refined predictions. Trained with OT-conditioned flow matching loss.
The final class prediction blends initial and arbiter-refined logits via the learned blend weight.
CrossContrastModel
Two MLP projection heads map frozen voxel features (645-dim) and frozen Qwen text embeddings (1536-dim) into a shared 256-dim latent space. Architecture per head: Linear → LayerNorm → GELU → Linear → LayerNorm → GELU → Linear. Trained with symmetric InfoNCE loss and a learned temperature parameter.
Text Embeddings
Class descriptions are encoded by Qwen 2.5-1.5B-Instruct using mean-pooled last hidden states. Each of the 38 classes has a 2-shot geometric description (e.g., "A flat triangular outline formed by three connected edges lying in the horizontal xy-plane, the simplest polygon").
This is a prototype exploring geometric–linguistic alignment at small scale. The 5×5×5 grid is intentionally minimal — large enough to represent 38 distinct geometric primitives with curvature distinctions, small enough to train in minutes on a single GPU. The interesting questions are about the structure of the shared latent space: whether text-space confusions mirror geometric failure modes, whether the alignment generalizes beyond the training vocabulary, and what happens at scale.
This is not a production classifier. The procedural dataset is synthetic, the grid resolution is toy-scale, and the cross-contrast vocabulary is fixed at 38 classes.