Distributed optical fiber sensing event classification and identification method based on mask auto-encoder self-supervised learning

By using masked autoencoder for self-supervised learning in a distributed fiber sensing system and pre-training with labelless data, the problems of difficulty in obtaining labeled data and long pre-training time are solved, and efficient event classification recognition is achieved.

CN119863657APending Publication Date: 2025-04-22ARTIFICIAL INTELLIGENCE INNOVATION RES INST OF ZHEJIANG UNIV OF TECH BINJIANG DISTRICT HANGZHOU
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411925278.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

It is difficult to obtain sufficient labeled DAS data in distributed fiber sensing systems, and traditional self-supervised pre-training time is too long, resulting in increased time and economic costs.

Method used

The self-supervised learning method based on masked autoencoder is adopted to pre-train the untagged data, extract the DAS signal characteristics and compress the calculation amount, so that the downstream classification recognition network only needs a small amount of labeled data for training.

Benefits of technology

It effectively reduces the demand for labeled data, shortens network pre-training time, and ensures the accuracy of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863657A_ABST
    Figure CN119863657A_ABST
Patent Text Reader

Abstract

A distributed optical fiber sensing event classification and identification method based on mask auto-encoder self-supervised learning belongs to the technical field of distributed optical fiber sound and vibration sensing, on one hand, a pre-training network does not need label data, a downstream classification and identification network only needs a small amount of labeled data, and the demand of the labeled data is reduced; and on the other hand, in the pre-training process, the model extracts DAS signal features and compresses the calculation amount of the DAS signals, so that pixel-level reconstruction of DAS signal reconstruction is changed into feature reconstruction, a large amount of time is saved, and the accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of distributed optical fiber sound and vibration sensing, and relates to a human event classification and recognition method of a distributed optical fiber sensing system based on a self-supervisory feature mask autoencoder. Background Art

[0002] Distributed acoustic sensing (DAS) technology uses optical fiber as a sensor to sense sound vibration signals. It is mainly used in traffic management, oil and gas detection, geological monitoring, offshore wind power, perimeter security and other fields. DAS technology generates a large amount of data, which is difficult to fully analyze and process with traditional methods. In recent years, big data and deep learning methods have been increasingly used in the analysis and processing of DAS data, making data analysis and processing more accurate, fast and comprehensive.

[0003] At present, supervised learning type deep learning occupies a dominant position in the processing of DAS data. Supervised learning requires that all data have labels for training and learning. However, due to the characteristics of DAS technology, obtaining labeled data requires a lot of manpower and time costs, and the pre-training time of mainstream self-supervised deep learning networks is long, wasting a lot of computing power. The reasons include the following aspects: (1) Collecting DAS data from various sources or fields may be time-consuming and costly; (2) Some DAS data may be restricted by privacy regulations, making it difficult to obtain; (3) Some DAS detection tasks may require professional knowledge or skills to accurately label or annotate data; (4) Most existing DAS databases are unlabeled databases. (5) The self-supervised network needs to learn the characteristics of the target by comparing the difference between pixel points, which is time-consuming. Therefore, it is an appropriate method to use a self-supervised mask autoencoder of compressible image signals based on a small amount of labeled DAS data and a large amount of unlabeled data to classify and recognize DAS data.

[0004] Some people have proposed the application of self-supervised methods in the DAS field in DAS pattern recognition tasks (Reference 1: Sun M, Yu M, Wang H, Song K, Guo X, Xue S, Zhang H, Shao Y, Cui H, Chang T and Zhang T. Intelligent water perimeter security event recognition based on NAM-MAE and distributed optic fiber acoustic sensing system. Opt Express. 31(22), 37058-37073(2023) Sun M, Yu M, Wang H, Song K, Guo X, Xue S, Zhang H, Shao Y, Cui H, Chang T and Zhang T. Intelligent water perimeter security event recognition based on NAM-MAE and distributed optic fiber acoustic sensing system. Opt Express. 31(22), 37058-37073(2023)). The DAS gait recognition task also has great application prospects in the field of DAS detection (Reference 2: Zhou, Y., Yeoh, JK, Li, YE, and Solihin, W., "Large Scale Indoor Occupant Tracking Using Distributed Acoustic Sensing and Machine Learning", BUILDING AND ENVIRONMENT 247, 111005 (2024). Zhou, Y., Yeoh, JK, Li, YE, and Solihin, W. Large Scale Indoor Occupant Tracking Using Distributed Acoustic Sensing and Machine Learning, Building and Environment, 247, 111005 (2024)). In order to complete the recognition task, DAS data needs to be labeled before it can be input into the recognition network for training and learning. However, it is often difficult to obtain labeled DAS data and most self-supervised training takes a long time, which increases the time and economic cost burden. Summary of the invention

[0005] In order to overcome the shortcomings of the existing technology and solve the problem that it is difficult to obtain sufficient labeled DAS data when identifying a distributed optical fiber sensing system and that the traditional self-supervised pre-training time is too long, the present invention provides a distributed optical fiber sensing event classification and recognition method based on masked autoencoder self-supervised learning. On the one hand, the pre-training network does not require labeled data, and the downstream classification and recognition network only requires a small amount of labeled data, reducing the demand for labeled data; on the other hand, in the pre-training, the model extracts the DAS signal features and compresses the calculation amount of the DAS signal, so that the DAS signal reconstruction is transformed from pixel-level reconstruction to feature reconstruction, saving a lot of time and ensuring accuracy.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A distributed optical fiber sensing event classification and recognition method based on masked autoencoder self-supervised learning comprises the following steps:

[0008] Step 1: Perform DAS data collection: Build a DAS data collection device to collect data collected by the DAS system when different events occur. When collecting unlabeled data, collect DAS data for a sufficiently long period of time to ensure that the unlabeled data is sufficient; when collecting labeled data, collect DAS data for a shorter but sufficient period of time;

[0009] Step 2, DAS signal preprocessing: The collected real labeled DAS data and unlabeled DAS data are divided into several parts of the same length in the time dimension, and the divided data are normalized after wavelet denoising to transform into two-dimensional spatiotemporal data to construct a time-space feature data set; each individual data in the DAS data set is represented as I(x, y), x, y are the coordinate values ​​of the pixel in the data, and I(x, y) is the brightness value of the pixel with coordinates x, y in the data;

[0010] Step 3, calculating the DAS signal gradient direction histogram;

[0011] Step 4: Construct a pre-trained network based on masked autoencoder;

[0012] In addition to the HOG extraction part, the pre-trained network also includes a block embedding layer L, a position embedding layer P1, a masker M, an encoder E1 and a decoder D, wherein the DAS signal processing input by the block embedding layer L is processed in blocks to generate a matrix vector representing the input signal; the position embedding layer P1 flattens and reduces the dimension of the image blocks output by the block embedding layer L, and performs position encoding on the image blocks to determine the spatial relationship between the image blocks; the masker M randomly sorts the encoded image blocks and masks the image blocks of a set proportion; the encoder E1 extracts features from the unmasked image blocks; the decoder D outputs the predicted mask information, and uses the mean square error MSE between the predicted mask information and the HOG image as the loss function to train the pre-trained network;

[0013] Step 5, unlabeled data pre-training: Use the original DAS data as the input of the pre-training network, reconstruct the HOG of the original DAS data as the output of the pre-training network, and train the pre-training network; repeat steps 4 and 5 using unlabeled DAS data, so that the decoder D predicts data that gradually approaches the HOG calculated by the real DAS data, and save the pre-trained encoder E1;

[0014] Step 6: Build the downstream classification task network;

[0015] The network structure of the downstream classification task also includes a block embedding layer L, a position embedding layer P2 and an encoder E2, where the block embedding layer L is exactly the same as the pre-trained network; the encoder E2 adds the cls block when training the output of the position embedding layer P2 and synchronizes the weights of the encoder E1 for training. The loss function of the downstream task is the cross entropy loss function between the predicted label and the true label of the cls block;

[0016] Step 7: Fine-tune the downstream task network: Repeat step 6 using a small amount of labeled DAS data to make the predicted label of the cls block in encoder E2 close to the true label, and obtain the weight of encoder E2;

[0017] Step 8, Test: Freeze all parameters of the downstream task network and perform classification tests on sufficient unlabeled data.

[0018] Furthermore, in step 3, the gradient histogram of some unlabeled two-dimensional spatiotemporal data is calculated to extract the gradient features in the data. The calculation process of the gradient histogram (HOG, Histogram of Oriented Gradients) is divided into three processes:

[0019] First, the gradient value of each pixel in the image is calculated. The gradient is a measure of the brightness change in the image, usually expressed as a difference in two directions (for example, horizontal and vertical directions):

[0020] Gx =I(x+1,y)-I(x-1,y);

[0021] G y =I(x,y+1)-I(x,y-1);

[0022] Where I(x, y) is the brightness value of the image, G x and G y Represent the gradients in the horizontal and vertical directions respectively;

[0023] Secondly, calculate the gradient direction and magnitude. By combining the horizontal and vertical gradients, calculate the gradient direction and magnitude of each pixel:

[0024] θ=atan2(G x , G y );

[0025]

[0026] Where tan2(G x , G y ) is the four-quadrant inverse tangent function, which is used to calculate the angle from the horizontal direction to the gradient direction, and |G| represents the magnitude of the gradient;

[0027] Finally, the image features are described by calculating the gradient direction distribution in each small unit cell. The image is divided into small units. In each small unit, a direction histogram is created based on the gradient direction of the pixel point, and these gradient directions are assigned to the histogram. The HOG features are locally normalized. The image is divided into larger blocks, and the HOG features of each block are normalized.

[0028]

[0029] Among them, v is the eigenvector before normalization, ||v|| 2 is the L2 norm of the eigenvector, ∈ is a small constant used to avoid division by zero errors;

[0030] By combining the normalized HOG features of each block, the HOG features of the entire image can be obtained. The obtained HOG is further compressed through convolution and input into the network as the reconstruction target of the pre-trained network.

[0031] Furthermore, the process of step 4 is as follows:

[0032] 4.1. Image block processing: The block embedding layer L divides the DAS data spatiotemporal image into image blocks of fixed size;

[0033] 4.2. Linear Projection: Position Embedding Layer P1 Input the image block into the linear projection layer, generate the label corresponding to each image block, and output an ordered label sequence; and embed the ordered label sequence into the position code, and output the label sequence Z = [z1, z2, ..., z n ] where z i is the i-th token of the token sequence;

[0034] 4.3. Randomly and evenly select the image blocks that have completed the position encoding according to the corresponding label group, retain the selected image blocks, and mask the remaining ones as masks. The mask is a learnable label sequence representation. The masking ratio needs to be moderate, so as to reduce the information redundancy between image blocks, which is more conducive to the model network learning the global features of the image;

[0035] 4.4. Transformer encoding: The labeled sequence with position encoding and the masked image block are input to encoder E1. Encoder E1 contains N transformer encoding blocks. Each transformer encoding block first enters the normalization layer to output the normalized labeled sequence, and the normalized labeled sequence then enters the multi-head self-attention layer. In the self-attention layer, the input sequence X is first subjected to three linear transformations to obtain the sequence of query Q, key K and value V, which can be obtained by matrix multiplication and projection matrix W. Q , W K , W V To obtain:

[0036]

[0037] Where W Q , W K , W V is the weight matrix obtained through training, and the obtained query Q, key K and value V sequence are divided into h heads respectively, and the head q is obtained i , k i , v i For a subset of the original sequence, the attention score is calculated for each head i, using the dot product attention mechanism:

[0038]

[0039] in is the scaling factor, d k is the dimension of query Q and key K in each head, and the Softmax function converts the attention score into a weight. The attention output of each head is concatenated to obtain the final output of multi-head self-attention:

[0040] MultiHead(Q,K,V)=Concat(Attention(q1,k1,v1),Attention(q2,k2,v2),...,Attention(q h , k h , v h ))

[0041] The concatenated output is passed through another trained weight matrix W O Perform a linear transformation and then perform a residual connection with the input sequence:

[0042] Output=LN(MultiHead(Q,K,V))·W O +X;

[0043] Among them, LN is the layer normalization operation. After the output of the multi-head self-attention layer is input into a normalization layer, it enters the multi-layer perceptron layer. The multi-layer perceptron layer enlarges and then reduces its input dimension to the dimension size of the initial input tag sequence. After the output is output, it is residually connected with the input sequence to output the deformer code and enter the next deformer code block. After N deformer code blocks, the final deformer code is obtained. Each deformer code corresponds to the tag in the initial tag sequence, and a fixed number of tag groups correspond to the initial image block.

[0044] 4.5. Input the image block with features extracted by the encoder into the decoder D. The architecture of D corresponds to the encoder E1, which is the block architecture of the same transformer. The input sequence contains position encoding. Output two parts of information: the unmasked HOG image block is generated by the decoder. The label sequence and the masked mask sequence, all mask sequences are represented by the same learnable label sequence. The last layer of the decoder is a linear layer, which outputs the reconstructed image block. The loss function is the mean squared error (MSE) function:

[0045]

[0046] Among them, pi is the reconstructed feature, The original feature.

[0047] Furthermore, the process of step 6 is as follows:

[0048] 6.1. The initial weight parameters of encoder E2 constructed by the downstream task are the same as the weight parameters of encoder E1 after training of the pre-training task;

[0049] 6.2. In the step of adding position encoding, the data label value cls is added according to the label of the label data, the 0 position information is embedded, and the label sequence output by the linear projection layer is concatenated and input into the transformer encoder to output the encoding with the label data;

[0050] 6.3. The tag value represented by cls is used as the final output of encoder E2;

[0051] 6.4. Calculate the cross entropy loss function between the encoder output and the original data label value:

[0052]

[0053] where e i is the true probability set, e j The predicted value output by the model.

[0054] In the present invention, the use of machine learning and other models for DAS system event pattern recognition is widely used in its application field. The machine learning model usually requires a large amount of labeled data to drive it. However, in practice, obtaining a large amount of labeled data requires huge resources and may be very difficult. Mainstream unsupervised learning and self-supervised learning neural networks require a lot of time for pre-training. Self-supervision technology with signal compression is a more effective solution. The present invention is oriented to the DAS system, based on a self-supervised masked autoencoder network structure with HOG, and sets a network pre-training network for reconstructing DAS unlabeled data and a pattern recognition visual deformer network based on a small amount of labeled data, which effectively reduces the demand for labeled data for the DAS system pattern recognition machine learning model, shortens the time for network pre-training, and effectively combines unlabeled data without losing accuracy to achieve the effect of event pattern recognition.

[0055] The beneficial effects of the present invention are mainly manifested in: effectively reducing the demand for labeled data of the DAS system pattern recognition machine learning model, shortening the time of network pre-training, and effectively combining unlabeled data to achieve the effect of event pattern recognition without losing accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a schematic diagram of the process of the present invention;

[0057] Figure 2 It is a block diagram of a DAS data acquisition system;

[0058] Figure 3 Schematic diagram of experimental data collection;

[0059] Figure 4 It is the space-time diagram of the event signal after preprocessing;

[0060] Figure 5 Histogram signal time-space diagram for feature extraction

[0061] Figure 6 This is the structure diagram of the pre-trained network;

[0062] Figure 7 The process of extracting the gradient direction histogram;

[0063] Figure 8 This is the network structure diagram of the downstream task;

[0064] Fig. 9 The accuracy of downstream tasks with different numbers of labels;

[0065] Fig.10 Predict confusion matrix plots for self-supervised network model pattern recognition;

[0066] Fig.11 Identify the predicted confusion matrix for the self-supervised network model using the gradient orientation histogram as the reconstruction target. DETAILED DESCRIPTION

[0067] The present invention will be further described below in conjunction with the accompanying drawings.

[0068] Reference Figures 1 to 11 , a distributed fiber optic sensing event classification and recognition method based on masked autoencoder self-supervised learning, performs pattern recognition on six different gait combinations of three experimental personnel, and explains the application of the self-supervised masked autoencoder distributed fiber optic sensing system gait pattern recognition method with gradient direction histogram to extract image information in the DAS system pattern recognition scenario. This example is based on the collected unlabeled data containing the above six types of events and the six types of labeled data annotated with corresponding labels, and classifies the six types of gait signals collected by DAS through a self-supervised learning model.

[0069] Taking the laboratory carpet as a specific example, the flow chart of the pattern recognition method based on distributed optical fiber sensing of different events is as follows: Figure 1 As shown, the method comprises the following steps:

[0070] Step 1: Collect DAS signals;

[0071] Build as Figure 2 The experimental device of the DAS data acquisition system shown in the figure, in which the DAS components such as narrow linewidth laser, optical amplifier EDFA, optical coupler, local oscillator, acousto-optic modulator, optical circulator, optical filter, photodetector, high-speed data acquisition card are integrated in the DFS-2000 series DAS demodulation instrument. The model of the instrument is DFS-2005, with a detection distance of 5km, a spatial resolution of 5m, and a DAS signal sampling rate of 20kS / s. The instrument is connected to a 5km long G652 rubber-coated single-mode optical fiber, which contains 959 optical fiber points.

[0072] The laser output by the laser is modulated and amplified to form a detection pulse, which enters the sensing fiber to scan the optical fiber link. According to the changes in the scattered signal at different times, the vibration event can be located. The backscattered light in the sensing fiber is collected by the circulator, and the phase information of the scattered light is obtained by mutual interference with the local oscillator light. After passing through the photoelectric detector and the digital-to-analog conversion chip, the FPGA realizes phase demodulation, fading suppression and other signal processing, and finally obtains the vibration information of different positions of the optical fiber. The demodulated vibration signal is transmitted to the industrial computer via Gigabit Ethernet to realize the back-end processing of signal feature analysis and event identification of the vibration data.

[0073] The optical fiber is laid parallel to the carpet at a distance of 5 cm. One end of the optical fiber is connected to the distributed optical fiber system (DAS) and the other end is coiled. Figure 3 shown.

[0074] Collecting labeled data: After starting the machine and setting the parameters, data is collected at seven fiber points: 35, 36, 37, 38, 39, 40, and 41. The collection time is 1500s, which includes six types of events. There are a total of 1500×20000×7 data values ​​as the labeled data set.

[0075] Collecting unlabeled data: After starting the machine and setting the parameters, data were collected at seven fiber points: 35, 36, 37, 38, 39, 40, and 41. The collection time was 13,500 seconds, which included six types of events. There were a total of 13,500 × 20,000 × 7 data values ​​as the unlabeled data set.

[0076] Step 2, signal preprocessing: At the positions of the event-occurring optical fiber points 35, 36, 37, 38, 39, 40, and 41, the corresponding time-space two-dimensional signal matrix row index is used to extract the data signal, and the time length of each signal is 5 seconds. The wavelet transform method is used to reduce the noise of the data and eliminate the noise in the signal in the frequency domain to achieve the noise reduction effect. The principle formula is as follows:

[0077]

[0078]

[0079] Where a>0 is called the scale factor, which acts to adjust the wavelet The function is scaled, b is the scaling factor, that is, the distance of displacement.

[0080] Continuous wavelet transform (CWT) steps: first select a wavelet basis function, fix a scale factor, and compare it with the initial segment of the signal; calculate the wavelet coefficients (reflecting the similarity between the wavelet at the current scale and the corresponding signal segment) through the CWT calculation formula; change the translation factor to shift the wavelet along the time axis, and repeat the above two steps to complete an analysis; increase the scale factor, and repeat the above three steps for a second analysis; loop the above four steps three times to get a clean signal.

[0081] After decomposing the wavelet into four layers, threshold processing is performed. The threshold selection formula is:

[0082]

[0083] Where f(k min ) takes the absolute value of each element in the signal, sorts them from large to small, and then squares each sequence to get a new signal sequence.

[0084] The thresholded wavelet signal is subjected to inverse continuous wavelet transform to obtain a pure signal. The unlabeled dataset contains 2700 spatiotemporal graphs, and the labeled dataset contains 300 spatiotemporal graphs, of which 50 spatiotemporal graphs are for each type of event.

[0085] Step 3, calculating the DAS signal gradient direction histogram;

[0086] like Figure 6 As shown, the data input into the pre-trained network is subjected to gradient histogram calculation, and the gradient features in the data are extracted. After feature extraction of the data, it is used as the target of network reconstruction. The Histogram of Oriented Gradients (HOG) is a feature extraction method for object detection. The calculation process of HOG is divided into three steps. First, the gradient value of each pixel in the image is calculated. The gradient is a measure of the brightness change in the image, usually expressed as a difference in two directions (for example, horizontal and vertical directions):

[0087] G x =I(x+1,y)-I(x-1,y);

[0088] G y =I(x,y+1)-I(x,y-1);

[0089] Where I(x, y) is the brightness value of the image, G x and G y Represent the gradients in the horizontal and vertical directions respectively.

[0090] Secondly, calculate the gradient direction and magnitude. By combining the horizontal and vertical gradients, the gradient direction and magnitude of each pixel can be calculated:

[0091] θ=atan2(G x , G y );

[0092]

[0093] Where tan2(G x , G y ) is the four-quadrant inverse tangent function, which is used to calculate the angle from the horizontal direction to the gradient direction. |G| represents the magnitude of the gradient;

[0094] Finally, the image features are described by calculating the distribution of gradient directions in each small cell. The image is divided into small cells. In each cell, a direction histogram is created based on the gradient direction of the pixel. These gradient directions are assigned to the histogram and the HOG features are locally normalized. The image is divided into larger blocks, and the HOG features of each block are normalized;

[0095]

[0096] Among them, v is the eigenvector before normalization, ||v|| 2 is the L2 norm of the eigenvector, ∈ is a small constant used to avoid division by zero errors;

[0097] By combining the normalized HOG features of each block, the HOG feature descriptor of the entire image can be obtained. The obtained HOG is further compressed by convolution and input into the network as the reconstruction target of the pre-trained network.

[0098] Step 4: Build a pre-trained network of the masked autoencoder;

[0099] like Figure 7 As shown, the pre-trained network includes a block embedding layer L, a position embedding layer P1, a masker M, an encoder E1 and a decoder D. The image signal processing of the block embedding layer L input is processed in blocks to generate a matrix vector representing the input image; the position embedding layer P1 flattens and reduces the dimension of the image blocks input by L, and performs position encoding on the image blocks to determine the spatial relationship between the image blocks; the masker M randomly sorts the encoded image blocks and masks 40% of the image blocks; the encoder E1 extracts features from the unmasked image blocks; the decoder D outputs the predicted mask information, and the mean square error (MSE) between the predicted mask information and the HOG image is used as the loss function to train the pre-trained network.

[0100]

[0101] Among them, I iis the reconstructed feature, is the original feature;

[0102] The model receives 224×224×3 image data, and divides the input image into 16×16 image blocks through the block embedding layer L. On the one hand, the feature dimension of the input image block after the position embedding layer P1 is 768, the number of layers N of the deformer encoder is 12, among which the number of attention heads h of the multi-head self-attention mechanism is 12, and the masking ratio of the masker is 40%. The number of layers of the decoder is 8, the number of attention heads of the decoder is 16, the expansion ratio of the hidden layer of the multi-layer perceptron relative to the feature dimension of the embedding layer is 4, the normalization layer type is layer normalization, the encoder maps the image block of the input image to the embedding space, and then the decoder attempts to reconstruct the target image from the embedded representation masked by the masker.

[0103] Step 5: Pre-training with unlabeled data;

[0104] The 2700 preprocessed unlabeled spatiotemporal images are transformed into a 224×224×3 format and input into the pretrained network. The masker M is used to mask the output of the position embedding layer P1. The masked data is input into the encoder E1 to output the reconstructed unlabeled data. Repeat the above steps to make the masked unlabeled data gradually approach the real unlabeled data and restore the gradient feature histogram.

[0105] During the pre-training process, the ratio of training set to validation set was 4:1, the batch size was 8, the model optimizer used AdamW optimizer, the learning rate was 0.001, the first-order moment exponential decay rate was 0.9, the second-order moment exponential decay rate was 0.95, and the learning rate warm-up cycle was 50. After 800 iterations, the model loss function converged to 0.036, the pre-training was stopped, and the model weight parameters were saved.

[0106] After the pre-trained network loss function meets the convergence condition, the training weight parameters of the E1 encoder are synchronized with the E2 encoder. The E1 encoder weight parameters are loaded when the E2 encoder is initialized to achieve synchronization.

[0107] Step 6: Build the downstream classification task network;

[0108] like Figure 8As shown in the figure, the specific structure of the block embedding layer L, the position embedding layer P2 and the encoder E2. The model receives 24×224×3 image data, the input image is divided into 16×16 image blocks, the feature dimension of the input image block after the position embedding layer is 768, the number of layers N of the deformer encoder is 12, of which the number of attention heads h of the multi-head self-attention mechanism is 12, and the expansion ratio of the hidden layer of the multi-layer perceptron relative to the feature dimension of the embedding layer is 4. The encoder maps the image block of the input image and the input image label to the embedding space, extracts the embedding representation corresponding to its label and outputs it as the predicted label probability after normalization. The E2 encoder outputs the predicted mode label after synchronizing the label data set input with the training parameters of the E1 encoder.

[0109] The 300 pre-processed labeled spatiotemporal images are transformed into a 224×224×3 format and input into the prediction training network. Label 'A' represents the gait event of a single experimenter A, label 'B' represents the gait event of a single experimenter B, label 'C' represents the gait event of a single experimenter C, label 'D' represents the gait event of a single experimenter D, label 'A_B' represents the gait events of experimenters A and B, label 'A_C' represents the gait events of experimenters A and C, and label 'B_C' represents the gait events of experimenters B and C.

[0110] Repeat the above steps to make the predicted pattern label gradually approach the real pattern label, thus obtaining a pattern recognition network model with high accuracy. During the downstream task training process, the ratio of training set to validation set is 4:1, the batch size is 8, the AdamW optimizer is used, the learning rate is 0.001, the first-order moment exponential decay rate is 0.9, the second-order moment exponential decay rate is 0.95, and the learning rate scheduling uses the cosine annealing method:

[0111]

[0112] Where x is the number of previous iterations, epochs is the number of training cycles, and lrf is the minimum value of the cosine function. The cosine annealing learning rate schedule gradually reduces the learning rate during training, which helps the model converge better. In the early stage of training, the learning rate is large, which helps the model learn the characteristics of the data faster; in the later stage of training, the learning rate gradually decreases, allowing the model to adjust parameters more finely and improve generalization performance. After 200 iterations, the loss function converges to 0.02486.

[0113] Step 7: Test.

[0114] After the downstream classification task is trained to full convergence, the encoder E2 weights are obtained, all parameters of the downstream task network are frozen, and classification tests are performed on sufficient unlabeled data. 350 spatiotemporal graphs of each event are collected as the test set to test the model performance and draw the confusion matrix as shown below: Fig.11 As shown, its F1 score reaches 0.9388, and the F1 score formula is as follows:

[0115]

[0116] Where Precision represents precision, Recall represents recall, TP is the number of samples correctly predicted as positive examples by the model, FP is the number of samples incorrectly predicted as positive examples by the model, and FN is the number of samples incorrectly predicted as negative examples by the model.

[0117] Train the same structure pattern recognition model, and input the same number of 2700 unlabeled data for pre-training for the mask autoencoder and the mask autoencoder with gradient direction histogram feature map as the target. After 400 cycles of iteration, the model obtains the pre-training weight. Synchronize the pre-training model weight parameters, and use the same model with 30, 40, 50, and 60 labeled data for 200 cycles of iteration. The results are as follows Fig. 9 It shows that in downstream tasks, 50 labeled data of each type can ensure the classification accuracy while ensuring the training efficiency of downstream tasks.

[0118] As a control, the same structural pattern recognition model was trained without extracting the gradient direction histogram feature map as the target image, and the same number of 2700 unlabeled data was input for pre-training. After 400 cycles of iteration, the model obtained the pre-training weight. The confusion matrix after 200 cycles of iteration of the same pre-training model weight parameters and inputting the same number of 50 labeled data of each type is as follows Fig.10 As shown, its F1 score is 0.9462. The time taken for pre-training is 4 hours and 37 minutes.

[0119] As a control, we trained the same structural pattern recognition model, extracted the gradient direction histogram as the target image, and input the same number of 2700 unlabeled data for pre-training. After 400 cycles of iteration, the model obtained the pre-training weight. Synchronize the pre-training model weight parameters, input the same number of 50 labeled data of each type, and the confusion matrix after 200 cycles of iteration is as follows: Fig.11 As shown in the figure, its F1 score is 0.9388, which is slightly inferior to the self-supervised mask autoencoder for pixel reconstruction. The pre-training time is 3 hours and 23 minutes. It shows that extracting histogram as the target image for image reconstruction can greatly shorten the pre-training time of multiple unlabeled data while ensuring accuracy.

[0120] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.

Claims

1. A distributed optical fiber sensing event classification and recognition method based on masked autoencoder self-supervised learning, characterized in that: The method comprises the following steps: Step 1: Perform DAS data collection: Build a DAS data collection device to collect data collected by the DAS system when different events occur. When collecting unlabeled data, collect DAS data for a sufficiently long period of time to ensure that the unlabeled data is sufficient; when collecting labeled data, collect DAS data for a shorter but sufficient period of time; Step 2, DAS signal preprocessing: The collected real labeled DAS data and unlabeled DAS data are divided into several parts of the same length in the time dimension, and the divided data are normalized after wavelet denoising to transform into two-dimensional spatiotemporal data to construct a time-space feature data set; each individual data in the DAS data set is represented as I(x, y), where x, y are the coordinate values ​​of the pixels in the data, and I(x, y) is the brightness value of the pixel with coordinates x, y in the data; Step 3, calculating the DAS signal gradient direction histogram; Step 4: Construct a pre-trained network based on masked autoencoder; In addition to the HOG extraction part, the pre-trained network also includes a block embedding layer L, a position embedding layer P1, a masker M, an encoder E1 and a decoder D, wherein the DAS signal processing input by the block embedding layer L is processed in blocks to generate a matrix vector representing the input signal; the position embedding layer P1 flattens and reduces the dimension of the image blocks output by the block embedding layer L, and performs position encoding on the image blocks to determine the spatial relationship between the image blocks; the masker M randomly sorts the encoded image blocks and masks the image blocks of a set proportion; the encoder E1 extracts features from the unmasked image blocks; the decoder D outputs the predicted mask information, and uses the mean square error MSE between the predicted mask information and the HOG image as the loss function to train the pre-trained network; Step 5, unlabeled data pre-training: Use the original DAS data as the input of the pre-training network, reconstruct the HOG of the original DAS data as the output of the pre-training network, and train the pre-training network; repeat steps 4 and 5 using unlabeled DAS data, so that the decoder D predicts data that gradually approaches the HOG calculated by the real DAS data, and save the pre-trained encoder E1; Step 6: Build the downstream classification task network; The network structure of the downstream classification task also includes a block embedding layer L, a position embedding layer P2 and an encoder E2, where the block embedding layer L is exactly the same as the pre-trained network; the encoder E2 adds the cls block when training the output of the position embedding layer P2 and synchronizes the weights of the encoder E1 for training. The loss function of the downstream task is the cross entropy loss function between the predicted label and the true label of the cls block; Step 7: Fine-tune the downstream task network: Repeat step 6 using a small amount of labeled DAS data to make the predicted label of the cls block in encoder E2 close to the true label, and obtain the weight of encoder E2; Step 8, Test: Freeze all parameters of the downstream task network and perform classification tests on sufficient unlabeled data.

2. The distributed optical fiber sensing event classification and identification method based on masked autoencoder self-supervised learning as claimed in claim 1, characterized in that: In step 3, the gradient histogram of some unlabeled two-dimensional spatiotemporal data is calculated to extract the gradient features in the data. The calculation process of the gradient histogram HOG is divided into three processes: First, calculate the gradient value of each pixel in the image. The gradient is a measure of the brightness change in the image, expressed as a difference in two directions: G x =I(x+1,y)-I(x-1,y); G y =I(x,y+1)-I(x,y-1); Where I(x,y) is the brightness value of the image, G x and G y Represent the gradients in the horizontal and vertical directions respectively; Secondly, calculate the gradient direction and magnitude. By combining the horizontal and vertical gradients, calculate the gradient direction and magnitude of each pixel: θ=atan2(G x ,G y ); Where tan2(G x ,G y ) is the four-quadrant inverse tangent function, which is used to calculate the angle from the horizontal direction to the gradient direction, and |G| represents the magnitude of the gradient; Finally, the image features are described by calculating the gradient direction distribution in each small unit cell. The image is divided into small units. In each small unit, a direction histogram is created based on the gradient direction of the pixel point, and these gradient directions are assigned to the histogram. The HOG features are locally normalized. The image is divided into larger blocks, and the HOG features of each block are normalized. Where v is the eigenvector before normalization, ‖v‖ 2 is the L2 norm of the eigenvector, ∈ is a small constant used to avoid division by zero errors; By combining the normalized HOG features of each block, the HOG features of the entire image can be obtained. The obtained HOG is further compressed through convolution and input into the network as the reconstruction target of the pre-trained network.

3. The distributed optical fiber sensing event classification and identification method based on masked autoencoder self-supervised learning as claimed in claim 1 or 2, characterized in that: The process of step 4 is as follows: 4.

1. Image block processing: The block embedding layer L divides the DAS data spatiotemporal image into image blocks of fixed size; 4.

2. Linear Projection: Position Embedding Layer P1 Input the image block into the linear projection layer, generate the label corresponding to each image block, and output an ordered label sequence; and embed the ordered label sequence into the position code, and output the label sequence Z = [z1, z2, …, z n ] where z i is the i-th token of the token sequence; 4.

3. Randomly and evenly select the image blocks that have completed the position encoding according to the corresponding label group, retain the selected image blocks, and mask the remaining ones as masks. The mask is a learnable label sequence representation. The masking ratio needs to be moderate, so as to reduce the information redundancy between image blocks, which is more conducive to the model network learning the global features of the image; 4.

4. Transformer encoding: The labeled sequence with position encoding and the masked image block are input to the encoder E1. The encoder E1 contains N deformer encoding blocks. Each deformer encoding block first enters the normalization layer to output the normalized labeled sequence. The normalized labeled sequence then enters the multi-head self-attention layer. In the self-attention layer, the input sequence X is first subjected to three linear transformations to obtain the sequence of query Q, key K and value V, which can be obtained by matrix multiplication and projection matrix W. Q , W K , W V To obtain: Where W Q , W K , W V is the weight matrix obtained through training, and the obtained query Q, key K and value V sequence are divided into h heads respectively, and the head q is obtained i ,k i ,v i is a subset of the original sequence, and the attention score is calculated for each head i by the dot product attention mechanism: in is the scaling factor, d k is the dimension of query Q and key K in each head. The Softmax function converts the attention scores into weights, concatenates the attention outputs of each head, and obtains the final output of multi-head self-attention: MultiHead(Q,K,V)=Concat(Attention(q1,k1,v1),Attention(q2,k2,v2),...,Attention(q h ,k h ,v h )) The concatenated output is passed through another trained weight matrix W O Perform a linear transformation and then perform a residual connection with the input sequence: Output=LN(MultiHead(Q,K,V))·W O +X; Among them, LN is the layer normalization operation. After the output of the multi-head self-attention layer is input into a normalization layer, it enters the multi-layer perceptron layer. The multi-layer perceptron layer enlarges and then reduces its input dimension to the dimension size of the initial input tag sequence. After the output, it is residually connected with the input sequence to output the deformer code and enter the next deformer code block. After N deformer code blocks, the final deformer code is obtained. Each deformer code corresponds to the tag in the initial tag sequence, and a fixed number of tag groups correspond to the initial image block. 4.

5. Input the image block whose features are extracted by the encoder into the decoder D. The architecture of D corresponds to that of the encoder E1, which is the block architecture of the same transformer. The input sequence contains the position code and outputs two parts of information: the unmasked HOG image block is generated by the decoder through the tag sequence and the masked mask sequence. All mask sequences are represented by the same learnable tag sequence. The last layer of the decoder is a linear layer, which outputs the reconstructed image block. The loss function is the mean square error MSE function: Among them, p i is the reconstructed feature, The original feature.

4. The distributed optical fiber sensing event classification and identification method based on masked autoencoder self-supervised learning as claimed in claim 1 or 2, characterized in that: The process of step 6 is as follows: 6.

1. The initial weight parameters of encoder E2 constructed by the downstream task are the same as the weight parameters of encoder E1 after training of the pre-training task; 6.

2. In the step of adding position encoding, the data label value cls is added according to the label of the label data, the 0 position information is embedded, and the label sequence output by the linear projection layer is concatenated and input into the transformer encoder to output the encoding with the label data; 6.

3. The tag value represented by cls is used as the final output of encoder E2; 6.

4. Calculate the cross entropy loss function between the encoder output and the original data label value: where e i is the true probability set, e j The predicted value output by the model.

Citation Information

Cited By

  • Optical fiber speckle multi-parameter demodulation method based on parallel deep learning

    CN120495798A

  • A multi-parameter demodulation method for optical fiber speckle based on parallel deep learning

    CN120495798B

  • Radar signal modulation identification method and device for self-supervised contrast mask reconstruction

    CN120687944A

  • Gait identity recognition method based on generative self-supervised visual pre-training model BEiT and DAS technology

    CN121415435A

  • Distributed multi-sensor data fusion unsupervised learning method and system based on multi-dimensional mask

    CN122433018A