A hydrogen sensor calibration and calibration model training method and device

By using a hydrogen sensor calibration model and optimizing parameters through feature extraction and adversarial modules, the problem of low detection accuracy of hydrogen sensors under multiple interference factors was solved, achieving higher measurement accuracy and stability.

CN120629273BActive Publication Date: 2026-07-14GUANGDONG ELECTRIC POWER SCI RES INST ENERGY TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG ELECTRIC POWER SCI RES INST ENERGY TECH CO LTD
Filing Date
2025-06-05
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing hydrogen sensors have low detection accuracy under multiple interference factors, and existing compensation methods ignore the coupling effect between interference factors, resulting in inaccurate measurement accuracy.

Method used

A hydrogen sensor calibration model is adopted, including a feature extraction module, a hydrogen concentration prediction module, and an adversarial module. Dynamic features are extracted by expanding the number of electrical signal data channels, gated recurrent unit networks, and attention mechanisms. Feature suppression and compensation are performed by combining fully connected layers and adversarial modules to optimize model parameters.

Benefits of technology

This improved the detection accuracy and stability of the hydrogen sensor under various interference factors, and enhanced the model's adaptability and robustness to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120629273B_ABST
    Figure CN120629273B_ABST
Patent Text Reader

Abstract

The application discloses a hydrogen sensor calibration and calibration model training method and device, and belongs to the field of hydrogen concentration detection. The method comprises the following steps: collecting a plurality of electric signal data output by a hydrogen sensor and first hydrogen concentration data of a space where the hydrogen sensor outputs the electric signal data; extracting feature data in each electric signal data; predicting the respective corresponding corrected second hydrogen concentration data of the electric signal data according to the feature data; predicting a plurality of interference signals corresponding to the respective electric signal data according to the feature data; wherein each interference signal corresponds to an interference factor; obtaining a prediction error loss according to each first hydrogen concentration data and each second hydrogen concentration data, and obtaining an adversarial loss according to each interference signal; and finally combining a preset weight parameter to combine and optimize the parameters of the hydrogen sensor calibration model. Therefore, by implementing the application, the problem of low detection accuracy of the hydrogen sensor under multiple interference factors can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of hydrogen concentration detection, and in particular to a method and apparatus for calibrating a hydrogen sensor and training a calibration model. Background Technology

[0002] Hydrogen sensors are widely used in environmental monitoring, industrial safety, and energy storage to detect the concentration of hydrogen in the environment. However, the sensitive membrane in existing hydrogen sensors is easily affected by environmental factors such as temperature and humidity, causing changes in the response relationship between its resistance characteristics and hydrogen concentration, thus affecting the measurement accuracy of the hydrogen sensor.

[0003] To address the aforementioned technical problems, existing technologies employ single-factor compensation methods, compensating separately for interference factors such as temperature or humidity. For example, some hydrogen sensors adjust the sensor's output signal through temperature compensation circuits to reduce errors caused by temperature changes; while for the influence of humidity, some sensors correct the output by adding a humidity sensor or a dedicated humidity compensation circuit. However, these methods neglect the impact of the coupling effect between different interference factors on the interference compensation effect. For instance, as temperature increases, the activity of the sensitive membrane increases, and the resistance decreases; conversely, as humidity increases, the resistance of the sensitive membrane increases. When multiple interference factors occur simultaneously, failure to consider the coupling effect between them will lead to incomplete compensation, affecting the measurement accuracy of the hydrogen sensor. Furthermore, the influence of multiple interference factors coupled on hydrogen concentration detection is often non-linear, and existing compensation algorithms rely too heavily on simple mathematical models such as linear or polynomial fitting, failing to meet the compensation requirements under the influence of multiple interference factors.

[0004] Therefore, improving the detection accuracy of hydrogen sensors under multiple interference factors is a technical problem that needs to be solved. Summary of the Invention

[0005] This application provides a method and apparatus for calibrating a hydrogen sensor and training a calibration model, which can solve the problem of low detection accuracy of hydrogen sensors under multiple interference factors in the prior art.

[0006] One embodiment of this application provides a method for training a hydrogen sensor calibration model. The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and an adversarial module. The method includes:

[0007] Collect several electrical signal data output by the hydrogen sensor and the first hydrogen concentration data of the space where the hydrogen sensor is located when it outputs the electrical signal data;

[0008] The feature extraction module extracts feature data from each of the electrical signal data.

[0009] The hydrogen concentration prediction module predicts the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data.

[0010] The countermeasure module predicts several interference signals corresponding to each of the electrical signal data based on the feature data; wherein each interference signal corresponds to an interference factor.

[0011] The prediction error loss is obtained based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and the countermeasure loss is obtained based on each of the interference signals.

[0012] The temperature and humidity resistance loss is calculated based on the preset weight parameter combination, the prediction error loss, and the resistance loss, and the parameters of the hydrogen sensor calibration model are optimized based on the temperature and humidity resistance loss.

[0013] Compared to existing technologies, the above embodiments have the following advantages: Since the hydrogen concentration prediction module relies on feature data extracted from electrical signal data to accurately predict the second hydrogen concentration data, if the extracted feature data contains too many related features characterizing interference signals, the final predicted hydrogen concentration result will be inaccurate. To simultaneously suppress the related features of multiple interference signals in the feature data, an adversarial module is added to independently identify the related features of each interference signal in the feature data. Furthermore, temperature and humidity adversarial losses, including adversarial loss and prediction error loss, are used to negatively feedback adjust the parameters of the hydrogen sensor calibration model. This achieves simultaneous suppression of the related features of different interference signals during feature extraction, and enables the hydrogen concentration prediction module to effectively identify features related to hydrogen concentration in the feature data, thereby improving the detection accuracy of the hydrogen sensor calibration model under various interference factors.

[0014] Further, the step of extracting feature data from each of the electrical signal data through the feature extraction module includes:

[0015] Expand the number of channels of the electrical signal data to obtain the first data;

[0016] Dynamic feature information of the first data is extracted through a gated recurrent unit network;

[0017] The feature data is obtained by enhancing hydrogen concentration-related features in the dynamic feature information through an attention mechanism and suppressing interfering features.

[0018] Compared with existing technologies, the above embodiments have the following beneficial effects: by expanding the number of channels of electrical signal data and combining gated recurrent unit networks and attention mechanisms, dynamic feature information in electrical signals can be effectively extracted. Combined with the subsequent loss function to apply negative feedback conditions to the parameters in the feature extraction module, the representation of hydrogen concentration-related features during feature extraction is effectively enhanced, while interference features are suppressed. This improves the quality of feature data extracted by the hydrogen sensor calibration model, provides more accurate input for subsequent hydrogen concentration prediction, and improves the adaptability of the hydrogen sensor calibration model to complex interference environments.

[0019] Further, the step of predicting the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data using the hydrogen concentration prediction module includes:

[0020] The feature data is sequentially input into the first fully connected layer with a first preset number of layers, and the data output from the last first fully connected layer is averaged and aggregated along the channel dimension to obtain global features.

[0021] The second hydrogen concentration is obtained by combining the global features with the second fully connected layer.

[0022] Compared to existing technologies, the above embodiments have the following advantages: The method of using a fully connected layer combined with global feature aggregation can fully capture global feature information in electrical signal data, avoiding the impact of local feature loss on prediction results. Through mean aggregation, the hydrogen concentration prediction module can focus on the overall trend of hydrogen concentration change, and combined with the feature data enhanced by dynamic features, significantly improves the accuracy and stability of hydrogen concentration prediction.

[0023] Further, the step of predicting several interference signals corresponding to each of the electrical signal data based on the feature data using the countermeasure module includes:

[0024] The interference signals include temperature interference signals and humidity interference signals; the countermeasures module includes a temperature compensation submodule and a humidity compensation submodule.

[0025] The temperature compensation submodule flattens the feature data into a one-dimensional vector and sequentially inputs the one-dimensional vector into the third fully connected layer of the second preset number of layers to obtain the temperature interference signal.

[0026] The humidity compensation submodule flattens the feature data into a one-dimensional vector and sequentially inputs the one-dimensional vector into the fourth fully connected layer with a third preset number of layers to obtain the humidity interference signal.

[0027] Compared with existing technologies, the above embodiments have the following beneficial effects: by splitting the adversarial module into independent temperature compensation sub-modules and humidity compensation sub-modules, and performing signal prediction for temperature and humidity interference respectively, the hydrogen sensor calibration model can independently learn the characteristic patterns of each interference factor, thereby achieving accurate compensation for temperature and humidity interference, improving the pertinence and reliability of the compensation effect. By combining the temperature and humidity interference loss, which integrates interference loss and joint prediction error loss, the influence of multiple interference factors on the hydrogen concentration prediction result is effectively coupled, improving the accuracy and stability of the final hydrogen concentration prediction.

[0028] Further, the step of obtaining the prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining the adversarial loss based on each of the interference signals, includes:

[0029] The resistance loss includes temperature resistance loss and humidity resistance loss;

[0030] The mean square error value is calculated based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and the mean square error value is used as the prediction error loss;

[0031] Calculate the temperature interference loss based on each of the temperature interference signals;

[0032] The humidity interference loss is calculated based on each of the humidity interference signals.

[0033] Compared with the prior art, the above embodiments have the following beneficial effects: by calculating the mean square error value, the difference between the predicted value and the true value of the hydrogen sensor calibration model is directly quantified, forcing the model to minimize the prediction deviation and improving the accuracy of hydrogen concentration detection; in addition, since the purpose of adversarial training is to enable the model to distinguish the characteristics of the true signal and the interference signal, thereby suppressing the influence of interference factors on the prediction, the corresponding interference loss is calculated according to each interference signal, thereby enhancing the model's anti-interference ability against non-target factors such as temperature and humidity.

[0034] Further, the step of calculating the temperature and humidity resistance loss based on the preset weight parameter combination, the prediction error loss, and the resistance loss includes:

[0035] Based on the weight parameter combination, determine the weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss, and calculate the weighted sum of the prediction error loss, the temperature interference loss, and the humidity interference loss.

[0036] The weighted sum is used as the temperature and humidity resistance loss; wherein each weighted sum has a corresponding hydrogen sensor calibration model.

[0037] Compared with the prior art, the above embodiments have the following beneficial effects: by jointly calculating the prediction error loss, temperature interference loss and humidity interference loss, and by introducing a weighted summation of weighted parameters, the dual optimization objectives of the hydrogen sensor calibration model parameters are achieved. This not only reduces the direct error of hydrogen concentration prediction, but also suppresses the influence of interference signals through adversarial training, ultimately improving the robustness and generalization ability of the model in multi-interference scenarios.

[0038] Another embodiment of this application also provides a hydrogen sensor calibration method, including:

[0039] Take one weight parameter combination from the preset set of weight parameter combinations as the preset weight parameter combination, and train the preset hydrogen sensor calibration model according to the preset weight parameter combination and any hydrogen sensor calibration model training method in the embodiments of this application.

[0040] Select the best-performing hydrogen sensor calibration model from all the hydrogen sensor calibration models obtained from training.

[0041] The electrical signal data output by the hydrogen sensor is input into the first hydrogen sensor calibration model to calibrate the hydrogen sensor.

[0042] Compared to existing technologies, the above embodiments have the following advantages: Since differences in the combination of weight parameters affect the setting of the loss function, thus impacting the performance of the finally trained hydrogen sensor calibration model, this method trains multiple candidate models by iterating through multiple sets of weight parameter combinations and selecting the calibration model with the best performance. Leveraging the advantages of hyperparameter search, the optimal weight parameter combination is determined while simultaneously obtaining the best-performing hydrogen sensor calibration model, thereby improving the accuracy and reliability of hydrogen sensor calibration.

[0043] Furthermore, before inputting the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model, the method further includes: amplifying the electrical signal data and filtering and digitizing the amplified electrical signal data.

[0044] Compared with the prior art, the above embodiments have the following beneficial effects: the electrical signal data is amplified, filtered and digitally preprocessed before calibration, which effectively eliminates the noise interference of the original signal, improves the signal-to-noise ratio of the signal, provides a more reliable input basis for subsequent feature extraction and model prediction, reduces error propagation, and further ensures the accuracy and stability of hydrogen sensor calibration.

[0045] Another embodiment of this application also provides a hydrogen sensor calibration model training device. The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and an adversarial module. The device includes: a data acquisition module, a first feature data extraction module, a first prediction module, a second prediction module, a loss calculation module, and a model parameter tuning module.

[0046] The data acquisition module is used to acquire several electrical signal data output by the hydrogen sensor and the first hydrogen concentration data of the space where the hydrogen sensor is located when it outputs the electrical signal data.

[0047] The first feature data extraction module is used to extract feature data from each of the electrical signal data.

[0048] The first prediction module is used to predict the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data, using the hydrogen concentration prediction module.

[0049] The second prediction module is used to predict, based on the feature data, several interference signals corresponding to each of the electrical signal data using the countermeasure module; wherein each interference signal corresponds to an interference factor.

[0050] The loss calculation module is used to obtain the prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and to obtain the adversarial loss based on each of the interference signals.

[0051] The loss model parameter tuning module is used to calculate the temperature and humidity resistance loss based on the preset weight parameter combination, the prediction error loss, and the resistance loss, and to optimize the parameters of the hydrogen sensor calibration model based on the temperature and humidity resistance loss.

[0052] Another embodiment of this application provides a hydrogen sensor calibration device, including: a model training module, a model screening module, and a calibration module;

[0053] The model training module is used to sequentially extract a weight parameter combination from a preset set of weight parameter combinations as a preset weight parameter combination, and train a preset hydrogen sensor calibration model according to the preset weight parameter combination and any hydrogen sensor calibration model training device in the embodiments of this application.

[0054] The model selection module is used to select the first hydrogen sensor calibration model with the best performance from all the hydrogen sensor calibration models obtained from training.

[0055] The calibration module is used to input the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model to calibrate the hydrogen sensor. Attached Figure Description

[0056] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0057] Figure 1 This is a flowchart illustrating a hydrogen sensor calibration model training method provided in some embodiments of this application;

[0058] Figure 2 This is a schematic diagram of the structure of a hydrogen sensor calibration model provided in some embodiments of this application;

[0059] Figure 3 This is a flowchart illustrating a hydrogen sensor calibration method provided in some embodiments of this application;

[0060] Figure 4 This is a schematic diagram of the structure of a hydrogen sensor calibration system provided in some embodiments of this application;

[0061] Figure 5 This is a schematic diagram of the structure of a hydrogen sensor calibration model training device provided in some embodiments of this application;

[0062] Figure 6 This is a schematic diagram of the structure of a hydrogen sensor calibration device provided in some embodiments of the application. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0065] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0066] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0067] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0068] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0069] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0070] To address the impact of temperature or humidity on the detection accuracy of hydrogen sensors, existing technologies employ single-factor compensation methods, compensating separately for each interfering factor, such as temperature or humidity. For example, some hydrogen sensors adjust the sensor's output signal through temperature compensation circuits to reduce errors caused by temperature changes; while for humidity-related issues, some sensors correct the output by adding a humidity sensor or a dedicated humidity compensation circuit. However, these methods neglect the coupling effect between different interfering factors on the interference compensation effect. For instance, as temperature increases, the activity of the sensitive membrane increases, and the resistance decreases; conversely, as humidity increases, the resistance of the sensitive membrane increases. When multiple interfering factors occur simultaneously, failure to consider the coupling effect between them will lead to incomplete compensation, affecting the measurement accuracy of the hydrogen sensor. Furthermore, the influence of multiple interfering factors coupled on hydrogen concentration detection is often non-linear, and existing compensation algorithms rely too heavily on simple mathematical models such as linear or polynomial fitting, failing to meet the compensation requirements under the influence of multiple interfering factors.

[0071] Please refer to Figure 1 To address the problem of low detection accuracy of hydrogen sensors under multiple interference factors in existing technologies, this application provides a method for training a calibration model for a hydrogen sensor. (Reference) Figure 2 This is a schematic diagram of the structure of a hydrogen sensor calibration model provided in some embodiments of this application.

[0072] The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and an adversarial module; the feature extraction module includes a channel and feature enhancement submodule and an external attention submodule; the adversarial module includes a temperature compensation submodule and a humidity compensation submodule; the method includes S101 to S106, specifically:

[0073] S101: Collect several electrical signal data output by the hydrogen sensor and the first hydrogen concentration data of the space where the hydrogen sensor is located when it outputs the electrical signal data.

[0074] Furthermore, in some embodiments of this application, the first hydrogen concentration data is acquired by collecting data from a preset standard hydrogen concentration generating unit; wherein, the standard hydrogen concentration generating unit is used to generate a gaseous environment with a specified hydrogen concentration in the hydrogen sensor space environment.

[0075] Furthermore, in some embodiments of this application, the electrical signal data is time-series data with a shape of (1, 50), where 50 is the time dimension.

[0076] S102: Extract feature data from each of the electrical signal data through the feature extraction module.

[0077] Furthermore, in some embodiments of this application, the step of extracting feature data from each of the electrical signal data through the feature extraction module includes:

[0078] Expand the number of channels of the electrical signal data to obtain the first data;

[0079] Dynamic feature information of the first data is extracted through a gated recurrent unit network;

[0080] The feature data is obtained by enhancing hydrogen concentration-related features in the dynamic feature information through an attention mechanism and suppressing interfering features.

[0081] Preferably, in some embodiments of this application, expanding the number of channels of the electrical signal data to obtain the first data includes:

[0082] The original single-channel data is extended to 5 channels through a linear transformation by the channel and feature enhancement submodule, thereby transforming the electrical signal data into the first data with the shape (5, 50).

[0083] Preferably, in some embodiments of this application, the step of extracting the dynamic feature information of the first data through a gated recurrent unit network includes:

[0084] The channel and feature enhancement submodule includes several layers of gated recurrent unit (GRU) networks. Through these GRU networks, dynamic feature information is extracted from the first data, and the feature dimension is enhanced to 128. That is, the dynamic feature information is a feature tensor with shape (5, 128).

[0085] As can be seen from the above embodiments, by using the channel and feature enhancement submodule, the number of channels in the electrical signal data is expanded and deep features in the time series are extracted, thereby enabling the electrical signal data to be processed into dynamic feature information with rich expressive power.

[0086] Preferably, in some embodiments of this application, the step of enhancing the hydrogen concentration-related features in the dynamic feature information through an attention mechanism and suppressing interfering features to obtain the feature data includes:

[0087] The external attention submodule performs a linear mapping on the input (5, 128) feature tensor to generate a feature weight matrix to represent the importance of different features. The feature weight matrix is ​​then normalized using a normalization mechanism. The (5, 128) feature tensor is further weighted based on the normalized feature weight matrix to enhance the hydrogen concentration-related features in the dynamic feature information and suppress interfering features, thus obtaining feature data with the shape still (5, 128).

[0088] As can be seen from the above embodiments, this application can effectively extract dynamic feature information from electrical signals by expanding the number of channels of electrical signal data and combining gated recurrent unit networks and attention mechanisms. By combining the subsequent loss function with negative feedback conditions on the parameters in the feature extraction module, the representation of hydrogen concentration-related features in the feature extraction process is effectively enhanced, while suppressing interference features. This improves the quality of feature data extracted by the hydrogen sensor calibration model, provides more accurate input for subsequent hydrogen concentration prediction, and improves the adaptability of the hydrogen sensor calibration model to complex interference environments.

[0089] S103: The hydrogen concentration prediction module predicts the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data.

[0090] Furthermore, in some embodiments of this application, the step of predicting the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data using the hydrogen concentration prediction module includes:

[0091] The feature data is sequentially input into the first fully connected layer with a first preset number of layers, and the data output from the last first fully connected layer is averaged and aggregated along the channel dimension to obtain global features.

[0092] The second hydrogen concentration is obtained by combining the global features with the second fully connected layer.

[0093] Preferably, in some embodiments of this application, the step of sequentially inputting the feature data into a first fully connected layer of a first preset number of layers, and aggregating the data output from the last first fully connected layer by taking the mean along the channel dimension to obtain global features, includes:

[0094] The feature data with shape (5, 128) is processed layer by layer through four first fully connected layers. Each layer uses the ReLU activation function for non-linear enhancement. At this point, the output data of the last first fully connected layer still has the shape (5, 128). The average set of the output data of the last first fully connected layer is then taken along the channel dimension to obtain a global feature with shape (1, 128). Finally, the global feature with shape (1, 128) is input into a second fully connected layer to output a hydrogen concentration prediction value with shape (1, 1), which is the second hydrogen concentration.

[0095] As can be seen from the above embodiments, the method of using a fully connected layer combined with global feature aggregation in this application can fully capture the global feature information in the electrical signal data and avoid the impact of local feature loss on the prediction results. Through mean aggregation, the hydrogen concentration prediction module can focus on the overall trend of hydrogen concentration change. Combined with the feature data enhanced by dynamic features, the accuracy and stability of hydrogen concentration prediction are significantly improved.

[0096] S104: The countermeasure module predicts several interference signals corresponding to each of the electrical signal data based on the feature data; wherein each interference signal corresponds to an interference factor.

[0097] Furthermore, in some embodiments of this application, the step of predicting several interference signals corresponding to each of the electrical signal data based on the feature data using the countermeasure module includes:

[0098] The interference signals include temperature interference signals and humidity interference signals; the countermeasures module includes a temperature compensation submodule and a humidity compensation submodule.

[0099] The temperature compensation submodule flattens the feature data into a one-dimensional vector and sequentially inputs the one-dimensional vector into the third fully connected layer of the second preset number of layers to obtain the temperature interference signal.

[0100] The humidity compensation submodule flattens the feature data into a one-dimensional vector and sequentially inputs the one-dimensional vector into the fourth fully connected layer with a third preset number of layers to obtain the humidity interference signal.

[0101] Preferably, in some embodiments of this application, the step of flattening the feature data into a one-dimensional vector through the temperature compensation submodule and sequentially inputting the one-dimensional vector into a third fully connected layer of a second preset number of layers to obtain the temperature interference signal includes:

[0102] The feature data of shape (5, 128) is flattened into a one-dimensional vector of shape (1, 640). This one-dimensional vector of shape (1, 640) is then sequentially input into two third fully connected layers. During this process, the one-dimensional vector changes from shape (1, 640) to (1, 256) and then (1, 64). Finally, the one-dimensional vector of shape (1, 64) is input into a third fully connected layer to obtain a temperature prediction value of shape (1, 1), which represents the temperature interference signal. It should be noted that the temperature prediction value here refers to the temperature interference signal that the temperature compensation submodule can extract from the feature data. If the features related to the temperature interference signal in the feature data can be well suppressed, the temperature prediction value output by the temperature compensation submodule will be smaller. Therefore, the temperature compensation submodule can combine a temperature and humidity interference loss function to minimize the interference of the temperature interference signal in the hydrogen concentration prediction module during training.

[0103] Preferably, in some embodiments of this application, the step of flattening the feature data into a one-dimensional vector through the humidity compensation submodule and sequentially inputting the one-dimensional vector into a fourth fully connected layer with a third preset number of layers to obtain the humidity interference signal includes:

[0104] The feature data of shape (5, 128) is flattened into a one-dimensional vector of shape (1, 640). This one-dimensional vector of shape (1, 640) is then sequentially input into two fourth fully connected layers. During this process, the one-dimensional vector changes from shape (1, 640) to (1, 256) and (1, 64). Finally, the one-dimensional vector of shape (1, 64) is input into a fourth fully connected layer to obtain a humidity prediction value of shape (1, 1), which is the humidity interference signal. It should be noted that the humidity prediction value here refers to the humidity interference signal that the humidity compensation submodule can extract from the feature data. If the features related to the humidity interference signal in the feature data can be well suppressed, the humidity prediction value output by the humidity compensation submodule will be smaller. Therefore, the humidity compensation submodule can combine the temperature and humidity interference loss function to minimize the interference of the humidity interference signal in the hydrogen concentration prediction module during training.

[0105] As can be seen from the above embodiments, this application splits the adversarial module into independent temperature compensation sub-modules and humidity compensation sub-modules, and performs signal prediction for temperature and humidity interference respectively. This enables the hydrogen sensor calibration model to independently learn the characteristic patterns of each interference factor, thereby achieving accurate compensation for temperature and humidity interference, improving the pertinence and reliability of the compensation effect. By combining the temperature and humidity interference loss, which integrates interference loss and joint prediction error loss, the influence of multiple interference factors on the hydrogen concentration prediction result is effectively coupled, improving the accuracy and stability of the final hydrogen concentration prediction.

[0106] S105: Obtain prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtain countermeasure loss based on each of the interference signals.

[0107] Furthermore, in some embodiments of this application, the step of obtaining prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining adversarial loss based on each of the interference signals, includes:

[0108] The resistance loss includes temperature resistance loss and humidity resistance loss;

[0109] The mean square error value is calculated based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and the mean square error value is used as the prediction error loss;

[0110] Calculate the temperature interference loss based on each of the temperature interference signals;

[0111] The humidity interference loss is calculated based on each of the humidity interference signals.

[0112] Preferably, in some embodiments of this application, the step of calculating the mean square error value based on each of the first hydrogen concentration data and each of the second hydrogen concentration data includes:

[0113] The formula for calculating the mean square error value is as follows:

[0114]

[0115] Among them, L conc y represents the mean squared error, which is also the prediction error loss; i This is the first hydrogen concentration data, i.e., the actual hydrogen concentration value collected from the standard hydrogen concentration generating unit; This represents the second hydrogen concentration data, which is also the predicted hydrogen concentration output by the hydrogen prediction module; N is the number of samples.

[0116] Preferably, in some embodiments of this application, the step of calculating the temperature interference loss based on each temperature interference signal can be achieved by calculating the average value of the temperature interference signal corresponding to each sample data and using the average value as the temperature interference loss.

[0117] Preferably, in some embodiments of this application, the step of calculating the humidity interference loss based on each humidity interference signal can be achieved by calculating the average value of the humidity interference signal corresponding to each sample data, and using the average value as the humidity interference loss.

[0118] As can be seen from the above embodiments, this application directly quantifies the difference between the predicted value and the true value of the hydrogen sensor calibration model by calculating the mean square error value, forcing the model to minimize the prediction deviation and improving the accuracy of hydrogen concentration detection. In addition, since the purpose of adversarial training is to enable the model to distinguish the characteristics of the true signal and the interference signal, thereby suppressing the influence of interference factors on the prediction, the corresponding interference loss is calculated according to each interference signal, thereby enhancing the model's anti-interference ability against non-target factors such as temperature and humidity.

[0119] S106: Calculate the temperature and humidity resistance loss based on the preset weight parameter combination, the prediction error loss, and the resistance loss, and optimize the parameters of the hydrogen sensor calibration model based on the temperature and humidity resistance loss.

[0120] Furthermore, in some embodiments of this application, the step of calculating the temperature and humidity resistance loss based on a preset combination of weighting parameters, the prediction error loss, and the resistance loss includes:

[0121] Based on the weight parameter combination, determine the weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss, and calculate the weighted sum of the prediction error loss, the temperature interference loss, and the humidity interference loss.

[0122] The weighted sum is used as the temperature and humidity resistance loss; wherein each weighted sum has a corresponding hydrogen sensor calibration model.

[0123] Preferably, in some embodiments of this application, the calculation formula for the temperature and humidity resistance loss is specifically as follows:

[0124] L adv = -α·log P temp -β·log P hum +γ·L conc

[0125] Among them, L adv For temperature and humidity to counteract losses; α is the weight of the temperature compensation task; P temp β represents the temperature disturbance loss; β represents the weight of the humidity compensation task; P hum For humidity disturbance loss; γ is the weight controlling the hydrogen concentration prediction task; L conc To predict error loss. It should be noted that the combination of α, β, and γ is the weighting parameter combination, which can be determined in advance. The optimal weighting parameter combination can be determined by the method in the hydrogen sensor calibration method of this application embodiment.

[0126] As can be seen from the above embodiments, this application achieves a dual optimization objective for the parameters of the hydrogen sensor calibration model by jointly calculating the prediction error loss, temperature interference loss, and humidity interference loss, and by introducing a weighted summation of weighted parameters. This not only reduces the direct error in hydrogen concentration prediction, but also suppresses the influence of interference signals through adversarial training, ultimately improving the robustness and generalization ability of the model in multi-interference scenarios.

[0127] In summary, compared with the prior art, the hydrogen sensor calibration model training method provided in this application has the following beneficial effects:

[0128] Since the hydrogen concentration prediction module relies on feature data extracted from electrical signal data to accurately predict the second hydrogen concentration data, too many features representing interference signals in the extracted feature data will lead to inaccurate hydrogen concentration prediction results. To simultaneously suppress the related features of multiple interference signals in the feature data, an adversarial module is added to independently identify the related features of each interference signal in the feature data. Furthermore, temperature and humidity adversarial losses, including adversarial loss and prediction error loss, are used to negatively feedback adjust the parameters of the hydrogen sensor calibration model. This achieves simultaneous suppression of the related features of different interference signals during feature extraction and enables the hydrogen concentration prediction module to effectively identify features related to hydrogen concentration in the feature data, thereby improving the detection accuracy of the hydrogen sensor calibration model under various interference factors. In addition, this application designs independent compensation modules for temperature and humidity interference signals, improving the targeting and accuracy of the compensation effect; it achieves maximum confusion of temperature and humidity signals through an adversarial loss function, reducing the impact of various interferences on hydrogen concentration prediction; by integrating compensation and concentration prediction into a unified optimization objective, the overall performance of the model is significantly improved; finally, through refined temperature and humidity compensation, the model can work stably in complex environments, improving model robustness.

[0129] refer to Figure 3 This application provides a method for calibrating a hydrogen sensor. In some embodiments of this application, the method involves... Figure 4 The hydrogen sensor calibration system shown is implemented. The hydrogen sensor calibration system includes a sensor test chamber, a temperature and humidity control unit, a standard hydrogen concentration generation unit, a data acquisition and signal processing unit, and a control and calculation unit.

[0130] Preferably, in some embodiments of this application, the sensor test chamber is a closed space with strictly controlled environmental conditions for placing a hydrogen sensor. Specifically, the chamber has good sealing properties to ensure that the hydrogen sensor is in a stable environment. In addition, a sensor mounting bracket is arranged inside the chamber to keep the hydrogen sensor to be calibrated in a stable position, making it easy to measure and adjust its parameters.

[0131] Preferably, in some embodiments of this application, the temperature and humidity control unit is used to independently adjust the temperature and humidity inside the sensor test chamber to provide settable and repeatable temperature and humidity conditions for the hydrogen sensor. Specifically, the temperature and humidity control unit uses a heating / cooling unit to regulate the temperature, and can also use a constant humidity generator, a saturated salt solution system, or a precision humidity generator to maintain a specific humidity level. Furthermore, the temperature and humidity control unit monitors and feeds back to the control system in real time through a temperature and humidity sensor installed inside the sensor test chamber.

[0132] Preferably, in some embodiments of this application, the standard hydrogen concentration generating unit is used to generate a gas environment with a specified hydrogen concentration in the hydrogen sensor space environment. Specifically, the hydrogen concentration generating unit includes: a high-purity hydrogen cylinder or a mixed gas cylinder, a flow controller (such as a mass flow meter), and a gas mixing device; the gas flow ratio is precisely set by the flow controller, and the gas is fully mixed by the gas mixing device before the gas enters the sensor test chamber.

[0133] Preferably, in some embodiments of this application, the data acquisition and signal processing unit is responsible for acquiring the electrical signal data output by the hydrogen sensor, and simultaneously acquiring the environmental parameter (temperature, humidity, reference concentration) data output by the temperature and humidity sensor and the standard hydrogen concentration generating unit, and digitizing and preliminarily processing them. Specifically, the electrical signal data output by the hydrogen sensor is amplified, filtered, and digitized through a signal conditioning circuit; further, the data output by each sensor is stably recorded through a data acquisition (DAQ) module or a microcontroller (MCU).

[0134] Preferably, in some embodiments of this application, the control and calculation unit is used to execute the hydrogen sensor calibration model training method proposed in the embodiments of this application to obtain the optimal hydrogen sensor calibration model parameters, and store the optimal parameters to achieve hydrogen sensor calibration.

[0135] Furthermore, the hydrogen sensor calibration method includes steps S201 to S203, specifically as follows:

[0136] S201: Select a weight parameter combination from the preset weight parameter combination set as the preset weight parameter combination, and train the preset hydrogen sensor calibration model according to the preset weight parameter combination and any hydrogen sensor calibration model training method in the embodiments of this application.

[0137] Preferably, in some embodiments of this application, S201 is implemented by the control and calculation unit.

[0138] S202: Select the best-performing hydrogen sensor calibration model from all the hydrogen sensor calibration models obtained from training.

[0139] Preferably, in some embodiments of this application, the step of selecting the first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through training includes:

[0140] For each set of weight parameters, after the hydrogen sensor calibration model is optimized on the training set, its accuracy in predicting hydrogen concentration is evaluated on an independent validation set, and the weighted effects of the losses from each task are compared. Through this process, the set of weight parameters that performs best on the validation set is selected. The hydrogen sensor calibration model trained based on this optimal set of weight parameters is then considered the first hydrogen sensor calibration model.

[0141] S203: Input the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model to calibrate the hydrogen sensor.

[0142] Furthermore, in some embodiments of this application, before inputting the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model, the method further includes: amplifying the electrical signal data through the data acquisition and signal processing unit, and filtering and digitizing the amplified electrical signal data.

[0143] Before calibration, the electrical signal data is amplified, filtered, and digitally preprocessed, which effectively eliminates noise interference in the original signal, improves the signal-to-noise ratio, provides a more reliable input basis for subsequent feature extraction and model prediction, reduces error propagation, and further ensures the accuracy and stability of hydrogen sensor calibration.

[0144] Furthermore, the calibration system for the hydrogen sensor specifically includes the following steps: during calibration, the hydrogen sensor is fixed inside the test chamber; the environment inside the chamber is precisely adjusted by the temperature and humidity control unit to provide a controllable and repeatable environment under different temperature and humidity conditions; then, a standard hydrogen concentration generating unit supplies hydrogen of a known concentration to create a set hydrogen concentration scenario inside the chamber; next, the data acquisition and signal processing unit collects the output values ​​of each sensor and environmental parameters, and transmits the data to the control and calculation unit; finally, the control and calculation unit runs steps S201 to S203 to fit and calculate the collected data to obtain the optimal model parameters. After calibration, these parameters can be stored and used in practical applications to provide accurate temperature and humidity compensation for the sensor.

[0145] In summary, compared with existing technologies, the hydrogen sensor calibration method provided in this application has the following beneficial effects: Since differences in the combination of weight parameters affect the setting of the loss function, thus affecting the performance of the finally trained hydrogen sensor calibration model, this method trains multiple candidate models by traversing multiple sets of weight parameter combinations and selects the calibration model with the best performance. Utilizing the advantages of hyperparameter search, the optimal weight parameter combination is determined while simultaneously obtaining the hydrogen sensor calibration model with the best performance, thereby improving the accuracy and reliability of hydrogen sensor calibration.

[0146] like Figure 5 As shown, a hydrogen sensor calibration model training device is provided based on the above-described embodiment of the hydrogen sensor calibration model training method. The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and an adversarial module. The device includes: a data acquisition module 301, a first feature data extraction module 302, a first prediction module 303, a second prediction module 304, a loss calculation module 305, and a model parameter tuning module 306.

[0147] Further, in some embodiments of this application, the data acquisition module 301 is used to acquire several electrical signal data output by the hydrogen sensor and first hydrogen concentration data of the space where the hydrogen sensor is located when it outputs the electrical signal data; the first feature data extraction module 302 is used to extract feature data from each of the electrical signal data through the feature extraction module; the first prediction module 303 is used to predict the corrected second hydrogen concentration data corresponding to each of the electrical signal data according to the feature data through the hydrogen concentration prediction module; the second prediction module 304 is used to predict several interference signals corresponding to each of the electrical signal data according to the feature data through the countermeasure module; wherein each interference signal corresponds to an interference factor; the loss calculation module 305 is used to obtain the prediction error loss according to each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtain the countermeasure loss according to each of the interference signals; the loss model parameter tuning module 306 is used to calculate the temperature and humidity countermeasure loss according to the preset weight parameter combination, the prediction error loss and the countermeasure loss, and optimize the parameters of the hydrogen sensor calibration model according to the temperature and humidity countermeasure loss.

[0148] Furthermore, in some embodiments of this application, the step of extracting feature data from each of the electrical signal data through the feature extraction module includes: expanding the number of channels of the electrical signal data to obtain first data; extracting dynamic feature information of the first data through a gated recurrent unit network; enhancing the hydrogen concentration-related features in the dynamic feature information through an attention mechanism and suppressing interference features to obtain the feature data.

[0149] Furthermore, in some embodiments of this application, the step of predicting the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data through the hydrogen concentration prediction module includes: sequentially inputting the feature data into a first fully connected layer with a first preset number of layers, and averaging and aggregating the data output by the last first fully connected layer along the channel dimension to obtain global features; and obtaining the second hydrogen concentration by combining the global features through a second fully connected layer.

[0150] Furthermore, in some embodiments of this application, the step of predicting several interference signals corresponding to each of the electrical signal data based on the feature data through the countermeasure module includes: wherein the interference signals include temperature interference signals and humidity interference signals; the countermeasure module includes a temperature compensation submodule and a humidity compensation submodule; through the temperature compensation submodule, the feature data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into a second fully connected layer of a second preset number of layers to obtain the temperature interference signal; through the humidity compensation submodule, the feature data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into a third fully connected layer of a third preset number of layers to obtain the humidity interference signal.

[0151] Furthermore, in some embodiments of this application, the step of obtaining prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining countermeasure loss based on each of the interference signals, includes: the countermeasure loss including temperature countermeasure loss and humidity countermeasure loss; calculating a mean square error value based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and using the mean square error value as the prediction error loss; calculating the temperature interference loss based on each of the temperature interference signals; and calculating the humidity interference loss based on each of the humidity interference signals.

[0152] Furthermore, in some embodiments of this application, the step of calculating the temperature and humidity countermeasure loss based on the preset weight parameter combination, the prediction error loss, and the countermeasure loss includes: determining the weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss respectively based on the weight parameter combination, and calculating the weighted sum of the prediction error loss, the temperature interference loss, and the humidity interference loss; using the weighted sum as the temperature and humidity countermeasure loss; wherein each weighted sum has a corresponding hydrogen sensor calibration model.

[0153] It is understood that the above-described device embodiments correspond to the method embodiments of this application, and can implement the hydrogen sensor calibration model training method provided by any of the above-described method embodiments of this application.

[0154] In summary, compared with the prior art, the hydrogen sensor calibration model training device provided in this application has the following beneficial effects:

[0155] Since the hydrogen concentration prediction module relies on feature data extracted from electrical signal data to accurately predict the second hydrogen concentration data, too many features representing interference signals in the extracted feature data will lead to inaccurate hydrogen concentration prediction results. To simultaneously suppress the related features of multiple interference signals in the feature data, an adversarial module is added to independently identify the related features of each interference signal in the feature data. Furthermore, temperature and humidity adversarial losses, including adversarial loss and prediction error loss, are used to negatively feedback adjust the parameters of the hydrogen sensor calibration model. This achieves simultaneous suppression of the related features of different interference signals during feature extraction and enables the hydrogen concentration prediction module to effectively identify features related to hydrogen concentration in the feature data, thereby improving the detection accuracy of the hydrogen sensor calibration model under various interference factors. In addition, this application designs independent compensation modules for temperature and humidity interference signals, improving the targeting and accuracy of the compensation effect; it achieves maximum confusion of temperature and humidity signals through an adversarial loss function, reducing the impact of various interferences on hydrogen concentration prediction; by integrating compensation and concentration prediction into a unified optimization objective, the overall performance of the model is significantly improved; finally, through refined temperature and humidity compensation, the model can work stably in complex environments, improving model robustness.

[0156] like Figure 6 As shown, based on the above embodiment of the hydrogen sensor calibration method, a hydrogen sensor calibration device is provided, including: a model training module 401, a model screening module 402, and a calibration module 403.

[0157] Furthermore, in some embodiments of this application, the model training module 401 is used to sequentially extract a weight parameter combination from a preset set of weight parameter combinations as a preset weight parameter combination, and train a preset hydrogen sensor calibration model according to the preset weight parameter combination and the hydrogen sensor calibration model training device as described in any one of the embodiments of this application; the model screening module 402 is used to screen the first hydrogen sensor calibration model with the best performance from all the hydrogen sensor calibration models obtained from training; the calibration module 403 is used to input the electrical signal data output by the hydrogen sensor to the first hydrogen sensor calibration model to realize the calibration of the hydrogen sensor.

[0158] Furthermore, in some embodiments of this application, before inputting the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model, the method further includes: amplifying the electrical signal data and filtering and digitizing the amplified electrical signal data.

[0159] It is understood that the above-described device embodiments correspond to the method embodiments of this application, and can implement the hydrogen sensor calibration method provided by any of the above-described method embodiments of this application.

[0160] In summary, compared with existing technologies, the hydrogen sensor calibration device provided in this application has the following beneficial effects: Since differences in the combination of weight parameters affect the setting of the loss function, thus affecting the performance of the finally trained hydrogen sensor calibration model, this application trains multiple candidate models by traversing multiple sets of weight parameter combinations and selects the calibration model with the best performance. Utilizing the advantages of hyperparameter search, the optimal weight parameter combination is determined while simultaneously obtaining the hydrogen sensor calibration model with the best performance, thereby improving the accuracy and reliability of hydrogen sensor calibration.

[0161] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0162] Based on the embodiments of the above-described hydrogen sensor calibration or calibration model training methods, another embodiment of this application provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the hydrogen sensor calibration or calibration model training method of any embodiment of this application.

[0163] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more module units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0164] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0165] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0166] Based on the above-described method embodiments, another embodiment of this application provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the hydrogen sensor calibration or calibration model training method described in any of the above-described method embodiments of this application.

[0167] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

Claims

1. A method for training a calibration model for a hydrogen sensor, characterized in that, The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and an adversarial module. The method includes: Collect several electrical signal data output by the hydrogen sensor and the first hydrogen concentration data of the space where the hydrogen sensor is located when it outputs the electrical signal data; The feature extraction module extracts feature data from each of the electrical signal data. The hydrogen concentration prediction module predicts the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data. The countermeasure module predicts several interference signals corresponding to each of the electrical signal data based on the feature data; wherein each interference signal corresponds to an interference factor. The prediction error loss is obtained based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and the countermeasure loss is obtained based on each of the interference signals. The temperature and humidity resistance loss is calculated based on the preset weight parameter combination, the prediction error loss, and the resistance loss, and the parameters of the hydrogen sensor calibration model are optimized based on the temperature and humidity resistance loss. The step of extracting feature data from each of the electrical signal data through the feature extraction module includes: Expand the number of channels of the electrical signal data to obtain the first data; Dynamic feature information of the first data is extracted through a gated recurrent unit network; The feature data is obtained by enhancing the hydrogen concentration-related features in the dynamic feature information through an attention mechanism and suppressing interfering features. The step of predicting the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data using the hydrogen concentration prediction module includes: The feature data is sequentially input into the first fully connected layer with a first preset number of layers, and the data output from the last first fully connected layer is averaged and aggregated along the channel dimension to obtain global features. The second hydrogen concentration is obtained by combining the global features with the second fully connected layer; The step of predicting several interference signals corresponding to each of the electrical signal data based on the feature data through the anti-interference module includes: The interference signals include temperature interference signals and humidity interference signals; the countermeasures module includes a temperature compensation submodule and a humidity compensation submodule. The temperature compensation submodule flattens the feature data into a one-dimensional vector and sequentially inputs the one-dimensional vector into the third fully connected layer of the second preset number of layers to obtain the temperature interference signal. The humidity compensation submodule flattens the feature data into a one-dimensional vector and sequentially inputs the one-dimensional vector into the fourth fully connected layer with a third preset number of layers to obtain the humidity interference signal.

2. The hydrogen sensor calibration model training method as described in claim 1, characterized in that, The step of obtaining prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining adversarial loss based on each of the interference signals, includes: The resistance loss includes temperature resistance loss and humidity resistance loss; The mean square error value is calculated based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and the mean square error value is used as the prediction error loss; Calculate the temperature interference loss based on each of the temperature interference signals described. Calculate the humidity interference loss based on each of the humidity interference signals.

3. The hydrogen sensor calibration model training method as described in claim 2, characterized in that, The calculation of temperature and humidity resistance loss based on the preset weight parameter combination, the prediction error loss, and the resistance loss includes: Based on the weight parameter combination, determine the weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss, and calculate the weighted sum of the prediction error loss, the temperature interference loss, and the humidity interference loss. The weighted sum is used as the temperature and humidity resistance loss; wherein each weighted sum has a corresponding hydrogen sensor calibration model.

4. A method for calibrating a hydrogen sensor, characterized in that, include: Take one weight parameter combination from the preset set of weight parameter combinations as the preset weight parameter combination, and train the preset hydrogen sensor calibration model according to the preset weight parameter combination and any one of the hydrogen sensor calibration model training methods as described in claims 1 to 3. Select the best-performing hydrogen sensor calibration model from all the hydrogen sensor calibration models obtained from training. The electrical signal data output by the hydrogen sensor is input into the first hydrogen sensor calibration model to calibrate the hydrogen sensor.

5. The hydrogen sensor calibration method as described in claim 4, characterized in that, Before inputting the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model, the method further includes: amplifying the electrical signal data and filtering and digitizing the amplified electrical signal data.

6. A hydrogen sensor calibration model training device, characterized in that, The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and an adversarial module. The device includes a data acquisition module, a first feature data extraction module, a first prediction module, a second prediction module, a loss calculation module, and a model parameter tuning module. The data acquisition module is used to acquire several electrical signal data output by the hydrogen sensor and the first hydrogen concentration data of the space where the hydrogen sensor is located when it outputs the electrical signal data. The first feature data extraction module is used to extract feature data from each of the electrical signal data. The first prediction module is used to predict the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the feature data, using the hydrogen concentration prediction module. The second prediction module is used to predict, based on the feature data, several interference signals corresponding to each of the electrical signal data using the countermeasure module; wherein each interference signal corresponds to an interference factor. The loss calculation module is used to obtain the prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and to obtain the adversarial loss based on each of the interference signals. The loss model parameter tuning module is used to calculate the temperature and humidity resistance loss based on the preset weight parameter combination, the prediction error loss, and the resistance loss, and to optimize the parameters of the hydrogen sensor calibration model based on the temperature and humidity resistance loss. The step of extracting feature data from each of the electrical signal data through the feature extraction module includes: expanding the number of channels of the electrical signal data to obtain first data; extracting dynamic feature information of the first data through a gated recurrent unit network; enhancing the hydrogen concentration-related features in the dynamic feature information through an attention mechanism and suppressing interference features to obtain the feature data. The step of predicting the corrected second hydrogen concentration data corresponding to each of the electrical signal data through the hydrogen concentration prediction module includes: sequentially inputting the feature data into a first fully connected layer with a first preset number of layers, and averaging and aggregating the data output by the last first fully connected layer in the channel dimension to obtain global features; and obtaining the second hydrogen concentration by combining the global features through a second fully connected layer. The step of predicting several interference signals corresponding to each of the electrical signal data based on the feature data through the countermeasure module includes: wherein the interference signals include temperature interference signals and humidity interference signals; the countermeasure module includes a temperature compensation submodule and a humidity compensation submodule; through the temperature compensation submodule, the feature data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into a second fully connected layer of a second preset number of layers to obtain the temperature interference signal; through the humidity compensation submodule, the feature data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into a third fully connected layer of a third preset number of layers to obtain the humidity interference signal.

7. A hydrogen sensor calibration device, characterized in that, include: Model training module, model selection module, and calibration module; The model training module is used to sequentially extract a weight parameter combination from a preset set of weight parameter combinations as a preset weight parameter combination, and train a preset hydrogen sensor calibration model according to the preset weight parameter combination and the hydrogen sensor calibration model training device as described in claim 6. The model selection module is used to select the first hydrogen sensor calibration model with the best performance from all the hydrogen sensor calibration models obtained from training. The calibration module is used to input the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model to calibrate the hydrogen sensor.