Brillouin temperature extraction method and system based on self-attention recurrent neural network
By introducing a method based on self-attention recurrent neural network and meta-learning algorithm in BOTDA technology, dynamically adjusting the information flow, solving the problems of traditional technologies being sensitive to noise, long calculation time and static gating mechanisms, and achieving higher temperature extraction accuracy and real-time performance.
Patent Information
- Application Number
- CN202510336074.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-21
AI Technical Summary
Traditional Brillouin Optical Time Domain Analysis (BOTDA) technology is sensitive to noise during temperature extraction. The fitting results rely on initial parameter selection and have a long calculation time, which limits the feasibility of real-time applications. The static gating mechanism cannot adapt to the dynamic changes in information flow requirements.
The self-attention recurrent neural network is used to optimize the task adaptive weights of the transfer gate and the conversion gate in combination with the meta-learning algorithm, so that the model can dynamically adjust the information flow according to different time steps or tasks.
The prediction and extraction accuracy and real-time performance of Brillouin temperature are improved, and the problem of poor real-time performance and poor adaptability are reduced for long curve fitting, which enhances the model's adaptability to complex environments.
Smart Images

Figure CN119848440A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distributed optical fiber sensing, and in particular relates to a Brillouin temperature extraction method and system based on a self-attention recurrent neural network. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] BOTDA refers to a technology for fiber optic sensing based on the principle of Brillouin scattering, and its full name is Brillouin Optical Time Domain Analysis. The Brillouin Optical Time Domain Analysis system is a typical Brillouin distributed fiber optic sensing system, which is usually composed of a laser, a coupler, an electro-optic modulator, an arbitrary signal generator, an erbium-doped fiber amplifier, a grating filter, a circulator, a polarization scrambler, a photodetector, and a data acquisition unit. Based on the principle of Brillouin scattering, BOTDA extracts the temperature and strain information of the target area by analyzing the scattered signal during the optical fiber transmission process. It is widely used in geological monitoring, environmental monitoring, intelligent buildings and other fields, and is used to monitor the temperature and strain of infrastructure such as oil and gas pipelines, bridges, and tunnels.
[0004] The traditional method uses the Lorentz curve fitting method to obtain the Brillouin frequency shift. The center frequency corresponding to the maximum value of the measured Brillouin gain spectrum is found as the Brillouin frequency shift, and the temperature is obtained through the linear relationship formula between the Brillouin frequency shift and temperature. However, the traditional Lorentz curve fitting method is very sensitive to the noise in the data. Environmental noise or signal interference may cause inaccurate fitting results, thereby affecting the accuracy of temperature measurement. The fitting results are strongly dependent on the selection of initial parameters. If the initial values are not set properly, it may lead to fitting failure or result deviation, especially in complex data situations. The fitting process requires a long calculation time, especially when processing big data, and the efficiency is low, which limits the feasibility of real-time applications. With the development of machine learning, the extraction of Brillouin temperature has also begun to use the method of combining machine learning with the Lorentz curve. Among them, the Recurrent Highway Networks (RHN) network is used for Brillouin temperature extraction. However, the gating mechanism of the RHN network is static and has many limitations. Static gating cannot adapt to the dynamic changes in information flow requirements. The information flow requirements between different tasks are different, but the fixed gating mechanism may cause the performance of some tasks to degrade. In multi-task learning, the static gating mechanism can only choose shared optimization between tasks, and it is difficult to quickly adjust the characteristics of each task, which makes the overall extraction time-consuming and affects the efficiency of Brillouin temperature extraction. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a Brillouin temperature extraction method and system based on self-attention recurrent neural network. After introducing meta-learning in the BOTDA temperature extraction task, the gating mechanism of RHN can dynamically adjust the information flow according to different time steps or tasks, so that the model can better adapt to complex environments, thereby improving the prediction and extraction accuracy of Brillouin temperature and real-time performance, avoiding the problems of long curve fitting time, poor real-time performance and poor adaptability.
[0006] According to some embodiments, a first solution of the present invention provides a Brillouin temperature extraction method based on a self-attention recurrent neural network, using the following technical solution: The Brillouin temperature extraction method based on self-attention recurrent neural network includes: Using the pre-built Brillouin optical time domain analysis system, the real Brillouin gain spectrum data is collected and pre-processed; Based on the preprocessed Brillouin gain spectrum data, the corresponding Brillouin temperature is obtained using the trained self-attention recurrent neural network model; The training process of the self-attention recurrent neural network model is specifically as follows: Simulate the ideal Brillouin gain spectrum data and convert it into an input sequence to obtain a sample data set; Set the initial hidden state and use the meta-learning algorithm to optimize the task-adaptive weights of the transfer gate and the transformation gate at each time step; The optimized transition gate is used to determine the transition gate output of each layer at each time step, and the optimized transfer gate is used to determine the candidate hidden state of each layer at each time step; Based on the hidden state of the previous time step, the output of the conversion gate of the current time step, and the candidate hidden state, the hidden state in the current time step is updated as the final output of the model, i.e., the Brillouin temperature; The task adaptive weights and biases of the transfer gate and the conversion gate are adjusted by iterative optimization, and training is performed with the goal of minimizing the loss to obtain a trained self-attention recurrent neural network model.
[0007] Further, the Brillouin optical time-domain analysis system includes a narrowband laser, which is sequentially connected to a polarization-maintaining fiber coupler, a semiconductor optical amplifier, a first erbium-doped fiber amplifier, a first fiber circulator, a second wavelength division multiplexer, a sensing fiber, a first wavelength division multiplexer, a fiber isolator, a polarization scrambler, and a double-sideband electro-optical phase modulator; The first erbium-doped fiber amplifier is also connected to the acquisition card via a semiconductor optical amplifier frequency sweep module; The first fiber optic circulator is also connected to a fiber grating filter and a second erbium-doped fiber amplifier through a second fiber optic circulator, and the second erbium-doped fiber amplifier is connected to the acquisition card through a photoelectric probe; the fiber grating filter is also connected to a temperature control device; The double-sideband electro-optical phase modulator is also connected to an acquisition card through a frequency scanning module, the double-sideband electro-optical phase modulator is also connected to a polarization-maintaining optical fiber coupler, and the acquisition card is connected to a computer.
[0008] Furthermore, the self-attention recurrent neural network model includes an input layer, a hidden layer, a self-attention layer and an output layer; A highway layer is added to the hidden layer, and the highway layer includes two gating units: a transfer gate and a conversion gate.
[0009] Furthermore, after the self-attention layer obtains the output of the hidden layer, it allocates attention weights by calculating the similarity between each position of the input sequence, and weights the important features in the input sequence to obtain the output of the self-attention layer; The output of the output layer is the result of the fusion of the output of the self-attention layer and the output of the hidden layer.
[0010] Furthermore, the meta-learning algorithm is used to optimize the task adaptive weights of the transfer gate and the conversion gate in each time step, specifically: Randomly sample multiple training task data in each time step, where the training task data includes training data and verification data; Perform model training on the training data of each training task, perform gradient updates based on the loss function, learning rate, and model parameters of the training task, and then update the meta-parameters of the gating mechanism; The task-adaptive weights of transfer gates and transformation gates are optimized based on the updated meta-parameters of the gating mechanism.
[0011] Furthermore, the meta-learning algorithm includes inner loop optimization and outer loop optimization; The inner loop optimization is to optimize the parameters of the gating mechanism for each task separately, and use the standard time series loss function as the task-level loss function of the inner loop optimization; The outer loop optimization is to optimize the meta-parameters of the gating mechanism through meta-gradient update, and the average loss of all tasks is used as the meta-loss function of the outer loop optimization.
[0012] According to some embodiments, a second solution of the present invention provides a Brillouin temperature extraction system based on a self-attention recurrent neural network, which adopts the following technical solution: Brillouin temperature extraction system based on self-attention recurrent neural network, including: A data acquisition module is configured to collect and pre-process real Brillouin gain spectrum data using a pre-built Brillouin optical time domain analysis system; A temperature extraction module is configured to obtain a corresponding Brillouin temperature based on the preprocessed Brillouin gain spectrum data using a trained self-attention recurrent neural network model; The training process of the self-attention recurrent neural network model is specifically as follows: Simulate the ideal Brillouin gain spectrum data and convert it into an input sequence to obtain a sample data set; Set the initial hidden state and use the meta-learning algorithm to optimize the task-adaptive weights of the transfer gate and the transformation gate at each time step; The optimized transition gate is used to determine the transition gate output of each layer at each time step, and the optimized transfer gate is used to determine the candidate hidden state of each layer at each time step; Based on the hidden state of the previous time step, the output of the conversion gate of the current time step, and the candidate hidden state, the hidden state in the current time step is updated as the final output of the model, i.e., the Brillouin temperature; The task adaptive weights and biases of the transfer gate and the conversion gate are adjusted by iterative optimization, and training is performed with the goal of minimizing the loss to obtain a trained self-attention recurrent neural network model.
[0013] According to some embodiments, a third aspect of the present invention provides a computer-readable storage medium.
[0014] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the Brillouin temperature extraction method based on a self-attention recurrent neural network as described in the first aspect above.
[0015] According to some embodiments, a fourth aspect of the present invention provides a computer device.
[0016] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the Brillouin temperature extraction method based on a self-attention recurrent neural network as described in the first aspect above are implemented.
[0017] According to some embodiments, a fifth aspect of the present invention provides a computer program product or a computer program.
[0018] The present invention provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the Brillouin temperature extraction method based on a self-attention recurrent neural network as described in the first aspect above.
[0019] Compared with the prior art, the present invention has the following beneficial effects: The present invention proposes a Brillouin temperature extraction method based on a self-attention recurrent neural network, which combines the ideas of a recurrent neural network (RNN) and a highway network (Highway Network), can solve the problem of long-term dependencies, and has the ability to enhance the training depth of the recurrent network and process deep data features, can well train deep networks, learn deep feature relationships, solve the problems of gradient vanishing and gradient explosion, and improve the accuracy and real-time performance of temperature extraction; at the same time, combined with the self-attention mechanism, it can better capture global and local features, improve the accuracy of temperature measurement, and can more effectively analyze complex optical fiber signals; the network model can quickly respond to dynamic changes in the measured environment, improve the sensitivity to temperature changes, and improve the signal processing speed through efficient feature extraction and analysis, which is suitable for real-time temperature monitoring, and more accurate signal processing helps to reduce the measurement error caused by noise and interference. The introduction of a meta-learning algorithm, especially the application of a gating mechanism, can adjust the information flow according to the characteristics of the BOTDA signal by learning task-specific gating parameters, ensuring that the network can effectively extract useful information from the input data while avoiding noise interference. In the actual application of BOTDA, you may encounter a variety of different tasks, such as different temperature ranges. After introducing meta-learning, the network can adaptively adjust the gating mechanism according to the task embedding or context information, so that the training process of each task can obtain the optimal gating parameters, thereby improving the performance of each task in a multi-task learning environment. BOTDA sensor data may vary with changes in the environment or different devices. Traditional models may perform poorly on new tasks, and the self-attention recurrent neural network model that introduces meta-learning can improve the temperature extraction performance of the model in different situations by learning how to quickly adapt to new tasks or data distributions. In the BOTDA temperature extraction task, after introducing meta-learning, the gating mechanism of the self-attention recurrent neural network model can dynamically adjust the information flow according to different time steps or tasks, so that the model can better adapt to complex environments and improve prediction accuracy and robustness. For example, on new sensor data, meta-learning allows the network to quickly adjust its gating mechanism to better adapt to new input data features.
[0020] In practical applications, BOTDA technology may face different environmental conditions, different fiber layouts, different measurement configurations, etc. These conditions may affect the accuracy of temperature measurement. Multi-task learning can be used to model different measurement scenarios to improve the generalization ability of the model under different conditions. The Brillouin frequency shift in BOTDA is affected by temperature and may have differences in frequency bands or resolutions. Multi-task learning can improve the accuracy of temperature extraction by learning data in different frequency bands or different resolutions. The gating mechanism in the self-attention recurrent neural network model is a static structure. Introducing a meta-learning algorithm during the training process of the network model can help dynamically adjust the gating strategy and solve the new problem of dynamic information flow, so that the network can adaptively adjust the way information is transmitted according to different dynamic conditions such as input, tasks, and time steps. Through meta-learning, the network model can learn how to adjust its gating mechanism according to the characteristics of the current task or input, so as to achieve more efficient learning and adaptability in the process of information flow transmission; it can share initialization parameters between multiple tasks and optimize these parameters through meta-training, so that the network can quickly adapt to new tasks; when facing multi-task learning or new tasks, it does not need to start training from scratch, but can quickly adjust the model through a small amount of gradient updates, reducing training time and improving performance. After the introduction of meta-learning, the training process of the network model has become more complex and hierarchical. In the meta-training stage, the network optimizes the initialization parameters of the model by learning on multiple tasks, with the aim of enabling the model to quickly adapt to new tasks. In the meta-testing stage, the model quickly adapts to unseen tasks through a small amount of gradient updates to verify the effect of meta-learning. Through such a training process, the self-attention recurrent neural network model can quickly fine-tune based on an optimized initialization parameter to achieve better results when facing new tasks without starting training from scratch. This makes the model more adaptable and generalizable in multi-task learning and task transfer. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0022] Figure 1 is a flow chart of a Brillouin temperature extraction method based on a self-attention recurrent neural network in an embodiment of the present invention; Figure 2 Schematic diagram of the overall architecture of the self-attention recurrent neural network model in an embodiment of the present invention; Figure 3 Schematic diagram of the gating mechanism structure of the self-attention recurrent neural network model in an embodiment of the present invention; Figure 4is a schematic diagram of the structure of the self-attention layer in an embodiment of the present invention; Figure 5 is a structural diagram of a Brillouin optical time domain analysis system in an embodiment of the present invention; Reference numerals: NB Laser-narrowband laser; PM-OC-polarization-maintaining fiber coupler; SOA-semiconductor optical amplifier; EDFA1-first erbium-doped fiber amplifier; EDFA2-second erbium-doped fiber amplifier; SOA driver-SOA frequency sweep module; PD-photoelectric probe; FBG-fiber grating filter; TEC-temperature control device; WDM1-first wavelength division multiplexer; WDM2-second wavelength division multiplexer; FUT-sensing fiber; ISO-fiber isolator; Polarization scrambler-polarization scrambler; EOM-double-sideband electro-optical phase modulator; EOM driver-EOM frequency sweep module; Circulator1-first fiber circulator; Circulator2-second fiber circulator. DETAILED DESCRIPTION
[0023] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0024] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0025] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0026] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0027] Embodiment 1 The present embodiment provides a Brillouin temperature extraction method based on a self-attention recurrent neural network. The present embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal, a server, and a server, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In the present embodiment, the method includes the following steps: Using the pre-built Brillouin optical time domain analysis system, the real Brillouin gain spectrum data is collected and pre-processed; Based on the preprocessed Brillouin gain spectrum data, the corresponding Brillouin temperature is obtained using the trained self-attention recurrent neural network model; The training process of the self-attention recurrent neural network model is specifically as follows: Simulate the ideal Brillouin gain spectrum data and convert it into an input sequence to obtain a sample data set; Set the initial hidden state and use the meta-learning algorithm to optimize the task-adaptive weights of the transfer gate and the transformation gate at each time step; The optimized transition gate is used to determine the transition gate output of each layer at each time step, and the optimized transfer gate is used to determine the candidate hidden state of each layer at each time step; Based on the hidden state of the previous time step, the output of the conversion gate of the current time step, and the candidate hidden state, the hidden state in the current time step is updated as the final output of the model, i.e., the Brillouin temperature; The task adaptive weights and biases of the transfer gate and the conversion gate are adjusted by iterative optimization, and training is performed with the goal of minimizing the loss to obtain a trained self-attention recurrent neural network model.
[0028] like Figure 1 As shown, the method described in this embodiment specifically includes the following steps: S1. Generate Brillouin gain spectrum by pseudo-Voigt function, and obtain Brillouin gain spectrum data to form a training set; the pseudo-Voigt curve function is a combination of Lorentz curve and Gaussian curve, and the pseudo-Voigt curve function formula is as follows: (1); in, is the peak gain, is the Brillouin frequency shift (BFS), is the full width at half maximum of the Brillouin gain (BGS), is the proportion of the Lorentz component.
[0029] S2, build a self-attention recurrent neural network model (SA-RHN), and input the training set obtained in S1 into SA-RHN for training to obtain a trained network model; like Figure 2 As shown in the figure, based on the temperature extraction technology of Brillouin optical time domain analysis (BOTDA), a self-attention recurrent neural network model (SA-RHN) based on RHN (Recurrent Highway Network) fused with self-attention mechanism is proposed, wherein the self-attention recurrent neural network model includes an input layer, a hidden layer, a self-attention layer and an output layer, and the output layer is a fully connected layer. The activation functions ReLU and Tanh are applied to the recurrent unit and each gate.
[0030] A highway layer is added to the hidden layer, and the highway layer includes two gate control units: a carry gate and a transform gate. RHN controls the information flow through a high-dimensional transform layer. At each time step, RHN calculates a transform gate and a carry gate. These two gates together determine how the old state is updated and when the new state starts. After the self-attention layer obtains the output of the hidden layer, it allocates attention weights by calculating the similarity between each position of the input sequence, and performs weighted summing of the important features in the input sequence to obtain the output of the self-attention layer. The output of the output layer is the result of the fusion of the output of the self-attention layer and the output of the hidden layer, which can be output by weighted sum, splicing or residual connection.
[0031] In step S2, the SA-RHN network model training process includes: 1) Receive input sequence Contains preprocessing to convert raw input into a format suitable for the network.
[0032] 2) Set the initial hidden state Typically a zero vector or a small random value.
[0033] 3) For each time step , each layer performs the following operations: (2); In the formula, is the output of the conversion gate, for sigmoidfunction, used to map the result to the interval [0, 1], is the adaptive weight of the transformation gate task optimized by meta-learning, is the weight matrix, is the conversion gate bias vector, It is Layer at time step The hidden state of It is in The previous time step of the layer The hidden state of is another input for the current layer to combine the information flow in time.
[0034] (3); in, is the hyperbolic tangent function, with the output in the interval [-1,1], is the adaptive weight of the transfer gate task optimized by meta-learning, is the weight matrix, is the transfer gate bias vector, is the candidate hidden state for the current time step, Is in the current layer The previous time step The hidden state represents the historical information of the current layer in the time series. It is Layer at time step This is one of the inputs of the current layer calculation and contains information from the previous layer.
[0035] 4) Update hidden state (4); Among them, ⊙ elements are multiplied one by one, and the transfer gate (C) and the transformation gate (T) are used to update the hidden state. 5) Apply the above update formula (4) multiple times in the same time step, and the multi-layer design further extracts features.
[0036] Finally, the output is extracted from the last layer or specified layer for subsequent processing.
[0037] 6) Calculate the loss function, commonly cross entropy or mean square error. Use the back propagation algorithm and optimization methods (Adam, SGD) to adjust the weights and biases of each layer to minimize the loss.
[0038] The gating mechanism of RHN is trained using the meta-learning algorithm Model-Agnostic Meta-Learning (MAML). In RHN, the gating mechanism (transfer gate and conversion gate) is static, that is, these gating parameters are fixed to a set of task-specific weights during the training process. However, static gating mechanisms have obvious limitations, especially in dynamically changing task environments or multi-task scenarios. By introducing meta-learning, the gating mechanism of RHN can be made dynamic, thereby solving a series of new problems in dynamic information flow control. In the RHN network, the model only focuses on a specific task, while meta-learning aims to "learn" a learning strategy that can generalize to different tasks through multi-task learning. Dynamically adjusting the learning rate and other hyperparameters during the training process allows the network to quickly adapt to different inputs or tasks, allowing it to adjust adaptively according to the distribution of different tasks or data. After the introduction of meta-learning, the initialization of the model is no longer random, but is optimized through learning on multiple tasks. In this way, the network can quickly adapt to new tasks, reducing the time and complexity of training from scratch. Meta-learning helps dynamically learn the gating mechanism (the weights of the transfer gate and the transformation gate) so that they can be adjusted based on the input sequence, context, or historical information. This process occurs during the gating calculation at each time step, especially in the weight update of the transfer gate and the transformation gate, which allows the gating mechanism to adjust faster when encountering new data without completely retraining the entire network. In the meta-training phase, the model learns how to quickly adapt to new tasks through multiple tasks. Each task has its own training set and validation set. In the meta-testing phase, the model needs to face new tasks. , the task did not appear in the meta-training process. This stage mainly tests whether the model can use the previously learned initialization to quickly adapt to new tasks. It is necessary to design a strategy to dynamically adjust the gating parameters (such as transfer gates and conversion gates) so that the gating mechanism can optimize the transmission of information flow according to the dynamic changes of tasks and inputs.
[0039] The process of the meta-learning algorithm is carried out at each time step of the self-attention recurrent neural network model (SA-RHN) training. The model can update its parameters in real time based on feedback and improve its learning ability on new tasks. The implementation process and calculation details are as follows: Defining a dynamic gating mechanism like Figure 3 As shown, the gating mechanism of RHN includes: transfer gate -Determines the passing ratio of the current input information. Conversion gate -Determine the impact of the hidden state of the previous time step on the current state. The task of meta-learning is to , hidden state , task embedding Dynamic Generation and , so that the gating mechanism can adapt to the current task or input. The traditional dynamic gating generation formula and is generated by fixed weights: , After the introduction of meta-learning, and The generation can be adjusted dynamically: (5); (6); in, is the adaptive weight of the transformation gate task optimized by meta-learning, is the adaptive weight of the transfer gate task optimized by meta-learning, is the optimized conversion gate, is the optimized transfer gate, is the conversion gate bias vector, is the transfer gate bias vector, is the task embedding, which represents the global information of the task (dynamically updated through meta-learning), is the activation function Sigmoid .
[0040] Internal and external circuit training Meta-learning algorithms usually consist of two optimization layers: inner loop optimization (Task-specific Training) and outer loop optimization (Meta-Training). The goal of the inner loop is to optimize the parameters of the gating mechanism for each task individually so that the network performs best on the specific data of the current task. , according to the task data (Training set and validation set) Adjust the parameters of the gating mechanism and , the training process uses the standard time series loss function (mean squared error in temperature prediction): (7); in, It means Task No. The true value of the time step, It means Task No. The predicted value of time steps, N represents the total number of time steps in the current task (i.e. the length of the time series); The goal of the outer loop is to optimize the meta parameters of the gating mechanism through meta gradient updates so that the model can quickly adapt to new tasks. The meta-optimization loss is the average loss of all tasks: (8); is the meta-optimization loss of the outer loop, where is the total number of tasks, used for averaging; The optimization process calculates the meta-gradient through back-propagation, updates the meta-parameters of the gating mechanism, and obtains the updated meta-parameters : (9); in, is the learning rate of the outer loop meta-learning, which controls the step size of the meta-parameter update. Formula (9) shows that in meta-learning, the model needs to optimize its initial parameters based on the performance of the task’s validation set. , so the gradient calculation here uses the validation loss, which optimizes the average performance of all tasks on the validation set so that the initial parameters of the model Ability to adapt quickly to new tasks.
[0041] Loss function design Task-level loss: ; Yuan loss: ; Total loss: ; The RHN network training process, which goes through the meta-training and meta-testing phases, is as follows: Meta-training phase: Task sampling: randomly sample multiple tasks from the task distribution , each task Contains training data and validation data. The training data is used for in-task training, and the validation data is used for in-task evaluation.
[0042] In-task training: For each task The model is trained on its training data. The task data is updated several times. Through such in-task training, the parameters of the model are optimized on the task. The loss function , then in the task The gradient update process on is as follows: (10); in, are the original parameters of the model, It's through the mission The new parameters obtained after internal training, is the learning rate, It's a task The loss function of , formula (10) is optimized for the loss of a single task.
[0043] Meta-Validation: Evaluate the model parameters trained on each task on the validation set. Computational tasks The validation loss is: (11); Meta-Update: (12); in, is the learning rate of the inner loop meta-learning, controlling the step size of task-specific parameter updates, It's a task The validation loss on , the sum of the losses for multiple tasks in formula (12), used for different optimization strategies, affects the overall adaptability between tasks.
[0044] Meta-Testing Task selection: Select a new task from the task collection , which was not included in the meta-training. The goal is to test the model’s ability to quickly adapt to unseen tasks.
[0045] Fast Adaptation: Use the initialization parameters learned in the meta-training phase and directly apply the initialization to the training data of the new task. Perform a small number of gradient updates (usually a few times) on the new task to quickly adapt to the new task, and the model will adjust its parameters in small steps. Assume that The loss function on The update process is as follows: (13); in, represents the model parameters after updating with a small amount of training data, Represents the meta parameters of the current model, represents the learning rate, Indicates that based on the current parameters The loss function calculated on the new task is because in the fast adaptation stage, the model uses the training data to make a small gradient update in order to better adapt to the new task.
[0046] Since the parameters trained by the meta-learning algorithm have been initialized, the network can quickly adapt to new tasks with a small number of updates.
[0047] Evaluation: Evaluate the performance of the model on the validation set of the new task to see how well the model generalizes after a small number of gradient updates. The goal is to verify whether the model initialization obtained through meta-learning can help the model quickly adapt to new tasks.
[0048] like Figure 4 As shown, in step S2, the self-attention mechanism calculation process includes: Prepare input: receive n Input, ready for calculation; Input: Q-query, K-key, V-value; Initialize weights: Initialize weights for queries, keys, and values.
[0049] Infer Key, Query and Value: Calculate the key, query and value of each element.
[0050] Calculate attention score: Calculate the attention score by the similarity between the query and the key. softmax :The attention score is passed softmax The function performs normalization.
[0051] Matrix multiplication (MatMul) MatMul(Q,K^T): First, perform matrix multiplication on the query vector Q and the transpose of the key vector K to generate an attention score matrix. Each element of this score matrix represents the similarity between the query vector and the key vector.
[0052] Scale After matrix multiplication, the score matrix is scaled. The general scaling factor is ,in is the dimension of the key vector. The purpose of scaling is to avoid the score value being too large when the dimension is large, resulting in the gradient of the Softmax function being too small.
[0053] Mask (optional) Masking: In some cases (such as dealing with autoregressive models), in order to prevent the model from using future information, future time steps are masked so that the model cannot see the values of future moments when calculating attention. This is achieved by adding a very large negative value to certain positions in the score matrix.
[0054] Softmax: Apply the Softmax function to convert the scaled score matrix into a probability distribution. The result of this step is the attention weight of each word to other words.
[0055] Weighted sum: multiply the normalized attention score by the value and add the results to get the output.
[0056] Matrix multiplication (MatMul) MatMul (Softmax Output, V ): Finally, the attention weights of the Softmax output are combined with the value vector V Perform matrix multiplication to obtain the final weighted sum representation.
[0057] The Attention calculation formula in the form of key-value pairs is: (14).
[0058] S3. Build a Brillouin optical time-domain analysis system (BOTDA) to collect real Brillouin gain spectrum data, and input it into the SA-RHN network model trained in S2 to obtain the temperature corresponding to the gain spectrum.
[0059] like Figure 5 As shown, the Brillouin optical time domain analysis system includes a narrowband laser, which is sequentially connected to a polarization-maintaining fiber coupler, a semiconductor optical amplifier, a first erbium-doped fiber amplifier, a first fiber circulator, a second wavelength division multiplexer, a sensing fiber, a first wavelength division multiplexer, a fiber isolator, a polarization scrambler, and a double-sideband electro-optical phase modulator; The first erbium-doped fiber amplifier is also connected to the acquisition card via a semiconductor optical amplifier frequency sweep module; The first fiber optic circulator is also connected to a fiber grating filter and a second erbium-doped fiber amplifier through a second fiber optic circulator, and the second erbium-doped fiber amplifier is connected to the acquisition card through a photoelectric probe; the fiber grating filter is also connected to a temperature control device; The double-sideband electro-optical phase modulator is also connected to an acquisition card through a frequency scanning module, the double-sideband electro-optical phase modulator is also connected to a polarization-maintaining optical fiber coupler, and the acquisition card is connected to a computer.
[0060] In step S3, the Brillouin optical time domain analysis system includes a narrowband laser, a semiconductor optical amplifier, an erbium-doped fiber amplifier, a fiber grating filter, a polarization scrambler, a photoelectric probe, a double-sideband electro-optical phase modulator, a frequency scanning module, a sensing fiber, a fiber grating filter, a polarization-maintaining fiber coupler, a fiber isolator, a fiber circulator, a wavelength division multiplexer, a distributed Raman amplifier, a computer, and an acquisition card. After the system is built, a real Brillouin gain spectrum data set is collected.
[0061] This embodiment proposes a Brillouin temperature extraction technology based on the SA-RHN network, and collects Brillouin gain spectrum data to extract its corresponding temperature, which improves the accuracy and real-time performance of BOTDA's temperature extraction. RHN fusion self-attention mechanism network (SA-RHN) combines the ideas of recurrent neural network (RNN) and highway network (Highway Network), can solve the problem of long-term dependencies, and has the ability to enhance the training depth of recurrent networks and process deep data features. It can train deep networks well, learn deep feature relationships, solve the problems of gradient disappearance and gradient explosion, and improve the accuracy and real-time performance of temperature extraction. Introducing the meta-learning algorithm RHN does not need to start training from scratch when facing multi-task learning or new tasks, but can quickly adjust the model through a small amount of gradient updates, reduce training time and improve performance. The introduction of meta-learning algorithms in RHN, especially the application of gating mechanisms, can significantly improve the performance of the model on multiple tasks. Through MAML, RHN can learn a shared gating mechanism initialization, so that the model can quickly adapt to task requirements through a small amount of updates when facing new tasks. This approach not only improves the adaptability and generalization ability of the model, but also reduces the data requirements during training, thereby performing well in multiple practical tasks.
[0062] Embodiment 2 This embodiment provides a Brillouin temperature extraction system based on a self-attention recurrent neural network, including: A data acquisition module is configured to collect and pre-process real Brillouin gain spectrum data using a pre-built Brillouin optical time domain analysis system; A temperature extraction module is configured to obtain a corresponding Brillouin temperature based on the preprocessed Brillouin gain spectrum data using a trained self-attention recurrent neural network model; The training process of the self-attention recurrent neural network model is specifically as follows: Simulate the ideal Brillouin gain spectrum data and convert it into an input sequence to obtain a sample data set; Set the initial hidden state and use the meta-learning algorithm to optimize the task-adaptive weights of the transfer gate and the transformation gate at each time step; The optimized transition gate is used to determine the transition gate output of each layer at each time step, and the optimized transfer gate is used to determine the candidate hidden state of each layer at each time step; Based on the hidden state of the previous time step, the output of the conversion gate of the current time step, and the candidate hidden state, the hidden state in the current time step is updated as the final output of the model, i.e., the Brillouin temperature; The task adaptive weights and biases of the transfer gate and the conversion gate are adjusted by iterative optimization, and training is performed with the goal of minimizing the loss to obtain a trained self-attention recurrent neural network model.
[0063] The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment 1. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0064] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0065] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0066] Embodiment 3 This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps in the Brillouin temperature extraction method based on a self-attention recurrent neural network as described in the first embodiment above are implemented.
[0067] Embodiment 4 This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the Brillouin temperature extraction method based on the self-attention recurrent neural network as described in the first embodiment are implemented.
[0068] Embodiment 5 This embodiment provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the Brillouin temperature extraction method based on a self-attention recurrent neural network described in the first embodiment.
[0069] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0070] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0071] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0072] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0073] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0074] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A Brillouin temperature extraction method based on a self-attention recurrent neural network, characterized in that: include: Using the pre-built Brillouin optical time domain analysis system, the real Brillouin gain spectrum data is collected and pre-processed; Based on the preprocessed Brillouin gain spectrum data, the corresponding Brillouin temperature is obtained using the trained self-attention recurrent neural network model; The training process of the self-attention recurrent neural network model is specifically as follows: Simulate the ideal Brillouin gain spectrum data and convert it into an input sequence to obtain a sample data set; Set the initial hidden state and use the meta-learning algorithm to optimize the task-adaptive weights of the transfer gate and the transformation gate at each time step; The optimized transition gate is used to determine the transition gate output of each layer at each time step, and the optimized transfer gate is used to determine the candidate hidden state of each layer at each time step; Based on the hidden state of the previous time step, the output of the conversion gate of the current time step, and the candidate hidden state, the hidden state in the current time step is updated as the final output of the model, i.e., the Brillouin temperature; The task adaptive weights and biases of the transfer gate and the conversion gate are adjusted by iterative optimization, and training is performed with the goal of minimizing the loss to obtain a trained self-attention recurrent neural network model.
2. The Brillouin temperature extraction method based on self-attention recurrent neural network according to claim 1, characterized in that: The Brillouin optical time domain analysis system comprises a narrowband laser, which is sequentially connected to a polarization-maintaining fiber coupler, a semiconductor optical amplifier, a first erbium-doped fiber amplifier, a first fiber circulator, a second wavelength division multiplexer, a sensing fiber, a first wavelength division multiplexer, a fiber isolator, a polarization scrambler and a double-sideband electro-optical phase modulator; The first erbium-doped fiber amplifier is also connected to the acquisition card via a semiconductor optical amplifier frequency sweep module; The first fiber optic circulator is also connected to a fiber grating filter and a second erbium-doped fiber amplifier through a second fiber optic circulator, and the second erbium-doped fiber amplifier is connected to the acquisition card through a photoelectric probe; the fiber grating filter is also connected to a temperature control device; The double-sideband electro-optical phase modulator is also connected to an acquisition card through a frequency scanning module, the double-sideband electro-optical phase modulator is also connected to a polarization-maintaining optical fiber coupler, and the acquisition card is connected to a computer.
3. The Brillouin temperature extraction method based on self-attention recurrent neural network according to claim 1, characterized in that: The self-attention recurrent neural network model includes an input layer, a hidden layer, a self-attention layer and an output layer; A highway layer is added to the hidden layer, and the highway layer includes two gating units: a transfer gate and a conversion gate.
4. The Brillouin temperature extraction method based on self-attention recurrent neural network according to claim 3, characterized in that: After the self-attention layer obtains the output of the hidden layer, it allocates attention weights by calculating the similarity between each position of the input sequence, and weights the important features in the input sequence to obtain the output of the self-attention layer; The output of the output layer is the result of the fusion of the output of the self-attention layer and the output of the hidden layer.
5. The Brillouin temperature extraction method based on self-attention recurrent neural network according to claim 1, characterized in that: The meta-learning algorithm is used to optimize the task adaptive weights of the transfer gate and the conversion gate in each time step, specifically: Randomly sample multiple training task data in each time step, where the training task data includes training data and verification data; Perform model training on the training data of each training task, perform gradient updates based on the loss function, learning rate, and model parameters of the training task, and then update the meta-parameters of the gating mechanism; The task-adaptive weights of transfer gates and transformation gates are optimized based on the updated meta-parameters of the gating mechanism.
6. The Brillouin temperature extraction method based on self-attention recurrent neural network according to claim 5, characterized in that: The meta-learning algorithm includes inner loop optimization and outer loop optimization; The inner loop optimization is to optimize the parameters of the gating mechanism for each task separately, and use the standard time series loss function as the task-level loss function of the inner loop optimization; The outer loop optimization is to optimize the meta-parameters of the gating mechanism through meta-gradient update, and the average loss of all tasks is used as the meta-loss function of the outer loop optimization.
7. Brillouin temperature extraction system based on self-attention recurrent neural network, characterized in that: include: A data acquisition module is configured to collect and pre-process real Brillouin gain spectrum data using a pre-built Brillouin optical time domain analysis system; A temperature extraction module is configured to obtain a corresponding Brillouin temperature based on the preprocessed Brillouin gain spectrum data using a trained self-attention recurrent neural network model; The training process of the self-attention recurrent neural network model is specifically as follows: Simulate the ideal Brillouin gain spectrum data and convert it into an input sequence to obtain a sample data set; Set the initial hidden state and use the meta-learning algorithm to optimize the task-adaptive weights of the transfer gate and the transformation gate at each time step; The optimized transition gate is used to determine the transition gate output of each layer at each time step, and the optimized transfer gate is used to determine the candidate hidden state of each layer at each time step; Based on the hidden state of the previous time step, the output of the conversion gate of the current time step, and the candidate hidden state, the hidden state in the current time step is updated as the final output of the model, i.e., the Brillouin temperature; The task adaptive weights and biases of the transfer gate and the conversion gate are adjusted by iterative optimization, and training is performed with the goal of minimizing the loss to obtain a trained self-attention recurrent neural network model.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the Brillouin temperature extraction method based on a self-attention recurrent neural network as described in any one of claims 1 to 6 are implemented.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the Brillouin temperature extraction method based on self-attention recurrent neural network as described in any one of claims 1-6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the steps in the Brillouin temperature extraction method based on a self-attention recurrent neural network as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Brillouin frequency shift extraction method and device based on convolutional neural network
CN110926355A
BOTDA (Brillouin Optical Time Domain Analysis) temperature extraction method based on gating circulation unit and attention mechanism
CN117740189A
Brillouin frequency shift extraction method and device and storable medium
CN118152891A
BOTDA (Brillouin Optical Time Domain Analysis) temperature extraction method based on time convolutional network
CN118362222A
Brillouin scattering double-peak frequency shift extraction method and device for training ANN model based on simulation data
CN118965965A
Cited By
Brillouin optical time domain reflectometry method based on undersampling and neural network recovery
CN120313651A
Metalearning ARX model multi-task parameter collaborative identification method for small samples
CN121069758A
Small sample oriented meta-learning arx model multi-task parameter collaborative identification method
CN121069758B
Pump fault detection method based on data fragmentation and gated double-attention neural network
CN121614957A