Small sample unequal-length infrasound event classification method
By combining Siamese networks with a dynamic masking mechanism, the problems of noise and information loss in infrasound event classification are solved, achieving efficient classification of infrasound events of unequal length, improving classification accuracy and reducing training time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-24
AI Technical Summary
Existing infrasound event classification methods are prone to introducing noise and information loss when dealing with infrasound signals of unequal length. Furthermore, deep learning-based models have low computational efficiency when dealing with long-distance features and cannot effectively mask invalid features in filled regions, leading to a decrease in classification accuracy.
We employ a twin network structure combined with a dynamic masking mechanism. We extract local features through CNN and use Transformer to capture long-range dependencies. The dynamic masking mechanism accurately masks the filling regions and generates fixed-dimensional embedding vectors. We then combine metric learning for classification.
It improves the accuracy of classifying infrasound events of unequal length, reduces training time, avoids noise and information loss caused by padding and truncation, and achieves fast and efficient classification.
Smart Images

Figure CN121723261A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of infrasound signal classification technology, specifically relating to a method for classifying infrasound events of unequal length with small samples. Background Technology
[0002] Infrasound is a type of sound wave with a frequency below 20Hz. It is characterized by its low frequency, long propagation distance, and strong penetrating power. It is widely used in research on explosion and rocket launch monitoring and natural disaster prevention. In actual infrasound monitoring, the generation mechanism and environment of infrasound events are different, resulting in significant differences in the duration of the infrasound events. For example, lightning and mudslides are affected by the propagation distance. Even if the event type is the same, the duration of the infrasound signal collected by the sensor will be different.
[0003] Currently, the main classification methods for infrasound events are machine learning classification methods based on feature extraction and classification methods based on deep learning. Machine learning classification methods based on feature extraction rely heavily on experience to select appropriate features, while classification models based on deep learning require the same input dimension during batch training. When dealing with infrasound events of unequal length, methods often use padding and truncation to make the data equal in length. Although this method is easy to implement, it will introduce a lot of noise and information loss.
[0004] Infrasound event classification often employs a combination of CNNs and gated recurrent networks (such as LSTM or GRU) to fully extract local and global features. This approach yields better results than using CNNs or gated recurrent networks alone. However, gated recurrent networks suffer from drawbacks such as stepwise recursion, poor parallelism, low computational efficiency, and information decay when sequences are long. Transformers, on the other hand, offer advantages such as parallelization, high computational efficiency, the ability to directly establish dependencies between arbitrary positions, significantly enhanced long-distance feature capture capabilities, and support for masking mechanisms. In hybrid architectures combining CNN downsampling, directly using the mask matrix generated from the original input sequence ignores the scale compression and boundary shifts caused by convolution and pooling operations on the temporal structure. This results in a mismatch between the mask and the downsampled feature sequence in the temporal dimension. Although Transformers natively support masking mechanisms, inaccurate masks cannot effectively shield invalid features corresponding to the filled regions, thus weakening the model's ability to process infrasound signals of varying lengths. Summary of the Invention
[0005] The purpose of this invention is to provide a simple and rationally designed method for classifying infrasound events of unequal length in small samples in order to solve the above-mentioned problems.
[0006] The present invention achieves the above objectives through the following technical solutions:
[0007] A method for classifying infrasound events with small sample sizes and varying lengths includes: Step 1, infrasound signal acquisition; Step 2, Siamese network input; Step 3, data downsampling; Step 4, dependency capture; Step 5, attention weight calculation; and Step 6, classification head category output.
[0008] In step one above, the infrasound signal corresponding to the infrasound event collected by the station is obtained;
[0009] In step two above, the two subnetworks of the Siamese network are input in the form of sample pairs. The data is padded with 0s according to the length of the data to make the data length in a batch the same and generate a mask matrix that reflects the true situation of the data as shown in formula (1):
[0010]
[0011] In formula (1) The first of each sample sequence Sampling points, sequence is , In each sample, the th The labeling of sampling points, the mask matrix ;
[0012] In step three above, a CNN module based on a mask mechanism is used to extract local features of the signal and downsample the data. The mask matrix is adjusted according to the parameters operated on in the CNN module for each output position. , The length of the output after convolution or pooling; the validity of the data at position t should be considered in relation to the validity of all data within the entire receptive field, and its corresponding input window. As shown in formula (2):
[0013]
[0014] In formula (2) The stride of the convolution or pooling operation. For fill size, To sense the offset within the field, The size of the convolution kernel or pooling layer;
[0015] In step four above, the Transformer is used to capture long-distance dependencies under the guidance of the updated mask matrix;
[0016] In step five above, the AttentionPooling module, guided by the updated mask matrix, is used to process the content corresponding to each time step of the Transformer output. The attention weights are calculated as shown in Equations (4) and (5), and then a weighted sum is obtained to obtain a fixed-dimensional embedding vector. Completely eliminate the filled part, as shown in formula (6);
[0017] In step six above, the bulldozer distance is calculated from the fixed-dimensional embedding vectors obtained in the previous steps for the two twin sub-networks. Metric learning is performed, and a classification head is used to output the category. The classification head is shown in formula (7), and the bulldozer distance is shown in formula (8). After backpropagation based on the total loss composed of the classification-based cross-entropy loss and the metric-based contrastive loss, the optimizer updates the model parameters. The cross-entropy loss... Comparison of losses Total losses As shown in formula (9-11).
[0018] Preferably, in step two, L is the data length of the longest sample sequence within a batch. It has the same length as the mask matrix m.
[0019] Preferably, in step three, the mask matrix is updated and passed according to the parameters operated in the CNN module, including the convolution kernel and pooling size, padding, and stride size.
[0020] Preferably, in step three, if If the memory contains the index corresponding to the real data, then the mask matrix will pass the T tag, and the passing of the mask matrix is as shown in formula (3):
[0021]
[0022] In formula (3) This is the label for the t-th position in the updated mask matrix.
[0023] Preferably, in step five, the weight calculation is as follows:
[0024]
[0025] In formula (4) and For matrix parameters, and For bias terms, It is a non-linear activation function. The original attention at the h-th time step.
[0026] Preferably, in step five, the weight calculation formula is: (5) Equation (5) The attention weights after normalization of the original attention are given by formula (6): .
[0027] Preferably, in step six, formula (7) is:
[0028]
[0029] Equation (7) and For matrix parameters, and For bias terms, For layer normalization, formula (8) is:
[0030]
[0031] In formula (8) For bulldozer distance, This indicates the removal of the boundary. Represents all that satisfy the marginal distribution as and The joint distribution set, Indicates from the joint distribution A pair of points obtained from mid-sampling The distance between them Indicates in joint distribution Below, the expected value of the distance between sample pairs.
[0032] Preferably, in step six, formula (9) is:
[0033]
[0034] In equation (9) For cross loss, To represent the one-hot encoding of the real label, To predict the probability of events for the model.
[0035] Preferably, in step six, formula (10) is:
[0036]
[0037] In formula (10) To compare the losses, The distance between two embedding vectors is a metric. This is the similarity label for the sample pair; 1 is assigned when the two samples belong to the same category, and 0 is assigned when they belong to different categories.
[0038] Preferably, in step six, formula (11) is: .
[0039] The beneficial effects of this invention are as follows:
[0040] 1. This invention uses a dynamic masking mechanism to accurately mask the filled regions, enabling the model to effectively model long-distance dependencies while extracting local features. By combining fixed-dimensional embedding vectors generated only based on the true part of the signal with a Siamese network based on metric learning, it can quickly classify infrasound events of varying lengths in small samples, avoiding noise and information loss caused by padding and truncation. In addition, this method adopts an end-to-end approach, eliminating the need for empirically designed extracted features, and can directly classify infrasound events.
[0041] 2. This invention classifies infrasound data collected from real stations based on a combination of dynamic masking and twin networks. The proposed method can focus on the true part of the infrasound signal, eliminate the adverse effects of padding and truncation, and improve the accuracy of classifying infrasound events of unequal length. This method can also converge faster while maintaining high accuracy and reducing training time. Attached Figure Description
[0042] Figure 1 This is a flowchart of the classification method based on dynamic masking and Siamese networks of the present invention;
[0043] Figure 2 This is a training and verification curve diagram of the present invention with and without dynamic masking;
[0044] Figure 3 This is a verification curve diagram showing whether or not the present invention has a twin structure. Detailed Implementation
[0045] The present application will now be described in further detail with reference to the accompanying drawings. It should be noted that the following specific embodiments are only used to further illustrate the present application and should not be construed as limiting the scope of protection of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application based on the above application content.
[0046] Example: Please refer to Figure 1 , Figure 2 and Figure 3 A method for classifying infrasound events of unequal length in a small sample, comprising the following steps:
[0047] The first step is to acquire infrasound data collected by real stations. The infrasound data used in this embodiment comes from an infrasound detection array in Hungary. This dataset contains three types of infrasound signals: quarry explosion infrasound (QB), storm infrasound (WSS), and power plant infrasound (MPP). There are 500 samples for each type of event, for a total of 1,500 samples. The sampling frequency of the signals is 100Hz.
[0048] The second step is to set the learning rate (lr) of the experiment to 0.0001, the batch size to 32, the number of iterations to 30, and the optimizer to Adam.
[0049] The third step involves padding the data as in step two to ensure equal length, generating a mask matrix that reflects both the actual data and the padding. A CNN module is then used to extract local features. After one convolution or pooling operation, step three is performed on the mask matrix, inputting... In the process, updates and propagation are performed to provide precise guidance for distinguishing between real and filled data for downstream tasks. The CNN module contains two convolutional blocks, each of which contains a convolutional layer, batch normalization, non-linear activation (GELU), random dropout neurons, and max pooling. The parameters are shown in Table 1.
[0050] Fourth, the updated mask matrix is used to guide the model to perform steps four and five. The Transformer captures long-distance dependencies, and the AttentionPooling aggregates the content corresponding to each time step to obtain a fixed-dimensional embedding vector y, which contains a fully connected layer 1, a non-linear activation, a fully connected layer 2, and a weighted aggregation part of the input. The parameters of Transformer and AttentionPooling are shown in Table 2.
[0051] Step 5: Using the dataset obtained in Step 1, we verify whether dynamic masking can improve the classification of infrasound events of unequal length. Without using a Siamese network structure, we directly classify the fixed-dimensional y obtained from AttentionPooling in Step 5 using the classification head. The classification head consists of a fully connected layer 3, non-linear activation (GELU), randomly dropped neurons, layer normalization, and a fully connected layer 4. The parameters are shown in Table 3. In the experiment, the ratio of training set to validation set was 2:1. The classification results are shown in Table 3. Figure 2 As shown, Figure 2 The solid line represents the training accuracy, the dashed line represents the test accuracy, the blue curve represents the result without dynamic masking, and the orange curve represents the result with dynamic masking. As can be seen from the figure, the orange dashed line is significantly higher than the blue dashed line and is significantly more stable. Under the same dataset and model conditions, the validation set accuracy with dynamic masking is 95%, while the validation set accuracy without dynamic masking is 85%. The validation set accuracy with dynamic masking is significantly higher than that without dynamic masking, and the training is more stable, proving that dynamic masking effectively mitigates the adverse effects of padding and truncation on classification.
[0052] Step 6, refer to Figure 1The twin structure is then used to execute step six, employing the infrasound data obtained in step one to verify whether the twin structure can accelerate convergence. The training set contains 40 events for each class, and the validation set contains 430 events for each class. The classification results are as follows: Figure 3 As shown, Figure 3 The red curve represents the results with twin structure, and the blue curve represents the results without twin structure. Both models can achieve a validation set accuracy of 89% with a small sample size. The model with twin structure begins to converge around the 7th round, while the model without twin structure begins to converge around the 25th round. The training curve with twin structure is more stable with a small sample size than the curve without twin structure, proving that twin structure can converge faster while maintaining high accuracy and reducing training time.
[0053] Table 1
[0054]
[0055] Table 2
[0056]
[0057] Table 3
[0058]
[0059] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A method for classifying infrasound events with small sample sizes and varying lengths, comprising: Step 1, infrasound signal acquisition; Step 2, Siamese network input; Step 3, data downsampling; Step 4, dependency capture; Step 5, attention weight calculation; Step 6, classification head category output; characterized in that: In step one above, the infrasound signal corresponding to the infrasound event collected by the station is obtained; In step two above, the two subnetworks of the Siamese network are input in the form of sample pairs. The data is padded with 0 according to the length of the data to make the data length in a batch the same and generate a mask matrix that reflects the true situation of the data as shown in formula (1): In formula (1) The first of each sample sequence Sampling points, sequence is , In each sample, the th The labeling of sampling points, the mask matrix ; In step three above, a CNN module based on a mask mechanism is used to extract local features of the signal and downsample the data. The mask matrix is adjusted according to the parameters operated on in the CNN module for each output position. , The length of the output after convolution or pooling; the validity of the data at position t should be considered in relation to the validity of all data within the entire receptive field, and its corresponding input window. As shown in formula (2): In formula (2) The stride of the convolution or pooling operation. For fill size, To sense the offset within the field, The size of the convolution kernel or pooling layer; In step four above, the Transformer is used to capture long-distance dependencies under the guidance of the updated mask matrix; In step five above, the AttentionPooling module, guided by the updated mask matrix, is used to process the content corresponding to each time step of the Transformer output. The attention weights are calculated as shown in Equations (4) and (5), and then a weighted sum is obtained to obtain a fixed-dimensional embedding vector. Completely eliminate the filled part, as shown in formula (6); In step six above, the bulldozer distance is calculated from the fixed-dimensional embedding vectors obtained in the previous steps for the two twin sub-networks. Metric learning is performed, and a classification head is used to output the category. The classification head is shown in formula (7), and the bulldozer distance is shown in formula (8). After backpropagation based on the total loss composed of the classification-based cross-entropy loss and the metric-based contrastive loss, the optimizer updates the model parameters. The cross-entropy loss... Comparison of losses Total losses As shown in formula (9-11).
2. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step two, L represents the data length of the longest sample sequence within a batch. It has the same length as the mask matrix m.
3. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step three, the mask matrix is updated and passed on according to the parameters operated on in the CNN module, including the convolution kernel and pooling size, padding, and stride size.
4. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step three, if If the memory contains the index corresponding to the real data, then the mask matrix will pass the T tag, and the passing of the mask matrix is as shown in formula (3): In formula (3) This is the label for the t-th position in the updated mask matrix.
5. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step five, the weight is calculated as shown in formula (4): In formula (4) and For matrix parameters, and For bias terms, It is a non-linear activation function. The original attention at the h-th time step.
6. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step five, the weight calculation formula is: (5) Equation (5) The attention weights after normalization of the original attention are given by formula (6): .
7. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step six, formula (7) is: Equation (7) and For matrix parameters, and For bias terms, For layer normalization, formula (8) is: In formula (8) For bulldozer distance, This indicates the removal of the boundary. Represents all that satisfy the marginal distribution as and The joint distribution set, Indicates from the joint distribution A pair of points obtained from mid-sampling The distance between them Indicates in joint distribution Below, the expected value of the distance between sample pairs.
8. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step six, formula (9) is: In equation (9) For cross loss, To represent the one-hot encoding of the real label, To predict the probability of events for the model.
9. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step six, formula (10) is: In formula (10) To compare the losses, The distance metric between two embedding vectors. This is the similarity label for the sample pair; 1 is assigned when the two samples belong to the same category, and 0 is assigned when they belong to different categories.
10. The method for classifying infrasound events of unequal length in small samples according to claim 1, characterized in that: In step six, formula (11) is: .