Multi-head attention mechanism and bidirectional long and short term memory event identification method, system and device, and medium

By combining a multi-head attention mechanism with a bidirectional long short-term memory network model, the time-series processing and feature selection problems of the traditional LSTM algorithm in power optical cable line monitoring are solved, achieving higher recognition accuracy and lower false alarm rate, and providing a more reliable event recognition solution for power systems.

CN120995295APending Publication Date: 2025-11-21GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510858060.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Traditional LSTM algorithms suffer from low time-series processing efficiency, weak feature selection ability, and insufficient modeling of long-term dependencies in the monitoring of natural disasters along power and optical fiber lines, resulting in low recognition accuracy and high false alarm rate.

Method used

We employ a multi-head attention mechanism and a bidirectional long short-term memory network model. By constructing bidirectional LSTM layers and multi-head attention layers, combined with data preprocessing, we optimize model training and validation. We use cross-entropy loss function and Adam optimizer to prevent overfitting and improve the accuracy of feature extraction and recognition.

Benefits of technology

It significantly improves the accuracy of identifying events such as rodent infestation, ice storms, joint damage, and lightning strikes, reduces the false alarm rate, ensures the robustness and generalization ability of the model, and provides more accurate fiber optic sensing monitoring of power systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120995295A_ABST
    Figure CN120995295A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of deep learning and distributed optical fiber research, and discloses an event identification method, system and device based on a multi-head attention mechanism and bidirectional long and short term memory, and a medium, and the method comprises the steps: obtaining various phase-sensitive optical time domain reflectometer data related to a task, and carrying out the first processing; constructing a bidirectional long-short-term memory network model based on a multi-head attention mechanism, and inputting the data after the first processing into the bidirectional long-short-term memory network model for training and verification; and outputting the trained event identification model for classifying and identifying the optical fiber sensing event. According to the method, the importance of time sequence characteristics in data processing is fully considered, and key information data are focused through an attention mechanism, so that the recognition precision is improved, and false alarms are reduced. Compared with the prior art, the method has the advantages that the event identification accuracy is remarkably improved, and a more accurate and reliable event identification solution is provided for optical fiber sensing monitoring of a power system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of deep learning and distributed optical fiber research, and particularly relates to a method, system and device for event recognition based on a multi-head attention mechanism and a bidirectional long short-term memory, and a medium. BACKGROUND

[0002] With the rapid development of the power industry, the high stability of the power system requires the power generation, transmission and distribution system to have high automation performance. In order to enable the power system to quickly handle emergency situations and provide a quick response to the power market and power company services, it is extremely important to deploy intelligent communication infrastructure to provide timely and effective power dispatching and other related information. In the power communication network, optical fibers not only serve as carriers for power communication, but also serve as carriers for optical fiber sensing in online monitoring of the power system. In the transmission network, the huge optical fiber communication network formed by various types of optical cable lines can develop into a sensing network for online monitoring and become an important part of the power system Internet of Things.

[0003] As an important infrastructure in modern society, the power grid ensures people's daily life and economic activities. It carries the transmission and distribution of electricity, supporting industrial, commercial and residential electricity demand. The stable operation of the power grid is the premise of social work, and any failure or interruption can bring huge economic losses and social impact. Therefore, it is crucial to ensure the safety and reliability of the power grid. Preventing lightning strikes, icing and other natural disasters is a necessary measure to protect the stable operation of the power grid. Lightning strikes can cause damage to power facilities and even trigger large-scale power outages, affecting power supply. Icing can cause transmission line breakage or tower tilting, and in severe cases, it can cause large-scale power outages and equipment damage. Therefore, it is particularly important to develop an efficient and accurate algorithm for identifying icing, lightning strikes and other natural disasters on optical cable lines.

[0004] Traditional LSTM algorithms can only sequentially process data and rely on the time sequence of input sequences for information transmission. Moreover, the LSTM algorithm itself does not have a mechanism to automatically select and weight the most important information in the input sequence. In addition, there are still certain limitations in capturing long-term dependencies. SUMMARY

[0005] In view of the above existing problems, the present application is proposed.

[0006] Therefore, the present application provides a method, system, device and medium for event recognition based on a multi-head attention mechanism and a bidirectional long short-term memory, aiming to solve the problems of low time sequence processing efficiency, weak feature selection ability and insufficient long-term dependency modeling of traditional LSTM algorithms in the monitoring of natural disasters on power optical cable lines, thereby improving the intelligent recognition and early warning capability of the power grid against disasters such as icing and lightning strikes.

[0007] To solve the above technical problems, the present application provides the following technical solutions:

[0008] In a first aspect, the present application provides a method for event recognition based on multi-head attention mechanism and bidirectional long short-term memory, comprising:

[0009] Obtaining multiple phase-sensitive optical time domain reflectometry data related to a task and performing a first processing;

[0010] Building a bidirectional long short-term memory network model based on multi-head attention mechanism, inputting the first processed data into the bidirectional long short-term memory network model for training and verification;

[0011] Outputting the trained event recognition model for classifying and recognizing optical fiber sensing events.

[0012] As a preferred solution of the method for event recognition based on multi-head attention mechanism and bidirectional long short-term memory, the bidirectional long short-term memory network model based on multi-head attention mechanism comprises:

[0013] Designing a network input layer and configuring input nodes matching the dimension of the first processed data;

[0014] Building a bidirectional LSTM layer containing forward and reverse processing paths, wherein each LSTM unit contains a forget gate, an input gate and an output gate to control information flow;

[0015] Adding a multi-head attention layer after the bidirectional LSTM layer to capture the feature relationship of different subspaces through parallel calculation of multiple attention heads;

[0016] Adding a Dropout layer before the fully connected layer and setting an appropriate dropout rate to prevent overfitting;

[0017] Configuring an output layer using an activation function to match the multi-class event classification task.

[0018] As a preferred solution of the method for event recognition based on multi-head attention mechanism and bidirectional long short-term memory, the bidirectional long short-term memory network model based on multi-head attention mechanism further comprises:

[0019] Initializing network parameters and setting the number of hidden layer units and input / output dimensions;

[0020] Building forward and reverse LSTM processing paths, wherein the forward LSTM processes input sequences in chronological order to capture forward temporal dependency, and the reverse LSTM processes input sequences in reverse chronological order to capture reverse temporal dependency, and information flow is controlled through a gating mechanism at each time step.

[0021] The hidden states of the two-direction LSTM at each time step are spliced to fuse the bidirectional time sequence information, and the spliced state sequence is taken as the input of the next layer;

[0022] The above bidirectional processing procedure is repeated to enhance the feature extraction capability when constructing a multi-layer network structure, and layer normalization processing is added at key positions of the network to stabilize the training process.

[0023] The beneficial effects of the preferred technical solution are: through bidirectional time sequence information processing and dynamic feature weighting mechanism, the recognition accuracy of four typical events of rodent infestation, ice disaster, joint damage and lightning strike is significantly improved.

[0024] As a preferred solution of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory according to the application, wherein: the first processed data is input into the bidirectional long short-term memory network model for training and verification, including:

[0025] The data set is divided into a training set, a validation set and a test set according to a preset ratio, and each data set is standardized and batch-processed to adapt to the model input requirements; the model training parameters are initialized, including setting appropriate learning rate, batch size and optimizer parameters, and selecting cross-entropy as the loss function;

[0026] The small batch gradient descent method is used for parameter optimization, and the model performance indicators are evaluated on the validation set after each training cycle; the learning rate strategy and the early stopping mechanism are dynamically adjusted to prevent overfitting, and the training is automatically terminated when the performance of the validation set no longer improves;

[0027] The final performance of the model is evaluated on the test set, and various classification indicators including accuracy, precision, recall and F1 value are calculated, and the recognition effect of the model on each event category is analyzed through the confusion matrix, and the model parameters are fine-tuned according to the evaluation results to optimize the overall recognition performance.

[0028] The beneficial effects of the preferred technical solution are: to ensure the robustness and generalization ability of the model, and to significantly reduce the false positive rate while maintaining real-time compared with the traditional method.

[0029] As a preferred solution of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory according to the application, wherein: the acquisition of the multiple phase-sensitive optical time domain reflectometer data related to the task includes:

[0030] The distributed optical fiber acoustic wave sensing system is used to collect typical event data of rodent infestation, ice disaster, joint damage and lightning strike, and to ensure that the data covers a wide geographical range and time span;

[0031] Collect raw monitoring data of the distributed optical fiber acoustic wave sensing system, and preliminarily screen and mark the raw monitoring data.

[0032] As a preferred scheme of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory according to the application, the first processing process comprises:

[0033] The obtained multiple phase-sensitive optical time domain reflectometry data are proportionally divided into a training set and a test set;

[0034] According to the system background noise level, the sensor sensitivity and the signal amplitude difference of the actual event, a first threshold is set to remove abnormal values and noises in the data, and the abnormal values are identified and removed through a statistical method.

[0035] After the time dimension down-sampling processing of the preliminarily processed data, Z-score standardization processing is performed to convert data of different magnitudes to the same scale.

[0036] The preferred technical scheme has the beneficial effect that the importance of time sequence characteristics in data processing is fully considered, and the data preprocessing process is adopted to optimize the model training efficiency.

[0037] As a preferred scheme of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory according to the application, the time dimension down-sampling processing comprises:

[0038] A down-sampling rate N is determined, and an interval step is selected according to the original data sampling frequency and actual requirements.

[0039] An equal-interval sampling method is adopted to extract a data point from every N time points in the original time sequence; or an aggregation calculation method is adopted to calculate the mean value, maximum value or minimum value of the data of the continuous N time points as a new data point.

[0040] The quality of the down-sampled data is checked to ensure that the key event characteristics and time sequence trends are retained.

[0041] The dimension parameters of the subsequent model input layer are adjusted according to the amount of the processed data.

[0042] In a second aspect, the application provides an event recognition system based on a multi-head attention mechanism and a bidirectional long short-term memory, comprising:

[0043] A data processing module is configured to obtain multiple phase-sensitive optical time domain reflectometry data related to a task and perform first processing.

[0044] A model training module is configured to construct a bidirectional long short-term memory network model based on a multi-head attention mechanism, input the data processed by the first processing into the bidirectional long short-term memory network model for training and verification.

[0045] An event recognition module is configured to output the trained event recognition model and classify and recognize the optical fiber sensing event.

[0046] In a third aspect, the present application provides an electronic device comprising a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the steps of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory.

[0047] In a fourth aspect, the present application provides a computer readable storage medium storing computer executable instructions, and the computer executable instructions are executed by a processor to implement the steps of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory.

[0048] Compared with the prior art, the present application has the following beneficial effects: the present application provides an event recognition method, system, device and medium based on the multi-head attention mechanism and the bidirectional long short-term memory, effectively solves the problems of insufficient time sequence feature capture and weak key information selection ability of the traditional LSTM in the event recognition of the power optical fiber sensing by constructing a deep learning model based on the multi-head attention mechanism and the bidirectional long short-term memory. The present application innovatively combines the bidirectional LSTM with the multi-head attention mechanism, significantly improves the recognition accuracy of four typical events of rat infestation, ice disaster, joint damage and lightning strike through the bidirectional time sequence information processing and the dynamic feature weighting mechanism, optimizes the model training efficiency through the data preprocessing process, and ensures the robustness and generalization ability of the model through the collaborative optimization of the cross-entropy loss function and the Adam optimizer and the application of the early stopping strategy. Compared with the traditional method, the present application greatly reduces the false positive rate while maintaining real-time, and provides a more accurate and reliable event recognition solution for the optical fiber sensing monitoring of the power system. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0050] Figure 1 The overall flow logic diagram of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory according to an embodiment of the present application is shown.

[0051] Figure 2 The multi-head attention mechanism bidirectional long short-term memory model diagram of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory according to an embodiment of the present application is shown.

[0052] Figure 3 The confusion matrix diagram of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory according to the training result of the actual data collected in the real scene is shown in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0054] Embodiment 1, refer to Figure 1 For an embodiment of the present application, a method for event recognition based on a multi-head attention mechanism and a bidirectional long short-term memory is provided, as shown in Figure 1 and specifically includes the following steps:

[0055] S100: Obtain multiple phase-sensitive optical time domain reflectometry data related to the task, and perform first processing;

[0056] S200: Construct a bidirectional long short-term memory network model based on a multi-head attention mechanism, input the first processed data into the bidirectional long short-term memory network model for training and verification;

[0057] S300: Output the trained event recognition model for classifying and recognizing optical fiber sensing events.

[0058] It should be noted that, in order to solve the problems of low time series processing efficiency, weak feature selection ability and insufficient long-term dependence relationship modeling of the traditional LSTM algorithm in the natural disaster monitoring of power optical cable lines, the present application innovatively combines bidirectional LSTM with a multi-head attention mechanism, significantly improves the recognition accuracy of four typical events of rodent infestation, ice disaster, joint damage and lightning strike through bidirectional time series information processing and dynamic feature weighting mechanism; adopts a data preprocessing process to optimize the model training efficiency; through the collaborative optimization of the cross-entropy loss function and the Adam optimizer, and the application of the early stopping strategy, the robustness and generalization ability of the model are ensured. Compared with the traditional method, the present application greatly reduces the false positive rate while maintaining real-time, and provides a more accurate and reliable event recognition solution for optical fiber sensing monitoring of power systems.

[0059] Embodiment 2, refer to Figures 2-3 Based on the previous embodiment, the present embodiment provides a specific implementation of the event recognition method based on the multi-head attention mechanism and the bidirectional long short-term memory, which is used to describe the technical solutions adopted in the present method.

[0060] In the embodiment of the present application, the step S100 of acquiring the plurality of phase-sensitive optical time domain reflectometry data related to the task and performing the first processing includes the following sub-steps A1-A2:

[0061] In A1: acquiring the plurality of phase-sensitive optical time domain reflectometry data related to the task; specifically comprising:

[0062] Collecting typical event data of rodent infestation, ice damage, joint damage, lightning strikes using a distributed acoustic sensing (DAS) system, and ensuring that the data covers a wide geographical range and time span to ensure the comprehensiveness and accuracy of subsequent analysis;

[0063] Collecting raw monitoring data of the distributed acoustic sensing system and performing preliminary screening and classification labeling on the raw monitoring data.

[0064] It should be noted that collecting raw monitoring data from the DAS system needs to consider the influence of environmental factors and sensor performance to ensure the reliability and representativeness of the data. The raw monitoring data is preliminarily screened and sorted, and appropriate data types are selected according to the research purpose, and are classified and labeled for subsequent processing.

[0065] In A2: performing the first processing on the acquired data; specifically comprising:

[0066] The acquired plurality of phase-sensitive optical time domain reflectometry data is divided into a training set and a test set in proportion;

[0067] According to the system background noise level, sensor sensitivity and signal amplitude difference of actual events, a first threshold is set to remove abnormal values and noise in the data, and abnormal values are identified and removed by statistical method;

[0068] After time dimension down-sampling processing of the preliminarily processed data, Z-score standardization processing is performed to make the mean value of each feature 0 and the variance 1, and convert data of different orders of magnitude to the same scale.

[0069] Specifically, the time dimension down-sampling processing includes:

[0070] Determining the down-sampling rate N, selecting the interval step according to the original data sampling frequency and actual requirements;

[0071] Using equal interval sampling method to extract a data point from every N time points in the original time series; or using aggregation calculation method to calculate the mean, maximum or minimum value of the data of the continuous N time points as a new data point;

[0072] Performing quality check on the down-sampled data to ensure that the key event features and time sequence trends are retained;

[0073] Adjust the dimension parameters of the input layer of the subsequent model according to the processed data volume.

[0074] Specifically, the collected raw data is divided into a training set and a test set in a ratio of 8:2, the data set file is a label file of the corresponding sample, and the format of the sample in the data set is a.mat file.

[0075] It should be noted that the setting of the first threshold mainly includes the system background noise level, the sensor sensitivity characteristics, and the typical signal amplitude characteristics of different event types: by analyzing the background noise distribution of the system in the event-free state to determine the reference noise level, combining the sensitivity variation range of the sensor under different environmental conditions, and referring to the typical signal amplitude characteristic distribution of four types of target events such as mouse infestation and ice disaster, a dynamic threshold is calculated by using a statistical method. The threshold can effectively filter random noise and abnormal interference, and can also retain the complete characteristics of the real event signal, ensuring the accuracy and reliability of subsequent data processing.

[0076] In an optional embodiment, the first processing can also perform feature engineering processing, extract the frequency domain features of the signal through time-frequency analysis, and fuse the original time domain features to enhance the event representation ability.

[0077] In another optional embodiment, the first processing can also perform a data enhancement operation, for specific event categories with insufficient samples, time series translation, noise addition, or amplitude scaling methods are used to generate synthetic samples to improve the class balance of the data set and the model generalization performance.

[0078] In the embodiments of the present application, the step S200 described above constructs a bidirectional long short-term memory network model based on a multi-head attention mechanism, and the first processed data is input into the bidirectional long short-term memory network model for training and verification, including:

[0079] Specifically, as shown in Figure 2 Constructing a bidirectional long short-term memory network model based on a multi-head attention mechanism includes:

[0080] Designing a network input layer, configuring an input node matched with the dimension of the first processed data;

[0081] Building a bidirectional LSTM layer containing forward and reverse processing paths, wherein each LSTM unit contains a forget gate, an input gate, and an output gate to control information flow;

[0082] Adding a multi-head attention layer after the bidirectional LSTM layer, capturing the feature relationship of different subspaces through parallel calculation of multiple attention heads;

[0083] Adding a Dropout layer before the fully connected layer, and setting an appropriate dropout rate to prevent overfitting;

[0084] The output layer configured to use an activation function is matched to a multi-class event classification task.

[0085] In an optional embodiment, in addition to the basic network architecture design, a layer normalization module can be introduced when constructing the bidirectional long short-term memory network model based on the multi-head attention mechanism. The layer normalization module is embedded between the bidirectional LSTM layer and the multi-head attention layer. By independently standardizing the feature dimensions of each sample, the internal covariate shift problem is effectively alleviated, which not only significantly accelerates the model convergence speed, but also improves the stability of the training process, so that the model can better handle the complex time sequence features existing in the optical fiber sensing data.

[0086] In another optional embodiment, in addition to the basic network architecture design, a residual link can be introduced when constructing the bidirectional long short-term memory network model based on the multi-head attention mechanism. By establishing a cross-layer information channel at a key position in the network, the original features extracted by the shallow network are linearly superimposed with the advanced features learned by the deep network, which not only solves the gradient disappearance problem in deep network training, but also realizes the organic fusion of features at different levels, so that the model can make full use of the learned feature information at each layer, thereby comprehensively improving the recognition accuracy and robustness of various power system abnormal events.

[0087] Further, the bidirectional long short-term memory network model based on the multi-head attention mechanism further comprises:

[0088] Initialize network parameters and set the number of hidden layer units and input / output dimensions;

[0089] Construct a forward LSTM and a reverse LSTM processing path, wherein the forward LSTM processes the input sequence in chronological order to capture the forward time sequence dependency, and the reverse LSTM processes the input sequence in reverse chronological order to capture the reverse time sequence dependency. At each time step, the information flow is controlled through a gating mechanism; that is, the update forget gate is determined by the retention degree of each information, the input gate is determined by the calculation of the current input and the previous time hidden state, and the current memory how to affect the next time state is determined by the update output gate;

[0090] Concatenate the hidden states of the two direction LSTMs at each time step to fuse the bidirectional time sequence information, and then concatenate the state sequence as the input of the next layer;

[0091] Repeat the above bidirectional processing process when constructing a multi-layer network structure to enhance the feature extraction capability, and add layer normalization processing at a key position in the network to stabilize the training process.

[0092] It should be noted that the multi-head attention mechanism is introduced in the hidden layer, which allows the model to dynamically focus on different information fragments when processing complex data, thereby improving the performance of the model. In this algorithm, the multi-head attention layer weights and aggregates the features output by the bidirectional LSTM, enabling the model to focus on more important information by calculating the correlation between different input time steps. By calculating multiple heads in parallel, the model can learn different relationships in multiple subspaces, improving the representation ability and ultimately helping to improve the performance of the model.

[0093] Further, the model is optimized using a cross-entropy loss function, which is one of the commonly used loss functions in deep learning and is widely used in classification tasks. It optimizes the model by measuring the difference between the true label and the probability distribution predicted by the model, so that it can better fit the data, and the formula is:

[0094]

[0095] where, represents the cross-entropy loss between the true label y i and the predicted label , C represents the total number of classes, y i represents the true label value of the i-th class, i.e., whether the sample belongs to class i, represents the predicted probability of the model for the i-th class, i.e., the probability estimate that the sample belongs to class i;

[0096] In the embodiments of the present application, inputting the first processed data into the bidirectional long short-term memory network model for training and verification includes:

[0097] Divide the data set into a training set, a validation set and a test set according to a preset ratio, and perform standardization batch processing on each data set to adapt to the model input requirements; initialize the model training parameters, including setting appropriate learning rate, batch size and optimizer parameters, and selecting cross-entropy as the loss function;

[0098] Use the mini-batch gradient descent method to optimize the parameters, and evaluate the model performance indicators on the validation set after each training cycle; prevent overfitting by dynamically adjusting the learning rate strategy and early stopping mechanism, and automatically terminate training when the performance of the validation set no longer improves;

[0099] Evaluate the final performance of the model on the test set, calculate various classification indicators including accuracy, precision, recall and F1 value, and analyze the recognition effect of the model on each event class through the confusion matrix, and fine-tune the model parameters according to the evaluation results to optimize the overall recognition performance.

[0100] Specifically, when testing, the commonly used indicators for evaluating the performance of the classification model according to the accuracy, precision, recall and the like are used to help understand how the model performs in different aspects. Among them, TP (True Positive): true positive, that is, the number of actual positive classes correctly predicted as positive classes; TN (True Negative): true negative, that is, the number of actual negative classes correctly predicted as negative classes; FP (False Positive): false positive, that is, the number of actual negative classes incorrectly predicted as positive classes; FN (False Negative): false negative, that is, the number of actual positive classes incorrectly predicted as negative classes;

[0101] Among them, the accuracy refers to the proportion of the number of all correctly predicted samples to the total number of samples, which measures the overall correctness of the model, and is expressed as:

[0102]

[0103] Among them, the precision refers to the proportion of the actual positive classes in all the samples predicted as positive classes by the model, which focuses on the "purity" of the prediction results of the model, and is expressed as:

[0104]

[0105] Among them, the recall refers to the proportion of the correctly identified samples in all the actual positive samples, which measures the ability of the model to find actual positive samples, and is expressed as:

[0106]

[0107] In the embodiment of the present application, step S300 outputs the trained event recognition model for classifying and identifying the optical fiber sensing events.

[0108] In an optional embodiment, as Figure 3 The confusion matrix diagram of the training result of the model according to the actual data collected in the real scene is shown, wherein the diagonal values represent the correctly classified samples, and the non-diagonal lines represent the misclassification. As Figure 3 can be seen, the model performs excellently in "rat infestation" and "lightning strike" recognition, both achieving high accuracy, and the overall classification accuracy is high.

[0109] Therefore, the embodiment effectively solves the problems of insufficient time sequence feature capture and weak key information selection ability of the traditional LSTM in power optical fiber sensing event identification by constructing a deep learning model based on the multi-head attention mechanism and the bidirectional long short-term memory.

[0110] In the embodiment, a multi-head attention mechanism and bidirectional long short-term memory event identification system is provided, which comprises:

[0111] A data processing module is configured to acquire various phase-sensitive optical time domain reflectometry data related to a task and perform first processing.

[0112] A model training module is configured to construct a bidirectional long short-term memory network model based on a multi-head attention mechanism, input the first processed data into the bidirectional long short-term memory network model, and perform training and verification.

[0113] An event identification module is configured to output the trained event identification model and perform classification and identification of optical fiber sensing events.

[0114] It should be noted that the technical scheme of the multi-head attention mechanism and bidirectional long short-term memory event identification system belongs to the same concept as the technical scheme of the multi-head attention mechanism and bidirectional long short-term memory event identification method described above. The details of the technical scheme of the multi-head attention mechanism and bidirectional long short-term memory event identification system in the embodiment are not described in detail, and can be referred to the description of the technical scheme of the multi-head attention mechanism and bidirectional long short-term memory event identification method described above.

[0115] The above-mentioned each unit module can be embedded in or independent of the processor in the electronic device in hardware form, or can be stored in the memory in the electronic device in software form, so as to be called and executed by the processor to perform the operation corresponding to each module.

[0116] The embodiment also provides an electronic device, which comprises a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. The processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is configured to perform wired or wireless communication with an external terminal. The wireless communication can be achieved through WIFI, an operator network, NFC (Near Field Communication) or other technologies. The computer program is executed by the processor to implement the method for event recognition based on the multi-head attention mechanism and the bidirectional long short-term memory. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0117] The embodiment also provides a computer readable storage medium, which stores a computer program. The program is executed by a processor to implement the method proposed in the above embodiment.

[0118] The storage medium proposed in the embodiment belongs to the same inventive concept as the method proposed in the above embodiment. The technical details not described in the embodiment can be referred to the above embodiment, and the embodiment has the same beneficial effects as the above embodiment.

[0119] From the above description about the embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary universal hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a floppy disk, a ROM, a RAM, a FLASH, a hard disk or an optical disc, and includes a number of instructions for making an electronic device (which can be a personal computer, a server or a network device, etc.) execute the methods of the embodiments of the present application.

[0120] It should be noted that the above examples are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalently replaced, without departing from the spirit and scope of the technical solutions of the present application, which should be covered in the scope of the claims of the present application.

Claims

1. A method for event recognition based on multi-head attention mechanism and bidirectional long short-term memory, characterized in that, include: Acquire various phase-sensitive optical time-domain reflectometer data related to the mission and perform initial processing; A bidirectional long short-term memory network model based on a multi-head attention mechanism is constructed, and the first processed data is input into the bidirectional long short-term memory network model for training and validation. Output the trained event recognition model for classifying and recognizing fiber optic sensing events.

2. The event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in claim 1, characterized in that, The construction of the bidirectional long short-term memory network model based on the multi-head attention mechanism includes: Design a network input layer and configure input nodes that match the dimensions of the first processed data; Construct a bidirectional LSTM layer containing forward and reverse processing paths, where each LSTM unit contains a forget gate, an input gate, and an output gate to control the flow of information; A multi-head attention layer is added after the bidirectional LSTM layer to capture the feature relationships of different subspaces by computing multiple attention heads in parallel. Add a Dropout layer before the fully connected layer and set an appropriate dropout rate to prevent overfitting; Configure the output layer to use the activation function to match multi-class event classification tasks.

3. The event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in claim 2, characterized in that, The construction of the bidirectional long short-term memory network model based on the multi-head attention mechanism also includes: Initialize network parameters and set the number of hidden layer units and input / output dimensions; Construct forward LSTM and backward LSTM processing paths, wherein the forward LSTM processes the input sequence in chronological order to capture forward temporal dependencies, and the backward LSTM processes the input sequence in reverse chronological order to capture backward temporal dependencies, and information flow is controlled by a gating mechanism at each time step; The hidden states of the two LSTMs at each time step are concatenated to fuse bidirectional temporal information, and the concatenated state sequence is then used as the input to the next layer. The bidirectional processing described above is repeated when constructing a multi-layer network structure to enhance feature extraction capabilities, while layer normalization is added at key network locations to stabilize the training process.

4. The event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in claim 3, characterized in that, The step of inputting the first processed data into the bidirectional long short-term memory network model for training and validation includes: The dataset is divided into training, validation, and test sets according to a preset ratio, and each dataset is standardized and batch-processed to adapt to the model input requirements; the model training parameters are initialized, including setting appropriate learning rate, batch size, and optimizer parameters, and cross-entropy is selected as the loss function; Mini-batch gradient descent is used for parameter optimization, and the model performance is evaluated on the validation set after each training cycle. Overfitting is prevented by dynamically adjusting the learning rate and using an early stopping mechanism. Training is automatically terminated when the performance on the validation set no longer improves. The final performance of the model is evaluated on the test set. Various classification metrics, including accuracy, precision, recall, and F1 score, are calculated. The recognition effect of the model on each event category is analyzed by using a confusion matrix. Based on the evaluation results, the model parameters are fine-tuned to optimize the overall recognition performance.

5. The event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in claim 1, characterized in that, The acquisition of various phase-sensitive optical time-domain reflectometer data related to the mission includes: A distributed fiber optic acoustic sensing system is used to collect typical event data such as rodent infestation, ice storms, joint damage, and lightning strikes, ensuring that the data covers a wide geographical area and time span. The raw monitoring data of the distributed fiber optic acoustic wave sensing system is collected, and the raw monitoring data is initially screened and classified.

6. The event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in claim 5, characterized in that, The first processing procedure includes: The acquired data from various phase-sensitive optical time-domain reflectometers were divided into training and testing sets according to a set ratio; A first threshold is set based on the system background noise level, sensor sensitivity, and the difference in signal amplitude of actual events to remove outliers and noise from the data. Outliers are identified and removed using statistical methods. After performing time-dimensional downsampling on the initially processed data, Z-score standardization is applied to transform data of different magnitudes to the same scale.

7. The event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in claim 6, characterized in that, The time-dimension downsampling process includes: Determine the downsampling rate N, and select the interval step size based on the original data sampling frequency and actual needs; The data point can be extracted from the original time series every N time points using the equal interval sampling method; or the mean, maximum or minimum value of the data at N consecutive time points can be calculated as the new data point using the aggregation calculation method. Perform quality checks on the downsampled data to ensure that key event characteristics and time-series trends are preserved; Adjust the dimensional parameters of the subsequent model input layer based on the amount of processed data.

8. A multi-head attention mechanism and bidirectional long short-term memory event recognition system, using the multi-head attention mechanism and bidirectional long short-term memory event recognition method as described in any one of claims 1 to 7, characterized in that, include: The data processing module is used to acquire various phase-sensitive optical time-domain reflectometer data related to the mission and perform initial processing. The model training module is used to construct a bidirectional long short-term memory network model based on a multi-head attention mechanism, and inputs the first processed data into the bidirectional long short-term memory network model for training and verification. The event recognition module is used to output the trained event recognition model to classify and recognize fiber optic sensing events.

9. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store computer-executable instructions, and when the processor executes the computer-executable instructions, it implements the steps of the event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in any one of claims 1 to 7.

10. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that: When the computer-executable instructions are executed by the processor, they implement the steps of the event recognition method based on multi-head attention mechanism and bidirectional long short-term memory as described in any one of claims 1 to 7.