Source-linked AI summary
Flow-TAG: Flow-based conditional latent transport for accurate spline approximation and data compression
Roman Pavelkin, Luis A. Zavala-Mondragon, Fons van der Sommen
TL;DR
Curve fitting from noisy, discrete data is important for reliable CAD models, but choosing effective spline knots is a difficult optimization problem. Flow-TAG learns knot vectors from curve geometry with a generative flow model and 1D U-Net. It reports stronger spline approximation than evaluated baselines and applies the framework to ECG compression.
Problem
Choosing knot locations is difficult because the B-spline basis depends on them, making optimal knot placement nonlinear and combinatorial.
Source: §2 · p. 4Method
Flow-TAG uses a generative flow model with a 1D U-Net to map curve geometry to knot vectors, trained with a geometry-informed loss combining flow matching and curve fidelity.
Source: §1 · p. 2Results
Flow-TAG yields the highest-quality spline approximations among evaluated baselines, and its ECG compression setup achieves a compression ratio of 13 with distortion below 9%.
Source: §1 · p. 2, §5.3 · p. 13Takeaways & Limitations
The study demonstrates flow-TAG on previously unseen 2D and 3D curves and investigates its use for ECG compression.
Source: §1 · p. 2The experimental framework operates patch-wise on 100-point curve segments; processing an entire curve in one pass imposes additional constraints on the generative network architecture.
Source: §6 · p. 14
Abstract
from arXiv · showhide
Robust curve fitting is essential in computer-aided design for transforming noisy, discrete data into accurate geometric models that ensure numerical stability across engineering workflows. B-spline models have become the industry standard for this task, offering a flexible and reliable framework characterized by local control and smooth shape representation. This paper presents flow-TAG--a data-driven framework based on a generative flow model with a 1D U-Net backbone capable of mapping the geometry of a curve to the optimal parametrization for cubic B-splines. By leveraging learned geometric patterns, flow-TAG exhibits superior parameterization performance, robustness to noise in the input data, and strong generalization capability to previously unseen 2D and 3D curves drawn from distinct data distributions. Flow-TAG yields fitted curves that achieve the lower root-mean-square error (55% lower on average) and Hausdorff distance (52% lower on average) relative to state-of-the-art data-driven methods. In addition, we investigate the practical applicability of our generative framework in the compression of ECG signals for wearable devices. The proposed compression setup provides a compression ratio of 13 with the signal distortion of around 5%, which is acceptable in the field.
1 Introduction
Robust B-spline fitting supports reliable CAD geometry, but its accuracy depends on parameterization, especially for noisy or irregularly sampled data. Flow-TAG learns knot vectors from curve geometry and is evaluated on 2D and 3D curves and ECG compression.
1 Introduction
- Robust fitting matters because discrete curve data may be noisy or irregularly sampled, while inaccurate fits can undermine design intent and numerical stability.The introduction connects this need to surface modeling, tool-path generation, and finite element analysis.Source: §1 · p. 1
- B-splines are prominent in CAD because they combine compact representation with local support, smoothness control, and affine invariance.Parameter assignment affects approximation quality by influencing basis-function evaluation and how geometric features are distributed.Source: §1 · p. 1
- The introduction identifies classical heuristic parameterization methods as a target for data-driven approaches that learn parameter values from geometric patterns and noise characteristics.It points to a later section for discussion of prior neural parametrization methods.Source: §1 · p. 2
- Flow-TAG produces the highest-quality spline approximations among evaluated baseline methods, with robustness to input noise and generalization to unseen curves from distinct distributions.The framework uses a generative flow model with a 1D U-Net backbone.Source: §1 · p. 2
- The study also investigates using flow-TAG to compress ECG recordings for wearable devices.The introduction presents this as an evaluation of practical applicability on medical data.Source: §1 · p. 2
2 Problem statement
The problem is to represent sampled curves smoothly and compactly while choosing spline coefficients and knot locations that yield accurate fits. Knot placement is difficult because the spline basis depends on the knots, making the optimization nonlinear and combinatorial.
2 Problem statement
- The stated modeling goal is a smooth curve that accurately represents observations while retaining a compact and flexible representation.A B-spline curve is given as a widely used representation for this task.Source: §2 · p. 2
- Interpolation requires the spline to pass through every data point, but exact reconstruction may be sensitive to noise or irregular sampling.The paper describes interpolation as one of the curve-modeling frameworks used in the study.Source: §2 · p. 3
- When the control-point count is smaller than the sample count, the spline approximates rather than interpolates the data by minimizing fitting error.The text presents least squares as a common formulation for this approximation setting.Source: §2 · p. 3
- The knot-placement problem is to choose suitable knot locations for a given curve; uniform placement may miss local variation, while adaptive placement can allocate more basis functions to complex regions.For a fixed degree and control-point count, knot locations define the approximation space.Source: §2 · p. 3
- The knot-configuration problem is challenging because the B-spline basis functions depend on knot locations, making the optimization nonlinear and combinatorial.The paper notes that solutions often rely on heuristics, iterative refinement, or data-driven approaches.Source: §2 · p. 4
- Spline modeling couples estimating coefficients for a knot configuration with choosing knot locations for an accurate, compact representation.The target is a smooth function representing the underlying curve from ordered parameter values and observations.Source: §2 · pp. 2, 4
3 Related work
Prior work addresses learned spline parameterization and knot placement as well as curve compression. The approaches differ in their input handling, optimization burden, and robustness or reconstruction trade-offs.
3 Related work
- The section surveys published machine-learning work on spline-approximation optimization and methods for curve compression.These are the two topic areas identified for the related-work review.Source: §3 · p. 4
3.1 Learning-based methods for spline curve approximation
- PARNET predicts parameters and knot distributions from point-set geometry, while its synthetic-data training raises concerns about robustness to real-world noise and generalization.It combines point-parameterization and knot-selection networks with a least-squares control-point solution in its loss.Source: §3.1 · p. 4
- A fixed-window ResNet can generalize to arbitrary-length point sequences, but is vulnerable to high-frequency noise and requires retraining for different polynomial degrees.The approach uses ordered inputs, and complex curves may require more layers and knots.Source: §3.1 · p. 4
- DNN-Solver maps initial knots toward desirable knot positions, but its iterative optimization makes real-time curve fitting unsuitable.The paper characterizes it as predominantly optimization-based rather than learning-based.Source: §3.1 · p. 4
- Transformer methods include direct knot-vector prediction and SplineGen, whose stated limitations include point disorder and lacking explicit constraints on approximation error or minimum knot count.SplineGen is described as independent of point-set size and permutation-invariant, with aligned knots and parameters.Source: §3.1 · p. 4
3.2 Curve compression techniques
- Optimization-based spline compression of medical guidewires and ECG can be computationally intensive, creating a trade-off with real-time performance; the ECG approach may also be less robust to noisy recordings.The guidewire method's knot-placement cost scales poorly with problem size.Source: §3.2 · pp. 4–5
- Transform-based ECG compression can introduce distortion, while EMD/TQWT methods trade compression performance against computational complexity, mode mixing, or manual parameter tuning.The reviewed pipelines may also be evaluated on limited databases and can discard clinically significant features through aggressive thresholding.Source: §3.2 · p. 5
- CAE approaches compress ECG through bottleneck dimensionality reduction, but the reviewed methods differ in compression ratio and reconstruction accuracy.Yildirim et al. use a statically predefined ratio and report noticeable, signal-varying distortions; Bekiryazici et al. use a multichannel low-dimensional representation with quantization and entropy encoding.Source: §3.2 · p. 5
4 Methods
The methods section outlines the neural-network architecture, dataset preparation, and implementation details for the numerical experiments.
4 Methods
- The methods section covers network architecture and configuration, dataset characteristics and preparation, and implementation details intended to support reproducibility.Source: §4 · p. 5
4.1 Deep neural network to substitute the spline approximation
The section motivates replacing spline approximation with a learned network and describes a 1D U-Net whose reconstruction combines local detail with global context. Its training objective encourages sample fidelity and curvature regularity.
4.1 Deep neural network to substitute the spline approximation
- The network fθ learns a function that approximates smoothing-spline solutions by matching observed samples while penalizing curvature.The section relates the smoothing penalty to cubic splines with natural boundary conditions and their minimum-bending-energy property.Source: §4.1 · pp. 5–6
- The 1D U-Net uses skip connections to combine local high-resolution details with global context, supporting curve reconstruction while preserving observed samples and filling unobserved regions.The passage also notes that the architecture handles noisy inputs effectively.Source: §4.1 · p. 6
- The 1D U-Net architecture is presented as a fit for sparse curve reconstruction because it combines context-aware reconstruction with local geometric constraints.The section draws an analogy between U-Net skip connections and the local support of spline bases.Source: §4.1 · pp. 5–6
4.2 Task-aware flow-based generative modeling
Flow-TAG uses conditional flow matching to generate knot-placement latents guided by a spline-approximation task. Its multi-term objective, differentiable gating, and U-Net components support end-to-end training and knot selection.
4.2 Task-aware flow-based generative modeling
- The task-aware framework treats knot vectors as latent representations and uses downstream spline reconstruction loss to guide conditional transport.The spline approximant also acts as a prior that fixes the flow's terminal state within a meaningful objective space.Source: §4.2 · p. 6, §4.2.1 · p. 7
4.2.1 Conventional Flow Matching and its coupling with a downstream task
- Conventional flow matching transports Gaussian noise to a target distribution along linear paths, whereas flow-TAG guides latent transport using predictions from the differentiable spline task model.The estimated target distribution represents possible knot positions.Source: §4.2.1 · p. 7
4.2.2 Multi-task loss with uncertainty-based weighting
- The total objective combines flow-matching, mean-squared reconstruction, and smoothness losses, with learned uncertainty weights balancing the objectives.Increasing a task's σ decreases its weight; a logarithmic term discourages weights from growing too large and effectively ignoring an objective.Source: §4.2.2 · p. 8
4.2.3 Differentiable sigmoid gate
- A sigmoid gate converts generated latents into a differentiable soft mask, selecting values above a percentile threshold before passing them to the task model.At inference, top-M selection is applied directly to the generated latent.Source: §4.2.3 · p. 8
4.2.4 Flow-TAG overview
- At inference, the denoising autoencoder extracts multiscale features from the curve, which condition the flow model's knot-placement logits; the task model is used only during training.The workflow then selects knot indices and fits a cubic B-spline.Source: §4.2.4 · p. 9, §4.2.3 · p. 9
4.3 Datasets
The experiments use SplineGen curves for training, validation, and testing, and the MIT-BIH Arrhythmia dataset for ECG compression assessment. ECG recordings are filtered and segmented into normalized patches before spline processing.
4.3 Datasets
- The MIT-BIH Arrhythmia dataset provides ECG recordings for clinically relevant compression assessment, comprising 48 half-hour, two-channel excerpts from 47 subjects.Recordings were digitized at 360 Hz per channel with 11-bit resolution over a 10 mV range.Source: §4.3 · p. 9
- The public SplineGen dataset supplies the train, validation, and test sets and contains more than 1M generated 2D and 3D curves resampled to 100 points.Curves are scaled, rotated, and flipped; the dataset provides knots and control points.Source: §4.3 · p. 9
- ECG preprocessing applies a 1–150 Hz Butterworth filter and a 50 Hz notch filter, then segments recordings into 100-point mean-centered, min–max-normalized patches.The processed ECG signals are treated as 2D curves for spline fitting.Source: §4.3 · p. 9
4.4 Metrics
The section defines curve-fitting metrics and ECG-compression metrics for evaluating approximation quality, compression, and signal distortion.
4.4 Metrics
- RMSE estimates overall fit quality, while Hausdorff distance measures the maximum nearest-point discrepancy between two curves in either direction.These metrics evaluate flow-TAG's B-spline approximation of input curves.Source: §4.4 · pp. 9–10
- Compression Ratio (CR), Normalized Percent Root Difference (PRDN), and Quality Score (QS) are used to evaluate ECG signal compression.QS jointly quantifies compression ratio and post-compression signal distortion.Source: §4.4 · pp. 10–11
- PRDN below 9% is reported to preserve clinically relevant features with adequate signal quality, while values above 9% may indicate loss of critical information.PRDN between 0% and 2% reflects excellent compression.Source: §4.4 · p. 11
5 Results and discussions
The results examine training-weight adaptation, curve reconstruction, and ECG compression. Flow-TAG performs best on the reported 2D and 3D knot ranges, while its ECG setup achieves compression ratio 13 with distortion below 9%.
5.1 Training details
- After roughly 10,000 iterations, σ1 stabilizes near 0.48, while σ2 and σ3 continue decreasing to 0.02 and 0.03 by about 40,000 iterations.The LMSE and LSmooth coefficients increase inversely quadratically with σ, making their contributions dominant relative to the flow-matching term.Source: §5.1 · p. 11
5.2 Curve reconstruction
- Across 10 generations, knot-placement uncertainty varies by knot, and regions of low uncertainty are avoided during placement.The 2D examples show generated B-spline approximations and corresponding uncertainty maps.Source: §5.2 · p. 12, Figure 7 · p. 12
5.3 Curve compression
- Compression ratio 13 with signal distortion below 9% is reported for 30 internal knots per patch and 30 nonlinear quantization levels.The comparison reports better quality scores than ECG-adapted JPEG2000, CAE, and multichannel CAE; Table 1 presents the baseline comparison.Source: §5.3 · p. 13, Table 1 · p. 14, Figure 10 · p. 14
6 Conclusion
flow-TAG generates knot-vector parametrizations for cubic B-spline approximation and shows advantages over parameterization-optimizing baselines on 2D and 3D curves. The conclusion also notes preliminary ECG-compression results and constraints associated with patch-wise or global processing.
6 Conclusion
- The framework combines a 1D U-Net generative flow model and a self-tuning, multi-task geometry-informed loss to generate cubic B-spline parametrizations.The loss jointly incorporates flow matching and curve fidelity.Source: §6 · p. 14
- On the public SplineGen dataset, flow-TAG approximates 2D and 3D curves and outperforms baselines that optimize spline parameterization.The conclusion reports this advantage without giving metric values here.Source: §6 · p. 14
- ECG compression tests indicate encouraging but preliminary results for using flow-TAG as a signal encoder.The conclusion frames these results as prospects rather than established performance.Source: §6 · p. 14
- Patch-wise processing generates knots for 100-point curve segments and may be suboptimal in some scenarios, while a global pass constrains the generative network architecture.The framework can in principle be implemented under either regime.Source: §6 · p. 14
- Potential applications include latent representations for streaming data and advanced ECG-compression algorithms.Source: §6 · p. 14
A U-Net design and training details
The implementation uses related 1D U-Net architectures for denoising, task, and flow models, with time conditioning and multiscale features in the flow model. Training adds Gaussian noise to curves and trains the flow model using a multi-task objective and uncertainty-based loss weighting.
A U-Net design and training details
- The flow model vϕ uses the multi-task objective with uncertainty-based loss weighting, whereas D and fθ use the geometry-informed loss.Source: A U-Net design and training details · p. 14
- The denoising autoencoder D and task model fθ share a 1D U-Net architecture, while the flow model vϕ uses a 1D U-Net with multiscale features and time conditioning.The denoising and task architecture uses two Conv1D-BN-ReLU layers per DConv block and transposed convolutions for upsampling; odd-length inputs use right-padding.Source: A U-Net design and training details · pp. 14–15, Table 2 · p. 15, Table 3 · p. 15
- The architecture descriptions are provided in Tables 2 and 3, and Tables 4 and 5 report model performance for different training objectives.The supplied text identifies the table scopes but provides no performance values.Source: Table 2 · p. 15, Table 3 · p. 15, Table 4 · p. 16
- Training adds Gaussian noise to 2D or 3D curves and uses conditioning features from a frozen pretrained denoising autoencoder.The model is trained for 20 epochs on SplineGen with batch size 32 and Adam at learning rate 10^-4.Source: A U-Net design and training details · pp. 14, 16
- The flow model is trained to transport sampled Gaussian noise toward estimated knot masks along a linear flow-matching path.The training algorithm samples a knot count, predicts flow velocity and mask logits, forms soft masks, reconstructs curves with the pretrained task model, and updates model parameters using the loss.Source: A U-Net design and training details · p. 16
B Ablation study on the training objective of D and vϕ
The ablation section reports denoising and flow-model performance after 10,000 training iterations across combinations of the total training loss.
B Ablation study on the training objective of D and vϕ
- The denoising and flow models are evaluated after 10,000 iterations using different combinations of the total training loss.Tables 4 and 5 contain the reported performances, but the supplied passage gives no values or winning objective.Source: B Ablation study on the training… · p. 16
- The objective ablation covers both the denoising model and the flow model.Source: B Ablation study on the training… · p. 16
- The compared training settings are combinations of the total training loss in Eq. (26).Source: B Ablation study on the training… · p. 16