1D velocity inversion end-to-end
Learning objectives
- Run classical FWI gradient descent on the Section 6.1 problem, end-to-end
- Watch the velocity profile c(x) descend toward c_true over 25 iterations
- Use backtracking line search and gradient smoothing as a teaching stand-in for L-BFGS + Tikhonov
- Verify empirically that good starting models converge and bad ones cycle-skip
- See the data fit improve from a poor-match d_pred to a near-overlay with d_obs
Section 6.1 showed a single FWI gradient at one starting model. The actual job, recovering the velocity field, is iterative: compute the gradient, take a step downhill, repeat. This section runs that loop on the same 3-layer 1D model and watches the velocity profile descend.
For a clean demonstration we parameterise the unknown velocity field by its 3 LAYER VELOCITIES via a partition-of-unity built from the same sigmoidal layer boundaries used elsewhere:
where peaks in the top layer, in the middle, in the bottom. The Plessix gradient from Section 6.1 is projected onto this partition via the chain rule:
giving a 3-component gradient that the line search descends in 3-d parameter space. This is identical to what production FWI does when using a wavelet-basis or grid-blocked parameterisation, the inverse problem is restricted to the resolvable scales of the data, sidestepping the under-determination that plagues full-grid 1D inversions of single-shot data. Section 6.6 will return to FULL-grid inversion with multi-parameter coupling.
The classical FWI iteration
Pseudocode for one outer iteration of classical full-waveform inversion:
inputs: (cβ, cβ, cβ) (current layer velocities), d_obs (recorded data) output: (cβ_new, cβ_new, cβ_new)
- Build c(x): c(x) β cβ wβ(x) + cβ wβ(x) + cβ wβ(x)
- Forward solve: u β solve u_tt = c(x)Β² u_xx + s (FDTD)
- Sample receivers: d_pred β u(x_rec_r, t), for r = 1β¦6
- Residuals: r_r β d_pred_r β d_obs_r
- Misfit: J β (1/2) Ξ£_r Ξ£_n r_r(t_n)Β² Β· dt
- Adjoint solve: Ξ» β solve Ξ»_tt = cΒ² Ξ»_xx + Ξ£_r r_rΒ·Ξ΄_rec_r (backwards in time)
- Grid gradient: g(x) β β(2/cΒ³) Ξ£_t u_tt(x,t) Β· Ξ»(x,t) Β· dt
- Project to layers: g_k β β« g(x) Β· w_k(x) dx, for k = 1, 2, 3
- Line search: step β largest Ξ· for which J(c β Ξ· Δ) < J(c) (Δ = g normalised to max |Δ_k| = 1)
- Update: c_k_new β c_k β step Β· Δ_k
Steps 1-6 are exactly the Section 6.1 widget. Steps 7-9 turn one gradient into a velocity update. The widget below chains 25 of these outer iterations.
Implementation notes
- Layer parameterisation. The 3-vector is the unknown. Reduces 161 grid degrees of freedom to 3. For Section 6.2 we further freeze and at their (assumed-known) check-shot values and invert only , the cleanest single-unknown demonstration. With multiple unknown layers, single-shot data exhibits inter-parameter trade-offs that need multi-shot illumination to break (Section 6.6). Production FWI sometimes uses similar freezes when shallow-layer velocities are known from refraction surveys.
- Six receivers. Spread along . Each contributes a residual term to ; the adjoint solve sums their -source contributions. Multi-receiver = multiple constraints on the layer parameters.
- Line search. Backtracking: try ; if it does not reduce , halve and retry, up to 10 times. On success, the next iteration starts from the accepted step (gentle growth). MΓ©tivier & Brossier (2016) describe the same scheme in the SEISCOPE toolbox.
- Step normalisation. The 3-component layer gradient is normalised to before the line search. Then has the physical meaning "max layer-velocity perturbation per iteration", typically at start.
- Velocity clamps. are enforced after each update. Real FWI uses physically motivated bounds (e.g.\ m/s); the same idea, narrower range.
- What "convergence" means here. The widget measures relative-LΒ² of vs the truth. A good run gets this to . A run starting from a bad starting model gets stuck in a cycle-skipping island and stalls at 10-20% error.
Try it
What you should see
Pick and click βΆ Run. The line search takes 25 iterations, in the browser, about 8-15 seconds depending on hardware. Each iteration runs three FDTD solves (forward, adjoint, plus one trial in the line search), so the cost is dominated by FDTD time-stepping, not by anything PINN-related.
Expected behaviour:
- Good starting models : misfit drops by - and the velocity profile converges to within of . The colour ramp on the velocity panel goes orange (start) β cyan (final), and the cyan curve overlays the gray line.
- Marginal starting models : convergence is slower, may stall around 10-20% model error. The receiver fit improves but does not close completely.
- Cycle-skipped starting models : the gradient sign is wrong, descent makes things WORSE, the line search fails repeatedly, and the inversion stalls at the wrong local minimum. This is exactly the Section 6.1 cycle-skipping warning made concrete: the optimiser does not magically find the global minimum; it finds the closest local one.
Cycle skipping is the single biggest practical obstacle in FWI. Section 6.4 (frequency continuation) and Section 6.5 (envelope and Wasserstein misfits) build the standard remedies. They both START from this iteration loop, they just change the misfit or the data filtering before each iteration. The descent step itself is unchanged.
The PINN-FWI version of this exact iteration
Conceptually identical, structurally different. PINN-FWI replaces this entire loop with a single Adam optimiser over :
for epoch in range(N_epochs): L_data β Ξ£ (u_NN(x_rec, t_n) β d_obs(x_rec, t_n))Β² L_pde β Ξ£ (β_tΒ² u_NN β m_NN(x)Β² β_xΒ² u_NN)Β² L_ic β Ξ£ (u_NN(x, 0) β u_init(x))Β² L_bc β Ξ£ (u_NN(x_b, t))Β² L β Ξ»_d L_data + Ξ»_p L_pde + Ξ»_i L_ic + Ξ»_b L_bc grad_ΞΈ_u, grad_ΞΈ_m β backprop(L) ΞΈ_u β Adam(ΞΈ_u, grad_ΞΈ_u) ΞΈ_m β Adam(ΞΈ_m, grad_ΞΈ_m)
Where the classical version makes 25 outer iterations of (forward + adjoint + line search), the PINN version makes 3000-5000 epochs of (forward+backward through the joint loss). The classical iteration converges in < 30 outer iterations because the gradient is exact; the PINN iteration takes thousands of epochs because the wavefield network has to LEARN to satisfy the PDE while is moving underneath it (the "coupled convergence" weakness of Section 6.1). On this 1D toy, both eventually reach comparable model error; on Marmousi-class problems the gap widens dramatically in favour of classical FWI.
The PINN-FWI weight-balance question is taken up in Section 6.8, and Section 6.5 demonstrates how the misfit landscape itself differs (LΒ² vs envelope), both questions apply identically to classical FWI and to PINN-FWI.
References
- Tarantola, A. (1984). Inversion of seismic reflection data in the acoustic approximation. Geophysics 49(8), 1259-1266.
- Plessix, R.-E. (2006). A review of the adjoint-state method for computing the gradient of a functional with geophysical applications. Geophys. J. Int. 167(2), 495-503.
- MΓ©tivier, L., Brossier, R. (2016). The SEISCOPE optimization toolbox: A large-scale nonlinear optimization library based on reverse communication. Geophysics 81(2), F1-F15. The line-search implementation reference.
- Virieux, J., Operto, S. (2009). An overview of full-waveform inversion in exploration geophysics. Geophysics 74(6), WCC1-WCC26.
- Pratt, R.G. (1999). Seismic waveform inversion in the frequency domain, Part 1: Theory and verification in a physical scale model. Geophysics 64(3), 888-901. The frequency-domain analogue of the time-domain iteration here.