A machine learning-based debris flow early warning method

By processing debris flow ground motion signals using the Patch Fourier Transformer model based on Transformer, the problems of accuracy and rapid response in existing debris flow early warning methods are solved, and high-precision debris flow early warning is achieved.

CN119992763BActive Publication Date: 2026-03-24INST OF MOUNTAIN HAZARDS & ENVIRONMENT CHINESE ACADEMY OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing debris flow early warning methods rely on rainfall data or historical data, which makes it difficult to respond quickly and their accuracy is limited when the environment changes. Traditional models cannot effectively process the original waveform of vibration signals, and convolutional neural networks are prone to overfitting when reducing dimensions.

Method used

We employ the Patch Fourier Transformer (PFT) model based on Transformer, process debris flow ground motion signals through slice attention mechanism and multi-head attention mechanism, extract temporal features and embed location codes, and design a loss function for debris flow early warning.

Benefits of technology

It achieves accurate debris flow early warnings from tens of minutes to several hours in advance, with zero false alarms and zero missed alarms. It can accurately identify debris flow events in multiple instances, demonstrating its potential in practical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119992763B_ABST
    Figure CN119992763B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of debris flow early warning, and discloses a debris flow early warning method based on machine learning. The method comprises the following steps: acquiring a debris flow seismic signal; identifying the debris flow seismic signal by using a debris flow seismic signal identification model based on a slicing attention mechanism to obtain a debris flow seismic signal identification result; and performing debris flow early warning by using a set alarm threshold according to the debris flow seismic signal identification result. The present application can accurately perform early warning in multiple debris flows with a short time interval, and has potential in practical application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geological hazard identification, and specifically to a debris flow early warning method based on machine learning. Background Technology

[0002] Debris flows are highly destructive surface disasters, commonly found in mountainous or hilly areas. They are mainly composed of water, soil, rocks, and other debris, exhibiting extremely high fluidity and impact force. Due to the high degree of uncertainty and suddenness of debris flows, early warning systems are particularly important.

[0003] Traditional debris flow early warning methods mainly include: real-time triggering of warnings through rainfall monitoring, which is low-cost and simple to operate, but relies solely on rainfall data and is difficult to comprehensively assess risk; using hydrological models to simulate the relationship between rainfall and surface water, the effectiveness of which depends on data quality and is limited in accuracy when data is insufficient; and setting critical rainfall thresholds based on historical data and building early warning models by combining data from multiple sources, which, while accurate, is prone to bias when the environment changes, affecting the reliability of the warnings. Furthermore, comprehensive assessments of geological environments such as topography, soil, and vegetation can provide more complete information on debris flow susceptibility, but this is time-consuming, costly, and difficult to respond to quickly.

[0004] In recent years, machine learning methods have been gradually applied in debris flow early warning, but they still face many challenges: 1) Traditional models cannot directly process the original waveform of seismic signals, relying on manual feature extraction, which easily introduces redundant or insufficient features, leading to unreasonable inductive bias; 2) Convolutional neural networks (CNNs) require multiple layers during dimensionality reduction, which can easily lead to overfitting. To address these challenges, this invention proposes an improved Transformer-based model—Patch Fourier Transformer (PFT). PFT, through its patch attention mechanism, can effectively perceive energy changes in the time-frequency map and exhibit attention weights highly consistent with its spatiotemporal distribution. Tests were conducted using seismic data from over a dozen debris flow events in Illgraben in 2020, providing warning times ranging from tens of minutes to several hours without false alarms. The results demonstrate the significant potential and advantages of PFT in debris flow early warning tasks. Summary of the Invention

[0005] To address the aforementioned shortcomings in existing technologies, this invention provides a debris flow early warning method based on machine learning.

[0006] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows:

[0007] A debris flow early warning method based on machine learning, characterized by the following steps:

[0008] S1. Obtain debris flow ground motion signals and construct a debris flow ground motion signal recognition model based on slice attention mechanism;

[0009] S2. Based on the constructed slice attention mechanism, the debris flow ground motion signal recognition model is used to extract the temporal features of the debris flow ground motion signal and embed the location codes at different locations.

[0010] S3. A multi-head attention mechanism is used to calculate the attention weights, and the debris flow ground motion signal identification results are obtained through a fully connected layer.

[0011] S4. Based on the identification results of debris flow ground motion signals, debris flow early warning is carried out by setting alarm thresholds.

[0012] Furthermore, step S2 specifically includes the following steps:

[0013] S21. Instance normalization processing of debris flow ground motion signals is performed using a debris flow ground motion signal identification model based on slice attention mechanism.

[0014] S22. The debris flow ground motion signal is cut by overlapping sliding windows, and the Fourier transform of each cut slice is performed to obtain the slice sequence.

[0015] S23. Extract the temporal features of the slices from the Fourier transform sequence using an LSTM model and embed the positional codes of the corresponding slices.

[0016] Furthermore, step S23 specifically includes the following steps:

[0017] S231. The Fourier transform slice sequence is cut into a smaller-dimensional slice sequence by using overlapping sliding windows.

[0018] S232. Extract the temporal features of each slice in the obtained smaller dimension slice sequence through the LSTM model, so that the original slice sequence becomes a new slice sequence with smaller dimension and the same number of slices, and make the LSTM model share weights in all new slice sequences.

[0019] S233. The location information of the new slice sequence is embedded into the constructed debris flow ground motion signal identification model through location encoding.

[0020] Furthermore, the specific method of embedding in S233 is as follows:

[0021]

[0022]

[0023] In the formula, This refers to the embedding method for the current position and the corresponding dimension of the position vector. Current position It is the dimension index in the position vector. It is the dimension of the input vector.

[0024] Furthermore, the slice with embedded position encoding in S233 is represented as follows:

[0025]

[0026] In the formula, For slices after embedding position encoding, For position encoding, For slices in the new slice sequence.

[0027] Furthermore, step S3 specifically includes the following steps:

[0028] S31. Use the slice with embedded position encoding as the input to the encoder;

[0029] S32. A multi-head attention mechanism is used to transform the encoder input into a query matrix, a key matrix, and a value matrix, respectively.

[0030] S33. Calculate attention using the transformed query matrix, key matrix, and value matrix;

[0031] S34. Segment the outputs of all heads and map the segmented result to the set dimension of the constructed debris flow ground motion signal identification model through a linear layer.

[0032] S35. Design a loss function to measure the difference between the predicted probability and the true probability label, and then output the debris flow ground motion signal identification result.

[0033] Furthermore, the query matrix, key matrix, and value matrix in S32 are respectively represented as follows:

[0034]

[0035]

[0036]

[0037] In the formula, The matrix consists of the h-th head query matrix, key matrix, and value matrix, in that order. These are the linear transformation matrices of the query, key, and value corresponding to the h-th head, respectively.

[0038] Furthermore, the specific method by which the spliced ​​results are mapped to the defined dimensions of the constructed debris flow seismic signal identification model through a linear layer in S34 is as follows:

[0039]

[0040] In the formula, The matrix consists of a query matrix, a key matrix, and a value matrix, in that order. For each header's output, the subscript H represents its number. This is the weight matrix of the linear layer.

[0041] Furthermore, the loss function in S35 is expressed as:

[0042]

[0043] In the formula, N It is the sample size. It is the first The true label of each sample It is the first The predicted probability of a sample. This is the binary cross-entropy loss function.

[0044] The present invention has the following beneficial effects:

[0045] This invention is used to identify debris flows in continuous vibration signals. The PFT attention weight distribution is highly similar to the time-frequency graph. The model exhibits high accuracy in debris flow waveform identification, and can achieve zero false alarms and zero false negatives while providing warning times of tens of minutes to several hours. Furthermore, it can accurately provide warnings for multiple debris flows with short intervals, demonstrating its potential in practical applications. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of the debris flow early warning method based on machine learning according to the present invention.

[0047] Figure 2 This is a schematic diagram illustrating the performance of the model at different wavelengths in an embodiment of the present invention.

[0048] Figure 3a This is a schematic diagram illustrating the early warning time provided by different models for different debris flows in embodiments of the present invention.

[0049] Figure 3b This is a schematic diagram of the F1 and TS results of the PFT model of station ILL18 in this embodiment of the invention.

[0050] Figure 3c This is a schematic diagram of the F1 and TS results of the PFT model of station ILL13 in this embodiment of the invention.

[0051] Figure 3d This is a schematic diagram of the F1 and TS results of the PFT model of station ILL12 in this embodiment of the invention. Detailed Implementation

[0052] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0053] A machine learning-based debris flow early warning method, such as Figure 1 As shown, it includes the following steps:

[0054] S1. Obtain debris flow ground motion signals and construct a debris flow ground motion signal recognition model based on slice attention mechanism;

[0055] Because the entire dataset is imbalanced between debris flow (positive) and noise (negative) samples, to ensure the model can fully learn the waveform features of debris flows, we randomly sampled noise samples from 2017-2019 to achieve a 1:1 ratio of positive to negative samples. Subsequently, the dataset was divided into training, validation, and test sets, with proportions of 80%, 10%, and 10%, respectively. The training set is primarily used for the model to learn high-level feature representations of waveform data. The validation set is used to prevent overfitting and to preserve the optimal model state through early stopping. The test set is used for final model performance evaluation to ensure unbiased results. Data from 2020 was used to evaluate the model's continuous identification and early warning performance of vibration signals in actual operation.

[0056] This study employs a supervised learning method. The start and end times of each debris flow event in the training set are defined by timestamps. Within these time intervals, the labels of relevant samples are set to 1. Considering the uncertainty of manual annotation and the specific characteristics of debris flow events, we set linearly increasing and decreasing labels before and after the start and end of the debris flow, respectively, gradually increasing from 0 to 1 and decreasing from 1 to 0. This blurs the specific start and end times of the debris flow, enhancing the model's ability to identify event boundaries.

[0057] To obtain sufficient contextual information, the three-component waveform was divided into 5-minute long waveforms with an overlap rate of 80%, meaning that the step size for each division was 1 minute.

[0058] S2. Based on the constructed slice attention mechanism, the debris flow ground motion signal recognition model is used to extract the temporal features of the debris flow ground motion signal and embed the location codes at different locations.

[0059] The Transformer architecture using a pure encoder is primarily used for tasks that do not require sequence generation, such as text classification, entity recognition, or sentence embedding generation. In this architecture, only the encoder portion of the Transformer is included, with each encoder layer consisting of a self-attention mechanism and a feedforward network. This architecture captures the global dependencies between elements in the input sequence, enabling the generation of high-quality feature representations and effectively supporting downstream classification or other tasks.

[0060] We define the problem as follows: Given a three-component data sample Where L is the length of the waveform, our model uses ' 'express, , where C represents a classification probability for the waveform at each minute, and the model uses a Transformer encoder as our core architecture.

[0061] This embodiment specifically includes the following steps:

[0062] S21. Instance normalization processing of debris flow ground motion signals is performed using a debris flow ground motion signal identification model based on slice attention mechanism.

[0063] Instance normalization performs independent data normalization on each channel of each sample to adjust the scale and distribution of the data, making the model training process more stable and helping the model converge quickly in the early stages of training.

[0064]

[0065] in, It is the original value at time point t. and These are the mean and standard deviation of the waveform, respectively. and These are learnable scaling and offset parameters.

[0066] S22. The debris flow ground motion signal is cut by overlapping sliding windows, and the Fourier transform of each cut slice is performed to obtain the slice sequence.

[0067] For the data of each channel in the input sample (i=1,2,3), we divide it into overlapping slices, and the length of each slice is denoted as . And the step size of the slice is denoted as In this process Will become Where N is the number of slices, and N = .

[0068] In time-series models, the Fourier transform effectively captures the frequency characteristics of the data, helping the model better identify and understand the patterns hidden in the time dimension. Simultaneously, the Fourier transform can effectively separate noise, especially high-frequency noise, in the frequency domain, thereby improving signal quality. Furthermore, by transforming complex time-series data from the time domain into simple frequency components in the frequency domain, the Fourier transform simplifies data processing and reduces model complexity.

[0069] S23. Extract the temporal features of the slices from the Fourier transform sequence using an LSTM model and embed the positional codes of the corresponding slices.

[0070] The specific method is as follows:

[0071] S231. The Fourier transform slice sequence is cut into a smaller-dimensional slice sequence by using overlapping sliding windows.

[0072] S232. Extract the temporal features of each slice in the obtained smaller dimension slice sequence through the LSTM model, so that the original slice sequence becomes a new slice sequence with smaller dimension and the same number of slices, and make the LSTM model share weights in all new slice sequences.

[0073] As the sequence length increases, the dimensionality of each patch in the sequence also increases accordingly. We use LSTM to capture the dependencies in the patch sequence and preserve this key information during dimensionality reduction. For each patch: We've broken it down into a smaller patch: Where j=1,2….K are the indices of the smaller patches. For each small patch, the dimensions satisfy... Each patch becomes after passing through LSTM. Finally, the original sequence becomes LSTM shares weights across all patches.

[0074] S233. The location information of the new slice sequence is embedded into the constructed debris flow ground motion signal identification model through location encoding.

[0075] In the Transformer's attention mechanism, the calculation of attention weights is unordered, and it cannot directly capture the sequential relationship between patches in the waveform. The order of patches is particularly important for waveform recognition. Therefore, we explicitly inject the positional information of patches in the waveform into the model through positional encoding. Our embedding method is shown below:

[0076]

[0077]

[0078] in, This is the current position (index in the sequence). It is the dimension index in the position vector. It is the dimension of the input vector.

[0079] S3. A multi-head attention mechanism is used to calculate the attention weights, and the debris flow ground motion signal identification results are obtained through a fully connected layer.

[0080] This embodiment specifically includes the following steps:

[0081] S31. Use the slice with embedded position encoding as the input to the encoder;

[0082] The Transformer architecture using a pure encoder is primarily used for tasks that do not require sequence generation, such as text classification, entity recognition, or sentence embedding generation. In this architecture, only the encoder portion of the Transformer is included, with each encoder layer consisting of a self-attention mechanism and a feedforward network. This architecture captures the global dependencies between elements in the input sequence, enabling the generation of high-quality feature representations and effectively supporting downstream classification or other tasks.

[0083] S32. A multi-head attention mechanism is used to transform the encoder input into a query matrix, a key matrix, and a value matrix, respectively.

[0084] For each input token, compute Query, Key, and Value vectors, which are obtained through a linear transformation (weight matrix), the size of which is... Therefore, the complexity of calculating Query, Key, and Value is .

[0085] For each query, a dot product is performed with all other keys to obtain an attention score matrix of size . Therefore, the complexity of the dot product is... .

[0086] Calculating the Softmax for each query to obtain the weights also has a complexity of [missing information]. .

[0087] The output of each query is a weighted sum of all values. The complexity of this weighted summation is O(n log n). Because the output at each position needs to be combined with... Perform a weighted summation on each Value.

[0088] Therefore, the total complexity of a single Self-Attention calculation is:

[0089] S33. Calculate attention using the transformed query matrix, key matrix, and value matrix;

[0090] Each Transformer layer also contains a feedforward network, typically consisting of two linear transformations and an activation function (such as ReLU). Assume the hidden layer dimension of each layer is... (generally The computation process of the Feedforward network includes:

[0091] The first linear transformation: from dimension Switch to The computational complexity is .

[0092] Activation function: Assume the complexity of the activation function is constant. The complexity of this operation is .

[0093] The second linear transformation: from Convert back The computational complexity is .

[0094] Therefore, the total complexity of the Feedforward network is: .

[0095] Space complexity mainly consists of the following parts:

[0096] Input and output storage: The input and output of each token need to be stored, therefore the space complexity of the input and output is O(n log n). .

[0097] The weight matrix for Self-Attention: Self-Attention needs to store one... The attention score matrix has a space complexity of O(n). .

[0098] Parameters of the Feedforward network: The Feedforward network has two linear transformation weight matrices, namely... and Therefore, the space complexity is .

[0099] Therefore, the space complexity of each layer is: .

[0100] in, It is the number of layers in the Transformer. It is the length of the input sequence. It is the hidden layer dimension. It is the hidden layer dimension of the Feedforward network.

[0101] When we divide a one-dimensional sequence into slices and consider the stride... In this case, the partitioning method will differ from the case without using a step size. Step size This represents the distance between two consecutive patches, typically with a step size smaller than the patch length. (Also known as "overlapping"). This method is similar to the operation of a sliding window.

[0102] To calculate the number of patches after partitioning, we can derive a formula based on the step size and patch length. The sequence length... It will be divided into multiple patches, with each patch starting at position 0. , ..., until the starting position of the last patch does not exceed... Therefore, the number of patches after partitioning is: .

[0103] Considering step size In this case, the time complexity of Self-Attention depends on the new sequence length. and the dimensions of each patch The time complexity of each layer of Self-Attention is still... The space complexity is

[0104] S34. Segment the outputs of all heads and map the segmented result to the set dimension of the constructed debris flow ground motion signal identification model through a linear layer.

[0105] After calculating the positional encoding of the patches at different locations, we first pass them through a linear layer. Projected into the feature space of our model And embed positional encoding, i.e. ,here , Then As input to the encoder, our attention mechanism employs multi-head attention (Figure c) to enable the model to capture different features and dependencies of the input data from different perspectives or subspaces. We use multi-head attention as the input to the encoder. We use 1, 2, 3…H to represent the number of heads, where each head will transform its input into a Query, Key, and Value matrix respectively: , as well as ,in , , Then, by calculating its attention :

[0106]

[0107] The outputs of all the heads are then concatenated, and the concatenated result is mapped to the required dimension of the model through a linear layer:

[0108]

[0109] in The output of each head, Finally, we pass it through a feedforward layer to obtain the classification results of the waveform for each minute: ,in .

[0110] S35. Design a loss function to measure the difference between the predicted probability and the true probability label, and then output the debris flow ground motion signal identification result.

[0111] We use BCELoss (Binary Cross-Entropy Loss) as the loss function in our classification problem to measure the difference between the predicted probability and the true probability label, as expressed below:

[0112]

[0113] in, N It is the sample size. It is the first The true label of each sample It is the first The predicted probability of a sample.

[0114] Because debris flows differ from earthquakes (point sources) in that they are moving line sources, collisions between particles within the fluid, as well as collisions between particles and the riverbed, cause debris flows to continuously radiate surface waves as they move through the channel. To capture contextual information of varying lengths, the experiment maintained the same training samples for different models, but the sample lengths varied across models. Validation results on the 2017-2019 dataset are as follows: Figure 2 As shown:

[0115] pass Figure 2 It can be observed that the F1 score and accuracy generally show an upward trend between 1 and 5 minutes. This indicates that when the waveform is appropriately extended, the waveform itself can provide more contextual information to help the model learn. When the waveform is longer than 5 minutes, the overall performance decreases. This shows that excessively long waveforms firstly lead to a significant increase in the number of model parameters, and due to the limited training samples, they are prone to underfitting. Secondly, larger windows may introduce more noise or cause information overload in some cases, thereby reducing the model's recognition accuracy.

[0116] When using short waveforms (<3 min) as input, the 1 min model exhibits high recall but low precision, indicating that it performs well in identifying debris flow events at this waveform length. However, it also misclassifies a large number of negative samples (non-debris flow events) as positive samples. The 2 min model shows high precision but low recall, indicating that it is very accurate in identifying positive samples, but misses a significant number of positive samples. When the waveform is appropriately lengthened (3-5 min), the difference between recall and precision tends to decrease. However, when the waveform becomes too long (>5 min), this difference gradually amplifies, meaning that the model is very cautious in identifying positive samples and will only identify the waveform as positive when it is very certain. Among the tested waveform lengths, the 5 min waveform strikes a good balance between recall (0.955) and precision (0.959), indicating that a good balance is achieved between the false negative rate and the false positive rate in actual early warning systems.

[0117] These experimental results clearly demonstrate the advantages of the PFT model in several aspects of debris flow early warning tasks: Unlike traditional models that require complex feature engineering, the PFT model can directly extract key features of the time series from the original waveform without human intervention. This gives the model a stronger ability to capture latent patterns in the data, and the PFT model can not only adapt to different time windows of varying lengths but also maintain relatively stable performance at appropriate time scales (2-5 minutes), with PFT_5min showing the best performance.

[0118] To more intuitively see the overall performance of the PTF model and its classification performance for each category, we calculated the ROC curve and the confusion matrix: the former is a tool used to evaluate the performance of a classification model by showing the relationship between the model's false positive rate (FPR) and true positive rate (TPR); the latter displays the comparison between the model's predictions and actual results in matrix form to analyze the model's correct and incorrect classifications.

[0119] The True Positive Rate (TPR) represents the proportion of positive classes that are correctly classified, also known as recall or sensitivity; the False Positive Rate is the proportion of incorrect model judgments to the true negative values.

[0120] ,

[0121] Where TP is the number of correctly predicted positive classes, FN is the number of classes that were actually positive but were predicted as negative classes, FP is the number of classes that were actually negative but were predicted as positive classes, and TN is the number of correctly predicted negative classes.

[0122] The confusion matrix reveals that when the waveform is less than 5 minutes long, appropriately extending the waveform is beneficial for identifying positive examples (debris flow) (0.93->0.95). When the waveform is longer than 5 minutes long, its ability to identify positive examples decreases, but the model performs more accurately in identifying negative samples (0.97->0.99). This may be because when the debris flow waveform is too long, the dynamic process of the debris flow itself changes (such as erosion), causing differences in the debris flow signal before and after in the waveform, thus reducing the model's accuracy.

[0123] Overall, the PFT-based model demonstrates strong robustness in debris flow classification tasks, especially at a wavelength of 5 minutes. At this wavelength, the model has a high ability to identify both positive and negative samples, which can effectively reduce the risk of missed and false alarms in subsequent early warning tasks.

[0124] S4. Based on the identification results of debris flow ground motion signals, debris flow early warning is carried out by setting alarm thresholds.

[0125] Based on debris flow signal identification, real-time early warning of debris flows was further developed. In 12 events in 2020, PFT provided warning times ranging from 24 minutes to 170 minutes. Among them, the warning time was better than RF and LSTM in 11 events (except for June 17, 2020 (2)) and better than XGB in 9 events (except for June 4, 6.8 (1) and 6.17, 2020). Figure 3a As shown.

[0126] The model did not issue any alarms later than the arrival location of the debris flow front (delayed alarms), and there were no missed or false alarms. For the manually-based model, although LSTM's recognition performance was better than the tree model (RF, XGB) under feature A, delayed alarms of 54 minutes and 32 minutes occurred in the 2020-06-04 and 2020-08-30 events, respectively (alarm time later than the arrival location of the debris flow front). Although RF and XGB's recognition performance was similar, delayed alarms also occurred in these two events. When feature B was used, the warning performance of both the tree model and LSTM was significantly improved, with an overall increase of 38.3% in warning time. When feature C was used, the warning time of XGB and LSTM was further improved, with overall increases of 0.6% and 5.5%, respectively. This indicates that Benford's Law is not suitable for use alone for early warning. After feature selection, the warning time of the three models decreased by 11%, 24.2%, and 22.5%, respectively, indicating that even features with lower weights can play a role in actual model operation. Furthermore, RF-A and LSTM-ABD exhibited underreporting in a minor flood event on June 9, 2020; whereas our model accurately identifies such challenging events.

[0127] Even with multiple debris flow events spaced close together, the PFT model can accurately identify them. For example, the 95-minute time difference between the two events on June 8, 2020, resulted in a significant separation in the predictions from different stations, indicating that the model could identify the boundary between the two events. However, for events with shorter time intervals, such as the two events on June 17, 2020 (40 minutes apart), ILL12's predictions consistently maintained high confidence, while ILL18 and ILL13 showed some separation. Through cross-validation between stations, the model can accurately distinguish between different events.

[0128] The alarm threshold has a significant impact on the actual early warning results. When the threshold is too small, even if multiple stations can reduce false alarms through cross-validation, frequent false alarms may still occur. For example, when the threshold is set to 1, although the warning time can be advanced by about ten minutes, the false alarm rate will increase significantly. Conversely, when the threshold is set too large, although false alarms can be effectively avoided, it can easily lead to missed alarms for small debris flow events. However, in actual early warning scenarios, there is a significant spatiotemporal correlation between the labels of consecutive samples in continuous waveform data, meaning that the labels of a certain moment and its neighboring moments are often highly similar. Therefore, an inappropriate threshold has a significant impact on the results. Furthermore, when a single station independently performs a debris flow early warning task, simply increasing the threshold (<15) cannot completely eliminate false alarms. When the threshold exceeds 10, the missed alarm rate and F1 score of a single station tend to stabilize. Therefore, the alarm threshold of the first station is set to 10 to ensure the stability and reliability of the model. Considering the cross-validation mechanism between stations, to further extend the warning time, the threshold of the remaining stations is set to 5. With this configuration, the model can effectively avoid false alarms while ensuring that the warning time is not too short.

[0129] Furthermore, to evaluate model performance, we compared the results of PFT with those of models based on handcrafted features. See Figures 3b-3dAmong the Benford Law features (feature A), the LSTM model performed best, with F1=0.8451 and TS=0.7318 at station ILL18, F1=0.8193 and TS=0.6939 at station ILL12, and F1=0.8432 and TS=0.7290 at station ILL13, indicating that LSTM is more suitable for capturing time dependencies. The XGB and RF models performed similarly at each station, but were slightly inferior to LSTM. When using feature B (waveform, spectrum, etc.), the performance of tree models (XGB, RF) improved significantly, especially XGB at station ILL18 with F1=0.8616 and TS=0.7569. However, the performance of LSTM decreased at stations ILL18 and ILL13, indicating that it may be affected by overfitting. Feature C (AB hybrid feature) kept the tree model's performance unchanged, while LSTM improved performance across all stations, especially at station ILL12 with F1=0.9274 and TS=0.8646, indicating that LSTM could better utilize the complementarity between features. Finally, feature D (selection feature) negatively impacted the tree model, decreasing XGB's F1 and TS, while LSTM showed improved performance at stations ILL18 and ILL13 with F1=0.8954 and TS=0.8106 and F1=0.8945 and TS=0.8092 respectively, showing that selection feature is beneficial to LSTM. PFT performed relatively stably across different stations, especially at station ILL13, where FP reached its best value of 0 (see Table 1 for positive and negative example classification results of different models), and both F1 and TS exceeded all models: 0.9864 and 0.9732 respectively. It also outperformed the manually-based model at stations ILL12 and ILL18, and the model exhibited high stability across different stations. The model's precision and recall were measured. A high F1 score indicates that it can accurately identify debris flow events while effectively avoiding false positives and false negatives, which are especially important in the context of debris flow early warning. A high TS value indicates that the model can accurately identify debris flow samples and has a high degree of consistency with the actual values.

[0130] Table 1. Comparison of waveform recognition results of the PFT model in 2020 with all results based on artificial features.

[0131]

[0132] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0133] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0134] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0135] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

[0136] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

Claims

1. A debris flow early warning method based on machine learning, characterized in that, Includes the following steps: S1. Obtain debris flow ground motion signals and construct a debris flow ground motion signal recognition model based on slice attention mechanism; S2. Based on the constructed slice attention mechanism, the debris flow ground motion signal recognition model extracts the temporal features of the debris flow ground motion signal and embeds location codes at different locations. Specifically, this includes the following steps: S21. Instance normalization processing of debris flow ground motion signals is performed using a debris flow ground motion signal identification model based on slice attention mechanism. S22. The debris flow ground motion signal is cut by overlapping sliding windows, and the Fourier transform of each cut slice is performed to obtain the slice sequence. S23. Extract the temporal features of the slices from the Fourier transform sequence using an LSTM model, and embed the positional codes of the corresponding slices. This includes the following steps: S231. The Fourier transform slice sequence is cut into a smaller-dimensional slice sequence by using overlapping sliding windows. S232. Extract the temporal features of each slice in the obtained smaller dimension slice sequence through the LSTM model, so that the original slice sequence becomes a new slice sequence with smaller dimension and the same number of slices, and make the LSTM model share weights in all new slice sequences. S233. The location information of the new slice sequence is embedded into the constructed debris flow ground motion signal identification model through location encoding. The specific embedding method is as follows: In the formula, This refers to the embedding method for the current position and the corresponding dimension of the position vector. Current position It is the dimension index in the position vector. It is the dimension of the input vector; S3. A multi-head attention mechanism is used to calculate the attention weights, and the debris flow ground motion signal identification results are obtained through a fully connected layer. S4. Based on the identification results of debris flow ground motion signals, debris flow early warning is carried out by setting alarm thresholds.

2. The debris flow early warning method based on machine learning according to claim 1, characterized in that, The slice with embedded position encoding in S233 is represented as follows: In the formula, For slices after embedding position encoding, For position encoding, For slices in the new slice sequence.

3. The debris flow early warning method based on machine learning according to claim 2, characterized in that, S3 specifically includes the following steps: S31. Use the slice with embedded position encoding as the input to the encoder; S32. A multi-head attention mechanism is used to transform the encoder input into a query matrix, a key matrix, and a value matrix, respectively. S33. Calculate attention using the transformed query matrix, key matrix, and value matrix; S34. Segment the outputs of all heads and map the segmented result to the set dimension of the constructed debris flow ground motion signal identification model through a linear layer. S35. Design a loss function to measure the difference between the predicted probability and the true probability label, and then output the debris flow ground motion signal identification result.

4. The debris flow early warning method based on machine learning according to claim 3, characterized in that, The query matrix, key matrix, and value matrix in S32 are respectively represented as follows: In the formula, The lookup matrix, key matrix, and value matrix for the h-th head are, in order. The linear transformation matrix consists of the query matrix, key matrix, and value matrix of the h-th head, in that order.

5. The debris flow early warning method based on machine learning according to claim 3, characterized in that, The specific method by which the stitched result is mapped to the defined dimension of the constructed debris flow seismic signal identification model through a linear layer in S34 is as follows: In the formula, The matrix consists of a query matrix, a key matrix, and a value matrix, in that order. For each header's output, the subscript H represents its number. This is the weight matrix of the linear layer.

6. The debris flow early warning method based on machine learning according to claim 3, characterized in that, The loss function in S35 is expressed as follows: In the formula, N It is the sample size. It is the first The true label of each sample It is the first The predicted probability of a sample. This is the binary cross-entropy loss function.

Citation Information

Patent Citations

  • Sequence-to-sequence multi-step flood forecasting method and device based on space-time attention

    CN115630723A

  • Intelligent debris flow disaster forecasting method based on real-time rainfall monitoring

    CN118484735A