A method for suppressing seismic surface waves and random noise based on Swin Transformer and diffusion model
By combining the Swing Transformer and the diffusion model, the limitations of existing deep learning methods in denoising are overcome, achieving fine suppression of surface waves and random noise in seismic data, thus improving the signal-to-noise ratio and data quality.
Patent Information
- Application Number
- CN202411267142.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-11
AI Technical Summary
Existing deep learning methods have limitations in denoising performance, especially when dealing with complex seismic data, where they may lose useful information. The local perception characteristics of convolutional neural networks limit network performance, and their generalization performance for invisible data is suboptimal.
A seismic surface wave and random noise suppression method based on Swin Transformer and diffusion model is adopted. The multi-scale features of seismic data are extracted by Swin Transformer, and the noise distribution is learned by diffusion model. The time domain and FK domain features are combined for denoising.
It effectively suppresses surface waves and random noise in seismic data, improves the signal-to-noise ratio, retains the effective information of seismic data, and enhances the ability to represent complex geological structures and the quality of denoised data.
Smart Images

Figure CN118778119B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the interdisciplinary technical field of earth science and artificial intelligence, and in particular relates to a method for suppressing seismic surface waves and random noise based on SwinTransformer and a diffusion model. Background Art
[0002] Seismic exploration is an effective means of finding and developing oil and gas resources. The location of oil and gas resources is determined by studying the propagation of seismic waves in underground media. Seismic exploration artificially generates elastic waves. By using the differences in elasticity and density of underground media, seismic waves propagate in different media and produce reflections and refractions. These waves are received by detectors, completing the acquisition of seismic data. However, due to the complexity of geological structures and the limitations of acquisition conditions, the collected seismic data often contain regular noises and random noises such as acoustic waves, surface waves, and multiple waves. These noises will disrupt effective reflection information and affect the accuracy of stratigraphic interpretation and oil and gas exploration. Surface waves are the most common coherent noise in seismic exploration. They are formed by the propagation of signals along the surface. Surface waves intercepted from actual records may contain hidden effective signals, and therefore may have a negative impact on the denoising results. In seismic data processing, effectively suppressing noise has become a crucial task.
[0003] Traditional seismic data denoising methods include: Fourier transform, wavelet transform, Curvelet transform, etc. based on mathematical transformation; filtering-based methods; rank reduction methods; empirical mode decomposition methods; compressed sensing methods, etc. The advantages of the above model-driven denoising methods are interpretability, and each step in the algorithm process has mathematical or physical meaning. The disadvantage is that the corresponding problem model needs to be designed according to a certain data type, and more prior knowledge is needed to adjust the parameters to obtain better results. In addition, simple physical models often cannot describe the complex characteristics and important differences of mixed noise in high-dimensional seismic data.
[0004] In recent years, artificial intelligence technology has flourished, and deep learning technology has achieved remarkable results in many fields. Compared with traditional methods, deep learning overcomes the dependence on prior knowledge. With its powerful data learning ability, it automatically learns the effective features of input data and can efficiently process new data after learning. There are obvious differences between the frequency and wave velocity of surface waves and effective signals. These features can be used to achieve effective suppression of surface waves. Yu Siwei et al. used DnCNN to suppress the noise of scattered surface wave data generated by elastic wave forward modeling, and successfully suppressed the scattered surface waves in the exploration data of the Tarim Desert area through transfer learning. Tang Jie et al. used convolutional neural network to remove surface wave noise in seismic data, which can effectively handle surface wave denoising with unknown noise level. Zhong Tie et al. proposed a two-layer multi-scale feature fusion denoising network, which used multi-branch modules to extract potential features of different scales and branches of seismic data, and used treaty connection to achieve the fusion of deep and shallow information, significantly improving the signal-to-noise ratio of seismic data.
[0005] Compared with traditional model-driven denoising methods, deep learning algorithms have achieved significant improvements in denoising effects. However, existing deep learning methods still have some limitations. First, these methods often only extract features from a single domain, such as the time domain or the FK domain, which may lead to the loss of effective information in the seismic data during the processing process. This limitation is particularly evident when processing complex seismic data, and the effective signal recovery effect of some parts covered by noise is poor. Secondly, the local perception characteristics of convolutional neural networks limit the further improvement of network performance, limit the network's ability to obtain global information, and have problems such as incomplete denoising. Thirdly, deep learning models may rely too much on the features of the training set, and the generalization performance of unseen data is suboptimal. Summary of the invention
[0006] To solve the above technical problems, the present invention proposes a seismic surface wave and random noise suppression method based on Swin Transformer and diffusion model, and introduces Swin Transformer and diffusion model into seismic data mixed noise denoising. While retaining the effective information of seismic data, it extracts features more finely, and realizes effective suppression of surface waves and random noise, thereby generating clearer seismic data.
[0007] To achieve the above object, the present invention provides a method for suppressing seismic surface waves and random noise based on Swin Transformer and diffusion model, comprising:
[0008] Obtaining a mixed noise seismic data set including seismic surface waves and random noise, preprocessing the mixed noise seismic data set to obtain a preprocessed mixed noise seismic data set, wherein the mixed noise seismic data set includes training seismic data and ideal label seismic data;
[0009] Inputting the preprocessed mixed noise seismic data set into a trained initial denoising model to obtain a denoised seismic data set, and obtaining a mixed noise estimation data set based on the preprocessed mixed noise seismic data set and the denoised seismic data set;
[0010] Fitting the mixed noise estimation data set to a Gaussian distribution, matching the mixed noise estimation data set with a state at a certain moment in the forward process of a diffusion model to obtain noisy seismic data, and representing the noisy seismic data in a denoising chain to obtain an estimated noise distribution;
[0011] The estimated noise distribution is learned for the state at a certain moment after matching by using the reverse process of the diffusion model, the state at the previous moment is gradually obtained, and a denoising model is obtained by training, and denoised seismic data is obtained based on the denoising model.
[0012] Optionally, obtaining the training seismic data includes:
[0013] The velocity model containing scatterers is used to generate scattered surface wave data. Gaussian noises of different intensities are added to the scattered surface wave data to simulate and generate seismic data containing mixed noises of seismic surface waves and random noises.
[0014] Optionally, obtaining the ideal labeled seismic data includes:
[0015] The layered velocity model without scatterers is used for forward modeling to obtain data including direct waves, surface waves and reflected waves.
[0016] The constant velocity model without scatterers is used for forward modeling to obtain data including direct waves and surface waves.
[0017] The data including direct wave, surface wave and reflected wave is subtracted from the data including direct wave and surface wave to obtain ideal labeled seismic data.
[0018] Optionally, preprocessing the mixed noise seismic dataset to obtain the preprocessed mixed noise seismic dataset includes:
[0019] The mixed noise seismic data set is cut into two-dimensional slice seismic data of a preset size to obtain a preprocessed mixed noise seismic data set.
[0020] Optionally, obtaining a trained initial denoising model includes:
[0021] The preprocessed mixed noise seismic data set is input into the initial denoising model, the preprocessed mixed noise seismic data set is subjected to FK transformation to obtain FK domain features, the corresponding ideal label seismic data is used as the label of the time domain, the ideal label seismic data is converted to the FK domain as the label of the FK domain, the initial denoising function is trained, and the trained initial denoising model is obtained.
[0022] Optionally, the trained initial denoising model includes an encoder and a decoder; the encoder includes a first convolutional layer, a first Patch Merging layer, and a first Swin Transformer module;
[0023] The first convolutional layer is used to extract seismic data features;
[0024] The first Patch Merging layer is used to downsample the sliced seismic data to achieve multi-scale feature extraction of the seismic data;
[0025] The first Swin Transformer module is used to perform self-attention mechanism calculation on the input slice seismic data to make full use of global information;
[0026] The decoder includes a second Patch Expanding layer, a second Swin Transformer module, and a second convolutional layer;
[0027] The second Patch Expanding layer is used to upsample the sliced seismic data, expand the sliced seismic data and reduce the number of feature map channels;
[0028] The second Swin Transformer module is used to perform self-attention mechanism calculation on the input slice seismic data to make full use of global information;
[0029] The second convolutional layer is used to reduce the dimension of the feature map and integrate the features of all extracted seismic data.
[0030] Optionally, obtaining an estimated noise distribution includes:
[0031] The mixed noise estimation data set is subjected to Gaussian distribution fitting by a statistical method to obtain fitting parameters. The specific state in the forward process of the diffusion model is determined according to the method of minimizing the joint difference between the time domain and the FK domain. The noise distribution of the specific state is close to the fitted Gaussian distribution to obtain noisy seismic data. The noisy seismic data is represented in a denoising chain to obtain an estimated noise distribution.
[0032] Optionally, obtaining denoised seismic data includes:
[0033] The estimated noise distribution is learned from the state at a certain moment after matching by using the reverse process, and the state at the previous moment is gradually traced back by Bayesian inference. The noise distribution of the current state is estimated in each step of the backtracking, and the estimated result is input into the denoising model. The denoising model is used to denoise the seismic data of the current state to obtain the denoised seismic data.
[0034] Technical effect of the invention: The invention discloses a method for suppressing seismic surface waves and random noise based on Swin Transformer and diffusion model, which effectively suppresses surface waves and random noise in seismic data through theoretical analysis and experimental proof, and obtains seismic data with higher signal-to-noise ratio; With Swin Transformer as the basic network module, the U-Net architecture includes m Swin Transformer layers in the first Swin Transformer module, n Swin Transformer layers in the second Swin Transformer module, and m Swin Transformer layers in the third Swin Transformer module, which are used to replace traditional convolutional layers; the feature extraction process more effectively captures high-level features in seismic data, and processes them at multiple scales, thereby improving the representation capability of complex geological structures; and by utilizing multi-scale features, the diffusion model can better learn noise distribution, approximate actual seismic data, and improve the quality of denoised seismic data. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0036] Figure 1 A schematic diagram of a flow chart of a method for suppressing seismic surface waves and random noise based on Swin Transformer and diffusion model according to an embodiment of the present invention;
[0037] Figure 2 This is a schematic diagram of the network architecture of an embodiment of the present invention;
[0038] Figure 3 This is a schematic diagram of the network architecture of the first phase of an embodiment of the present invention;
[0039] Figure 4 This is a schematic diagram of the second stage matching of an embodiment of the present invention;
[0040] Figure 5 It is a schematic diagram of the Swin Transformer module of an embodiment of the present invention;
[0041] Figure 6: is a comparison diagram of mixed noise seismic data containing scattered surface waves and random noise and ideal label seismic data according to an embodiment of the present invention, wherein Figure 6 (a) is mixed noise seismic data containing scattered surface waves and random noise. Figure 6 (b) is ideal labeled earthquake data, Figure 6 (c) is the FK spectrum of mixed noise seismic data containing scattered surface waves and random noise. Figure 6 (d) is the FK spectrum of ideal labeled seismic data;
[0042] Figure 7 3 is a comparison diagram of denoising mixed noise seismic data containing scattered surface waves and random noise using different methods of the embodiments of the present invention, wherein Figure 7 (a) is the mixed noise suppression result of the algorithm of the present invention, Figure 7 (b) is the mixed noise suppression result of the time domain learning method only. Figure 7 (c) is the FK spectrum of the mixed noise suppression result of the algorithm of the present invention, Figure 7 (d) is the FK spectrum of the mixed noise suppression result of the time domain learning method of the present invention;
[0043] Figure 8 FIG. 1 is a comparison diagram of the denoising effects of different methods of the embodiments of the present invention on mixed noise seismic data containing scattered surface waves and random noise, wherein Figure 8 (a) is mixed noise seismic data containing scattered surface waves and random noise. Figure 8 (b) is the denoising result of the algorithm of the present invention. Figure 8 (c) is the DnCNN denoising result. Figure 8 (d) is the FK spectrum of mixed noise seismic data containing scattered surface waves and random noise. Figure 8 (e) is the FK spectrum of the denoising result of the algorithm of the present invention, Figure 8 (f) is the FK spectrum of DnCNN denoising result. DETAILED DESCRIPTION
[0044] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0045] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0046] like Figure 1 As shown, this embodiment provides a method for suppressing seismic surface waves and random noise based on Swin Transformer and diffusion model, including:
[0047] Preparation stage: obtaining a mixed noise seismic data set including seismic surface waves and random noise, preprocessing the mixed noise seismic data set to obtain a preprocessed mixed noise seismic data set, wherein the mixed noise seismic data set includes training seismic data and ideal label seismic data;
[0048] The first stage: input the preprocessed mixed noise seismic data set into the trained initial denoising model to obtain the denoised seismic data set, and obtain the mixed noise estimation data set based on the preprocessed mixed noise seismic data set and the denoised seismic data set;
[0049] The second stage: fit the mixed noise estimation data set to a Gaussian distribution, match the mixed noise estimation data set with the state at a certain moment in the forward process of the diffusion model to obtain noisy seismic data, and represent the noisy seismic data in the denoising chain to obtain the estimated noise distribution;
[0050] The third stage: using the reverse process of the diffusion model to learn and estimate the noise distribution of the state at a certain moment after matching, gradually obtaining the state at the previous moment, and training to obtain a denoising model, and obtaining denoised seismic data based on the denoising model.
[0051] Furthermore, obtaining training earthquake data includes:
[0052] The velocity model containing scatterers is used to generate scattered surface wave data. Gaussian noise of different intensities is added to the scattered surface wave data to simulate and generate seismic data containing mixed noise of seismic surface waves and random noise.
[0053] Furthermore, obtaining ideal labeled seismic data includes:
[0054] The layered velocity model without scatterers is used for forward modeling to obtain data including direct waves, surface waves and reflected waves.
[0055] The constant velocity model without scatterers is used for forward modeling to obtain data including direct waves and surface waves.
[0056] The data containing direct waves, surface waves and reflected waves are subtracted from the data containing direct waves and surface waves to obtain ideal labeled seismic data.
[0057] Furthermore, the mixed noise seismic data set is preprocessed to obtain the preprocessed mixed noise seismic data set including:
[0058] The mixed noise seismic data set is cut into two-dimensional slice seismic data of a preset size to obtain a preprocessed mixed noise seismic data set.
[0059] Specifically, the seismic data of size p*q in the training set is divided into two-dimensional seismic data data_x of size NS*NT, and the training seismic data set Train_data and the ideal label seismic data set Tag_data are obtained. The noisy seismic data is input into the first stage supervised learning model to train the initial denoising function , get the noise, the first stage is used for noise estimation , a U-Net network based on Swin Transformer is adopted, including convolutional layer, Patch Merging layer, Swin Transformer module, and Patch Expanding layer; the intermediate results of the network are represented by feature maps; the first feature map ① is located between the convolutional layer and the Patch Merging layer of the encoder, the third feature map ③ is located between the first Swin Transformer module Ⅰ and the Patch Merging layer; the sixth feature map ⑥ is located between the Patch Expanding layer and the second Swin Transformer module Ⅱ, and the eighth feature map ⑧ is located between the Patch Expanding layer and the convolutional layer of the decoder. The first feature map ① is connected to the eighth feature map ⑧ by a jump connection, and the third feature map ③ is connected to the sixth feature map ⑥ by a jump connection.
[0060] Furthermore, obtaining a trained initial denoising model includes:
[0061] The preprocessed mixed noise seismic data set is input into the initial denoising model, the preprocessed mixed noise seismic data set is subjected to FK transformation to obtain FK domain features, the corresponding ideal label seismic data is used as the label of the time domain, the ideal label seismic data is converted to the FK domain as the label of the FK domain, the initial denoising function is trained, and the trained initial denoising model is obtained.
[0062] Furthermore, the trained initial denoising model includes an encoder and a decoder; the encoder includes a first convolutional layer, a first Patch Merging layer, and a first Swin Transformer module;
[0063] The first convolutional layer is used to extract seismic data features;
[0064] The first Patch Merging layer is used to downsample the sliced seismic data to achieve multi-scale feature extraction of seismic data;
[0065] The first Swin Transformer module is used to calculate the self-attention mechanism for the input slice seismic data and make full use of the global information;
[0066] The decoder includes a second Patch Expanding layer, a second Swin Transformer module, and a second convolutional layer;
[0067] The second Patch Expanding layer is used to upsample the sliced seismic data, expand the sliced seismic data and reduce the number of feature map channels;
[0068] The second Swin Transformer module is used to calculate the self-attention mechanism for the input slice seismic data and make full use of the global information;
[0069] The second convolutional layer is used to reduce the dimension of the feature map and integrate the features of all extracted seismic data;
[0070] The loss in the first stage of training is:
[0071]
[0072] in, To evaluate the loss in the time domain and FK domain in this stage, is the weight coefficient, which is used to balance the importance of time domain loss and FK domain loss;
[0073]
[0074] in: is the data after noise suppression; is the label corresponding to the sample; is the loss of the i-th sample in the time domain; is the noise suppressed data after Fourier transformation; is the label after Fourier transformation; is the loss of the i-th sample in the FK domain.
[0075] The Swin Transformer module uses a self-attention mechanism to directly and fully utilize contextual information, while considering the information of the current position and its surrounding and distant positions to fully understand the global characteristics of seismic data. In the first stage, a trained initial denoising function is obtained during the training phase. .
[0076] In the first stage, the denoised seismic data set can be obtained by inputting the preprocessed mixed noise seismic data set into the trained initial denoising model. The distribution of the mixed noise can be estimated by comparing the preprocessed mixed noise data with the denoised data. This step helps to understand the characteristics of the noise and provides a basis for subsequent noise modeling and removal.
[0077] Further, obtaining the estimated noise distribution includes:
[0078] The mixed noise estimation data set is fitted with Gaussian distribution by statistical methods to obtain fitting parameters. The specific state in the forward process of the diffusion model is determined by the method of minimizing the joint difference between the time domain and the FK domain. The noise distribution of the specific state is close to the fitted Gaussian distribution to obtain noisy seismic data. The noisy seismic data is represented in the denoising chain to obtain the estimated noise distribution.
[0079] Specifically, the second stage performs state matching and estimates the mixed noise obtained in the first stage After processing, it is matched with the closest time step of the mixed noise containing random noise and surface waves in the forward process of the diffusion model; the processing process includes: After de-averaging, the noise is fitted to a Gaussian distribution to obtain the standard deviation of the Gaussian distribution parameters. The matching process includes: ① obtaining clean and noise-free labeled raw data; ② calculating the noise plan standard deviation of the current time step t in the forward process of the diffusion model and comparing it with the noise standard deviation fitted in the reverse denoising process to find the time step t with the smallest difference; ③ representing the seismic data containing mixed noise into the denoising chain as . Finding the minimum difference expression is as follows:
[0080]
[0081] in, is the preset noise plan, representing the noise level at each state in the Markov chain of the forward process, is the data after adding noise at time t, is the standard deviation of the mixed noise fit in the time domain, is the standard deviation of the mixed noise amplitude in the FK domain. The time step with the smallest joint difference in the time domain and the FK domain is the best match t. The seismic data containing mixed noise is represented on the Markov chain as .
[0082] In the state matching stage, the joint loss function is:
[0083] ;
[0084]
[0085] in, To evaluate the loss in the second stage in the time domain and FK domain respectively, is a weight coefficient used to balance the importance of time domain loss and FK domain loss.
[0086] The diffusion model usually uses two Markov chains, which are divided into two stages: forward diffusion process and reverse denoising process. In the forward diffusion process of the diffusion model, Gaussian noise is gradually added to the input label data. The non-noise data in the seismic data at time t is expressed as , ~ . is the clean original real data distribution.
[0087] In the forward diffusion process, for the input , after the forward diffusion process at time t, we can know from the properties of Markov chain and reparameterization technique:
[0088] , ;
[0089] ;
[0090] Where N represents Gaussian distribution, is the identity matrix. In the back diffusion process, the real distribution Cannot be obtained directly, under the condition The posterior probability The following can be derived by Bayes' formula and conditional probability formula.
[0091] According to the result of the forward process, the noise state at time t can be predicted from the noise state at the previous time t-1. A neural network can be used to approximate the distribution, and the reverse process is defined as a Markov chain, which consists of a series of Gaussian distributions parameterized by neural networks:
[0092] ;
[0093] in, are the parameters that need to be learned. are parameterized Gaussian distributions whose means and variances are determined by the training network and given;
[0094] Based on experience , is the predicted mean of the model; is the variance of the noise plan at time t, which serves as a parameter to control the degree of randomness;
[0095] ;
[0096] In the forward process The result of the previous moment can be expressed as:
[0097] .
[0098] In the second stage, the estimated mixed noise data set is fitted to a series of Gaussian distributions, and the noise characteristics are represented by a combination of specific statistical models. By matching the fitted mixed noise estimation data with the state at a certain moment in the forward process of the diffusion model, the noisy data closest to the actual seismic data is obtained. The estimated noise is accurately aligned with the state in the diffusion model to guide the subsequent reverse denoising process to generate noise data with specific characteristics.
[0099] Furthermore, the denoised seismic data includes:
[0100] The reverse process is used to learn and estimate the noise distribution of the state at a certain moment after matching, and the Bayesian inference is used to gradually trace back to the state at the previous moment. The noise distribution of the current state is estimated in each step of the backtracking, and the estimated result is input into the denoising model. The denoising model is used to denoise the seismic data of the current state to obtain the denoised seismic data.
[0101] Specifically, in the third stage of denoising, the reverse process of the diffusion model estimates the noise distribution according to the state at the matching moment, gradually obtains the state at the previous moment, and trains the denoising model , and get the denoised seismic data; the process takes a matched intermediate time step of the forward diffusion process as the starting point of the reverse diffusion process, and reversely diffuses the seismic data containing mixed noise. The data from this moment forward is sampled step by step and denoised in the time domain and FK domain, and finally the true distribution of the denoised seismic data is obtained. and label data Through FK transformation, it is converted to the FK domain to obtain the corresponding and , calculate the mean square error of the FK domain amplitude , the joint loss function of time domain and FK domain is:
[0102] ;
[0103] ;
[0104] ;
[0105] in, To evaluate the losses in the time domain and FK domain of the third stage, is the weight coefficient, which is used to balance the importance of time domain loss and FK domain loss; represents the denoised data in the time domain, represents the ideal labeled seismic data in the time domain, is the representation of denoised data in the FK domain, To represent the ideal seismic data in the FK domain, the MSELoss function is used in the third stage. The smaller the loss function, the closer the network output is to the characteristics of the ideal labeled seismic data, and the better the denoising effect.
[0106] In the third stage, the reverse process of the diffusion model is used to reversely denoise the state at a certain moment after matching. By learning to estimate the distribution of noise, the network is guided to learn the state at the previous moment, that is, gradually remove the noise to approximate the original seismic data. Through multiple iterations and training, a denoising model is obtained. It can more effectively remove mixed noise and improve the quality of denoised seismic data.
[0107] A specific application example of the present invention comprises the following steps:
[0108] like Figure 1-2 As shown, step 1. construct a mixed noise seismic data training set containing seismic surface waves and random noise;
[0109] According to the nature of the denoising task, a nonlinear mapping model from noisy seismic data to ideal seismic data is established, which requires a large number of sample pairs of seismic data containing mixed noise and ideal seismic data (labels).
[0110] The source of the mixed noise dataset Train_data_init in this embodiment is: first, a velocity model containing scatterers is used to generate scattered surface wave data, and then Gaussian noise of different intensities is added to the scattered surface wave data to simulate and generate seismic data containing mixed noise of seismic surface waves and random noise. When generating scattered surface wave data, the main parameters are: number of velocity layers, number of scatterers, size of scatterers, etc. By modifying these parameters and performing forward simulation, diverse data can be generated. When using a velocity model containing scatterers to generate scattered surface wave data, the medium density is set to be 2200kg / m 3 , the longitudinal wave velocity is set to twice the shear wave velocity. The parameter settings are shown in Table 1 below.
[0111] Table 1
[0112]
[0113] The ideal sample data set Tag_data_init of this embodiment comes from: subtracting the direct wave and surface wave from the mixed noise sample can obtain a clean sample, that is, the label data. The synthesis of clean data mainly includes the following processes: first, a layered velocity model without scatterers is used for forward modeling, and the obtained data includes direct waves, surface waves and reflected waves; then a constant velocity model without scatterers is used for forward modeling, and the obtained data includes direct waves and surface waves. Subtracting these two parts of data, you can get the ideal seismic data (label data). The samples in the training seismic data Train_data_init and the ideal seismic data Tag_data_init are divided into two-dimensional seismic data data_x of size NS*NT to obtain the training seismic data set Train_data and the theoretical seismic data set Tag_data.
[0114] Step 2. Sample label preparation;
[0115] In the first stage, the ideal seismic data is used as the label in the time domain, and the data obtained after the ideal seismic data is transformed by FK is used as the label in the FK domain;
[0116] In the second stage, the parameter standard deviation is obtained after Gaussian fitting of the noise obtained in the first stage. As a label in the time domain, the standard deviation of the noise amplitude fitted after the noise is converted to the FK domain As a label on the FK domain;
[0117] In the third stage, the ideal seismic data is used as the label in the time domain, and the data obtained after the ideal seismic data is transformed by FK is used as the label in the FK domain.
[0118] Step 3. Construct the initial denoising model of seismic data based on the U-Net network of the Swin Transformer module in the first stage;
[0119] like Figure 3 As shown in the figure, in this stage, the U-Net network is used as the basic network to build the initial denoising model of the first stage. , including two parts: encoder and decoder, specifically:
[0120] (1) Encoder design;
[0121] ① It mainly includes convolution layer, Patch Merging layer and Swin Transformer module; ② The convolution layer includes a convolution operations, each of which extracts different features; ③ The seismic data is downsampled through the Patch Merging layer to extract the multi-scale features of the seismic data; ④ The first Swin Transformer module contains m Swin Transformer layers, and the second Swin Transformer module contains n Swin Transformer layers to replace the traditional convolution layer; ⑤ After 2 times of ②③ operations, the seismic data processed by the self-attention mechanism is obtained. Figure 5 Shown is the window division during the self-attention mechanism calculation.
[0122] Decoder design;
[0123] ① It mainly includes Patch Expanding layer, Swin Transformer module and convolution layer; ② The seismic data processed by the encoder is input into the Patch Expanding layer of the decoder for upsampling operation; ③ The sliced seismic data transmitted through the jump connection is spliced with the sliced seismic data corresponding to the size after the Patch Expanding layer in the channel dimension, and the spliced data is input into the third Swin Transformer module containing m Swin Transformer layers for calculation of the self-attention mechanism, which can effectively capture the multi-scale features and complex patterns in the seismic data and improve the accuracy and effect of seismic data processing; ④ After operations ②③, seismic data with the same size as the input seismic data is obtained; ⑤ The convolution layer includes a convolution operations.
[0124] In addition, the first feature map ① is located between the convolution layer and the Patch Merging layer of the encoder, the third feature map ③ is located between the first Swin Transformer module Ⅰ and the Patch Merging layer; the sixth feature map ⑥ is located between the PatchExpanding layer and the second Swin Transformer module Ⅱ, and the eighth feature map ⑧ is located between the Patch Expanding layer and the convolution layer of the decoder.
[0125] The first feature map ① is connected to the eighth feature map ⑧ via a jump connection, and the third feature map ③ is connected to the sixth feature map ⑥ via a jump connection.
[0126] Step 4. Network input and label setting;
[0127] The present invention is divided into the following three stages, and the working process is as follows:
[0128] (1) In the first stage, the input of the supervised initial denoising model is the training earthquake dataset Train_data, the label in the time domain is the corresponding ideal earthquake dataset Tag_data, and the label in the FK domain is the corresponding ideal earthquake data Tag_data converted to Tag_data_frep in the FK domain. The network output is , the noise can be calculated as , the time domain loss is calculated by outputting the labels of the time domain ; ② Then The FK domain loss is obtained by converting it to the FK domain through Fourier transform and calculating it with the label in the FK domain. ;③ and construct the joint loss function of this stage ,in, and is the weight coefficient, keeping the time domain loss and the FK domain loss at the same order of magnitude; ④ According to the joint loss function of the time domain and FK domain, the first stage initial denoising function is trained to obtain the trained first stage initial denoising model .
[0129] (2) If Figure 4 As shown, the second stage is state matching. The input of the diffusion model state matching stage is the noise calculated in the previous stage. , the noise Fitting to a Gaussian distribution, the noise is represented as having a mean of 0 and a variance of The Gaussian distribution of ~ ; ② Match the fitted normal distribution noise with a certain state in the forward process. The state in the forward process is recorded as , which is the representation of the data at time point t. In the state matching process, the normal distribution parameters of the noise in the reverse process are calculated and the state in the forward process is ③ The matching process is as follows: the noise is matched with a certain state in the forward process, and the noisy seismic data is represented in the denoising chain. The reverse process estimates the noise distribution according to the state at this moment; ④ Gaussian noise is continuously added to the forward diffusion chain to make it close to the Gaussian distribution related to the seismic data containing mixed noise, and the noise distribution is calculated in the time domain. , calculated on the FK domain ,in, is the standard deviation of the noise fit in the time domain, is the standard deviation of the noise in the FK domain. The joint difference in the time domain and the FK domain The time step with the minimum value is the best matching time t. The noisy seismic data is expressed on the Markov chain as .
[0130] (3) The third stage: ① Based on a matched intermediate time step of the forward diffusion process as the starting point of the reverse diffusion process, the noisy seismic data is diffused backwards, and the state of the previous moment is gradually traced back through Bayesian inference; ② In each step of the backtracking, the noise distribution of the current state is estimated, and the estimated result is input into the denoising model. The denoising model is used to denoise the seismic data of the current state to obtain the denoised seismic data.
[0131] Step 5. Loss function setting;
[0132] (1) In the first stage, the joint loss function of this stage is constructed:
[0133] ,in, is the data after noise suppression; is the label corresponding to the sample; is the loss of the i-th sample in the time domain; is the noise suppressed sample after Fourier transform; is the label after Fourier transformation; is the loss of the i-th sample in the FK domain, is a weight coefficient used to balance the importance of time domain loss and FK domain loss.
[0134] (2) In the second stage, the joint loss function of this stage is constructed:
[0135] ;
[0136] in, is the preset noise plan, representing the noise level at each state in the Markov chain of the forward process, is the data after adding noise at time t, is the standard deviation of the noise fit in the time domain, is the standard deviation of the noise in the FK domain. is a weight coefficient used to balance the importance of time domain loss and FK domain loss.
[0137] (3) In the third stage, the joint loss function of this stage is constructed:
[0138] ;
[0139] Among them, the mean square error (MSE) is used to calculate the denoised data and real data The loss in the time domain and the corresponding label data in the time domain, Represents the denoised data converted to the FK domain, Represents the label data converted to the FK domain.
[0140] Step 6. Network model training;
[0141] The noisy seismic data were input into the network, and the ideal seismic data were used as labels. During the training process, the batch size was 4, the number of iterations was 250, the initial learning rate was set to 0.001, and the Adam optimizer was used to optimize the network.
[0142] The experimental platform configuration of this embodiment: the computer operating system is Ubutu18.04, the GPU is NVIDA GTX-3080, and the deep learning network model is built using pytorch1.7.0 and python3.8. The specific implementation process is as follows:
[0143] 1. Obtain earthquake data
[0144] The seismic data containing scattered surface waves are obtained by forward modeling the velocity model containing scatterers, and then Gaussian noise of different intensities is added to the data containing scattered surface waves to simulate and generate seismic data containing mixed noise of seismic surface waves and random noise. The parameter setting example for generating data containing scattered surface waves is as follows:
[0145] box 1400 700 2.2 195 0 405 0 395 15 205 15
[0146] box 1400 700 2.2 540 0 660 0 650 15 560 15
[0147] box 1400 700 2.2 545 0 655 0 645 15 555 15
[0148] box 1400 700 2.2 845 0 955 0 945 15 855 15
[0149] box 1400 700 2.2 1045 0 1355 0 1345 15 1055 15
[0150] The longitudinal wave velocity is set to twice the shear wave velocity, the medium density is constant at 2200kg / m3, and the last eight parameters are scatterer size parameters.
[0151] To make seismic data labels: First, use the layered velocity model without scatterers for forward modeling, and the data obtained includes direct waves, surface waves, and reflected waves; then use the constant velocity model without scatterers for forward modeling, and the data obtained includes direct waves and surface waves. Subtract these two parts of data to get the label data.
[0152] 2. Preprocessing of seismic data training set;
[0153] Read mat file;
[0154] Preprocessing of seismic data;
[0155] Using Matlab, multiple sets of training data were generated by using different parameters. Each set of mixed noise data containing scattered surface waves and random noise and its corresponding clean data constituted a set of training data. Each seismic data with a data size of 2180×670 was divided into 256×256 sliced seismic data. By performing data enhancement on these sliced data, a total of 50,000 seismic data slices were prepared as training data and input into the network for training. The data set was divided into training set and test set according to 8:2. In this way, the training seismic data set Train_data and the corresponding theoretical seismic data set Tag_data were obtained.
[0156] 3. Design the initial denoising model of seismic data based on the U-Net network of Swin Transformer in the first stage ;
[0157] Encoder design;
[0158] ① It mainly includes convolution layer, Patch Merging layer and Swin Transformer module; ② The convolution layer includes 2 convolution operations; ③ The seismic data is downsampled through the Patch Merging layer to extract the multi-scale features of the seismic data; ④ The first Swin Transformer module contains 8 Swin Transformer layers, and the second Swin Transformer module contains 8 Swin Transformer layers to replace the traditional convolution layer; ⑤ After 2 times of ②③ operations, the seismic data processed by the self-attention mechanism is obtained.
[0159] Decoder design;
[0160] ① It mainly includes Patch Expanding layer, Swin Transformer module and convolution layer; ② The seismic data processed by the encoder is input into the Patch Expanding layer of the decoder for upsampling operation; ③ The sliced seismic data transmitted through the jump connection is spliced with the sliced seismic data corresponding to the size after the Patch Expanding layer in the channel dimension, and the spliced data is input into the 8-layer Swin Transformer module for calculation of the self-attention mechanism, which can effectively capture the multi-scale features and complex patterns in the seismic data and improve the accuracy and effect of seismic data processing; ④ After operations ②③, seismic data with the same size as the input seismic data is obtained; ⑤ The convolution layer includes 2 convolution operations.
[0161] In the implementation process, the Patch Expanding layer is used to upsample the feature map from low resolution to high resolution. The key code is as follows:
[0162]
[0163] Among them, input_resolution represents the spatial resolution (height and width) of the input feature map, in_channels represents the number of channels of the input feature map, scale_factor represents the scale factor of upsampling, self.conv represents a 1x1 convolution layer that reduces the number of input channels to half of the original, and self.up_p and self.up_b are two different upsampling methods. The UpSample module designed in this way can use different upsampling strategies according to different needs, and can also adjust the number of channels of the feature map. This is very useful for restoring image resolution or feature map details in deep learning models.
[0164] At the same time, the feature module of the skip layer fusion layer is defined as a module, in which the construction uses the standard function defined in Pytorch:
[0165]
[0166] Among them, x represents the feature map; x_downsample represents the feature map generated in the downsampling stage of the network; x=torch.cat([x,x_downsample[3-inx]],-1) means concatenating the feature map x of the current layer with the corresponding downsampled feature map x_downsample[3 - inx]; self.concat_back_dim[inx](x) represents passing the concatenated feature map x to the linear layer that adjusts the number of channels; the normalization layer self.norm_up is applied to the final feature map to standardize the feature map to facilitate model training.
[0167] 4. Design the second stage state matching process to match the noise predicted in the first stage After processing, it is matched with the closest time step containing noise in the forward process of the diffusion model; the noise After de-averaging, the noise is fitted to a Gaussian distribution to obtain the standard deviation of the Gaussian distribution parameters. ; Calculate the noise plan standard deviation of the current time step t in the forward process and compare it with the noise standard deviation fitted in the reverse denoising process to find the time step t with the smallest difference; Represent the noisy seismic data into the denoising chain as .
[0168] The state matching is performed in the time domain FK domain joint loss. The key code is as follows:
[0169]
[0170] Among them, mu_time, std_time represent the mean and standard deviation in the time domain, mu_freq, std_freq represent the mean and standard deviation in the FK domain, combined_diff represents the joint loss of the time domain and the FK domain, and best_t is the time step of the best state matching in the Markov chain.
[0171] Loss function setting;
[0172] The loss function is mainly divided into two parts: ① the loss in the time domain; ② the loss in the F-K domain. The key code for calculating the loss in the FK domain is as follows:
[0173]
[0174] Among them, the transform_fk function first adjusts the image size to match the given dataset_dim; uses torch.fft.fft2 to perform a two-dimensional Fourier transform on the image; extracts the real and imaginary parts of the Fourier transform result respectively, and stacks them into the last dimension through torch.stack. Perform Fourier transform on the label data and denoised data respectively to obtain their FK domain representation. The L1 loss in the time domain (loss_time) is used to measure the difference between the denoised data and the label data in the time domain. The L1 loss in the FK domain (loss_frep) is used to measure the difference between the denoised data and the label data in the FK domain. The total loss (loss_G) is the sum of the time domain loss and the FK domain loss.
[0175] 5. Design the third stage reverse denoising process. Based on the best matching state given in the second stage, the reverse process estimates the noise distribution according to the state at the matching moment, gradually obtains the state at the previous moment, and trains another final denoising function denoise function to obtain the denoised seismic data. The key code is as follows:
[0176]
[0177] Among them, x_in represents receiving and processing the input noise data, matched_state represents the given best matching state, calling the self.p_sample_loop method, executing the denoising loop according to the input parameters, gradually reducing the noise level, and generating the denoising result.
[0178] The key codes in the self.p_sample_loop method are as follows:
[0179]
[0180] Among them, matched_state is the best state obtained by matching in the second stage, which represents the maximum time step of the sampling cycle. During the sampling process, time decreases from matched_state to 0. Noise represents the noise introduced in the current time step to increase the randomness and diversity of the image. x_recon represents the denoised image at each step.
[0181] 6. Train the network and test the model
[0182] The dataset is divided into training set and test set in the ratio of 8:2. The same method is used to generate both the training set and the test set to ensure consistency between them, thereby avoiding the problem of inaccurate model performance evaluation caused by different data organization methods. After completing the training on the training set, the test set is used to test the denoising effect of the model.
[0183] Implementation effect: Figure 7 This is a noise suppression experiment in different domains on mixed noise seismic data containing scattered surface waves and random noise. The method of using only time domain learning with the same network structure is compared with the method of combining time domain and FK domain learning in this implementation. Figure 7 (a) The noise suppression results are as follows: Figure 7 (b) is the noise suppression result of the time domain learning method only. Figure 7 (c) is the FK spectrum of the noise suppression result of this implementation, Figure 7 (d) is the FK spectrum of the noise suppression result of the time domain learning method only. Figure 7As can be seen from (a), the noise suppression result of this implementation method has richer texture and stronger continuity, and the mixed noise is effectively suppressed; Figure 7 (b) When only the time domain learning method is used, some noise still remains, and effective information is lost during the noise suppression process, resulting in discontinuity of the event axis. Figure 7 (c) It can be seen that the noise interference in the low-frequency part has been suppressed, and there is almost no noise residue; Figure 7 (d) It can be seen that there are still residual noise signals in the range of 10-20Hz, and the surface wave noise has not been completely suppressed. Since the time domain learning method only does not combine the FK domain features to train the network, its ability to fit the FK domain features is relatively limited. This shows that the implementation method has certain advantages in jointly learning the time domain and FK domain features.
[0184] Figure 8 This is an experiment to suppress noise using different methods on mixed noise seismic data of scattered surface waves and random noise. Figure 8 (a) is mixed noise seismic data containing scattered surface waves and random noise. Figure 8 (b) is the denoising result of the algorithm of the present invention. Figure 8 (c) is the DnCNN denoising result. Figure 8 (d) is the FK spectrum of mixed noise seismic data containing scattered surface waves and random noise. Figure 8 (e) is the FK spectrum of the denoising result of the algorithm of the present invention, Figure 8 (f) is the FK spectrum of the DnCNN denoising result. Figure 8 (a) It can be seen that the scattered surface waves cover part of the effective signal and are confused with the characteristics of the effective signal, resulting in the deterioration of the continuity of the effective signal event axis. The addition of random noise further reduces the signal-to-noise ratio of the seismic data. Figure 8 (b) It is observed that the scattered surface waves in the denoising results have been effectively suppressed, and the reflected wave events covered by the scattered surface waves have been basically restored. Figure 8 (b) no longer contains obvious random noise. Figure 8 (c) It can be seen that the use of DnCNN to suppress the mixed surface wave noise has a certain effect, reducing the impact of scattered surface waves on the effective signal to a certain extent, but at the same time, it causes damage to the event axis information and leaves more random noise residual. Figure 8 (d) is the FK spectrum of mixed noisy seismic data containing scattered surface waves and random noise. Figure 8(e) is the FK spectrum of the noise suppression result of the present invention. This method has a good suppression effect on the mixed noise of scattered surface waves and random noise. In the low-frequency part of the FK spectrum, the surface waves and the effective signal characteristics are no longer confused. The FK spectrum of the denoising result is slightly different from the FK spectrum without noise data, and basically does not contain random noise. Figure 8 (f) is the FK spectrum of the denoising result of DnCNN. It can be seen that its suppression effect on the part with stronger scattered surface wave energy is more obvious, but random noise points are widely distributed in its FK spectrum. This shows that its noise suppression performance in the case of mixed noise is worse than that of this method. Comprehensive analysis of the noise suppression results implemented by the present invention and the noise suppression results of DnCNN shows that the network structure implemented by the present invention can effectively suppress the noise of mixed noise seismic data containing scattered surface waves and random noise.
[0185] The invention discloses a method for suppressing seismic surface waves and random noise based on Swin Transformer and a diffusion model. The method effectively suppresses surface waves and random noise in seismic data through theoretical analysis and experimental verification, and obtains seismic data with a higher signal-to-noise ratio. With Swin Transformer as a basic network module, the U-Net architecture comprises m Swin Transformer layers in a first Swin Transformer module, n Swin Transformer layers in a second Swin Transformer module, and m Swin Transformer layers in a third Swin Transformer module, which are used to replace traditional convolutional layers. The feature extraction process more effectively captures high-level features in seismic data, and processes them at multiple scales, thereby improving the representation capability of complex geological structures. Furthermore, by utilizing the features at multiple scales, the diffusion model can better learn the noise distribution, approximate the actual seismic data, and improve the quality of the denoised seismic data.
[0186] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A seismic surface wave and random noise suppression method based on Swin Transformer and diffusion model, characterized in that: include: Obtaining a mixed noise seismic data set including seismic surface waves and random noise, preprocessing the mixed noise seismic data set to obtain a preprocessed mixed noise seismic data set, wherein the mixed noise seismic data set includes training seismic data and ideal label seismic data; Inputting the preprocessed mixed noise seismic data set into a trained initial denoising model to obtain a denoised seismic data set, and obtaining a mixed noise estimation data set based on the preprocessed mixed noise seismic data set and the denoised seismic data set; Fitting the mixed noise estimation data set to a Gaussian distribution, matching the mixed noise estimation data set with a state at a certain moment in the forward process of a diffusion model to obtain noisy seismic data, and representing the noisy seismic data in a denoising chain to obtain an estimated noise distribution; Using the reverse process of the diffusion model to learn the estimated noise distribution for the state at a certain moment after matching, gradually obtaining the state at the previous moment, and training to obtain a denoising model, and obtaining denoised seismic data based on the denoising model; Obtaining the training seismic data includes: Using a velocity model containing scatterers to generate scattered surface wave data, adding Gaussian noise of different intensities to the scattered surface wave data to simulate and generate seismic data containing mixed noise of seismic surface waves and random noise; Obtaining the ideal labeled seismic data includes: The layered velocity model without scatterers is used for forward modeling to obtain data including direct waves, surface waves and reflected waves. The constant velocity model without scatterers is used for forward modeling to obtain data including direct waves and surface waves. Subtracting the data including direct wave, surface wave and reflected wave from the data including direct wave and surface wave to obtain ideal labeled seismic data; Preprocessing the mixed noise seismic data set to obtain the preprocessed mixed noise seismic data set includes: Slicing the mixed noise seismic data set into two-dimensional slice seismic data of a preset size to obtain a preprocessed mixed noise seismic data set; Obtaining the trained initial denoising model includes: Input the preprocessed mixed noise seismic data set into the initial denoising model, subject the preprocessed mixed noise seismic data set to FK transformation to obtain FK domain features, use the corresponding ideal label seismic data as labels in the time domain, convert the ideal label seismic data to the FK domain as labels in the FK domain, train the initial denoising function, and obtain a trained initial denoising model; The trained initial denoising model includes an encoder and a decoder; the encoder includes a first convolutional layer, a first Patch Merging layer, and a first Swin Transformer module; The first convolutional layer is used to extract seismic data features; The first Patch Merging layer is used to downsample the sliced seismic data to achieve multi-scale feature extraction of the seismic data; The first Swin Transformer module is used to perform self-attention mechanism calculation on the input slice seismic data to make full use of global information; The decoder includes a second Patch Expanding layer, a second Swin Transformer module, and a second convolutional layer; The second Patch Expanding layer is used to upsample the sliced seismic data, expand the sliced seismic data and reduce the number of feature map channels; The second Swin Transformer module is used to perform self-attention mechanism calculation on the input slice seismic data to make full use of global information; The second convolutional layer is used to reduce the dimension of the feature map and integrate the features of all extracted seismic data; Obtaining an estimated noise distribution involves: The mixed noise estimation data set is subjected to Gaussian distribution fitting by a statistical method to obtain fitting parameters, and a specific state in the forward process of the diffusion model is determined according to a method of minimizing the joint difference between the time domain and the FK domain. The noise distribution of the specific state is close to the fitted Gaussian distribution to obtain noisy seismic data, and the noisy seismic data is represented in a denoising chain to obtain an estimated noise distribution; The denoised seismic data include: The estimated noise distribution is learned from the state at a certain moment after matching by using the reverse process, and the state at the previous moment is gradually traced back by Bayesian inference. The noise distribution of the current state is estimated in each step of the backtracking, and the estimated result is input into the denoising model. The denoising model is used to denoise the seismic data of the current state to obtain the denoised seismic data.
