arXiv:2610.41304physics.flu-dynOct 2026

Manuscript Offprint

arXiv:2610.41304

ART of PIV: Agentic Real-Time Particle Image Velocimetry for Active Flow Control

Antonio Terpin, Francesco Banelli, Alan Bonomi, Raffaello D'Andrea

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Particle image velocimetry (PIV) measures fluid motion from images of tracer particles, but its accuracy depends on choices throughout the estimation pipeline, including image preprocessing, flow estimation, and postprocessing. These choices are typically left to expert tuning, and a fixed configuration can become less accurate as conditions change. This matters especially when PIV supplies feedback for real-time control, where measurements must be both accurate and fast, and flow conditions vary. We introduce ART of PIV—short for Agentic Real-Time and also a nod to the art of tuning a PIV pipeline—which automates pipeline choice for each image pair. A learned agent selects a configuration according to a chosen measurement objective from a library assembled for a specified speed budget. Across cross-correlation, classical optical-flow, and learning-based estimators, ART of PIV reduces average end-point error (AEPE) by 12.2–22.4% relative to the best single estimator at matched speed, with gains extending to 1000–4000 image pair/s. In a simulated local velocity regulation task, it reduces mean normalized closed-loop cost by 13.24–13.59 percentage points relative to a tuned fixed estimator, with the same classical controller in both cases. In a tabletop water channel, we illustrate two ways to tune ART of PIV for a fluidic pinball of three rotating cylinders: selecting between complementary optical-flow tunings for accuracy, and selecting regions of interest with coherent rotation or shear using a common flow estimator. For the first variant, we train a DreamerV3 reinforcement learning controller directly in the physical world and demonstrate tracking of a prescribed flow field in the wake of a fluidic pinball.

Figure

Figure 1. ART of PIV casts flow quantification as an agentic decision: given a pair of tracer-particle snapshots, a lightweight agent selects one estimator from a library A1,…,ANA_1, \ldots, A_N and returns the selected estimator's flow.

1. Introduction

Particle image velocimetry (PIV) (Adrian, 1991; Raffel et al., 2018; Westerweel et al., 2013; Scharnowski and Kähler, 2020) and related image-based flow-quantification methods (Horn and Schunck, 1981; Liu and Shen, 2008) are among the central tools for measuring flow fields, with applications spanning laboratory (Adrian, 1991), industrial (Raffel et al., 2018), microfluidic (Santiago et al., 1998), and environmental (Fujita et al., 2007) settings. Traditionally, their role has been observational: to reconstruct a velocity field for analysis, validation, and diagnostics. Performance has accordingly been measured almost exclusively through accuracy. For an image pair, the end-point error (EPE) is the ℓ2\ell_2 distance between the estimated and ground-truth flow, averaged over pixels. Averaging these errors over the image pairs in a dataset gives the average end-point error (AEPE). Throughout, we use algorithm and estimator broadly to include the configured measurement pipeline: image preprocessing, flow estimation, and postprocessing, following the organization of FlowGym Θ\Theta (Banelli et al., 2026). Two configurations may therefore differ in their crop, image conditioning, or output resolution while sharing the same underlying flow-estimation method.

Recent results in active flow control invite a broader perspective. Terpin and D'Andrea (in press) showed that, on a real-world flow-control task, an agent equipped with dense flow feedback discovers high-performance strategies within tens of minutes of real-world interaction, whereas an agent without that feedback fails to learn a policy that increases drag. Once flow quantification is embedded in a real-time learning or control loop, latency becomes as consequential as accuracy: a highly accurate but slow estimator simply cannot run online, while a fast but crude one risks yielding feedback too noisy to learn from. With accuracy as the measurement objective, this leads to the speed-accuracy trade-off: the best accuracy attainable at a given inference speed. Three estimator families span this trade-off: classical cross-correlation (Scarano, 2002; Liberzon et al., 2026), optical flow (Kroeger et al., 2016; Horn and Schunck, 1981; Farnebäck, 2003), and learning-based estimators (Cai et al., 2019; Huang et al., 2022; Luo et al., 2024). No single method dominates. For instance, using FlowGym Θ\Theta (Banelli et al., 2026), we find that the accurate RAFT32-PIV (Lagemann et al., 2021) runs at only 1.7 image pair/s on an RTX 5090, while fast estimators such as DIS (Kroeger et al., 2016) and OpenPIV run from tens to thousands of image pairs per second at lower accuracy. For representative operating points in these families, Table 1 compares fixed estimators with our approach, which selects an estimator for each image pair.

In this work, we ask how a flow-measurement pipeline can adapt to changing conditions within a given inference-time budget. The preferred configuration can depend on both the flow and what the user wants to measure. Even when accuracy is the objective, the best-performing estimator or parameter setting can vary across flows and regions of a single image pair (Bonomi et al., in press). Tuning a PIV pipeline is therefore an art: as the 2014 PIV Challenge put it, “the largest uncertainties are introduced by the user who selects the evaluation parameters based on knowledge, experience and intuition” (Kähler et al., 2016). One line of work responds by adapting a single estimator’s parameters to the data: the interrogation window in cross-correlation (Scarano and Riethmuller, 1999; Theunissen et al., 2007, 2010), or the regularization in optical flow (Jassal et al., 2025). We build a library of configurations suited to different conditions and learn when to use each. The motivation is practical: tuning a pipeline for a particular regime can be easier than finding a common configuration for all regimes. Human expertise can guide library design and training labels. Alternatively, labels can follow a quantitative criterion, such as minimum estimation error

EstimatorLibrary spansSpeed(image pair/s)AEPE (px)
Best singleART of PIVrAEPE (%)
Learned
RAFT32-PIVflow classes≈1.70.01200.009620.3
Classical optical flow
DIShyperparameters≈200.14980.126815.3
DIShyperparameters≈10000.15770.138512.2
Cross-correlation
OpenPIVhyperparameters≈10000.25440.197922.2
OpenPIVhyperparameters≈40000.25440.197422.4

Table 1. Selecting an estimator for each image pair improves accuracy at matched speed across three estimator families. The library spans flow-class specialists or hyperparameter tunings of the listed estimator. Speeds are in image pair/s and include the agent in the sequential reference implementation. Errors are AEPE (px; lower is better); rAEPE is the percentage decrease in AEPE relative to the best single estimator (higher is better). The fixed baseline is the best budget-feasible tuning for DIS and OpenPIV, and the pretrained network for RAFT32-PIV. Results are means over three training seeds on the held-out test set of Cai et al. (2019); experimental details are in Section 3.1. Bold marks the lower error at each operating point.

when the true flow is known. The agent learns to predict the preferred configuration for new image pairs.

Our contributions. We introduce ART of PIV, an agent that learns to select a measurement pipeline for each image pair within a specified speed budget. A small convolutional neural network (CNN) predicts the preferred configuration from a supplied library and returns its flow; see Figure 1. The library and supervision encode the user's measurement preferences, including choices of preprocessing, estimator tuning, and postprocessing. Selection can overlap with estimator execution to keep its additional latency small. Adapting the choice on every image pair is particularly relevant in active flow control, where the controller continually changes the flow conditions.

We evaluate selection for accuracy using estimators from three paradigms: classical optical flow, learning-based estimation, and cross-correlation, including DIS, RAFT32-PIV, and OpenPIV. Relative to the best single configuration at matched speed, ART of PIV reduces AEPE by 12.2–22.4%. This gain persists at 1000–4000 image pair/s, where the resulting accuracy could enable control with flow feedback in systems with very fast dynamics, such as combustion instabilities (McManus et al., 1993), aerodynamic flow separation (Greenblatt and Wygnanski, 2000), and gust load alleviation (Regan and Jutte, 2012).

To assess whether these estimation gains translate to active flow control, we first evaluate ART of PIV on a simulated local velocity regulation task. With the same classical controller, ART of PIV increases the time a work area stays near its target velocity and reduces mean normalized closed-loop cost by 13.24–13.59 percentage points relative to a separately tuned fixed DIS reference (see Section 3.2.1). We then deploy ART of PIV on the tabletop water-channel setup of Terpin and D'Andrea (in press), available at https://activefluidcontrol.com, using a fluidic pinball of three rotating cylinders to illustrate two ways of learning our measurement preferences. The first variant selects between DIS A and DIS B, complementary tunings chosen for accuracy in different flow regimes. The second selects regions of interest with coherent rotation or shear using the common flow estimator DIS C. Using flow feedback from the first variant, we train a DreamerV3 reinforcement learning controller directly on the physical setup and demonstrate successful flow tracking (see Section 3.2.2). The method and evaluation infrastructure are available in FlowGym Θ\Theta (Banelli et al., 2026), and the deployment code is available in FlowGames Θ\Theta.

References (89)