A method for classifying and identifying seismic signals based on a transformer

By employing a Transformer-based seismic signal classification method and utilizing self-attention and multi-head window self-attention mechanisms, the problem of the receptive field limitation of convolutional neural networks is solved, achieving higher classification accuracy and training efficiency for natural earthquakes and artificial blasting.

CN116304818BActive Publication Date: 2026-01-06GUANGXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310246159.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-15
Publication Date
2026-01-06
Estimated Expiration
2043-03-15

AI Technical Summary

Technical Problem

Existing convolutional neural networks have limitations in receptive field for seismic signal classification, making it difficult to effectively utilize contextual information, resulting in insufficient accuracy in classifying natural earthquakes and artificial blasting.

Method used

A Transformer-based seismic signal classification method is adopted, which uses self-attention mechanism and window multi-head self-attention mechanism to capture global context information. By constructing self-attention module, multi-head self-attention module, window-type multi-head self-attention module, sliding window multi-head self-attention module and spatial permutation sliding window multi-head self-attention module, deeper features are extracted.

Benefits of technology

It improves the classification accuracy of natural earthquakes and artificial blasting, reduces computing power and memory requirements, and enhances the training speed and classification ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304818B_ABST
    Figure CN116304818B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on Transform earthquake signal classification identification method, comprising the following steps: S1.data acquisition;S2. Construct main network;S3. In training stage, optimization is carried out using RMSprop optimizer;S4. Parameter registration, training model.This method can capture global context information by the way of self-attention, establish the long-distance dependence of target, extract deeper features, and improve the recognition ability of seismic source signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the study of seismic signal source category classification and identification, belonging to the field of signal classification in signal processing, specifically a Transformer-based seismic signal classification and identification method. Background Technology

[0002] Distinguishing between observed seismic waveforms and their corresponding event source types (such as natural earthquakes or man-made blasting events) has been a challenging yet crucial aspect of seismological research for decades. In recent years, the frequency of man-made blasting / explosions related to various human activities, such as blasting and nuclear tests, has gradually increased, making it more difficult to obtain a catalog of natural earthquakes and highlighting the necessity of seismic waveform signal classification. Therefore, accurately identifying between natural and non-natural earthquakes has significant scientific and practical implications. Deep learning has become a popular research area in machine learning in recent years. As a multi-layer neural network learning algorithm composed of multiple hidden layers, deep learning has shown excellent performance in learning features from input data. It has made significant progress in image classification, image segmentation, and object detection. In the study of seismic signal classification and identification of natural earthquakes and man-made blasting events, deep learning can better extract seismic signal features, including the differences in source types inherent in the seismic signals, and accurately classify source types based on the extracted features. Convolutional neural networks are a popular research direction in deep learning. Many scholars at home and abroad have proposed research on earthquake signal recognition based on convolutional neural networks. The method [CHEN R 2018] extracts earthquake waveform features through Mel-Cepstrum as input to the convolutional neural network to identify and classify earthquakes and explosions (CHEN R, HUANG H, CHAI H. Study on the discrimination of seismic waveform signals between earthquake and explosion events by convolutional neural network [J]. Progress in geophysics, 2018, 33(4): 1331-1338.).Method [Yonggang W 2019] uses a residual network model to identify natural earthquakes and artificial blasting, converting waveforms into power spectra as input to the model. The model learns the spectral characteristics of earthquake and blasting waveforms to improve the ability to classify and identify earthquake source types (Yonggang W, Qianli Y, Tingting W, et al. Earthquake and explosion identification based on Deep Learning residual network model[J]. Acta Seismologica Sinica, 2019, 41(5):646-657.); Method [TIAN X 2022] uses a multi-input convolutional neural network model, taking waveform signals of natural earthquakes and artificial blasting and their time-frequency data as input to the model to improve the model's classification and identification ability (TIAN X, WANG MJ, ZHANG X, et al. Discrimination of earthquake and quarryblast based on multi-input convolutional neural network[J]. Chinese Journal of Geophysics, 2022, 65(5):1802-1812.). Method [Kong Q 2022] improves the generalization performance of the model by combining deep learning with physical features such as P / S amplitude ratio and local magnitude (Kong Q, Wang R, Walter WR, et al. Combining Deep Learning with Physics Based Features in Explosion-Earthquake Discrimination[J].arXiv preprint arXiv:2203.06347,2022.). Method [Ku B 2020] introduces the SE attention mechanism into the convolutional neural network, which achieves good results in earthquake event classification (Ku B, Kim G, Ahn JK, et al. Attention-based convolutional neural network for earthquake event classification[J].IEEE Geoscience and Remote Sensing Letters,2020,18(12):2057-2061.).

[0003] Convolutional neural networks (CNNs) have achieved good results in seismic source type identification, but the receptive field of the convolutional kernels in CNNs is relatively limited, requiring the stacking of multiple convolutional-pooling structures to expand the receptive field. However, the receptive field expanded by stacking in this way will decay Gaussian outward from a certain central origin, making the actual receptive field much smaller than the theoretical receptive field, which is not conducive to using contextual information for feature capture. Summary of the Invention

[0004] The purpose of this invention is to improve the classification accuracy of natural earthquakes and artificial blasting by better learning global information of seismic signal characteristics, and to provide a Transformer-based seismic signal classification and recognition method. This method can capture global contextual information through self-attention, establish long-distance dependencies on targets, extract deeper features, and improve the ability to identify seismic source signals.

[0005] The technical solution to achieve the objective of this invention is as follows:

[0006] A Transformer-based seismic signal classification and identification method includes the following steps:

[0007] S1. Data Acquisition: Acquire three-component event waveform data from seismic stations, where the three components are east-west, north-south, and vertical components. Treat the three components of an event waveform data as three events for identification, that is, treat one component of an event as a recognition unit to increase the amount of data and enable the model to learn waveform features. The specific implementation process includes the following two processing steps:

[0008] S11: Data Truncation and Mean Removal: Due to the varying recording times of the original waveform data, preprocessing was performed to truncate the original waveforms to the same length. The original waveform data showed significant differences in the time from the initial P-wave to the end of the S-wave, ranging from tens to hundreds of seconds. To fully capture the waveform characteristics within the truncated length, the truncation time began 160 seconds before the initial S-wave, with a truncated length of 327.68 seconds and a sampling frequency of 100Hz. Z The sampling points are 32768. The data is then processed using the difference method to remove the mean bias. Let h0 = 0. The calculation formula is as follows:

[0009] h k =d k -d k-1 k∈[1,n];

[0010] S12: Data Normalization: The amplitudes of different seismic signal data may vary greatly, and the distance between the same seismic signal station and the epicenter will also have a certain impact on the amplitude. In order to ensure that the seismic signal data are compared under the same degree of dispersion and to help the model converge faster, the seismic signal data used in the experiment needs to be normalized. The maximum-minimum normalization method is used to shrink the seismic signal data to the [0,1] interval. The maximum-minimum normalization formula is:

[0011]

[0012] S2. Constructing the backbone network: The backbone network extracts features from seismic waveform data to learn the characteristics of seismic signals, and then classifies these features. The backbone network mainly consists of the following steps:

[0013] S21: Constructing a self-attention module: The self-attention mechanism captures global contextual information by calculating the mutual influence between input sequences, establishing long-distance dependencies on the target, and solving the problem of limited long-distance dependencies in traditional attention. The attention calculation process is as follows:

[0014] Assume x i Let i∈(1,2,3,…,n) be the feature map of the input sample, and W Q W k W V Generate q respectively i k i v i The model weight coefficients, x i , i∈(1,2,3,…,n) respectively with W Q W k W V q is obtained by multiplying the weight coefficients. i k i v i , i∈(1,2,3,…,n), calculate q i With k i The correlation between them, divided by the square root of the dimension of matrix k. The SoftMax function is used to calculate the result, and then compared with the corresponding v. m The feature map z after weighted multiplication is obtained. i For i∈(1,2,3,…,n), the calculation formula is:

[0015]

[0016] S22: Constructing a Multi-Head Self-Attention Module: A multi-head self-attention module is a module that integrates q... i k i v iThe whole is viewed as a single head, and the correlation between different features in the feature map is calculated using multiple different heads, with x... i With multiple groups of W Q W k W V Multiply to get q i k i v i Let i ∈ (1,2,3,…,n), and perform self-attention calculations to obtain the calculation results for different heads. The calculation results from different heads are then concatenated and input into a fully connected layer for linear transformation to obtain the final result, as shown in the formula:

[0017] z hi =Attention(QW i Q QW i K QW i V )

[0018] z1 = Concat(z h1 ,z h2 ,z h3 W l ;

[0019] S23: Constructing a window-based multi-head self-attention module: Divide the feature map into multiple windows of size 16, and then assign each feature map window X to a different weight matrix W. Q W K W V Multiply to obtain the corresponding query vector Q, key vector K and value vector V. Then, multi-head self-attention is calculated for each window. After the calculation, the feature maps of each window are stitched together into a feature map of the same size as before the window division. Then, a sliding window multi-head self-attention module is constructed based on the constructed window-type multi-head self-attention module. The sliding window multi-head self-attention module mainly obtains cross-window information.

[0020] S24: Constructing a sliding window multi-head self-attention module: The sliding window multi-head self-attention mechanism is achieved by performing a sliding window operation on the multi-head self-attention of windows. That is, before dividing the feature map into windows, a scrolling operation is performed on the feature data to enable information transmission between different windows, obtain long-distance dependencies, and at the same time have a global receptive field. Then, based on the constructed sliding window multi-head self-attention module, a sliding window multi-head self-attention module is built. The sliding window multi-head self-attention module mainly obtains cross-window information.

[0021] S25: Constructing a Spatial Permutation Sliding Window Multi-head Self-Attention Module: The Spatial Permutation Sliding Window Multi-head Self-Attention Module layer adopts the sliding window multi-head attention mechanism in the Swing Transformer network structure and the spatial permutation rules in the Shuffle Transformer network. The input data is spatially permuted before and after the Shifted Windows Multi-head Self-Attention (SW-MSA) mechanism, and different channels are exchanged with each other. This allows the second window multi-head self-attention mechanism layer of two consecutive window multi-head self-attention mechanism layers to receive input from different windows, promoting information interaction between windows.

[0022] S26: Constructing the MLP module: Optimizing the multi-head self-attention calculation results of the spatial permutation sliding window using the MLP module;

[0023] S27: Constructing the Overall Network: The first layer of the overall network is a convolutional layer with a kernel size of 16, a stride of 16, and 12 channels. This first convolutional layer segments the 32768×1 source signal into non-overlapping feature maps of size 2048×1. The resulting feature maps are then input into a Transformer module consisting of Windows Multi-head Self-Attention (W-MSA) and Shuffle Shifted Windows Multi-head Self-Attention (SSW-MSA) layers to extract global information from the feature maps. The feature maps are then input into a merging layer, where they are sampled at intervals of 4 feature points and concatenated into a single tensor, reducing the size by a factor of 4 and increasing the number of channels by a factor of 4. A fully connected layer then reduces the number of channels by a factor of 2, further reducing the feature map size and increasing the number of channels, resulting in a feature map of size 512×24. Compared to the SSW-MSA layer, the W-MSA layer uses a multi-head self-attention mechanism... The Self-Attention (MSA) layer reduces computational and memory requirements and improves local modeling capabilities. Then, it passes through a Transformer module, a merging layer, a W-MSA layer, and a SSW-MSA layer, and finally through Layer Normalization (LN), global pooling, and a fully connected layer to output the final classification result.

[0024] Each Transformer module consists of a window multi-head self-attention mechanism layer and a spatial permutation sliding window multi-head self-attention mechanism layer. These layers are composed of layer normalization, window multi-head self-attention mechanism, spatial permutation sliding window multi-head self-attention mechanism (SSW-MSA), and a multi-layer perceptron (MLP) connected via residual links. The specific process can be represented as follows:

[0025] x l =W-MSA(LN(z) l-1 ))+z l-1 ,

[0026] z l =MLP(LN(x) l ))+x l ,

[0027] y l =SSW-MSA(LN(z) l ))+z l ,

[0028] z l+1 =MLP(LN(y l ))+y l ,

[0029] Where x l y l and z l Let represent the output features of the W-MSA module, SSW-MSA module, and Multilayer Perceptron (MLP) module, respectively. When the window size of the fixed-window multi-head self-attention mechanism is M, assuming the multi-head self-attention mechanism has N blocks and each window of the windowed multi-head self-attention mechanism has M blocks, then the computational complexity of the sum of multi-head self-attention and windowed multi-head self-attention is:

[0030] Ω(MSA)=4NC 2 +2N 2 C

[0031] Ω(W-MSA)=4NC 2 +2NMCC represents the number of channels. When M is less than N, the training speed and computational efficiency of the model will be improved. When M is fixed, the computational complexity based on window self-attention increases linearly with N.

[0032] S3. During the training phase, the RMSprop optimizer is used to optimize the parameter weights of the model;

[0033] This phase can be summarized as follows:

[0034] (1) A windowed multi-head self-attention method with lower computational complexity is proposed for one-dimensional time series data compared to multi-head self-attention.

[0035] (2) A window-based multi-head self-attention algorithm based on spatial permutation and sliding window is proposed for the classification and recognition of natural earthquakes and artificial blasting. Compared with the huge demand for computing power and memory of the multi-head self-attention mechanism, the window-based multi-head attention algorithm reduces the computing power and memory requirements during model training.

[0036] S4. Parameter registration and model training; the specific training parameter settings are as follows:

[0037] Batch_size=64, epoch=1000, Optimizer=Adam, Learning_rate=0.001;

[0038] The specific experimental environment setup is shown in Table 1:

[0039] Table 1 Experimental Environment Parameters

[0040]

[0041] Compared with ResNet18 convolutional network models, VIT models based on multi-head attention, and traditional SVM algorithms, our proposed method can more accurately distinguish between natural earthquakes and artificial blasting. Compared to the methods mentioned above, our method achieves higher classification accuracy in most cases under Gaussian white noise with varying signal-to-noise ratios, and maintains high accuracy even as the signal-to-noise ratio decreases. Attached Figure Description

[0042] Figure 1 This is an overall flowchart of an embodiment;

[0043] Figure 2 The examples show waveforms of natural earthquakes and artificial blasting.

[0044] Figure 3 This is the backbone network diagram in the embodiment;

[0045] Figure 4 This is a diagram illustrating the self-attention principle in the embodiment.

[0046] Figure 5 This is a diagram illustrating the calculation process of the multi-head self-attention mechanism for windows in the embodiment;

[0047] Figure 6 This is a spatial displacement structure diagram in the embodiment;

[0048] Figure 7 This is a graph showing the signal-to-noise ratio comparison experiment. Detailed Implementation

[0049] The invention will now be described in further detail with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the invention.

[0050] Example:

[0051] Reference Figure 1 A method for classifying and identifying seismic signals based on Transformer includes the following steps:

[0052] S1. Data Acquisition: The dataset for this example comes from the three-component event waveform data of 50 natural earthquake events and 12 artificial blasting events recorded by seismic stations in Guangxi Zhuang Autonomous Region and its surrounding areas from 2019 to 2020. The three components are east-west, north-south, and vertical components. Each event waveform data point is treated as three separate events for identification; that is, one component of an event is treated as a recognition unit. This increases the dataset size, allowing the model to learn waveform features. The surface wave magnitudes (Ms) of the earthquake events range from 1.0 to 5.2, and the surface wave magnitudes of the blasting events... The magnitude Ms ranges from 1.3 to 2.6, with signal recording durations varying from several hundred seconds to over two thousand seconds. The sampling frequency is 100 Hz. Seismological experts removed waveform records with excessive noise or those failing to reflect the full-process waveform energy fluctuations from the earthquake dataset. 4578 waveforms from natural earthquakes and artificial blasting events that were not obscured by noise were selected, including 2751 natural earthquake waveforms and 1827 artificial blasting waveforms. The dataset was divided into training and testing sets, with 80% of the natural earthquake and artificial blasting data used as the training set and the remaining 20% ​​as the testing set. The specific implementation process includes the following two processing steps:

[0053] S11: Data Truncation and Mean Removal: Due to the varying recording times of the original waveform data, preprocessing was performed to truncate the original waveforms to the same length. The original waveform data showed significant differences in the time from the initial P-wave to the end of the S-wave, ranging from tens to hundreds of seconds. To fully capture the waveform characteristics within the truncated length, the truncation time began 160 seconds before the initial S-wave, with a truncated length of 327.68 seconds and a sampling frequency of 100Hz. Z The sampling points are 32768. Then, the data is processed to remove the mean skewness using the finite difference method. Let h0 = 0. The calculation formula is as follows:

[0054] h k =d k -d k-1 k∈[1,n];

[0055] S12: Data Normalization: The amplitudes of different seismic signal data may vary greatly, and the distance between the same seismic signal station and the epicenter will also have a certain impact on the amplitude. In order to ensure that the seismic signal data are compared under the same degree of dispersion and to help the model converge faster, the seismic signal data used in the experiment needs to be normalized. In this example, the maximum-minimum normalization method is used to scale the seismic signal data to the [0,1] interval. The maximum-minimum normalization formula is:

[0056]

[0057] The processed waveform signals of natural earthquakes and artificial blasting are shown below. Figure 2 As shown;

[0058] S2. Construct the backbone network: such as... Figure 3 As shown, the backbone network extracts features from seismic waveform data to learn the characteristics of seismic signals, and then classifies these features. The backbone network mainly consists of the following steps:

[0059] S21: Construct a self-attention module: such as Figure 4 As shown, the self-attention mechanism captures global contextual information by calculating the mutual influence between input sequences, establishes long-distance dependencies on the target, and solves the problem of limited long-distance dependencies in traditional attention. The attention calculation process is shown below:

[0060] Assume x i Let i∈(1,2,3,…,n) be the feature map of the input sample, and W Q W k W V Generate q respectively i k i v i The model weight coefficients, x i , i∈(1,2,3,…,n) respectively with W Q W k W V q is obtained by multiplying the weight coefficients. i k i v i , i∈(1,2,3,…,n), calculate q i With k i The correlation between them, divided by the square root of the dimension of matrix k. The SoftMax function is used to calculate the result, and then compared with the corresponding v. m The feature map z after weighted multiplication is obtained. i For i∈(1,2,3,…,n), the calculation formula is:

[0061]

[0062] S22: Constructing a Multi-Head Self-Attention Module: A multi-head self-attention module is a module that integrates q... i k i v i The whole is viewed as a single head, and the correlation between different features in the feature map is calculated using multiple different heads, with x... i With multiple groups of W Q W k W V Multiply to get q i k i v i Let i ∈ (1,2,3,…,n), and perform self-attention calculations to obtain the calculation results for different heads. The calculation results from different heads are then concatenated and input into a fully connected layer for linear transformation to obtain the final result, as shown in the formula:

[0063] z hi =Attention(QW i Q QW i K QW i V )

[0064] z1 = Concat(z h1 ,z h2 ,z h3 W l ;

[0065] S23: Constructing a window-based multi-head self-attention module: such as... Figure 5 As shown, the feature map is divided into multiple windows with a window size of 16, and then each feature map window X is weighted by a different weight matrix W. Q W K W V Multiply to obtain the corresponding query vector Q, key vector K and value vector V. Then, multi-head self-attention is calculated for each window. After the calculation, the feature maps of each window are stitched together into a feature map of the same size as before the window division. Then, a sliding window multi-head self-attention module is constructed based on the constructed window-type multi-head self-attention module. The sliding window multi-head self-attention module mainly obtains cross-window information.

[0066] S24: Constructing a sliding window multi-head self-attention module: The sliding window multi-head self-attention mechanism performs a sliding window operation on the multi-head self-attention of windows. That is, before dividing the feature map into windows, a scrolling operation is performed on the feature data, enabling information to be passed between different windows, obtaining long-distance dependencies, and simultaneously possessing a global receptive field. Then, based on the constructed sliding window multi-head self-attention module, a sliding window multi-head self-attention module is built. The sliding window multi-head self-attention module mainly obtains cross-window information.

[0067] S25: Constructing a multi-head self-attention module for a spatial permutation sliding window: such as... Figure 6 As shown, the spatial permutation sliding window multi-head self-attention module layer adopts the sliding window multi-head attention mechanism in the Swing Transformer network structure and the spatial permutation rule in the Shuffle Transformer network. The input data is spatially permuted before and after the sliding window multi-head attention mechanism, i.e., SW-MSA, and different channels are exchanged with each other. This enables the second window multi-head self-attention mechanism layer of two consecutive window multi-head self-attention mechanism layers to receive input from different windows, promoting information interaction between windows.

[0068] S26: Constructing the MLP module: Optimizing the multi-head self-attention calculation results of the spatial permutation sliding window using the MLP module;

[0069] S27: Constructing the Overall Network: The first layer of the overall network is a convolutional layer with a kernel size of 16, a stride of 16, and 12 channels. This first convolutional layer segments the 32768×1 source signal into non-overlapping feature maps of size 2048×1. The resulting feature maps are then input into a Transformer module consisting of a windowed multi-head self-attention (W-MSA) layer and a spatial permutation sliding window multi-head self-attention (SSW-MSA) layer to extract global information from the feature maps. Finally, the feature maps are input into a merging layer, where they are sampled at intervals of 4 feature points. The data are then concatenated into a single tensor, reducing its size by a factor of 4 and increasing the number of channels by a factor of 4. A fully connected layer then reduces the number of channels by a factor of 2, reducing the size of the feature map and increasing the number of channels to obtain a feature map of size 512×24. Compared with the multi-head self-attention mechanism (MSA layer) of the W-MSA layer and SSW-MSA layer, the MSA layer can reduce computational power and memory requirements and improve local modeling ability. The data is then passed through a Transformer module, a merging layer, a W-MSA layer, and an SSW-MSA layer, respectively. Finally, the data is processed by layer normalization, global pooling, and a fully connected layer to output the final classification result.

[0070] Each Transformer module consists of a window multi-head self-attention mechanism layer and a spatial permutation sliding window multi-head self-attention mechanism layer. These layers are composed of layer normalization, window multi-head self-attention mechanism, spatial permutation sliding window multi-head self-attention mechanism, and a multilayer perceptron linked via residuals. The specific process can be represented as follows:

[0071] x l =W-MSA(LN(z) l-1 ))+z l-1 ,

[0072] z l =MLP(LN(x) l ))+x l ,

[0073] y l =SSW-MSA(LN(z) l ))+z l ,

[0074] z l+1 =MLP(LN(y l ))+y l ,

[0075] Where x l y l and z l Let represent the output features of the W-MSA module, SSW-MSA module, and multilayer perceptron module, respectively. When the window size of the fixed-window multi-head self-attention mechanism is M, assuming the multi-head self-attention mechanism has N blocks and each window of the windowed multi-head self-attention mechanism has M blocks, then the computational complexity of the sum of multi-head self-attention and windowed multi-head self-attention is:

[0076] Ω(MSA)=4NC 2 +2N 2 C

[0077] Ω(W-MSA)=4NC 2 +2NMCC represents the number of channels. When M is less than N, the training speed and computational efficiency of the model will be improved. When M is fixed, the computational complexity based on window self-attention increases linearly with N. In this invention, the size of M is set to 16.

[0078] S3. During the training phase, the RMSprop optimizer is used to optimize the parameter weights of the model;

[0079] This phase can be summarized as follows:

[0080] (1) A windowed multi-head self-attention method with lower computational complexity is proposed for one-dimensional time series data compared to multi-head self-attention.

[0081] (2) A window-based multi-head self-attention algorithm based on spatial permutation and sliding window is proposed for the classification and recognition of natural earthquakes and artificial blasting. Compared with the huge demand for computing power and memory of the multi-head self-attention mechanism, the window-based multi-head attention algorithm reduces the computing power and memory requirements during model training.

[0082] S4. Parameter registration and model training; the specific training parameter settings are as follows:

[0083] Batch_size=64, epoch=1000, Optimizer=Adam, Learning_rate=0.001;

[0084] The specific experimental environment setup is shown in Table 1:

[0085] Table 1 Experimental Environment Parameters

[0086]

[0087] The method in this example is compared with other methods, and the comparison results are shown in Table 2:

[0088] Table 2 Comparison of accuracy of this method with other classification methods.

[0089]

[0090]

[0091] As shown in Table 1, the traditional seismic signal classification method SVM performs worse than other methods. The ResNet18 classification method based on convolutional neural networks achieves an average accuracy of 96.99%, which is higher than other SVM and VIT classification methods. The VIT-based global self-attention method performs relatively poorly, with an accuracy of only 96.02%. In contrast, the method in this example achieves an average accuracy of 98.01%, which is higher than other methods.

[0092] This example demonstrates the noise resistance of the above classification methods through experiments. Gaussian white noise with different signal-to-noise ratios was added to natural earthquake and artificial blasting signals to test the impact of different signal-to-noise ratios on the accuracy of the models. The formula for Gaussian white noise is as follows:

[0093]

[0094] noise represents the generated noise, N is the length of the generated noise, X is the original signal, and snr is the signal-to-noise ratio.

[0095] like Figure 7 As shown, the accuracy of this method gradually decreases as the signal-to-noise ratio decreases, but compared with other methods, the accuracy of this method still has a significant advantage and is relatively stable.

Claims

1.A method for identifying and classifying seismic signals based on a Transformer, characterized in that, Comprising the following steps: S1. Data acquisition: acquiring three-component event waveform data recorded by seismic stations, wherein the three components are east-west, north-south and vertical components; treating the three components of an event waveform data as three events for identification, i.e. taking one component in an event as an identification unit to increase the number of data sets, so that the model can learn the waveform features, and the specific implementation process includes the following two processes: S11: data intercepts and removes the mean tendency: intercepts the time of 160 seconds before the initial motion of S wave, intercepts the length of 327.68 seconds, the sampling frequency is 100H Z , the sampling point is 32768 points, then the data is removed by difference method to remove the mean tendency; S12: Data normalization: normalizing the seismic signal data, using the maximum and minimum value normalization method to scale the seismic signal data to the [0, 1] interval; S2. Constructing the main network: the main network extracts features from seismic waveform data to learn the characteristics of seismic signals, and then classifies the features, and the main network is composed of the following steps: S21: Constructing a self-attention module: the self-attention mechanism captures global context information by calculating the mutual influence between input sequences, establishes long-distance dependence for the target, and the attention calculation process is: Assume is the feature map of the input sample, is the feature map of the input sample, , is the model weight coefficient of the generated , is multiplied by the weight coefficient , is calculated between the correlation of , is divided by the square root of the dimension of the matrix , the result is calculated using the SoftMax function, and the weighted operation feature map is obtained by multiplying the corresponding ; S22: Constructing a multi-head self-attention module: the multi-head self-attention module is to regard the whole as a head, calculate the correlation between different features in the feature map through multiple different heads, multiply the correlation between different features in the feature map and multiple groups of , and perform self-attention calculation to obtain the calculation results of different heads, and the calculation results of different heads are spliced and input into a fully connected layer to obtain the final results. ​​​ S23: constructing a window multi-head self-attention module: dividing the feature map into multiple windows according to a window size of 16, then multiplying each feature map window X with different weight matrices to obtain corresponding query vector Q, key vector K and value vector V, then performing multi-head self-attention calculation on each window, after the calculation is completed, splicing each window feature map into a feature map with the same size as before the window is divided, then constructing a sliding window multi-head self-attention module based on the constructed window multi-head self-attention module, and the sliding window multi-head self-attention module obtains cross-window information; S24: Constructing a sliding window multi-head self-attention module: the sliding window multi-head self-attention mechanism is obtained by sliding window operation on the window multi-head self-attention, i.e. before dividing the window of the feature map, a rolling operation is performed on the feature data, so that information transmission between different windows can be achieved, and long-distance dependence is obtained while having a global receptive field; S25: Constructing a spatial displacement sliding window multi-head self-attention module: the spatial displacement sliding window multi-head self-attention module adopts the sliding window multi-head self-attention mechanism in the Swin Transformer network structure and the spatial displacement rule in the Shuffle Transformer network, and performs spatial displacement on the input data before and after the sliding window multi-head self-attention mechanism, so that different channels exchange with each other, so that the second window multi-head self-attention mechanism layer of the two consecutive window multi-head self-attention mechanism layers can receive input from different windows, and promote information exchange between windows; S26: Constructing a multi-layer perception module: optimizing the spatial displacement sliding window multi-head self-attention calculation result through the multi-layer perception module; S27: constructing a total network: the first layer of the total network is a convolutional layer with a convolution kernel size of 16, a step size of 16, and a channel number of 12, the size of the feature map output by the first layer is S27: constructing a total network: the first layer of the total network is a convolutional layer with a convolution kernel size of 16, a step size of 16, and a channel number of 12, the size of the feature map output by the first layer is The source signal is divided into non-overlapping feature maps with a size of , and then the obtained feature maps are input into a Transformer module to extract the global information of the feature maps. Then the feature maps are input into a merging layer, and the feature maps are sampled at intervals of 4 feature points and spliced into a whole tensor, the size is reduced by 4 times, the channel number is increased by 4 times, and then the channel number is reduced to 2 times through a fully connected layer to reduce the size of the feature map and increase the channel number, and a feature map with a size of is obtained. Then, the feature map is input into 1 Transformer module, 1 merging layer, and 1 Transformer module, and finally the classification result is output through layer normalization, global pooling and fully connected layer. Each Transformer module is composed of a window multi-head self-attention mechanism layer and a spatial displacement sliding window multi-head self-attention mechanism layer, and the window multi-head self-attention mechanism layer and the spatial displacement sliding window multi-head self-attention mechanism layer are composed of layer normalization, window multi-head self-attention mechanism, spatial displacement sliding window multi-head self-attention mechanism and multi-layer perception through residual connection; The specific process can be represented as: , wherein respectively represent the output features of the window multi-head self-attention mechanism, the sliding window multi-head self-attention mechanism and the multi-layer perception module. S3. In the training stage, the parameters of the model are optimized using the RMSprop optimizer; S4. Parameter registration, train the model; use the trained model to classify and identify seismic signals; Batch_size = 64, epoch = 1000, Optimizer = Adam, Learning_rate = 0.001.