Optical fiber sensing signal identification method based on ResNet double-attention mechanism

Through the optical fiber sensing signal recognition method based on the ResNet dual attention mechanism, the feature extraction process is simplified, the recognition accuracy and efficiency are improved, the problems of complex calculation and weak migration ability in the existing technology are solved, and multi-type disturbances are realized Efficient identification of events.

CN118606745APending Publication Date: 2024-09-06HUBEI UNIV OF TECH
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202410593029.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

The existing distributed optical fiber vibration signal recognition technology has complex calculations and weak migration capabilities, making it difficult to generalize in different application environments, especially the feature selection process is time-consuming.

Method used

An optical fiber sensing signal recognition method based on the ResNet dual attention mechanism is adopted. By collecting multiple types of disturbance event raw data from the Φ-OTDR distributed optical fiber sensing system, preprocessing and relative position matrix encoding are performed to build a dual attention mechanism fusion system. ResNet network model, train and verify the model to achieve signal recognition.

Benefits of technology

It simplifies the feature extraction steps, improves the recognition accuracy and efficiency, enhances the detection ability of intrusion behavior, and is suitable for the identification of multiple types of disturbance events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606745A
    Figure CN118606745A
Patent Text Reader

Abstract

The invention provides an optical fiber sensing signal identification method based on a ResNet double-attention mechanism, and belongs to the technical field of optical fiber signal identification, and the method comprises the steps: collecting original noise signals and various disturbance signals through building a phi-OTDR distributed optical fiber sensing system, and carrying out the recognition of the original noise signals and the various disturbance signals; a preprocessed one-dimensional time sequence signal is converted into a two-dimensional image on the basis of the principle of a Grubrum angle field, deeper-level features can be obtained, the step of complex feature extraction is omitted, information of the time dimension of an original time sequence is effectively reserved, a ResNet double-attention mechanism model is constructed, disturbance recognition is conducted through the model, and the recognition accuracy is improved. The method improves the recognition accuracy and recognition efficiency, and facilitates the precise detection of intrusion behaviors. The model provided by the invention is excellent in image recognition capability, the explicit high-order space interaction introduced in the model architecture design is beneficial to improving the modeling capability of the visual model, and the optical fiber sensing event converted into the two-dimensional data can be effectively recognized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of optical fiber signal recognition, and in particular to an optical fiber sensing signal recognition method based on a ResNet dual attention mechanism. Background Art

[0002] Distributed fiber optic sensing technology has been widely used in engineering and life due to its advantages of high sensitivity, high accuracy, low cost, and long monitoring range. Phase-sensitive optical time domain reflectometry (Φ-OTDR) technology is a distributed fiber optic sensing technology with the advantage of high-precision vibration monitoring. It has great advantages in road monitoring, pipeline detection, and perimeter security. Φ-OTDR technology extracts the phase by measuring the backward Rayleigh scattering (or back Rayleigh scattering) in the optical fiber, and the obtained vibration signal can accurately reflect the external interference.

[0003] At present, the identification of distributed optical fiber vibration signals is mainly through feature extraction, which is cumbersome and time-consuming, especially in the process of selecting appropriate features according to signal characteristics. In addition, the selected feature categories and quantities are affected by the collected data, resulting in weak migration ability in different application environments and difficulty in generalizing to other intrusion events and application scenarios. Summary of the invention

[0004] The present invention provides a fiber optic sensor signal recognition method based on the ResNet dual attention mechanism, which is used to solve the defects of complex calculation and large amount of calculation in the prior art for distributed fiber optic sensor signal recognition.

[0005] The optical fiber sensing signal recognition method based on the ResNet dual attention mechanism provided by the present invention includes:

[0006] Collect raw data of various disturbance events in the Φ-OTDR distributed optical fiber sensing system;

[0007] Preprocessing the original data of the multiple types of disturbance events to obtain a preprocessed one-dimensional time series signal;

[0008] Performing relative position matrix encoding on the preprocessed one-dimensional time series signal to obtain a two-dimensional image, sorting the two-dimensional image based on the type of disturbance event to obtain a data set, and dividing the data set into a training set and a validation set;

[0009] Constructing a ResNet network model integrating a dual attention mechanism, training the ResNet network model using the training set, and verifying the ResNet network model using the verification set to obtain a trained optical fiber sensing signal recognition model;

[0010] The disturbance event data to be identified is input into the optical fiber sensing signal identification model, and the optical fiber sensing signal identification result is output.

[0011] According to a fiber optic sensing signal recognition method based on the ResNet dual attention mechanism provided by the present invention, raw data of multiple types of disturbance events in a Φ-OTDR distributed fiber optic sensing system are collected, including:

[0012] Constructing the Φ-OTDR distributed optical fiber sensing system;

[0013] Different types of disturbance events in the Φ-OTDR distributed optical fiber sensing system are determined, and original data corresponding to the different types of disturbance events are collected.

[0014] According to a fiber optic sensing signal recognition method based on the ResNet dual attention mechanism provided by the present invention, the Φ-OTDR distributed fiber optic sensing system is constructed, comprising:

[0015] Ultra-narrow linewidth lasers, signal generators, acousto-optic modulators, erbium-doped fiber amplifiers, circulators, sensing fibers, photodetectors, data acquisition cards, and signal processing modules;

[0016] The continuous light signal emitted by the ultra-narrow linewidth laser is input into the acousto-optic modulator, and the pulse signal generated by the signal generator is input into the acousto-optic modulator, and the acousto-optic modulator modulates the continuous light signal into a pulse light signal;

[0017] The erbium-doped fiber amplifier amplifies the pulse light signal, and connects the amplified pulse light signal to the sensing optical fiber through the circulator;

[0018] The backscattered Rayleigh light signal returned from the sensing optical fiber is transmitted to the photodetector after passing through the circulator, and the photodetector converts the received light signal into an electrical signal, and transmits the electrical signal to the data acquisition card;

[0019] The data acquisition card samples the electrical signal and transmits the obtained sampled signal to the signal processing module;

[0020] The signal processing module identifies and marks the sampled signals to obtain original data corresponding to multiple types of disturbance events.

[0021] According to a fiber optic sensor signal recognition method based on the ResNet dual attention mechanism provided by the present invention, the raw data of the multiple types of disturbance events are preprocessed to obtain a preprocessed one-dimensional time series signal, including:

[0022] Performing wavelet denoising on the original data of the multiple types of disturbance events to obtain wavelet denoised data;

[0023] The wavelet denoised data is divided using a sliding window to obtain the preprocessed one-dimensional time series signal.

[0024] According to a fiber optic sensor signal recognition method based on the ResNet dual attention mechanism provided by the present invention, wavelet denoising is performed on the original data of the multiple types of disturbance events to obtain wavelet denoised data, including:

[0025] Determine the wavelet decomposition level N and the wavelet waveform, and perform N-layer wavelet decomposition calculation on the original data of the multiple types of disturbance events;

[0026] Threshold quantization is performed on each layer of high-frequency coefficients from layer 1 to layer N;

[0027] According to the Nth layer low-frequency coefficients of wavelet decomposition and the high-frequency coefficients of the 1st layer to the Nth layer after threshold quantization processing, the signal wavelet reconstruction is performed to obtain the wavelet denoised data.

[0028] According to a fiber optic sensor signal recognition method based on the ResNet dual attention mechanism provided by the present invention, a sliding window is used to divide the wavelet denoising data to obtain the preprocessed one-dimensional time series signal, including:

[0029] Determine the sliding window size and sliding step size, perform sliding division on the sample points corresponding to the wavelet denoised data, and obtain time series samples;

[0030] The numerical value corresponding to any sample point in the time series sample is obtained, and the numerical value corresponding to any sample point is normalized based on the maximum value of several sample points in the time series sample and the minimum value of several sample points in the time series sample to obtain the preprocessed one-dimensional time series signal.

[0031] According to a fiber optic sensor signal recognition method based on the ResNet dual attention mechanism provided by the present invention, the preprocessed one-dimensional time series signal is encoded by relative position matrix to obtain a two-dimensional image, the two-dimensional image is sorted based on the type of disturbance event to obtain a data set, and the data set is divided into a training set and a verification set, including:

[0032] The standard normal distribution z of the preprocessed one-dimensional time series signal is obtained by z-score standardization. t :

[0033]

[0034] Where u represents x t The average value of x t The standard deviation of N represents the dimension of one-dimensional time series signal;

[0035] Using the segmented aggregation approximation method, the reduction factor k is determined to generate a new smoothed time series X, reducing the dimension N to m:

[0036]

[0037] in t j is the time series T n The value at timestamp j;

[0038] Calculate the relative position between any two timestamps and convert the new smoothed time series X into a two-dimensional matrix M:

[0039]

[0040] The i-th row and i-th column of the matrix M are both x i is the reference point, which respectively represents the difference between each point in the sequence and the reference point, and the difference between the reference point and each point in the sequence.

[0041] According to a fiber optic sensor signal recognition method based on a ResNet dual attention mechanism provided by the present invention, a ResNet network model integrating the dual attention mechanism is constructed, comprising:

[0042] In the feature extraction stage of the ResNet network model, a contextual attention CotAttention module is added to divide the input feature map into multiple channel groups. Each channel group includes several continuous channels. 1×1 convolution and 3×3 separable convolution are used to process the features of each channel group.

[0043] The convolutional block attention module (CBAM) is embedded into the basic block of the ResNet network model. 1×1 convolution and 3×3 separable convolution are used to process the channel grouping for each basic block, and mean pooling and maximum pooling are used to obtain global information.

[0044] Mean pooling and maximum pooling are used for each channel group to obtain global information, and the global information is concatenated;

[0045] The 1x1 convolution and sigmoid activation function are used to generate channel attention weights, and the attention weights of each channel are weighted to the feature representation of each channel to obtain the key areas of the feature map.

[0046] According to a method for optical fiber sensor signal recognition based on ResNet dual attention mechanism provided by the present invention, the context attention CotAttention module includes:

[0047] Input 2D features of size H×W×C Figure X , where H is the height, W is the width, and C is the number of channels.q , W k , W v ) converts X to:

[0048] Queries Q=XW q ,Keys K=XW k , Value V=XW v

[0049] Each embedding matrix performs a 1×1 convolution in space, and the local relationship matrix between K and Q for:

[0050]

[0051] in, It is represented as a local matrix multiplication, which is used to calculate the relationship between each query and matching keys in a local k×k grid in space;

[0052] Connect with Q, perform two consecutive convolutions on the connection result, multiply the obtained attention map with V by local matrix to obtain the dynamic context modeling feature map, and output feature Y, which represents the fusion of all values ​​in each k×k grid and the local attention matrix;

[0053] Correspondingly, the convolutional block attention module CBAM includes a channel attention module and a spatial attention module;

[0054] The calculation formula of the channel attention module is:

[0055] Among them, F is the feature map, and Represent the average pooling feature and the maximum pooling feature respectively, and after the Sigmoid function represented by σ, the output feature map M of the channel attention is generated. c (F);

[0056] The calculation formula of the spatial attention module is:

[0057]

[0058] in, and The size is 1×H×W, H is the height, W is the width, σ represents the sigmoid function, f 7×7 Represents a convolution operation of size 7×7.

[0059] According to a fiber optic sensor signal recognition method based on the ResNet dual attention mechanism provided by the present invention, the ResNet network model is trained using the training set, and the ResNet network model is verified using the verification set to obtain a trained fiber optic sensor signal recognition model, including:

[0060] Determine the set of training parameters including training batch size, number of training iterations and maximum learning rate,

[0061] Using the Adam optimizer and the cross entropy loss function, the training set is input into the ResNet network model for forward propagation to obtain predicted sample labels, and the cross entropy loss function is used to calculate the loss value of the predicted label and the true label;

[0062] The PyTorch framework is used for model training. Each training cycle includes:

[0063] Divide the training set into several batches, each batch includes several images and corresponding labels, perform back propagation according to the loss value, update the model parameters, obtain the loss and accuracy of the current batch, and after all batches are completed, calculate the average loss and accuracy of the current cycle;

[0064] After the training is completed, the accuracy of the ResNet network model is verified using the verification set to obtain the optical fiber sensing signal recognition model.

[0065] The optical fiber sensing signal recognition method based on ResNet dual attention mechanism provided by the present invention collects original noise signals and multiple types of disturbance signals by building a Φ-OTDR distributed optical fiber sensing system, and converts the preprocessed one-dimensional time series signal into a two-dimensional image based on the principle of Gram angular field, which can not only obtain deeper features, but also save the complex feature extraction steps, effectively retain the information of the time dimension of the original time series, build a ResNet dual attention mechanism model, and use the model to perform disturbance recognition, thereby improving the recognition accuracy and efficiency, and facilitating the accurate detection of intrusion behavior. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0067] Figure 1 It is one of the flow charts of the optical fiber sensing signal recognition method based on the ResNet dual attention mechanism provided by the present invention;

[0068] Figure 2 This is the second flow chart of the optical fiber sensing signal recognition method based on the ResNet dual attention mechanism provided by the present invention;

[0069] Figure 3 It is a schematic diagram of the Φ-OTDR distributed optical fiber sensing system provided by the present invention;

[0070] Figure 4 is a schematic diagram of raw data corresponding to multiple types of disturbance events provided by the present invention, wherein: Figure 4 (a) in the figure is the original noise collected. Figure 4 (b) in the figure is the original data corresponding to the collected stone scratches. Figure 4 (c) in the figure is the original data corresponding to the longitudinal pull. Figure 4 (d) in the figure is the original data corresponding to the stone knocking. Figure 4 (e) in the figure is the original data corresponding to the collected branch lines. Figure 4 (f) in the figure is the raw data corresponding to the climbing collected;

[0071] Figure 5 This is an effect diagram of wavelet denoising of original data provided by the present invention;

[0072] Figure 6 is a schematic diagram of a two-dimensional image obtained by using an image encoding method of a relative position matrix provided by the present invention, wherein: Figure 6 (a) in the figure is the sampling point with amplitude between -0.01 and 0.01. Figure 6 (b) in the figure is a sampling point with an amplitude between 0 and 1. Figure 6 (c) in the figure is a sampling point with an amplitude between -0.5 and 1. Figure 6 (d) in the figure is the sampling point with amplitude between -0.05 and 0.05. Figure 6 (e) in the figure is a sampling point with an amplitude between -10 and 0. Figure 6 (f) in the figure is the sampling point with amplitude between -0.1 and 0.1;

[0073] Figure 7 It is a structural diagram of the ResNet dual attention mechanism model provided by the present invention;

[0074] Figure 8 It is a structural diagram of the CotAttention module provided by the present invention;

[0075] Fig. 9 It is a structural diagram of the CBAM module provided by the present invention;

[0076] Fig.10 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0077] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0078] Figure 1 is one of the flow charts of the optical fiber sensing signal recognition method based on the ResNet dual attention mechanism provided by an embodiment of the present invention, such as Figure 1 As shown, including:

[0079] Step 100: Collecting raw data of multiple types of disturbance events in the Φ-OTDR distributed optical fiber sensing system;

[0080] Step 200: preprocessing the original data of the multiple types of disturbance events to obtain a preprocessed one-dimensional time series signal;

[0081] Step 300: performing relative position matrix encoding on the preprocessed one-dimensional time series signal to obtain a two-dimensional image, sorting the two-dimensional image based on the type of disturbance event to obtain a data set, and dividing the data set into a training set and a validation set;

[0082] Step 400: constructing a ResNet network model integrating a dual attention mechanism, training the ResNet network model using the training set, and verifying the ResNet network model using the verification set to obtain a trained optical fiber sensor signal recognition model;

[0083] Step 500: input the disturbance event data to be identified into the optical fiber sensing signal identification model, and output the optical fiber sensing signal identification result.

[0084] Specifically, Figure 2 As shown, the embodiment of the present invention first collects and obtains original data corresponding to multiple types of disturbance events based on the Φ-OTDR distributed optical fiber sensing system, and the original data is a one-dimensional time series signal.

[0085] Then the original data is preprocessed to obtain a preprocessed one-dimensional time series signal.

[0086] The preprocessed one-dimensional time series signal is then encoded with a relative position matrix to obtain a two-dimensional image; the two-dimensional image is sorted according to the type of disturbance event to obtain a total data set, and the total data set is divided into a training set and a verification set.

[0087] A ResNet network model integrating the dual attention mechanism is further constructed, the network model is trained using the training set, and the network model is verified using the verification set to obtain a trained network model.

[0088] Finally, the trained network model is used for disturbance identification.

[0089] The present invention builds a Φ-OTDR distributed optical fiber sensing system, collects original noise signals and multiple types of disturbance signals, and converts the preprocessed one-dimensional time series signals into two-dimensional images based on the principle of Gram's angular field. It can not only obtain deeper features, but also save the complex feature extraction steps, effectively retain the information of the original time series time dimension, construct a ResNet dual attention mechanism model, and use the model for disturbance recognition, which improves the recognition accuracy and efficiency, and is conducive to the accurate detection of intrusion behavior.

[0090] Based on the above embodiment, step 100 includes:

[0091] Specifically, the Φ-OTDR distributed optical fiber sensing system constructed in the embodiment of the present invention includes: an ultra-narrow linewidth laser, a signal generator, an acousto-optic modulator, an erbium-doped fiber amplifier, a circulator, a sensing fiber, a photodetector, a data acquisition card and a signal processing module, such as Figure 3 shown.

[0092] The continuous light signal emitted by the ultra-narrow linewidth laser is input into the acousto-optic modulator, and the pulse signal generated by the signal generator is input into the acousto-optic modulator, which modulates the continuous light signal into a pulse light signal; the erbium-doped fiber amplifier amplifies the pulse light signal, and the amplified pulse light signal is connected to the sensing optical fiber through a circulator; the back Rayleigh scattered light signal returned from the sensing optical fiber is received by the photodetector after passing through the circulator, and the photodetector converts the received light signal into an electrical signal and transmits it to the data acquisition card; the data acquisition card samples the electrical signal and transmits the obtained sampled signal to the signal processing module; the signal processing module identifies and marks the sampled signal to obtain the original data corresponding to multiple types of disturbance events.

[0093] Specifically, the light source of the Φ-OTDR distributed optical fiber sensing system adopts an ultra-narrow linewidth laser, which is a tunable ultra-narrow linewidth laser, and the linewidth range of the ultra-narrow linewidth laser is 0.1kHz to 0.2kHz (for example, 0.1kHz). A signal generator is used to generate a continuous pulse signal, and an acousto-optic modulator is used to modulate the continuous light with a central wavelength of 1550nm into a pulse sequence with a repetition frequency of 1kHz to 4kHz (for example, 4kHz) and a pulse duration of 50ns to 500ns (for example, 200ns). The optical pulse is amplified by an erbium-doped fiber amplifier and injected into a sensing optical fiber (for example, a standard G652 single-mode sensing optical fiber) with a total length of 2km to 30km (for example, 20km) through a circulator. When vibration occurs along the sensing optical fiber, the optical fiber at the corresponding position will change, causing the phase of the back-scattered Rayleigh light at that position to change. After passing through the circulator, it is received by a photodetector, and the optical signal is converted into an electrical signal through filtering and amplification. The output signal is sampled by a data acquisition card at a sampling rate of 50MHz to 400MHz (for example, 100MHz) and transmitted to a signal processing module for identification and analysis.

[0094] The following is an example of collecting raw data corresponding to multiple types of disturbance events: data collection of raw noise and five types of disturbance events (stone knocking, stone scratching, branch scratching, longitudinal pulling and climbing) is performed separately, see Figure 4 , Figure 4 (a) in the figure is the original noise collected. Figure 4 (b) in the figure is the original data corresponding to the collected stone scratches. Figure 4 (c) in the figure is the original data corresponding to the longitudinal pull. Figure 4 (d) in the figure is the original data corresponding to the stone knocking. Figure 4 (e) in the figure is the original data corresponding to the collected branch lines. Figure 4 (f) in the figure is the raw data corresponding to the climbing. That is, 6 different types of data are collected, and the amount of data of each type is between 160 and 300. The 6 types of events are labeled and coded as 0, 1, 2, 3, 4, 5, and 6 respectively to generate the original one-dimensional data set. The collected raw data is a one-dimensional time series signal with a length of 1000 to 6000 (for example, 3000).

[0095] Based on the above embodiment, step 200 includes:

[0096] The preprocessing in the embodiment of the present invention includes wavelet denoising and sliding window division. The sliding window division includes using a sliding window with a preset step size to slide and divide a number of sample points obtained after the standardization processing, and performing normalization processing after obtaining the time series samples, and scaling the time series to the range of [-1,1], that is, denoising and sample division of the original signal to obtain a vibration ripple signal with a fixed length.

[0097] Wavelet denoising is mainly divided into three steps: first, perform wavelet decomposition on the signal, select a wavelet and determine a wavelet decomposition level N, then perform N-layer wavelet decomposition calculations on the signal; threshold quantization of wavelet decomposition high-frequency coefficients, select a threshold for threshold quantization processing for each layer of high-frequency coefficients from the 1st layer to the Nth layer (three directions); perform wavelet reconstruction of the signal based on the low-frequency coefficients of the Nth layer of wavelet decomposition and the high-frequency coefficients of the 1st layer to the Nth layer after quantization. The embodiment of the present invention selects the general threshold value 'sqtwolog', adjusts the threshold value based on the estimation of the noise layer according to the first layer coefficients, and performs multi-layer (the value range of the wavelet denoising layer number N is 1 to 100, for example, N=50) wavelet denoising. The effect of wavelet denoising is as follows. Figure 5 shown.

[0098] Sliding window partitioning is to set the window size to 100-1000 (for example, 300) and the step size to 70-800 (for example, 210), and perform sliding partitioning on the sample points. Each sample has multiple (for example, 120) independent sample points. For each time series sample X = {x1, x2, ..., x n}, normalize and scale the obtained time series to the range of [-1,1], and the calculation method is as follows:

[0099]

[0100] in, is the normalized value corresponding to the i-th sample point in the time series sample, x i is the value corresponding to the i-th sample point in the time series sample, X is the time series sample, max(X) is the maximum value corresponding to several sample points in the time series sample, and min(X) is the minimum value corresponding to several sample points in the time series sample.

[0101] Based on the above embodiment, step 300 includes:

[0102] The relative position matrix (RPM) in the embodiment of the present invention is formed into a two-dimensional matrix by calculating the relative position between two timestamps. Each column shows the mirror image of the former, which can contain the redundant features of the original time series, so that the similarity information between classes and within classes in the converted image is easier to capture. The specific encoding process is as follows:

[0103] For the normalized one-dimensional data, a standard normal distribution z is obtained by the following z-score standardization method for the original time series: t :

[0104]

[0105] Where u represents x t The average value of x t The standard deviation of N represents the dimension of one-dimensional time series signal;

[0106] Using the Piecewise Aggregate Approximation (PAA) method, we select a suitable reduction factor k and generate a new smoothed time series X, reducing the dimension N to m:

[0107]

[0108] in t j is the time series T n The value at timestamp j is reduced by calculating the average value of the piecewise constant, which can maintain the approximate trend of the original time series. Finally, the length of the new smoothed time series is m. Calculate the relative position between the two timestamps and convert the preprocessed time series X into a two-dimensional matrix M:

[0109]

[0110] The i-th row and i-th column of the matrix are both x i The former is the difference between each point in the sequence and the reference point, and the latter is the difference between the reference point and each point in the sequence. Deconstructing the information of the time series from both positive and negative perspectives can provide redundant features of the fault point to improve the generalization ability. The two-dimensional image obtained by the image encoding method of the relative position matrix is ​​as follows: Figure 6 As shown, Figure 6 (a) in the figure is the sampling point with amplitude between -0.01 and 0.01. Figure 6 (b) in the figure is a sampling point with an amplitude between 0 and 1. Figure 6 (c) in the figure is a sampling point with an amplitude between -0.5 and 1. Figure 6(d) in the figure is the sampling point with amplitude between -0.05 and 0.05. Figure 6 (e) in the figure is a sampling point with an amplitude between -10 and 0. Figure 6 (f) in the figure is a sampling point with an amplitude between -0.1 and 0.1.

[0111] Based on the above embodiment, step 400 includes:

[0112] The embodiment of the present invention constructs a ResNet network model that integrates a dual attention mechanism. Since the ResNet network has the characteristics of inductive bias, it has good generalization and convergence speed. The contextual attention CotAttention (Contextual Attention) mechanism is a neural network model for visual question-answering tasks in multimodal scenarios, which is usually used for text sequence modeling tasks in the field of natural language processing. It has strong model capabilities when processing large-scale data sets; the convolutional block attention module (Convolutional Block Attention Module, CBAM) is an important attention mechanism module introduced in a convolutional neural network, which is embedded in basic blocks at different levels to improve the perception of important information in the image layer by layer. Therefore, the traditional convolutional neural network is combined with the attention mechanism, and the advantages of both are combined to form a new network model with good generalization and model capabilities.

[0113] First, a CotAttention mechanism is added in the feature extraction stage, and separable convolution is used to reduce the amount of calculation. The input feature map is divided into multiple channel groups, each of which contains a certain number of continuous channels. For each channel group, 1x1 convolution and 3x3 separable convolution are used to process the features. Then, the CBAM module is embedded in the basic block (BasicBlock) of ResNet to enhance the feature representation of each basic block. Within each basic block, the channel grouping is processed by 1x1 convolution and 3x3 separable convolution, and then mean pooling and maximum pooling are used to obtain global information. Next, for each channel group, it uses mean pooling and maximum pooling to obtain global information and splices them together. Finally, the channel attention weights are generated by applying 1x1 convolution and sigmoid activation function again. Ultimately, these weights will be used to weight the feature representation of each channel, so that the network can more automatically focus on the most critical areas on the input feature map. After the above processing, the detection efficiency of the model is greatly improved compared to the traditional ResNet network. The overall structure is as follows Figure 7 shown.

[0114] The structure diagram of the CotAttention module is as follows Figure 8As shown, given an input two-dimensional feature of size H×W×C Figure X , (where H is the height, W is the width, and C is the number of channels), respectively, through the embedding matrix (W q , W k , W v ) Convert X to Queries Q = XW q ,Keys K=XW k , Value V=XW v Each embedding matrix is ​​convolved 1×1 in space. The local relationship matrix between K and Q for:

[0115]

[0116] It is expressed as a local matrix multiplication, which is used to calculate the relationship between each query and the matching keys in the local k×k grid in the space. Then it is concat with Q, and the concat result is convolved twice continuously. The obtained Attention Map and V are locally matrix multiplied to obtain the dynamic context modeling feature map. Finally, the output feature Y of CoT is the fusion of all values ​​in each k×k grid and the local attention matrix.

[0117] The uniqueness of CotAttention is that it fully considers the contextual relationship between channels. By introducing global information, it improves the expressiveness of specific channels in a targeted manner, thereby more effectively capturing important features in the image. This mechanism helps to improve the perception of the model and make it more suitable for image classification tasks in complex scenes. By introducing the COT-Attention mechanism, the model's ability to capture image features can be enhanced, improving model performance and generalization capabilities.

[0118] Figure 8In the code, conv means convolution, Batch Norm is a batch normalization operation for images, and Relu is an activation function, which makes the neural network better fit nonlinear problems. In deep learning, MAXPOOL (maximum pooling) and AvgPOOL (average pooling) are both common pooling operations, which are usually used in convolutional neural networks to reduce the size of feature maps and extract the most important feature information. The MAXPOOL operation divides the input feature map into several small blocks, and then takes the maximum value of all elements in each small block as the output of the block. This can retain the most significant feature information, reduce the dimension of the feature map, and reduce the computational cost. The (average pooling) operation is similar to MAXPOOL, but it takes the average value of the elements in each small block as the output of the block. AvgPOOL can effectively reduce the redundant information in the feature map, making the model more generalizable. The last four stages in the network model represent residual blocks. ID BLOCK×2 represents two residual blocks that do not change the dimension. Similarly, ID BLOCK×3 represents three residual blocks that do not change the dimension. When the MTF coding map is input into the network model, the input image will first be preprocessed, such as cropping, resizing, and normalization, so that the input image size can meet the input format required by the model. Then the image enters the convolution layer, where the features of the image will be extracted. It then enters the residual block, where the network calculates the residual between the input and output of each convolution layer and adds it to the input of the next convolution layer. This helps to speed up model training and improve model accuracy.

[0119] Before entering the next convolution layer and residual block, a CotAttention mechanism is introduced, which allows the model to pay attention to the most important areas in the feature map to the greatest extent. Then enter the convolution layer and residual block again. After repeating this operation three times, the feature map will enter the AvgPOOL module. In the AvgPOOL module, the model will use global average pooling to compress the feature map to generate a feature vector, and compress the output of the convolution layer through the Flatten layer. This can reduce the complexity of the model calculation and the number of network parameters, and can eliminate spatial information. Finally, the feature vector will enter the fully connected layer FC, and the classification or regression prediction task will be performed in this last layer.

[0120] The structure of the CBAM attention module is as follows: Fig. 9 As shown in the figure, the CBAM module mainly consists of two parts: the Channel Attention Module and the Spatial Attention Module. It realizes global modeling of image features by fine-tuning the channel and spatial information.

[0121] The channel attention mechanism extracts the global information of each channel through global average pooling and global max pooling operations. These two types of information are fused through the fully connected layer, and the learned weights are normalized through the Sigmoid activation function, and finally applied to each channel of the original feature to obtain the weighted feature representation. The calculation formula of the channel attention mechanism is as follows:

[0122] Among them, F is the feature map and Represent the average pooling feature and the maximum pooling feature respectively, and after the Sigmoid function represented by σ, the output feature map M of the channel attention is generated. c (F).

[0123] The spatial attention mechanism extracts global information at each position by performing global average pooling and global maximum pooling on the spatial position. The two types of information are fused through splicing and convolution operations, and the learned weights are also normalized through the Sigmoid activation function, and finally applied to each position of the original feature to obtain the weighted feature representation. The mathematical expression of the spatial attention mechanism is as follows:

[0124]

[0125] in, and The size is 1×H×W, H is the height, W is the width, σ represents the sigmoid function, f 7×7 Represents a convolution operation of size 7×7.

[0126] The introduction of the CBAM module helps the neural network understand image features more comprehensively and improves its ability to model complex images. Its mathematical expression clearly demonstrates the process of weighting channel and spatial information through the attention mechanism, providing a theoretical basis for improving the performance of deep learning models.

[0127] Furthermore, the training parameters of the model are configured, the batch size is set to 8 to 1024 (for example, 64), and the training is performed for 50 to 300 (for example, 150) epochs. The maximum learning rate is set to 0.0001 to 0.01 (for example, 0.001), the Adam optimizer and the cross entropy loss function are selected, and the training sample features are sent to the constructed model for forward propagation to obtain the predicted sample label (that is, the ResNet dual attention mechanism model outputs the classification label result). The cross entropy loss function is used to calculate the loss value of the predicted label and the true label.

[0128] Finally, the model is trained using the PyTorch framework. Each training cycle (epoch) includes the following steps:

[0129] The training set is divided into several batches, each batch contains a certain number of images and corresponding labels.

[0130] The following operations are performed for each batch: the image is input into the ResNet network model to obtain the output classification label result; the cross entropy loss between the classification label result output by the ResNet dual attention mechanism model and the true label result is calculated; back propagation is performed according to the loss to update the parameters of the model; the loss and accuracy of the current batch are recorded; after all batches are completed, the average loss and accuracy of the current cycle are calculated.

[0131] After the training is completed, the verification set is used to verify the accuracy of the ResNet dual attention mechanism model.

[0132] For example, all two-dimensional image data sets can be randomly divided into training sets and validation sets in a ratio of 7:3, the training sets are sent to the model for training, and the validation sets are used to adjust the model parameters and record the experimental results. Specifically, the trained model can be used to identify disturbance signals, monitor and identify five types of disturbance data and original noise, including stone knocks, stone scratches, branch scratches, longitudinal pulling, and climbing.

[0133] Based on the above embodiment, step 500 includes:

[0134] The embodiment of the present invention uses the trained ResNet dual attention mechanism network model to perform disturbance recognition, and determines whether the disturbance type corresponding to the input signal belongs to stone scratching, longitudinal pulling, stone knocking, branch scratching, climbing or is original noise.

[0135] The model proposed in the present invention has superior image recognition capability, and the network's image modeling capability increases with the increase of the spatial interaction order. The explicit high-order spatial interaction introduced in the model architecture design is conducive to improving the modeling capability of the visual model and can effectively identify the fiber optic sensing events converted into two-dimensional data.

[0136] Fig.10 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10As shown, the electronic device may include: a processor (processor) 1010, a communication interface (Communications Interface) 1020, a memory (memory) 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020, and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 can call the logic instructions in the memory 1030 to execute the optical fiber sensing signal recognition method based on the ResNet dual attention mechanism, which includes: collecting multiple types of disturbance event original data in the Φ-OTDR distributed optical fiber sensing system; preprocessing the multiple types of disturbance event original data to obtain a preprocessed one-dimensional time series signal; performing relative position matrix encoding on the preprocessed one-dimensional time series signal to obtain a two-dimensional image, sorting the two-dimensional image based on the type of disturbance event to obtain a data set, and dividing the data set into a training set and a verification set; constructing a ResNet network model integrating the dual attention mechanism, training the ResNet network model using the training set, and verifying the ResNet network model using the verification set to obtain a trained optical fiber sensing signal recognition model; inputting the disturbance event data to be identified into the optical fiber sensing signal recognition model, and outputting the optical fiber sensing signal recognition result.

[0137] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0138] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fiber optic sensor signal recognition method based on ResNet dual attention mechanism, characterized in that: include: Collect raw data of various disturbance events in the phase-sensitive optical time domain reflectometry Φ-OTDR distributed fiber sensing system; Preprocessing the original data of the multiple types of disturbance events to obtain a preprocessed one-dimensional time series signal; Performing relative position matrix encoding on the preprocessed one-dimensional time series signal to obtain a two-dimensional image, sorting the two-dimensional image based on the type of disturbance event to obtain a data set, and dividing the data set into a training set and a validation set; Constructing a ResNet network model integrating a dual attention mechanism, training the ResNet network model using the training set, and verifying the ResNet network model using the verification set to obtain a trained optical fiber sensing signal recognition model; The disturbance event data to be identified is input into the optical fiber sensing signal identification model, and the optical fiber sensing signal identification result is output.

2. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 1 is characterized in that: Collect raw data of various disturbance events in the Φ-OTDR distributed optical fiber sensing system, including: Constructing the Φ-OTDR distributed optical fiber sensing system; Different types of disturbance events in the Φ-OTDR distributed optical fiber sensing system are determined, and original data corresponding to the different types of disturbance events are collected.

3. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 2 is characterized in that: The Φ-OTDR distributed optical fiber sensing system is constructed, including: Ultra-narrow linewidth lasers, signal generators, acousto-optic modulators, erbium-doped fiber amplifiers, circulators, sensing fibers, photodetectors, data acquisition cards, and signal processing modules; The continuous light signal emitted by the ultra-narrow linewidth laser is input into the acousto-optic modulator, and the pulse signal generated by the signal generator is input into the acousto-optic modulator, and the acousto-optic modulator modulates the continuous light signal into a pulse light signal; The erbium-doped fiber amplifier amplifies the pulse light signal, and connects the amplified pulse light signal to the sensing optical fiber through the circulator; The backscattered Rayleigh light signal returned from the sensing optical fiber is transmitted to the photodetector after passing through the circulator, and the photodetector converts the received light signal into an electrical signal, and transmits the electrical signal to the data acquisition card; The data acquisition card samples the electrical signal and transmits the obtained sampled signal to the signal processing module; The signal processing module identifies and marks the sampled signals to obtain original data corresponding to multiple types of disturbance events.

4. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 1 is characterized in that: Preprocessing the original data of the multiple types of disturbance events to obtain a preprocessed one-dimensional time series signal, including: Performing wavelet denoising on the original data of the multiple types of disturbance events to obtain wavelet denoised data; The wavelet denoised data is divided using a sliding window to obtain the preprocessed one-dimensional time series signal.

5. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 4 is characterized in that: Performing wavelet denoising on the original data of the multiple types of disturbance events to obtain wavelet denoised data includes: Determine the wavelet decomposition level N and the wavelet waveform, and perform N-layer wavelet decomposition calculation on the original data of the multiple types of disturbance events; Threshold quantization is performed on each layer of high-frequency coefficients from layer 1 to layer N; According to the Nth layer low-frequency coefficients of wavelet decomposition and the high-frequency coefficients of the 1st layer to the Nth layer after threshold quantization processing, the signal wavelet reconstruction is performed to obtain the wavelet denoised data.

6. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 4 is characterized in that: The wavelet denoised data is divided using a sliding window to obtain the preprocessed one-dimensional time series signal, including: Determine the sliding window size and sliding step size, perform sliding division on the sample points corresponding to the wavelet denoised data, and obtain time series samples; The numerical value corresponding to any sample point in the time series sample is obtained, and the numerical value corresponding to any sample point is normalized based on the maximum value of several sample points in the time series sample and the minimum value of several sample points in the time series sample to obtain the preprocessed one-dimensional time series signal.

7. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 1 is characterized in that: The preprocessed one-dimensional time series signal is encoded with a relative position matrix to obtain a two-dimensional image, the two-dimensional image is sorted based on the type of disturbance event to obtain a data set, and the data set is divided into a training set and a verification set, including: The standard normal distribution z of the preprocessed one-dimensional time series signal is obtained by z-score standardization. t : Where u represents x t The average value of x t The standard deviation of N represents the dimension of one-dimensional time series signal; Using the segmented aggregation approximation method, the reduction factor k is determined to generate a new smoothed time series X, reducing the dimension N to m: in t j is the time series T n The value at timestamp j; Calculate the relative position between any two timestamps and convert the new smoothed time series X into a two-dimensional matrix M: The i-th row and i-th column of the matrix M are both x i is the reference point, which respectively represents the difference between each point in the sequence and the reference point, and the difference between the reference point and each point in the sequence.

8. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 1 is characterized in that: Construct a ResNet network model that integrates the dual attention mechanism, including: In the feature extraction stage of the ResNet network model, a contextual attention CotAttention module is added to divide the input feature map into multiple channel groups. Each channel group includes several continuous channels. 1×1 convolution and 3×3 separable convolution are used to process the features of each channel group. The convolutional block attention module (CBAM) is embedded into the basic block of the ResNet network model. 1×1 convolution and 3×3 separable convolution are used to process the channel grouping for each basic block, and mean pooling and maximum pooling are used to obtain global information. Mean pooling and maximum pooling are used for each channel group to obtain global information, and the global information is concatenated; The 1x1 convolution and sigmoid activation function are used to generate channel attention weights, and the attention weights of each channel are weighted to the feature representation of each channel to obtain the key areas of the feature map.

9. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 8, characterized in that: The context attention CotAttention module includes: The input two-dimensional feature map X of size H×W×C, where H is the height, W is the width, and C is the number of channels, is embedded in the matrix (W q , W k , W v ) converts X to: Queries Q=XW q ,Keys K=XW k ,Value V=XW v Each embedding matrix performs a 1×1 convolution in space, and the local relationship matrix between K and Q for: in, It is represented as a local matrix multiplication, which is used to calculate the relationship between each query and matching keys in a local k×k grid in space; Connect with Q, perform two consecutive convolutions on the connection result, multiply the obtained attention map with V by local matrix to obtain the dynamic context modeling feature map, and output feature Y, which represents the fusion of all values ​​in each k×k grid and the local attention matrix; Correspondingly, the convolutional block attention module CBAM includes a channel attention module and a spatial attention module; The calculation formula of the channel attention module is: Among them, F is the feature map, and Represent the average pooling feature and the maximum pooling feature respectively, and after the Sigmoid function represented by σ, the output feature map M of the channel attention is generated. c (F); The calculation formula of the spatial attention module is: in, and The size is 1×H×W, H is the height, W is the width, σ represents the sigmoid function, f 7×7 Represents a convolution operation of size 7×7.

10. The optical fiber sensing signal recognition method based on ResNet dual attention mechanism according to claim 1 is characterized in that: The ResNet network model is trained using the training set, and the ResNet network model is verified using the verification set to obtain a trained optical fiber sensing signal recognition model, including: Determine a set of training parameters including a training batch size, a number of training iterations, and a maximum learning rate, use an Adam optimizer and a cross entropy loss function, input the training set into the ResNet network model for forward propagation, obtain predicted sample labels, and use the cross entropy loss function to calculate loss values ​​of predicted labels and true labels; The PyTorch framework is used for model training. Each training cycle includes: Divide the training set into several batches, each batch includes several images and corresponding labels, perform back propagation according to the loss value, update the model parameters, obtain the loss and accuracy of the current batch, and after all batches are completed, calculate the average loss and accuracy of the current cycle; After the training is completed, the accuracy of the ResNet network model is verified using the verification set to obtain the optical fiber sensing signal recognition model.

Citation Information

Cited By

  • Distributed optical fiber sensing pipeline leakage identification method

    CN119123343A

  • Construction method of intelligent agricultural platform based on big data analysis and visual model

    CN119294653A

  • Unsupervised distributed aerial optical cable anomaly detection method

    CN119519827A

  • Signal identification method and system of optical fiber sensing network

    CN119743195A

  • Power load identification method and system based on GAF and ResNet-CBAM fusion architecture

    CN120408161A