Fitting a geometric shape to an image or point cloud means searching a space of shape parameters. An ellipse has five (center, two axes, angle), and a 3D highway curve built from spirals and parabolas has nine. Classical detectors either vote over a grid whose size grows exponentially with the number of parameters, or they sample random small point sets and check each resulting candidate, as RANSAC does. Both scale badly. Learned alternatives either predict one answer per detected box, and so fail when the box detector misses a target, or they search with reinforcement learning so slowly that fitting one highway scene took about 43 hours. This proposal replaces the random hypothesis step with a learned generator. A one-step flow model, meaning a generator that maps random noise to a sample in a single network evaluation, is trained to propose many plausible parameter vectors at once, conditioned on the image. A cheap classical check then accepts or rejects each proposal against the edge or point evidence.
The bet is that the hard part of high-dimensional geometric search is proposing good candidates, and that verifying a candidate is easy. A generative model can learn that distribution of candidates, including its multiple peaks when several shapes or ambiguous partial arcs are present. Recent one-step generators make drawing hundreds of candidates a single batched forward pass instead of a sequential chain. We also argue that the way shape parameters are written down matters a great deal. Ellipse parameters have built-in ambiguities: swapping the axes and rotating by 90° describes the same ellipse, and every orientation of a circle is the same circle. These ambiguities bend the noise-to-data paths a flow must learn and hurt single-step accuracy. A closed-form change of coordinates removes the ambiguities, playing the role that expensive symmetry matching plays in molecular flows.
Core Claim
A conditional one-step flow over a symmetry-free shape parameterization, used only as a proposal distribution inside a sample-and-verify loop, will recover occluded, overlapping, small, and highly elongated ellipses that both box-then-fit hybrids and edge-grouping detectors miss. It will do so at latency comparable to those hybrids. The flow's role is narrow. It never outputs the final answer. It replaces random minimal-set sampling with samples concentrated near plausible shapes, and the existing geometric verification tests remain the final judge.
Relation to Prior Work
Three works come closest, and each stops short of this. Monte Carlo Diffusion for Generalizable Learning-Based RANSAC uses a forward diffusion process only offline, to corrupt clean correspondences into varied training noise. Its estimator at test time is still ordinary RANSAC hypothesis sampling. We borrow its randomized-corruption recipe for training data, but our generator runs at inference and produces the hypotheses. 3D MeanFlow shows that average-velocity transport can complete point clouds in about 5 ms. However, it generates unstructured coordinates rather than a compact parameter vector, and it sits downstream of a box detector, so it cannot recover objects the detector missed. We generate parameters directly from whole-image features with no proposal stage. 3D Highway Curve Reconstruction through Deep Reinforcement Learning treats 9-parameter curve fitting as sequential decision making with PPO. It motivates this work through its roughly 155,000-second fitting time, and our second domain asks whether an amortized proposer can remove that cost.
The method comes from Mean Flows for One-step Generative Modeling. That paper learns the average velocity over a time interval rather than the instantaneous velocity, reaching a one-step FID (an image-quality score, lower is better) of 3.43 on ImageNet 256×256 without distillation. We apply it in a space of five to nine dimensions with heavy image conditioning, a regime it never tested.
The symmetry argument follows Equivariant flow matching. That work shows that aligning samples across rotation and permutation symmetries shortens flow paths, from 2.84 to 2.15 on the 13-particle Lennard-Jones cluster benchmark (LJ13). It needs Hungarian matching, whose cost grows cubically with particle count. Our symmetries are finite and known in closed form, so a fixed reparameterization does the same job at no runtime cost.
Classical work defines what we must beat and supplies our verifier. Arc-Support Line Segments Revisited splits the 5D search into center, orientation, and axis subspaces. It reports an F-measure of 0.9447 on the PCB dataset, but notes failures at semi-major axes near 20 px with axis ratio 0.25. A Fast Ellipse Detector Using Projective Invariant Pruning prunes candidates by 98.5% with determinant-based invariants, running in 8.54 ms but reaching only an F-measure of 0.4692. Real-Time Ellipse Detection for Robotics Applications shows that a fit-then-validate pipeline with strict overlap checks can be very precise when contours are clean. Our verifier reuses that style of check. Efficient and Precise Ellipse Detection via Deep Learning-Based Axis-Aligned Bounding Box Estimation is the box-then-fit hybrid. It admits that targets missed by its Faster R-CNN detector are unrecoverable, which is exactly the failure our approach targets.
Research Program
The parameterization comes first. For an ellipse with center $(x_c, y_c)$, semi-axes $a, b$ and angle $\varphi$, we map to
$$s = \big(x_c,\; y_c,\; \log(ab),\; \log(a/b)\cos 2\varphi,\; \log(a/b)\sin 2\varphi\big).$$
This vector is the center plus the matrix logarithm of the ellipse's shape matrix. It is unchanged when the axes are swapped and the angle shifted by 90°, and unchanged when the angle shifts by 180°. It maps all orientations of a circle to a single point. The map is continuous and invertible, so the generator never has to learn a target with several redundant modes. For highway curves we normalize each segment to a canonical frame (start point and tangent) before learning the remaining shape parameters. We expect less benefit from symmetry there, and treat that domain mainly as a latency test.
The generator is a convolutional encoder run once per image, followed by a small average-velocity head. The head takes a noise vector in $\mathbb{R}^5$ and cross-attends to local encoder features. It is trained with the MeanFlow objective so that one evaluation maps noise to a shape sample. Training data is synthetic: rendered ellipses with controlled occlusion, overlap, clutter, blur, scale, and elongation. We add corruption randomized in the manner of Monte Carlo Diffusion so the model does not overfit to one edge detector's noise pattern.
At inference we draw $K$ samples (64 to 1024) in one batch. We score each sample by the fraction of its perimeter supported by edge pixels whose gradients agree with the ellipse normal. We then apply non-maximum suppression with distances measured in the coordinates $s$, and refine survivors with a Fitzgibbon least-squares fit on their supporting pixels. The highway variant applies the same loop to mobile laser scanning point clouds, using a point-to-curve residual as the verifier.
We will analyze three things. The first is path straightness: how far the one-step sample lands from the result of integrating the same flow with many steps, compared between the raw $(a,b,\varphi)$ coordinates and $s$. The second is recall as a function of $K$, which shows how concentrated the learned proposals are compared with random sampling. The third is a latency breakdown into encoder, head, verifier, and refinement, which tells us where the time actually goes.
Baselines
The naive reference point is classical random hypothesis sampling with the identical verifier. Candidates are formed from random five-point edge subsets, fitted, and scored by the same edge-support and refinement code, under the same hypothesis budget $K$ and on the same hardware. This baseline isolates the key ingredient. If learned proposals do not reach a given recall with far fewer hypotheses than random ones, the generator adds nothing.
The strongest learned competitor is the box-then-fit hybrid of Wang et al.. It reports precision 0.8442 and F-measure 0.7675 on the Concurrent Ellipses Dataset, F-measure 0.6569 on the Occluded Ellipses Dataset, and about 174 ms per image in Python. It is the strongest competitor because it is the best reported learned method on the overlap and occlusion benchmarks we target. We will rerun it on our GPU, with its detector trained on the same synthetic data as our encoder, so that neither data nor hardware favors us. Beating it means a higher F-measure on Occluded Ellipses at equal or lower measured latency. On Concurrent Ellipses we require matching its precision while improving recall.
Among classical detectors we compare with three methods, each run with its published settings. Against Lu et al. (F-measure 0.9447 at 0.1693 s on PCB), we expect to come close on clean industrial images and to win on a stratified small-and-elongated split. Against Jia et al. (F-measure 0.4692 at 8.54 ms on its Dataset #1), the comparison concerns speed: we report where on the speed–accuracy curve each method sits. Against Keipour et al. (F1 0.981 at 32.2 ms on the AirLab dataset), we expect at best to tie on its clean-contour regime. Such a tie would be acceptable.
Three ablations use the same encoder and the same training data. In the first, a deterministic regression head predicts a fixed set of ellipses using set matching in the style of DETR. In the second, a mixture density network head produces $K$ Gaussian components. In the third, our flow head is run on raw $(a,b,\varphi)$ instead of $s$.
For highway curves, the reference is the PPO fit of Wei et al., which reports about 43 hours per experiment. No reported accuracy number was found on Lacuna for that benchmark, so we will compare fit residuals against our own reimplementation, or against Cuckoo Search if PPO cannot be reproduced.
Why not just…?
Why not just regress the parameters directly with a set-prediction head? This is the most serious threat, because it also needs a single forward pass and handles multiple instances. Our argument is that an occluded arc is consistent with a whole family of ellipses. A regressor trained with matched L1 loss predicts the average of that family, which can match no real edge support, whereas sampling followed by verification can pick the correct member. The set-prediction ablation settles the question on Occluded Ellipses and on the small-and-elongated split. If it matches the flow there, we will report that the generative component is unnecessary.
Why not just use a mixture density network? A mixture density network is a single-pass network that outputs a mixture of Gaussians and so already models multiple peaks. It is the cheapest generative alternative, and it may well work in five dimensions. We expect it to struggle with thin, curved families of solutions such as ellipses sharing one visible arc, which a fixed number of Gaussian blobs fits poorly. The direct test is to compare it with our flow on recall-versus-$K$ curves using the same verifier. If the two are equivalent, the honest conclusion is that the contribution lies in the sample-and-verify loop and the reparameterization, not in MeanFlow.
Why not just use RANSAC or classical grouping? Random minimal-set sampling needs a number of draws that grows rapidly with outlier rate and sample size. On noisy correspondences, Monte Carlo Diffusion reports that MAGSAC++ reaches only 5.4% AUC@20° (area under the pose-accuracy curve up to a 20° error threshold), against 26.2% for a learned model. Grouping detectors fail on small and elongated shapes, as their own papers report. The random-proposal baseline with our verifier measures this gap directly.
Why not just run a multi-step flow, since the parameter space is tiny? This objection is fair. Because the encoder runs once and the head is small, 8 to 16 steps may cost little. The one-step design matters only if the head's cross-attention over $K$ hypotheses dominates the total time. We will measure the latency breakdown at 1, 2, 4, and 16 steps. If multi-step sampling is nearly free and more accurate, we will adopt it. The symmetry-free coordinates should help either way, by cutting the number of steps needed.
Proposed Experiments
We train only on synthetic data and evaluate zero-shot on the Concurrent and Occluded Ellipses datasets, PCB, Prasad, Traffic Sign, Dataset #1, and AirLab. For Prasad and Traffic Sign, no reported result was found on Lacuna, so we rerun all baselines there. Metrics are precision, recall, and F-measure under each benchmark's overlap criterion, plus per-image latency measured on one GPU and one mobile CPU.
The first decisive check is whether we exceed F-measure 0.6569 on Occluded Ellipses at a measured latency at or below the hybrid's rerun time, while beating the set-regression and mixture-density ablations. The second check is the recall-versus-$K$ comparison with random proposals: learned proposals should reach random sampling's recall at the largest budget while using at least ten times fewer hypotheses. The third check is whether the coordinates $s$ reduce the gap between one-step and many-step samples, and whether that reduction appears as better one-step recall on the small-and-elongated split.
On highway point clouds from the HELIOS simulator and the RIEGL VMX-450 scanner, the check is whether amortized proposals plus verification reach PPO-level residuals in seconds rather than hours. Failure in this domain would localize the method's limits to settings with fewer symmetries.
References
- Monte Carlo Diffusion for Generalizable Learning-Based RANSAC
- 3D MeanFlow: One-Step Point Cloud Completion and Generation via Average-Velocity Transport
- 3D HIGHWAY CURVE RECONSTRUCTION FROM MOBILE LASER SCANNING POINT CLOUDS THROUGH DEEP REINFORCEMENT LEARNING
- Mean Flows for One-step Generative Modeling
- Equivariant flow matching
- Arc-Support Line Segments Revisited: An Efficient High-Quality Ellipse Detection
- A Fast Ellipse Detector Using Projective Invariant Pruning
- Real-Time Ellipse Detection for Robotics Applications
- Efficient and Precise Ellipse Detection via Deep Learning-Based Axis-Aligned Bounding Box Estimation