# Mcformer Piv Eval

> Evaluates optical flow models on synthetic Particle Image Velocimetry (PIV) datasets with varying particle densities, flow velocities, and turbulence levels. Probes spatio-temporal flow modeling and robustness to sparse particle imagery and high-speed turbulent regimes. Use when the user wants to benchmark on PIV Benchmark (MHD, Isotropic, Mixing, Channel, Boundary Layer), or asks about evaluating this task. Reports NEPE.

- Skill: `qhjqhj00/mcformer-piv-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/mcformer-piv-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/mcformer-piv-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/mcformer-piv-eval

---


# mcformer-piv-eval

> MCFormer: A Multi-Cost-Volume Network and Comprehensive Benchmark for Particle Image Velocimetry — Lin et al. (2025) (arXiv:2507.04750, 2025)

## What this evaluates

Evaluates optical flow models on synthetic Particle Image Velocimetry (PIV) datasets with varying particle densities, flow velocities, and turbulence levels. Probes spatio-temporal flow modeling and robustness to sparse particle imagery and high-speed turbulent regimes.

## Datasets

- **PIV Benchmark (MHD, Isotropic, Mixing, Channel, Boundary Layer)** — total ?; splits: test (-1)

## Metrics

- `EPE` — range: other
  - Average L2 distance between predicted and ground truth flow vectors across N pixels: (1/N) * sum(||u_pred - u_gt||_2)
- `NEPE` **(primary)** — range: percent
  - Average normalized L2 error relative to ground truth flow magnitude: (1/N) * sum(||u_pred - u_gt||_2 / (||u_gt||_2 + epsilon))

## Input / output format

**Input**: Paired or multi-frame synthetic PIV images containing seeded particles under varying flow conditions.

**Output**: 2D flow field (velocity vectors) for each pixel/point in the image.

## Scoring recipe

```python
def compute_epe(pred, gt):
    return np.mean(np.linalg.norm(pred - gt, axis=-1))

def compute_nepe(pred, gt, eps=1e-6):
    gt_norm = np.linalg.norm(gt, axis=-1) + eps
    return np.mean(np.linalg.norm(pred - gt, axis=-1) / gt_norm)
```

## Common pitfalls

- High absolute EPE on high-speed/turbulent flows (e.g., Isotropic 8x) does not indicate poor relative accuracy; NEPE must be checked.
- Models optimized for standard optical flow benchmarks (Sintel/KITTI) do not directly transfer to sparse PIV imagery due to different motion patterns and particle density.
- Particle density variations can cause performance degradation for some models at high densities due to particle overlap, requiring robustness testing across densities.

## Evidence (verbatim from paper)

> We employed the endpoint error (EPE) loss as both the training objective and the evaluation metric for assessing model performance. The EPE loss is calculated as equation ([1]). where N is the number of pixels (or points) in the flow field, u_i^pred is the predicted flow vector at pixel i, u_i^gt is the ground truth flow vector at pixel i, and ||·||_2 denotes the L2 norm (Euclidean distance). It provides a direct measure of the pixel-wise difference between the predicted flow field and the ground truth. This metric is widely adopted in optical flow and PIV literature due to its clear physical interpretation and ease of computation. In addition to the standard EPE loss, we introduce a metric, Normalize EPE (NEPE), to better assess prediction accuracy across varying flow velocities. NEPE is calculated as equation([2]).

## Citation

```bibtex
@misc{lin2025mcformer,
  title={MCFormer: A Multi-Cost-Volume Network and Comprehensive Benchmark for Particle Image Velocimetry},
  author={Lin et al. (2025)},
  year={2025},
  note={arXiv:2507.04750}
}
```

- arXiv: 2507.04750

