Ground-penetrating radar synthesis

Physics guides the flow.

PCFlow turns gprMax scene descriptions into GPR B-scans with a 26-channel Maxwell condition encoder and rectified flow in the SDXL-VAE latent space.

PCFlow radar mascot
Method

From scene physics to radar response.

The source does not reduce the condition to a text label. It rasterizes material and geometry, derives propagation and response priors, and injects all five physical groups throughout the velocity network.

PCFlow architecture pipeline

PCFlow source pipeline: physical scene encoding, latent rectified-flow training and ODE decoding.

01 / CONDITION

Maxwell-informed fields

Coordinates, εr, σ, impedance, attenuation, phase, interfaces, pipe geometry, travel time and response priors form one interpretable 26-channel tensor.

02 / NETWORK

Physics-SPADE U-Net

Geometry, material, reflection, propagation and detail groups modulate residual blocks across a four-level U-Net, with attention at its lower resolutions.

03 / GENERATION

Rectified-flow ODE

The U-Net learns a latent velocity from noise to data. Euler or Heun integration then transports a random SDXL latent into a synthesized B-scan.

Training loop

A reproducible five-stage path.

The main preset uses AdamW, automatic mixed precision, gradient clipping and EMA. Conditions are dropped for 10% of samples during training, while deeper latent rows receive greater loss weight.

Load pairRead a grayscale PNG and its matching gprMax `.in` scene.
Build physicsRasterize εr, σ and geometry, then compute the 26-channel condition.
Encode latentConvert to pseudo-RGB and use the frozen SDXL VAE to obtain z₁.
Match velocitySample z₀ and t, construct zₜ, then predict v = z₁ − z₀.
Track progressUpdate EMA; log, validate, sample and checkpoint on configured intervals.
OptimizerAdamW
Learning rate1e-4
Batch / steps8 / 50,000
Condition dropout0.10
EMA decay0.999
Validation solverHeun · 50 steps
terminal
# Run inside the executable source directory
cd PCFlow

# Main preset
python train.py

# Alternate training preset
python train.py \
  --model-config configs/model_gpr.yaml \
  --train-config configs/train_gpr_dataset_split.yaml
Bundled benchmark

Every image stays paired with its scene.

The repository includes 800 scenes across steel, water-filled PVC and air-filled PVC targets. JSONL indexes connect each B-scan to the `.in` file consumed by the loader.

DATA SPLITS / 800 TOTAL
TRAINSTRESSVALTEST
Train443
Stress test199
Validation88
Test ID70
build a custom index
python data/gpr_dataset/build_index.py \
  --images_dir path/to/images \
  --ins_dir path/to/conditions \
  --out_jsonl path/to/train.jsonl
Image and `.in` filenames must share the same stem. Update the JSONL paths in the selected training YAML afterward.
Quick start

Clone, install, train.

Use Python 3.10 and install the CUDA-enabled PyTorch build suited to your system. The first run downloads the frozen `stabilityai/sdxl-vae` unless a local path is configured.

setup
git clone https://github.com/GeometryFu/PCFlow.git
cd PCFlow

conda create -n pcflow python=3.10 -y
conda activate pcflow

# Install a suitable CUDA-enabled PyTorch build first
pip install -r requirements.txt
python train.py
Read the PCFlow paper on arXiv:2609.07300. See the README for current sampling behavior and implementation notes.