## 2 Theory
### PIRNN Forward Modeling  
Establishing an accurate seismic forward modeling process is fundamental to FWI. Compared to traditional FWI, PINNs can seamlessly integrate physical constraints, such as the wave equation, into the neural network structure. This integration allows PINNs to leverage the nonlinear fitting capabilities of deep learning while maintaining physical interpretability. Moreover, PINN methods typically require minimal labeled data and can be trained effectively in data-scar scenarios, which is particularly valuable in geophysical exploration [31]. Additionally, PINNs exhibit superior generalization capabilities, handle complex nonlinear problems, and offer potential advantages in computational efficiency. In this study, we impose physical constraints on neural network-based FWI and employ a first-order pressure-velocity acoustic wave equation within a split-field structure for forward modeling in PIRNNs:  
\[ \begin{cases}\frac{\partial p_{x}(r,t)}{\partial t}=\upsilon^{2}(r)\frac{ \partial v_{x}(r,t)}{\partial x}\\ \frac{\partial p_{z}(r,t)}{\partial t}=\upsilon^{2}(r)\frac{\partial v_{z}(r,t )}{\partial z}\\ \frac{\partial v_{x}(r,t)}{\partial t}=\frac{\partial p(r,t)}{\partial z}\\ \end{cases}  \tag{5}\]  
where \(p_{x}\) and \(p_{z}\) are the pressure components in the \(x\) and \(z\) directions, \(v_{x}\) and \(v_{z}\) are the particle velocities in the \(x\) and directions, and \(v\) is the acoustic velocity, which serves as the velocity parameter to be inverted. Accurate forward modeling is fundamental to FWI. In this study, we employ high-order finite-difference methods with a staggered-grid format to solve the aforementioned first-order pressure-velocity acoustic wave equation. Furthermore, perfectly matched layer (PML) boundaries are integrated to ensure a high-precision forward modeling process by effectively absorbing outgoing waves and minimizing reflections at the boundaries. RNNs are a class of artificial neural networks that can be categorized into two types: finite impulse response networks, which use directed acyclic graphs, and infinite impulse response networks, which utilize directed cyclic graphs. Both types can represent dynamic temporal behaviors. Unlike deep neural networks, RNNs leverage their internal state (memory) to process sequential inputs, enabling the current output to be influenced by previous results. This renders RNNs particularly well-suited for time-dependent signal processing tasks, such as text and audio processing. Time-stepping methods are widely employed in numerical simulations of wave equations, which describe the variation of wave fields in both time and space. These methods compute the wave field state at the next time step based on the current state. The core feature of RNNs--their ability to process time-series data--aligns well with these time-stepping solution methods. Specifically, in RNNs, the hidden state carries information from one-time step to the next. This characteristic closely parallels the time-stepping solution method for wave equations, where the hidden state can be interpreted as the wave field information from the previous time step. To further clarify the relationship between the time dependency in wave equation solutions and RNN characteristics, we use \(v_{x}\) and \(p_{x}\) from the first-order pressure-velocity wave equation as examples. We construct a recursive formula with second-order temporal accuracy and second-order staggered-grid finite-difference accuracy in the time domain:  
\[ \begin{cases}\frac{\partial v_{x}(r,t)}{\partial t}=\frac{\partial p(r,t)}{ \partial x}\\ \frac{\partial p_{x}(r,t)}{\partial t}=v^{2}(r)\frac{\partial v_{x}(r,t)}{ \partial x}\end{cases} . \tag{6}\]  
We discretize the aforementioned equations by defining the pressure components \(p_{x}\) and \(p_{z}\) on the full grid points and the particle velocities \(v_{x}\) and \(v_{z}\) on the half grid points. We expand these at \((k+1/2)\Delta t\) and \([ix\Delta x,iz\Delta z]\)[32]:  
\[