Temperature compensation method of FBG sensor, model training method, system, equipment and medium
By constructing a temperature compensation model based on machine learning, the problem of insufficient measurement accuracy of FBG sensors in nonlinear environments is solved, and the high-precision temperature compensation effect is achieved, which is suitable for the measurement results of various types of parameters of FBG sensors.
Patent Information
- Application Number
- CN202510204342.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-07-22
AI Technical Summary
The measurement accuracy of the strain, pressure, etc. of the FBG sensor is affected by the fluctuations in ambient temperature, especially in high temperature, high humidity or strong thermal convection environments, and the traditional temperature compensation method is complex and difficult to adapt to complex nonlinear environments.
By building a temperature compensation model, using machine learning algorithms such as neural networks and conditions to generate adversarial networks, the temperature compensation model is trained based on the strain monitoring data set of FBG sensors, map the strain measurements to the wavelength value and compensate, and optimize the model parameters to reduce the impact of temperature drift.
It improves the measurement accuracy and stability of FBG sensors in complex environments, significantly reduces temperature drift errors, and is suitable for temperature compensation for measurement results of various types of parameters.
Smart Images

Figure CN120354128A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a temperature compensation method, a model training method, a system, a device, and a medium for an FBG sensor. Background Art
[0002] A Fiber Bragg Grating Sensor (FBG Sensor) is an optical fiber sensing device widely used in the health monitoring of civil engineering structures, aerospace, the energy industry, and the medical field. Due to its advantages such as corrosion resistance, electromagnetic interference resistance, high sensitivity, and suitability for long-distance transmission, FBG sensors show significant advantages in environmental parameter measurement. FBG sensors sense external strain through the change in the Bragg wavelength of the fiber grating. Its basic principle is to utilize the refractive index modulation and periodic change of the fiber grating to monitor the drift of the reflected light wavelength to infer environmental parameters such as strain.
[0003] However, the measurement accuracy of strain, pressure, etc. of FBG sensors is often significantly affected by environmental temperature fluctuations. Temperature changes will cause the drift of the Bragg wavelength, thereby introducing measurement errors. Especially in high-temperature, high-humidity, or strong heat convection environments, this drift problem is particularly prominent. To improve the measurement accuracy of FBG sensors, traditional methods usually adopt temperature compensation techniques, such as compensating through additional reference gratings or based on theoretical models. However, these methods have problems such as complex implementation, dependence on precise models, or difficulty in adapting to complex nonlinear environments. Summary of the Invention
[0004] The main purpose of the embodiments of this application is to propose a temperature compensation method, a model training method, a system, a device, and a medium for an FBG sensor, aiming to simplify the temperature compensation method for the measurement results of FBG sensors, achieve compensation for measurement results in a nonlinear environment, and improve the accuracy of measurement results.
[0005] To achieve the above object, on the one hand, an embodiment of this application proposes a temperature compensation model training method for an FBG sensor, including the following steps:
[0006] Obtain a first training data set and initialize a temperature compensation model, where the first training data set includes multiple sample data, and each sample data includes a strain measurement value and a true strain value measured by an FBG sensor under the influence of a set temperature;
[0007] Map the strain measurement values in the first training data set to corresponding wavelength measurement values to obtain a second training data set;
[0008] Input the wavelength measurement values and the set temperature values in the second training dataset into the temperature compensation model to obtain wavelength compensation data;
[0009] Compensate the strain measurement values in the first training data according to the wavelength compensation data to obtain a third training dataset;
[0010] Optimize the temperature compensation model according to the third training dataset to obtain a trained temperature compensation model.
[0011] In some embodiments, the sample data in the first training dataset is obtained through the following steps:
[0012] Control a force generating device to apply a preset force to an FBG sensor located in a temperature-changing test chamber to collect the strain measurement values measured by the FBG sensor;
[0013] Determine the true strain value according to the preset force generated by the force generating device, and record the true strain value, the set temperature of the temperature-changing test chamber, and the strain measurement values to obtain sample data.
[0014] In some embodiments, the method for training the temperature compensation model of the FBG sensor further includes the following steps:
[0015] Normalize the set temperature values, strain measurement values, and true strain values in the first training dataset respectively to obtain a processed first training dataset.
[0016] In some embodiments, the step of optimizing the temperature compensation model according to the third training dataset to obtain a trained temperature compensation model includes the following steps:
[0017] Train a discriminator according to the compensated strain measurement values and true strain values in the third training dataset so that the discriminator performs binary classification of true and false data on the input data of the discriminator;
[0018] Calculate the model loss according to the binary classification result of the compensated strain measurement values by the discriminator;
[0019] Update the parameters of the temperature compensation model according to the model loss to obtain a trained temperature compensation model.
[0020] In some embodiments, the step of training a discriminator according to the compensated strain measurement values and true strain values in the third training dataset so that the discriminator performs binary classification of true and false data on the input data of the discriminator includes the following steps:
[0021] Form false sample data based on the compensated strain measurement values and corresponding preset temperature values in the third training dataset, and form true sample data based on the true strain values and corresponding preset temperature values in the third training dataset;
[0022] Input the false sample data and the true sample data into the discriminator respectively to obtain the first discrimination result of the discriminator for the false sample data and the second discrimination result for the true sample data;
[0023] Calculate the least squares loss according to the first discrimination result and the second discrimination result, and update the discriminator according to the least squares loss.
[0024] In some embodiments, calculating the model loss according to the binary classification result of the discriminator for the compensated strain measurement values includes the following steps:
[0025] Input the compensated strain measurement values into the optimized discriminator to obtain a binary classification result, and determine the adversarial loss according to the binary classification result;
[0026] Calculate the compensation loss according to the compensated strain measurement values and the corresponding true strain values;
[0027] Calculate the model loss according to the adversarial loss and the compensation loss.
[0028] To achieve the above object, another aspect of the embodiments of the present application proposes a temperature compensation method for an FBG sensor, including the following steps:
[0029] Obtain the measurement result output by the FBG sensor and the ambient temperature at which the FBG sensor operates, and map the measurement result to a corresponding wavelength measurement value;
[0030] Input the ambient temperature and the wavelength measurement value into the temperature compensation model to obtain a wavelength compensation value;
[0031] Adjust the measurement result according to the wavelength compensation value to obtain a temperature-compensated measurement result;
[0032] Wherein, the temperature compensation model is trained by the temperature compensation model training method for an FBG sensor according to any one of claims 1 to 6.
[0033] To achieve the above object, another aspect of the embodiments of the present application proposes a temperature compensation model training system for an FBG sensor, including:
[0034] The first module is used to obtain a first training data set and initialize a temperature compensation model. The first training data set includes multiple sample data, and each sample data includes a strain measurement value and a true strain value measured by an FBG sensor under the influence of a set temperature.
[0035] The second module is used to map the strain measurement values in the first training data set to corresponding wavelength measurement values to obtain a second training data set.
[0036] The third module is used to input the wavelength measurement values and the set temperature values in the second training data set into the temperature compensation model as input data to obtain wavelength compensation data.
[0037] The fourth module is used to compensate the strain measurement values in the first training data according to the wavelength compensation data to obtain a third training data set.
[0038] The fifth module is used to optimize the temperature compensation model according to the third training data set to obtain a trained temperature compensation model.
[0039] To achieve the above object, on the other hand, an embodiment of the present application provides an electronic device. The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory. When the program is executed by the processor, the method described in the above embodiment is implemented.
[0040] To achieve the above object, on the other hand, an embodiment of the present application provides a storage medium. The storage medium is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in the above embodiment.
[0041] The temperature compensation method, model training method, system, device, and medium of the FBG sensor proposed in this application obtain the first training data set and initialize the temperature compensation model. The first training data set includes multiple sample data, and each sample data includes the strain measurement value and the true strain value measured by the FBG sensor under the influence of a set temperature. The strain measurement values in the first training data set are mapped to corresponding wavelength measurement values to obtain the second training data set. The wavelength measurement values and the set temperature values in the second training data set are used as input data and input into the temperature compensation model to predict the required wavelength compensation data. The strain measurement values in the first training data are compensated according to the wavelength compensation data to obtain the third training data set, and then the temperature compensation model is optimized according to the third training data set to obtain the trained temperature compensation model. This application collects the training data set based on the strain monitoring of the FBG sensor, then constructs the data set for measuring the wavelength change under the influence of temperature through the mapping relationship between the strain parameter and the wavelength, and trains the temperature compensation model based on this data set. This model is used to analyze the wavelength compensation under the influence of temperature, and this model can be applied to the temperature compensation of various types of parameter measurement results of the FBG sensor, simplifying the temperature compensation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flowchart of the temperature compensation model training method for the FBG sensor provided by an embodiment of this application;
[0043] Figure 2 is a static curve graph of the experimental measurement data before temperature compensation provided by an embodiment of this application;
[0044] Figure 3 is a schematic diagram of the training and compensation process based on the conditional generative adversarial network provided by an embodiment of this application;
[0045] Figure 4 The static curve graph of the experimental measurement data after temperature compensation provided by an embodiment of this application;
[0046] Figure 5 is a flowchart of the temperature compensation method for the FBG sensor provided by an embodiment of this application;
[0047] Figure 6 is a schematic diagram of the hardware structure of the electronic device provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] In order to make the objectives, technical solutions, and advantages of this application clearer, the following further elaborates on this application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.
[0049] It should be noted that although the functional modules are divided in the system and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the system or the order in the flowchart. Terms such as "first" and "second" in the specification, claims, and the above-mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0051] The temperature compensation model training method for FBG sensors or the temperature compensation method for FBG sensors provided by the embodiments of this application relates to the field of computer technology. The temperature compensation model training method for FBG sensors or the temperature compensation method for FBG sensors provided by the embodiments of this application can be applied to terminals, can also be applied to server sides, or can be software running on terminals or server sides. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server side can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the temperature compensation model training method for FBG sensors or the temperature compensation method for FBG sensors, etc., but is not limited to the above forms.
[0052] This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0053] Figure 1It is an alternative flowchart of the temperature compensation model training method for the FBG sensor provided by the embodiments of the present application. Figure 1 The method in may include but is not limited to steps S101 to S105.
[0054] Step S101, obtain the first training dataset and initialize the temperature compensation model, where the first training dataset includes multiple sample data, and each sample data includes the strain measurement value and the true strain value measured by the FBG sensor under the influence of a set temperature.
[0055] Step S102, map the strain measurement values in the first training dataset to the corresponding wavelength measurement values to obtain the second training dataset.
[0056] Step S103, input the wavelength measurement values and the set temperature values in the second training dataset into the temperature compensation model as input data to obtain the wavelength compensation data.
[0057] Step S104, compensate the strain measurement values in the first training data according to the wavelength compensation data to obtain the third training dataset.
[0058] Step S105, optimize the temperature compensation model according to the third training dataset to obtain the trained temperature compensation model.
[0059] In step S101 of some embodiments, the temperature compensation model may adopt a machine learning model capable of capturing the non-linear relationship between the input and the output. Exemplarily, the temperature compensation model may be constructed using algorithms such as neural networks, support vector machines, decision trees, and random forests.
[0060] In some embodiments, the sample data in the first training dataset in step S101 may be obtained through but not limited to the following steps:
[0061] Step S201, apply a preset force to the FBG sensor located in the temperature-changing test chamber by controlling the force generating device to collect the strain measurement value measured by the FBG sensor.
[0062] Step S202, determine the true strain value according to the preset force generated by the force generating device, and record the true strain value, the set temperature of the temperature-changing test chamber, and the strain measurement value to obtain the sample data.
[0063] In this embodiment, an FBG sensor of a target type (such as a BC-S5 differential fiber Bragg grating strain sensor) can be selected as the experimental object, and the strain measurement values directly output by the FBG sensor under different temperatures and different applied forces (tensile force or pressure can be applied to the FBG sensor as needed) are collected. Alternatively, the reflection signals in the fiber optic channel of the FBG sensor under different temperatures and different applied forces can be collected first, and then the strain measurement values of the FBG sensor are calculated based on the wavelength changes of the reflection signals. On this basis, a first training dataset including temperature, applied force (i.e., the true strain value), and strain measurement values is constructed. It can be understood that after obtaining the reflection signal, a wavelet denoising method can be used to filter the high-frequency noise mixed in the reflection signal to obtain a clearer original signal. The steps of the wavelet denoising method include: performing wavelet decomposition on the reflection signal, selecting the decomposition level and wavelet basis function, applying soft threshold processing to remove the noise signal, and reconstructing the signal from the denoised wavelet coefficients to obtain the original signal. Then, the wavelength changes of the original signal obtained after filtering are analyzed to determine the strain measurement values of the FBG sensor.
[0064] Exemplarily, the FBG sensor is fixed to a fixture and placed on a slide rail. A force generating device (which can set the generated force) is used to tension the steel cable so that the sensor is subjected to a small initial stress. At the same time, the FBG sensor is placed in a temperature-changing test chamber. The experiment can be designed with 6×10 working conditions, and each working condition experiment is repeated twice. Specifically, a tensile stress of 0 to 100 MPa is applied to the FBG sensor by gradually increasing the tensile force, with a step size of 10 MPa. To ensure the operability of subsequent data statistics steps, the starting stress of the test is replaced by 0.05 MPa instead of 0 MPa. At the same time, the temperature of the temperature-changing test chamber is adjusted to control the ambient temperature in steps of 10°C, and the temperature change range is 10°C to 60°C. At each applied stress at each temperature point, the above experimental process is repeated and the stress data collected by the sensor is recorded. The average value of the two measurement results of each fiber Bragg grating strain sensor in the 6×10 tests is taken as the strain measurement value. Then, the temperature values, applied forces (i.e., the true stress values), and stress measurement values recorded under each working condition are used to obtain sample data. Further, a relationship curve of the measurement values at 6 different temperature points and the tensile force applied by the test device is plotted as Figure 2 shown. As Figure 2 can be seen, the FBG sensor exhibits a relatively obvious temperature drift phenomenon.
[0065] In some embodiments, the temperature compensation model training method for the FBG sensor according to the embodiments of the present application further includes, but is not limited to, the following steps:
[0066] Step S301: Normalize the set temperature values, strain measurement values, and true strain values in the first training dataset respectively to obtain the processed first training dataset.
[0067] In this embodiment, normalize all the temperature data in the first training dataset, that is, find the minimum temperature value and the maximum temperature value among them, and then map the temperature values based on the formula of min-max normalization, so as to map the temperature data to the interval [0, 1]. Similarly, use the same method to normalize all the strain measurement data in the first training dataset and all the true strain data in the first training dataset, and map the data of each dimension to the interval [0, 1] to reduce the dimensional difference of different data dimensions and improve the stability of subsequent model training.
[0068] In step S102 of some embodiments, in order to train a model that can perform temperature compensation on wavelengths, it is necessary to map the strain values measured by the FBG sensor to the corresponding wavelength values, use the wavelength values and the corresponding temperature values as the input of the model, and the wavelength compensation value as the output of the model. There is a certain mapping relationship between the wavelength value and the strain value. Through this mapping relationship, the strain measurement values in the first training dataset can be mapped to the corresponding wavelength measurement values. Specifically, the relationship between strain (∈) and wavelength change (Δλ) can be expressed by the following formula:
[0069] Δλ = λ B ·(1 - p e )·∈;
[0070] Where, Δλ is the wavelength change amount; λ B is the initial wavelength, and the initial wavelength (λ B ) of the fiber Bragg grating is the central reflection wavelength in the strain-free state; p e is the photoelastic coefficient (usually about 0.22); ∈ is the strain measurement value.
[0071] According to the measured strain value, use the above formula to calculate the wavelength change amount Δλ, and then add the wavelength change amount Δλ to the initial wavelength λ B to obtain the final wavelength λ, that is, λ = λ B + Δλ.
[0072] In step S103 of some embodiments, after converting the strain measurement values in the first training dataset into corresponding wavelength measurement values to obtain the second training dataset, the preset temperature value and the wavelength measurement value of the sample data in the second training dataset are used as inputs to the temperature compensation model, and the wavelength compensation value output by the temperature compensation model is obtained. It can be understood that the second training dataset includes multiple sample data, and each sample data includes a wavelength measurement value, a preset temperature value, and a true strain value. In this embodiment, the temperature compensation model can be a deep learning neural network or a support vector machine. By training the temperature compensation model, a mapping relationship between the wavelength measurement value and the wavelength compensation value of the FBG sensor under a certain environmental temperature condition is constructed, so that the temperature compensation model can compensate the wavelength of the FBG sensor for subsequent calculation of accurate strain values.
[0073] In step S104 of some embodiments, after using the preset temperature value and the wavelength measurement value of the sample data in the second training dataset as inputs to the temperature compensation model and obtaining the wavelength compensation value output by the temperature compensation model, it is necessary to compare the output of the model with the label to update the parameters of the model. Since the label of the sample in the second training dataset is the true strain value, it is necessary to compensate the strain measurement value of the sample data in the first training dataset according to the wavelength compensation value output by the model to obtain the third training dataset. It can be understood that the third training dataset includes multiple sample data, and each sample data includes the compensated preset temperature value, the compensated strain measurement value, and the true strain value. The parameters of the temperature compensation model are updated by comparing the gap between the compensated strain measurement value and the true strain value in the third training dataset.
[0074] Exemplarily, the compensated strain measurement value can be calculated by the following formula:
[0075]
[0076] where, ∈ compensated denotes the compensated strain measurement value, λ B denotes the initial wavelength, Δλ strain denotes the wavelength change caused only by strain, p e denotes the photoelastic coefficient. Δλ strain is calculated by the following formula:
[0077] Δλ strain =Δλ total -Δλ templ ;
[0078] where, Δλ total denotes the total wavelength change of the measured grating (including the influence of strain and temperature, calculated from the strain measurement value before compensation), Δλ templIndicates the wavelength change of the reference grating (caused only by temperature and obtained through the wavelength compensation value).
[0079] In step S105 of some embodiments, the loss of the temperature compensation model is determined by calculating the batch training gap between the compensated strain measurement values and the true strain values in the third training dataset, and then the parameters of the temperature compensation model are adjusted by the gradient descent method according to this loss. After adjusting the temperature compensation model, steps S101 to S105 are repeatedly executed to obtain new training data and perform the next batch training to continuously adjust the parameters of the temperature compensation model until the model loss is less than a certain preset value, and a trained temperature compensation model is obtained.
[0080] In this embodiment, a training dataset is collected based on the strain monitoring of the FBG sensor, and then a dataset for measuring the wavelength change under the influence of temperature is constructed through the mapping relationship between the strain parameter and the wavelength. A temperature compensation model is trained based on this dataset. This model is used to analyze the wavelength compensation under the influence of temperature and can be applied to the temperature compensation of various types of parameter measurement results (such as strain parameters, acceleration parameters, or vibration parameters, etc.) of the FBG sensor, simplifying the temperature compensation method.
[0081] In some embodiments, the temperature compensation model of this embodiment can be trained based on a Conditional Generative Adversarial Network (CGAN). As a deep learning model, the conditional generative adversarial network has the ability to generate a data distribution related to the input conditions and can effectively handle the problem of nonlinear feature extraction and modeling in complex environments. Therefore, applying CGAN to the training of the temperature compensation model of the FBG sensor can improve the wavelength compensation value and prediction accuracy of the FBG sensor, and further improve the measurement accuracy of the FBG sensor. In this embodiment, a temperature compensation model based on CGAN is designed. The generator (i.e., the temperature compensation model) is used to generate the required wavelength compensation value, and the discriminator is used to judge the authenticity of the generated signal to achieve adversarial learning and compensation optimization for spectral temperature drift. Then, the temperature drift signal of the actual sensor is compensated and corrected by the trained generator, so as to calculate the accurate measurement result after compensation.
[0082] In some embodiments, in step S105, the step of optimizing the temperature compensation model according to the third training dataset to obtain a trained temperature compensation model may include, but is not limited to, the following steps:
[0083] Step S401: Train the discriminator according to the compensated strain measurement values and the true strain values in the third training dataset, so that the discriminator performs binary classification processing on the input data of the discriminator for true and false data;
[0084] Step S402: Calculate the model loss according to the binary classification result of the discriminator on the compensated strain measurement value;
[0085] Step S403: Update the parameters of the temperature compensation model according to the model loss to obtain a trained temperature compensation model.
[0086] Exemplarily, the generator undertakes the core task of FBG sensor temperature compensation. By learning the non-linear mapping relationship between the input temperature value and the stress measurement value with temperature drift, the generator generates the required wavelength compensation value. Through this wavelength compensation value, the stress measurement value after temperature compensation can be calculated to reduce the influence of temperature drift on stress measurement, making the compensated stress measurement value as close as possible to the actually applied stress and improving the measurement accuracy. The input of the generator includes the conditional vector c, where c includes the temperature value T and the wavelength measurement value with temperature drift, and the output is the wavelength compensation value. The input of the generator may further include random noise introduced by reasons such as signal transmission. By training the generator, the influence of wavelength offset caused by random noise can also be compensated. The generator network can adopt a four-layer fully connected structure, linearly transforming layer by layer and gradually abstracting the signal features through activation functions. The Mish activation function is used in the first three layers of the network to enhance the non-linear expression ability and improve the generator's modeling ability for complex temperature drift signals; the last layer is a linear output layer for generating the finally compensated stress signal. The generator receives random noise and the conditional vector as inputs and decodes layer by layer using the fully connected layer to generate the corresponding wavelength compensation value. The parameters of the generator network model can be as shown in Table 1.
[0087] Table 1 Generator Parameter Table
[0088]
[0089] Exemplarily, in the dynamic compensation model of the generative adversarial network, the role of the discriminator is to perform binary classification on the truly applied stress signal (i.e., the true strain value) and the strain measurement value compensated based on the wavelength compensation value generated by the generator, and provide gradient information to help the generator adjust the distribution of the output signal to make it closer to the real data. The goal of the discriminator is to strive to classify the real signal as "1" and the generated signal as "0", so that the generator can be continuously optimized through adversarial training. The discriminator network adopts a three-layer fully connected structure. The first two layers use the Leaky ReLU activation function to extract the deep features of the signal layer by layer, enhancing the discriminator's ability to discriminate complex signals; the last layer is a linear output layer, without using the Sigmoid activation function, and directly outputs the linear value for the regression task in the LSGAN loss. Finally, the discriminator maps the extracted features into a single probability value as the basis for judging the authenticity of the input signal. The discriminator takes the temperature value and the compensated strain measurement value as inputs to determine whether the generated sample based on the generator is the true strain value. The parameters of the discriminator network model can be as shown in Table 2.
[0090] Table 2 Discriminator Parameter Table
[0091]
[0092] Exemplarily, after determining the network structures of the generator and the discriminator, the generator and the discriminator can be trained using sample data. Please refer to Figure 3, in the training phase, first, the generator (G) generates an intermediate compensation signal (i.e., wavelength compensation signal) based on the temperature error signal (i.e., wavelength measurement values carrying temperature conditions). Then, the temperature error signal is compensated according to the intermediate compensation signal to generate a compensated strain measurement value. The discriminator (D) network is optimized. The real signal (i.e., real strain value carrying temperature conditions) and the generated signal (i.e., compensated strain test value carrying temperature conditions) are input for training, respectively making their outputs approach the target values of 1 and 0; then, based on the optimized discriminator, the adversarial loss of the generator is calculated from the evaluation of the compensated strain measurement value obtained from the generator, and the accuracy of the generated signal is improved through the adversarial loss. Further, the generator can also be optimized by combining the compensation loss of the generator itself. When the generator starts training, the data distribution of the compensation signal is very different from the data distribution of the real signal, so it will be judged as a false data pair. During the adversarial training process, the generator adjusts its own parameters according to the loss feedback signal provided by the discriminator, making the data it generates gradually approach the real signal. In the continuous iteration of the adversarial training, the discrimination ability of the discriminator is gradually improved, and at the same time, the signal generated by the generator gradually approaches the distribution of the real signal. When the discriminator can no longer distinguish the generated signal from the real signal, the network training is completed, and the generator temperature compensation model is obtained. In the temperature compensation phase, the trained temperature compensation model can be used to compensate the temperature error signal to obtain a compensated signal.
[0093] Exemplarily, a total of 1000 Epochs are set for the experimental training, the Batch size is 16, the model optimizer is Adam, and the initial learning rate is set to 0.0002. The training loss is printed every 50 Epochs to observe the convergence of the model. After the training is completed, the weights of the generator are saved to a local file. After obtaining the temperature compensation model through training, the test set data is input into the trained model to generate wavelength compensation values, and then the stress compensation values are calculated, as Figure 4 shown. By comparing with the real stress values, the temperature compensation effect is verified. As Figure 4 can be seen, the temperature interference resistance of the FBG sensor is significantly improved after temperature compensation, and the corresponding measurement outputs for the same tensile input at different temperatures are basically the same.
[0094] In some embodiments, in step S401, the step of training the discriminator according to the compensated strain measurement values and real strain values in the third training dataset to enable the discriminator to perform binary classification processing of true and false data on the input data of the discriminator may include, but is not limited to, the following steps:
[0095] Step S501, forming false sample data according to the compensated strain measurement values and corresponding preset temperature values in the third training dataset, and forming true sample data according to the real strain values and corresponding preset temperature values in the third training dataset;
[0096] Step S502: Input the fake sample data and the real sample data into the discriminator respectively, and obtain the first discrimination result of the discriminator for the fake sample data and the second discrimination result for the real sample data;
[0097] Step S503: Calculate the least squares loss according to the first discrimination result and the second discrimination result, and update the discriminator according to the least squares loss.
[0098] Exemplarily, the training objective of the discriminator is to continuously improve the ability to distinguish real data and generated data by minimizing its own loss function. Its loss function can adopt the least squares loss of LSGAN, and the specific form is as follows:
[0099]
[0100] where represents the real sample data, D(x,c) represents the second discrimination result of the discriminator for the real sample data (including the real strain value x and the preset temperature value c), represents the fake sample data (including the compensated strain measurement value G(z,c) obtained by the discriminator D based on the generator G and the preset temperature value c), and D(G(z,c),c) represents the first discrimination result of the discriminator D for the fake sample data.
[0101] In some embodiments, in step S402, the step of calculating the model loss according to the binary classification result of the discriminator for the compensated strain measurement value may include, but is not limited to, the following steps:
[0102] Step S601: Input the compensated strain measurement value into the optimized discriminator to obtain the binary classification result, and determine the adversarial loss according to the binary classification result;
[0103] Step S602: Calculate the compensation loss according to the compensated strain measurement value and the corresponding real strain value;
[0104] Step S603: Calculate the model loss according to the adversarial loss and the compensation loss.
[0105] Exemplarily, the training process of the generator adopts a strategy combining the adversarial loss and the compensation loss. The adversarial loss uses the least squares loss of LSGAN. By minimizing the squared error between the data generated by the generator and the target value, the distribution of the generated signal is made as close as possible to the real data distribution, while improving the training stability and avoiding the problem of gradient disappearance. The compensation loss directly constrains the error between the generated signal and the real stress value through the mean square error (MSE), and improves the accuracy of the generated signal. The model loss function of the generator is as follows:
[0106]
[0107] Among them, G(z, c) represents the compensated strain measurement value obtained based on the generator, x represents the true strain value, and λ is the weight factor of the compensation loss, which is used to balance the influence of the adversarial loss and the compensation loss on the generator, so that the generator can simultaneously achieve the goals of distribution approximation and signal compensation. In this embodiment, the value of λ can be set to 50 through experiments to simultaneously meet the requirements of signal distribution approximation and compensation accuracy optimization.
[0108] In this embodiment, by optimizing the network structures of the generator and the discriminator and combining the dual constraints of the adversarial loss and the compensation loss, the modeling ability and compensation accuracy of the generation model for temperature drift signals are significantly improved, thereby reducing the influence of temperature on the measurement results and meeting the requirements of high-precision measurement in complex application scenarios.
[0109] Please refer to Figure 5 , and this application embodiment also proposes a temperature compensation method for FBG sensors, which may include but is not limited to the following steps:
[0110] Step S701, obtain the measurement result output by the FBG sensor and the ambient temperature at which the FBG sensor operates, and map the measurement result to the corresponding wavelength measurement value;
[0111] Step S702, input the ambient temperature and the wavelength measurement value into the temperature compensation model to obtain the wavelength compensation value;
[0112] Step S703, adjust the measurement result according to the wavelength compensation value to obtain the temperature-compensated measurement result.
[0113] In this embodiment, the measurement principle of the FBG sensor is as follows: The external environment (pressure, vibration, displacement, acceleration, strain, etc.) causes changes in the grating period and the effective refractive index, thereby causing a shift in the Bragg wavelength. Therefore, by analyzing the wavelength shift, the corresponding environmental measurement result can be determined. This embodiment can obtain any one of the measurement results output by the FBG sensor (such as the strain measurement value or the acceleration measurement value, etc.) and the ambient temperature at which the FBG sensor operates, map the measurement result to the corresponding wavelength measurement value, then input the ambient temperature and the wavelength measurement value into the temperature compensation model trained in the above embodiment to obtain the wavelength compensation value, and adjust the measurement result according to the wavelength compensation value to obtain the temperature-compensated measurement result.
[0114] Through the temperature compensation method of this application embodiment, the temperature drift error of the FBG sensor can be significantly reduced, and the measurement accuracy and stability of the sensor in a complex environment can be improved.
[0115] This application embodiment also proposes a temperature compensation model training system for FBG sensors, including:
[0116] The first module is used to obtain the first training dataset and initialize the temperature compensation model. The first training dataset includes multiple sample data, and each sample data includes the strain measurement value and the true strain value measured by the FBG sensor under the influence of a set temperature.
[0117] The second module is used to map the strain measurement values in the first training dataset to corresponding wavelength measurement values to obtain the second training dataset.
[0118] The third module is used to input the wavelength measurement values and the set temperature values in the second training dataset into the temperature compensation model as input data to obtain wavelength compensation data.
[0119] The fourth module is used to compensate the strain measurement values in the first training data according to the wavelength compensation data to obtain the third training dataset.
[0120] The fifth module is used to optimize the temperature compensation model according to the third training dataset to obtain the trained temperature compensation model.
[0121] It can be understood that the content in the above embodiments of the temperature compensation model training method for the FBG sensor is applicable to the embodiments of this system. The functions specifically implemented by the embodiments of this system are the same as those of the above embodiments of the temperature compensation model training method for the FBG sensor, and the beneficial effects achieved are also the same as those of the above embodiments of the temperature compensation model training method for the FBG sensor.
[0122] The embodiments of this application also provide an electronic device, which includes: a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing the connection and communication between the processor and the memory. When the program is executed by the processor, it realizes the above temperature compensation model training method for the FBG sensor or the temperature compensation method for the FBG sensor. This electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.
[0123] Please refer to Figure 6 , Figure 6 which shows the hardware structure of an electronic device in another embodiment. The electronic device includes:
[0124] A processor 601, which can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of this application.
[0125] The memory 602 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 602 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 602, and the processor 601 is called to execute the temperature compensation model training method of the FBG sensor or the temperature compensation method of the FBG sensor in the embodiments of this application;
[0126] The input / output interface 603 is used to implement information input and output;
[0127] The communication interface 604 is used to implement communication interaction between this device and other devices. It can implement communication through a wired manner (such as USB, network cable, etc.) or through a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0128] The bus 605 transmits information between various components of the device (such as the processor 601, the memory 602, the input / output interface 603, and the communication interface 604);
[0129] Among them, the processor 601, the memory 602, the input / output interface 603, and the communication interface 604 are communicatively connected to each other inside the device through the bus 605.
[0130] The embodiments of this application also provide a storage medium. The storage medium is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned temperature compensation model training method of the FBG sensor or the temperature compensation method of the FBG sensor.
[0131] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely provided relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0132] The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art will know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0133] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.
[0134] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.
[0136] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0137] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (one) of the following" or similar expressions refer to any combination of these items, including any combination of single item (one) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0138] In several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the system or unit can be in electrical, mechanical or other forms.
[0139] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in various embodiments of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes: various media that can store programs, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
[0142] The preferred embodiments of the embodiments of this application have been described above with reference to the accompanying drawings, which does not limit the scope of rights of the embodiments of this application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of this application shall be within the scope of rights of the embodiments of this application.
Claims
1. A method for training a temperature compensation model of an FBG sensor, characterized in that, Including the following steps: Obtain a first training dataset and initialize a temperature compensation model, where the first training dataset includes multiple sample data, and each sample data includes a strain measurement value and a true strain value measured by an FBG sensor under the influence of a set temperature; Map the strain measurement values in the first training dataset to corresponding wavelength measurement values to obtain a second training dataset; Use the wavelength measurement values and the set temperature values in the second training dataset as input data and input them into the temperature compensation model to obtain wavelength compensation data; Compensate the strain measurement values in the first training data according to the wavelength compensation data to obtain a third training dataset; Optimize the temperature compensation model according to the third training dataset to obtain a trained temperature compensation model.
2. The temperature compensation model training method for the FBG sensor according to claim 1, wherein The sample data in the first training dataset is obtained through the following steps: Control a force generating device to apply a preset force to an FBG sensor located in a temperature-changing test chamber to collect the strain measurement values measured by the FBG sensor; Determine the true strain value according to the preset force generated by the force generating device, and record the true strain value, the set temperature of the temperature-changing test chamber, and the strain measurement value to obtain sample data.
3. The method for training the temperature compensation model of the FBG sensor according to claim 1, wherein The method for training the temperature compensation model of the FBG sensor further includes the following steps: Normalize the set temperature values, strain measurement values, and true strain values in the first training dataset respectively to obtain a processed first training dataset.
4. The temperature compensation model training method of the FBG sensor according to claim 1, characterized in that, The step of optimizing the temperature compensation model according to the third training dataset to obtain a trained temperature compensation model includes the following steps: Train a discriminator according to the compensated strain measurement values and true strain values in the third training dataset, so that the discriminator performs binary classification processing on the input data of the discriminator for true and false data; Calculate the model loss according to the binary classification result of the discriminator for the compensated strain measurement values; Update the parameters of the temperature compensation model according to the model loss to obtain a trained temperature compensation model.
5. The method for training the temperature compensation model of the FBG sensor according to claim 4, characterized in that, The step of training the discriminator according to the compensated strain measurement values and true strain values in the third training dataset, so that the discriminator performs binary classification processing on the input data of the discriminator for true and false data includes the following steps: Form false sample data according to the compensated strain measurement values and corresponding preset temperature values in the third training dataset, and form true sample data according to the true strain values and corresponding preset temperature values in the third training dataset; Input the false sample data and the true sample data into the discriminator respectively to obtain a first discrimination result of the discriminator for the false sample data and a second discrimination result for the true sample data; Calculate the least squares loss according to the first discrimination result and the second discrimination result, and update the discriminator according to the least squares loss.
6. The method for training the temperature compensation model of the FBG sensor according to claim 4, characterized in that, The step of calculating the model loss according to the binary classification result of the discriminator for the compensated strain measurement values includes the following steps: Input the compensated strain measurement value into the optimized discriminator to obtain a binary classification result, and determine the adversarial loss according to the binary classification result; Calculate the compensation loss according to the compensated strain measurement value and the corresponding true strain value; Calculate the model loss according to the adversarial loss and the compensation loss.
7. A temperature compensation method for an FBG sensor, characterized in that, It includes the following steps: Obtain the measurement result output by the FBG sensor and the ambient temperature at which the FBG sensor operates, and map the measurement result to a corresponding wavelength measurement value; Input the ambient temperature and the wavelength measurement value into the temperature compensation model to obtain a wavelength compensation value; Adjust the measurement result according to the wavelength compensation value to obtain a temperature-compensated measurement result; Among them, the temperature compensation model is trained by the temperature compensation model training method of the FBG sensor according to any one of claims 1 to 6.
8. A temperature compensation model training system for an FBG sensor, characterized in that, It includes: A first module for obtaining a first training data set and initializing a temperature compensation model, wherein the first training data set includes a plurality of sample data, and each sample data includes a strain measurement value and a true strain value measured by the FBG sensor under the influence of a set temperature; A second module for mapping the strain measurement values in the first training data set to corresponding wavelength measurement values to obtain a second training data set; A third module for inputting the wavelength measurement values and the set temperature values in the second training data set into the temperature compensation model as input data to obtain wavelength compensation data; A fourth module for compensating the strain measurement values in the first training data according to the wavelength compensation data to obtain a third training data set; A fifth module for optimizing the temperature compensation model according to the third training data set to obtain a trained temperature compensation model.
9. An electronic device, characterized in that, The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing the connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are realized.
10. A storage medium, which is a computer-readable storage medium for computer-readable storage, characterized in that The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Damage identification method based on Lamb wave temperature compensation and related device
CN120992772A