SynthPix: Accelerated Synthetic PIV Imaging
- SynthPix is an ultra-high-throughput synthetic image generation framework for PIV, achieving rates up to 22,538 image pairs/sec on GPUs using JAX.
- It leverages vectorized particle seeding, flow propagation, and parallelism to overcome legacy CPU limitations and enable real-time dataset production.
- The framework offers YAML/JSON-driven configuration and a Python API for seamless integration into machine learning and control systems.
SynthPix is an ultra-high-throughput synthetic image generation framework for Particle Image Velocimetry (PIV), engineered for accelerators using JAX. Its primary objective is to address the need for large-scale, rapid generation of PIV image pairs in contemporary data-driven fluid dynamics, where deep learning, reinforcement learning, and real-time feedback control methodologies demand millions of images per experiment. SynthPix is designed to standardize and accelerate synthetic PIV image dataset creation, overcoming the performance, flexibility, and parallelism limitations observed in prior tools (Terpin et al., 10 Dec 2025).
1. Motivation and Context
Modern PIV applications—particularly those deploying machine learning for flow estimation or real-time control—are bottlenecked by legacy synthetic image generation tools, which are typically CPU-based, sequential, or lack batch-awareness. Tools like EUROPIV-SIG, SynPIVimage, PIVlab, and various MATLAB scripts deliver up to 1–6 image pairs per second. SynthPix was developed to enable on-the-fly dataset production at rates two to four orders of magnitude higher. This supports reinforcement learning regimes that iteratively optimize PIV extractor parameters and enables fast prototyping and deployment of feedback control loops dependent on real-time flow imagery (Terpin et al., 10 Dec 2025).
2. Algorithmic Pipeline
SynthPix generates a batch of image pairs of dimension through several vectorized stages:
- Particle Seeding Density Selection: For each field in the batch, a “particles-per-pixel” parameter is sampled in , giving total particles per image.
- Particle Initialization: For Image 1, each particle is assigned:
- Position:
- Intensity peak:
- Widths:
- Correlation: Each particle contributes an anisotropic Gaussian intensity patch:
- Image 2 (Flow Propagation): Each particle is advected by the ground-truth flow :
Blob parameters are perturbed via zero-mean Gaussian noise. Each particle may be randomly hidden (intensity set to zero) with probability , modeling physical entrainment and optical dropout.
- Rasterization and Aggregation: For every particle, a Gaussian patch is rasterized in its local window, with the total image computed by discrete summation:
Global sensor noise (Gaussian or Poisson) is added, and histogram matching may be applied.
- Batch Output: Both images and associated ground-truth flow fields are batched for iterative downstream consumption.
3. JAX Implementation and Accelerator Optimization
All computation in SynthPix is implemented using pure Python and JAX to leverage XLA compilation and functional parallelism:
- Per-particle parallelism: The core patch generation routine is vectorized using
jax.vmapalong the particle axis. - Batch parallelism: Full image-pair batches are processed via a second-level
vmap; further, device-level parallelism is available throughjax.pmapfor multi-GPU/TPU execution. - Data Layout: Images are stored as [batch, 2, H, W], flows as [batch, 2, H, W], and per-particle metadata as [batch, N, ...].
- I/O hiding: Upstream flow fields are loaded and staged in a background thread to hide disk or network latency by pre-fetching batches to device memory.
- JIT compilation: All critical branches are JIT-compiled, ensuring pipeline latency is measured in milliseconds and end-to-end throughput is maximized (Terpin et al., 10 Dec 2025).
4. Performance Benchmarks
SynthPix achieves unprecedented synthetic PIV image-pair generation rates:
| System | Throughput (image pairs/sec) | Hardware/Batch |
|---|---|---|
| SynthPix (CPU) | 55 | AMD Threadripper, B=1 |
| SynthPix (GPU) | 10,477 (B=1) | RTX 4090 |
| SynthPix (GPU) | 22,538 (B=256) | RTX 4090 |
| SynPIVimage (CPU) | 0.89 | Baseline comparison |
| PIVlab (CPU) | 5.97 | Baseline comparison |
Performance scales linearly with the number of accelerators and is primarily limited by particle count, maximal particle size, and aggregate image resolution. Throughput saturates beyond as per-device resources reach capacity. Batch size and image dimensions drive only mild or linear slowdowns, establishing suitability for arbitrary field or patch configuration (Terpin et al., 10 Dec 2025).
5. Configuration, User API, and Integration
SynthPix exposes a YAML/JSON-driven configuration describing every generation parameter:
- Image and batch: height, width, batch size
- Flow field source: File format, flows/batch, and reuse count
- Particle scattering: range, range, range, intensity and diameter bounds, hide probability
- Noise/optics: Sensor noise, Poisson/Gaussian parameters, histogram matching
- Device selection: CPU, single or multiple GPU/TPU identifiers
The Python API enables integration with machine learning initialization and training loops. For example:
1 2 3 4 5 6 7 8 9 10 11 |
import synthpix sampler = synthpix.make("config.yaml") batch = next(sampler) images1, images2 = batch.images1, batch.images2 # [B,H,W] flows = batch.flow_fields # [B,2,H,W] while not done: batch = next(sampler) flow_est = agent.step(batch.images1, batch.images2) reward = -epe(flow_est, batch.flow_fields) agent.update(reward) |
Latency can be measured over multiple batches to inform pipeline scheduling.
6. Limitations and Future Extensions
The current implementation assumes orthographic, 2D flows with no depth-of-field, lens distortion, CCD fill-factor, or spectral interference when particle masks overlap. Planned extensions include:
- Full 3D particle scattering and depth-of-field effects
- Non-orthogonal and projective camera models
- Fill-factor correction, non-Gaussian PSFs, and spectral-domain summation
- Variable illumination modeling and explicit motion blur effects
- Integration with differentiable-physics and differentiable-rendering stacks
These enhancements will further increase the physical realism of outputs and extend hardware capabilities as new accelerator architectures emerge (Terpin et al., 10 Dec 2025).
7. Significance and Impact
SynthPix sets a new standard for PIV synthetic data generation, enabling research groups to train and benchmark flow estimation and control systems across millions of batches with minimal resource overhead. Its speed and configurability facilitate systematic evaluation of algorithmic performance, robust controller synthesis, and exploratory research into model-based and data-driven fluid dynamics under realistic optical conditions. By consolidating PIV image simulation, flow field augmentation, and accelerator-level parallelism in a single platform, SynthPix actively catalyzes development in machine vision for experimental and computational fluid mechanics (Terpin et al., 10 Dec 2025).