# Inversion of Rayleigh Wave Dispersion Curve Extracting from Ambient Noise Based on DNN Architecture
## 2 Materials and Methods
### DNN Architecture  
We chose a DNN model with multiple hidden layers. It is also known as a multilayer perceptron and is an artificial neural network with a relatively simple connection. Its advantage is that it is easy to construct, suitable for complex discrete data series, and performs better than CNN, temporal recurrent neural networks (RNN), and other network  
Figure 1: Theoretical layered shear wave velocity models and corresponding dispersion curves generated for training the algorithm. (**a**) Ten distinct velocity models were considered, where the inflection points of each curve correspond to the interfaces between layers. Within each layer, the velocities exhibit a linear variation with depth. (**b**) The dispersion curves corresponding to the ten velocity models.  
structures that are a subset of DNN. The DNNs usually have multiple hidden layers; adding hidden layers can better separate the characteristics of data and can thus better describe the nonlinear characteristics.  
The DNN model introduced in this paper contains one input layer, four hidden layers, and one output layer (Figure 2). To invert the 1D S-wave velocity models from the dispersion curve, we took the frequency-dependent phase velocities as the input, composed of 101 uniformly sampled data with periods ranging from 0.08 to 0.48 s. Before training, we first scaled the original data via normalization so that all values were within the range [0, 1]. The outputs were the corresponding S-wave velocity model. According to our experience, the output dimensions of the first to fifth layers were set to 1600, 1200, 800, 200, and 101, respectively. The sixth layer was the output layer with dimension 101 due to the total thickness (50 m) being discretized into 101 layers with a spacing of 0.5 m. The Rectified Linear Unit (ReLu) activation function was chosen at each layer (except for the output layer) to avoid the problem of vanishing gradients. To reduce the complexity and instability of the model during the learning process, enhance the anti-disturbance ability, and thus avoid the danger of overfitting, the L2 regularization function was employed for the weights of each layer, and the L1 regularization function was used for the outputs of each layer.  
Using deep learning to invert the 1D \(V_{S}\) model is a regression problem. A large number of neural network loss functions can be used to account for the difference between predicted and true values. The most common nonlinear functions are the mean absolute error (MAE), mean squared error (MSE), and mean squared logarithmic error (MSLE). We chose the MSE loss function because it is more sensitive to outliers than MAE and is a commonly used loss function for regression problems. Corresponding to the loss function, the Adam optimizer is used to update the weights of the network. The evaluation metrics used in regression problems are different from those used in the classification problem, so the concept of accuracy does not apply to regression problems. To control the accuracy of the network, we defined the relative error as  
\[e=\frac{1}{n}\sum_{i=1}^{n}\frac{\Delta v}{v} \tag{5}\]  
Here, \(n\) is the number of layer depth nodes (101), \(\Delta v\) is the difference between true S-wave and predicted velocities, and \(v\) is the true S-wave velocities. From Equation (5), we define accuracy as  
\[A=1-e \tag{6}\]  
Figure 2: DNN architecture.