Hydrogen sensor calibration and calibration model training method and device
By introducing the feature extraction module and the adversarial module into the hydrogen sensor calibration model, the problem of low detection accuracy under multiple interference factors in the existing technology is solved, and higher detection accuracy and stronger environmental adaptability are achieved.
Patent Information
- Application Number
- CN202510743405.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-05
AI Technical Summary
Existing hydrogen sensors have low detection accuracy under multiple interference factors, and the compensation algorithm cannot effectively deal with the coupling effects between interference factors.
A hydrogen sensor calibration model is employed, consisting of a feature extraction module, a hydrogen concentration prediction module, and an adversarial module. The feature extraction module expands the number of channels in the electrical signal data and combines a gated recurrent unit network with an attention mechanism to extract dynamic feature information. The adversarial module independently identifies interfering signals and optimizes model parameters using a temperature and humidity adversarial loss.
The detection accuracy of the hydrogen sensor under various interference factors is improved, the adaptability of the model to complex interference environments is enhanced, and the pertinence and reliability of the compensation effect are improved.
Smart Images

Figure CN120629273A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of hydrogen concentration detection, and in particular to a method and device for hydrogen sensor calibration and calibration model training. Background Art
[0002] Hydrogen sensors are widely used in environmental monitoring, industrial safety, and energy storage to detect hydrogen concentration in the environment. The sensitive membrane in existing hydrogen sensors is easily affected by interfering factors such as temperature and humidity. This can cause changes in the relationship between its resistance and hydrogen concentration, thus affecting the sensor's measurement accuracy.
[0003] To address the aforementioned technical issues, existing technologies employ a single-factor compensation method, specifically compensating for interference factors such as temperature or humidity separately. For example, some hydrogen sensors adjust the sensor's output signal through a temperature compensation circuit to reduce the error caused by temperature changes. To address the effects of humidity, some sensors correct their output by adding a humidity sensor or a dedicated humidity compensation circuit. However, these methods ignore the impact of the coupling effects between different interference factors on the interference compensation effect. For example, when the temperature rises, the activity of the sensitive membrane increases and the resistance value decreases; while when the humidity increases, the resistance value of the sensitive membrane increases. When multiple interference factors occur simultaneously, failure to consider the coupling effects between the interference factors will result in incomplete compensation, affecting the measurement accuracy of the hydrogen sensor. Furthermore, the effects of the coupling of multiple interference factors on hydrogen concentration detection are often nonlinear, and existing compensation algorithms rely too heavily on simple mathematical models such as linear fitting or polynomial fitting, failing to meet the compensation requirements under the influence of multiple interference factors.
[0004] Therefore, how to improve the detection accuracy of hydrogen sensors under multiple interference factors is a technical problem that needs to be solved at present. Summary of the Invention
[0005] The present application provides a hydrogen sensor calibration and calibration model training method and device, which can solve the problem of low detection accuracy of hydrogen sensors under multiple interference factors in the prior art.
[0006] In one embodiment of the present application, a method for training a hydrogen sensor calibration model is provided. The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and a countermeasure module. The method includes:
[0007] collecting a plurality of electrical signal data output by the hydrogen sensor and first hydrogen concentration data of the space in which the hydrogen sensor is located when the hydrogen sensor outputs the electrical signal data;
[0008] Extracting feature data from each of the electrical signal data by the feature extraction module;
[0009] Predicting, by the hydrogen concentration prediction module, the corrected second hydrogen concentration data corresponding to each of the electrical signal data according to the characteristic data;
[0010] Predicting, by the countermeasure module, a plurality of interference signals corresponding to each of the electrical signal data based on the characteristic data; wherein each of the interference signals corresponds to an interference factor;
[0011] Obtaining a prediction error loss according to each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining a countermeasure loss according to each of the interference signals;
[0012] The temperature and humidity resistance loss is calculated according to a preset weight parameter combination, the prediction error loss, and the resistance loss, and the parameters of the hydrogen sensor calibration model are optimized according to the temperature and humidity resistance loss.
[0013] Compared to the prior art, the above embodiment has the following beneficial effects: Because the hydrogen concentration prediction module relies on feature data extracted from the electrical signal data to accurately predict the second hydrogen concentration data, if the extracted feature data contains too many relevant features representing the interference signal, the final predicted hydrogen concentration result will be inaccurate. In order to simultaneously suppress the relevant features of multiple interference signals in the feature data, an adversarial module is added to independently identify the relevant features of each interference signal in the feature data. Furthermore, the parameters of the hydrogen sensor calibration model are negatively feedback-adjusted through temperature and humidity adversarial losses, including adversarial losses and prediction error losses. This achieves the simultaneous suppression of the relevant features of different interference signals during the feature extraction process, and enables the hydrogen concentration prediction module to effectively identify features in the feature data related to hydrogen concentration, thereby improving the detection accuracy of the hydrogen sensor calibration model under multiple interference factors.
[0014] Furthermore, extracting feature data from each of the electrical signal data by the feature extraction module includes:
[0015] Expanding the number of channels of the electrical signal data to obtain first data;
[0016] extracting dynamic feature information of the first data through a gated recurrent unit network;
[0017] The features related to hydrogen concentration in the dynamic feature information are enhanced through an attention mechanism, and interference features are suppressed to obtain the feature data.
[0018] Compared with the prior art, the above embodiment has the following beneficial effects: by expanding the number of channels of electrical signal data and combining the gated recurrent unit network with the attention mechanism, it is possible to effectively extract dynamic feature information from the electrical signal, and combine the subsequent loss function to perform negative feedback conditions on the parameters in the feature extraction module, effectively enhancing the characterization of features related to hydrogen concentration in the feature extraction process, while suppressing interference features, thereby improving the quality of feature data extracted by the hydrogen sensor calibration model, providing more accurate input for subsequent hydrogen concentration prediction, and improving the adaptability of the hydrogen sensor calibration model to complex interference environments.
[0019] Furthermore, predicting the corrected second hydrogen concentration data corresponding to each of the electrical signal data according to the characteristic data by the hydrogen concentration prediction module includes:
[0020] Inputting the feature data into the first fully connected layer of the first preset number of layers in sequence, and taking the mean of the data output by the last first fully connected layer in the channel dimension to obtain the global feature;
[0021] The second hydrogen concentration is obtained by combining the global features through a second fully connected layer.
[0022] Compared to existing technologies, the above embodiment has the following advantages: The use of a fully connected layer combined with global feature aggregation fully captures the global feature information in the electrical signal data, preventing the impact of local feature loss on the prediction results. The mean aggregation operation enables the hydrogen concentration prediction module to focus on the overall trend of hydrogen concentration. Combined with the feature data after dynamic feature enhancement, the accuracy and stability of hydrogen concentration prediction are significantly improved.
[0023] Furthermore, the anti-countermeasure module predicts, based on the characteristic data, a plurality of interference signals corresponding to the electrical signal data, including:
[0024] Wherein, the interference signal includes a temperature interference signal and a humidity interference signal; the countermeasure module includes a temperature compensation submodule and a humidity compensation submodule;
[0025] By means of the temperature compensation submodule, the characteristic data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into a third fully connected layer of a second preset number of layers to obtain the temperature interference signal;
[0026] The characteristic data is flattened into a one-dimensional vector through the humidity compensation submodule, and the one-dimensional vector is sequentially input into a fourth fully connected layer of a third preset number of layers to obtain the humidity interference signal.
[0027] Compared with the existing technology, the above embodiment has the following beneficial effects: by splitting the countermeasure module into independent temperature compensation sub-module and humidity compensation sub-module, signal prediction is performed for temperature and humidity interference respectively, so that the hydrogen sensor calibration model can independently learn the characteristic laws of each interference factor, thereby realizing accurate compensation for temperature and humidity interference, improving the pertinence and reliability of the compensation effect, and combining the temperature and humidity interference loss that integrates the interference loss and the joint prediction error loss, effectively coupling the influence of multiple interference factors on the hydrogen concentration prediction results, thereby improving the accuracy and stability of the final hydrogen concentration prediction.
[0028] Furthermore, obtaining prediction error loss according to each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining countermeasure loss according to each of the interference signals, includes:
[0029] The resistance loss includes temperature resistance loss and humidity resistance loss;
[0030] 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;
[0031] Calculating the temperature interference loss according to each of the temperature interference signals;
[0032] The humidity interference loss is calculated according to each of the humidity interference signals.
[0033] Compared with the existing technology, the above embodiment has 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 improve 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 real 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] Furthermore, the calculation of the temperature and humidity resistance loss according to the preset weight parameter combination, the prediction error loss, and the resistance loss includes:
[0035] Determining weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss, respectively, according to the weight parameter combination, and calculating a 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 existing technology, the above embodiment has the following beneficial effects: by combining the prediction error loss, temperature interference loss and humidity interference loss, and introducing a weighted summation of weight parameter combinations, the dual optimization goals of the hydrogen sensor calibration model parameters are achieved, which not only reduces the direct error of hydrogen concentration prediction, but also suppresses the influence of interference signals through adversarial training, and ultimately improves the robustness and generalization ability of the model in multiple interference scenarios.
[0038] Another embodiment of the present application further provides a hydrogen sensor calibration method, comprising:
[0039] Sequentially selecting a weight parameter combination from the preset weight parameter combination set as the preset weight parameter combination, and training the preset hydrogen sensor calibration model according to the preset weight parameter combination in combination with any one of the hydrogen sensor calibration model training methods in the embodiments of the present application;
[0040] Selecting the first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through training;
[0041] The electrical signal data output by the hydrogen sensor is input into the first hydrogen sensor calibration model to implement calibration of the hydrogen sensor.
[0042] Compared to the prior art, the above embodiment has the following beneficial effects: Because differences in weight parameter combinations can affect the loss function settings and, consequently, the performance of the ultimately trained hydrogen sensor calibration model, by traversing multiple weight parameter combinations to train multiple candidate models and screening the calibration model with the best performance, the advantages of hyperparameter search are utilized to simultaneously determine the optimal weight parameter combination and obtain the optimal 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 existing technology, the above embodiment has 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 transmission, and further ensures the accuracy and stability of hydrogen sensor calibration.
[0045] Another embodiment of the present application further provides a hydrogen sensor calibration model training device, wherein the hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and a countermeasure 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 configured to acquire a plurality of electrical signal data output by the hydrogen sensor and first hydrogen concentration data of the space in which the hydrogen sensor is located when outputting the electrical signal data;
[0047] The first feature data extraction module is used to extract feature data from each of the electrical signal data through the feature extraction module;
[0048] The first prediction module is configured to predict, based on the characteristic data, the corrected second hydrogen concentration data corresponding to each of the electrical signal data using the hydrogen concentration prediction module;
[0049] The second prediction module is configured to predict, through the countermeasure module, a plurality of interference signals corresponding to each of the electrical signal data based on the characteristic data; wherein each of the interference signals corresponds to an interference factor;
[0050] The loss calculation module is configured to obtain a prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and to obtain a countermeasure 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 a 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.
[0052] Another embodiment of the present application further provides a hydrogen sensor calibration device, comprising: a model training module, a model screening module, and a calibration module;
[0053] The model training module is configured to sequentially select a weight parameter combination from a preset weight parameter combination set as a preset weight parameter combination, and train a preset hydrogen sensor calibration model according to the preset weight parameter combination in combination with any one of the hydrogen sensor calibration model training devices in the embodiments of the present application;
[0054] The model screening module is used to screen a first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through 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 achieve calibration of the hydrogen sensor. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0057] Figure 1 A flowchart of a hydrogen sensor calibration model training method provided in some embodiments of the present application;
[0058] Figure 2 This is a structural diagram of a hydrogen sensor calibration model provided in some embodiments of the present application;
[0059] Figure 3 This is a flow chart of a hydrogen sensor calibration method provided in some embodiments of the present application;
[0060] Figure 4 This is a structural schematic diagram of a hydrogen sensor calibration system provided in some embodiments of the present application;
[0061] Figure 5 This is a structural diagram of a hydrogen sensor calibration model training device provided in some embodiments of the present application;
[0062] Figure 6 This is a structural schematic diagram of a hydrogen sensor calibration device provided in some embodiments of the application. DETAILED DESCRIPTION
[0063] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts 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 those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.
[0065] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.
[0066] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0067] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0068] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0069] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.
[0070] To address the impact of temperature or humidity on hydrogen sensor detection accuracy, existing technologies employ single-factor compensation methods, specifically compensating for interfering factors such as temperature or humidity separately. For example, some hydrogen sensors adjust their output signal through a temperature compensation circuit to reduce the error caused by temperature changes. To address the impact of humidity, some sensors modify their output by adding a humidity sensor or a dedicated humidity compensation circuit. However, these methods ignore the impact of coupling effects between different interfering factors on the compensation effect. For example, when temperature rises, the activity of the sensitive membrane increases, and its resistance decreases; whereas, when humidity increases, its resistance increases. When multiple interfering factors are present simultaneously, failure to account for the coupling effects between these factors will result in incomplete compensation, impacting the hydrogen sensor's measurement accuracy. Furthermore, the impact of the coupling of multiple interfering factors on hydrogen concentration detection is often nonlinear, and existing compensation algorithms rely too heavily on simple mathematical models such as linear or polynomial fitting, failing to meet the compensation requirements for multiple interfering factors.
[0071] Please refer to Figure 1 In order to solve the problem of low detection accuracy of hydrogen sensors under multiple interference factors in the prior art, the present invention provides a hydrogen sensor calibration model training method. Figure 2 This is a structural schematic diagram of a hydrogen sensor calibration model provided in some embodiments of the present 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: Collecting a plurality of electrical signal data output by a hydrogen sensor and first hydrogen concentration data of a space in which the hydrogen sensor is located when outputting the electrical signal data.
[0074] Furthermore, in some embodiments of the present 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 gas environment with a specified hydrogen concentration in the hydrogen sensor space environment.
[0075] Furthermore, in some embodiments of the present application, the electrical signal data is time series data with a shape of (1, 50), where 50 is the time dimension.
[0076] S102: Extracting feature data from each of the electrical signal data by the feature extraction module.
[0077] Furthermore, in some embodiments of the present application, extracting feature data from each of the electrical signal data by the feature extraction module includes:
[0078] Expanding the number of channels of the electrical signal data to obtain first data;
[0079] extracting dynamic feature information of the first data through a gated recurrent unit network;
[0080] The features related to hydrogen concentration in the dynamic feature information are enhanced through an attention mechanism, and interference features are suppressed to obtain the feature data.
[0081] Preferably, in some embodiments of the present application, the step of expanding the number of channels of the electrical signal data to obtain the first data includes:
[0082] Through the channel and feature enhancement submodule, the original single-channel data is expanded into 5 channels through linear transformation, so that the electrical signal data becomes the first data with a shape of (5, 50).
[0083] Preferably, in some embodiments of the present application, extracting 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, which extract dynamic feature information from the first data and increase the feature dimension to 128. That is, the dynamic feature information is a feature tensor with a shape of (5, 128).
[0085] It can be seen from the above embodiments that, through the channel and feature enhancement submodule, the number of channels of the electrical signal data is expanded and the deep features in the time series are extracted, so that the electrical signal data is processed into dynamic feature information with rich expressive capabilities.
[0086] Preferably, in some embodiments of the present application, the step of enhancing the features related to hydrogen concentration in the dynamic feature information by an attention mechanism and suppressing interference features to obtain the feature data includes:
[0087] Through the external attention sub-module, the input (5, 128) feature tensor is linearly mapped to generate a feature weight matrix to represent the importance of different features; the feature weight matrix is further standardized by the normalization mechanism; and the (5, 128) feature tensor is further weighted according to the standardized feature weight matrix, thereby enhancing the features related to hydrogen concentration in the dynamic feature information and suppressing the interference features, and obtaining feature data with the shape still being (5, 128).
[0088] It can be seen from the above embodiments that the present application can effectively extract dynamic feature information from electrical signals by expanding the number of channels of electrical signal data and combining the gated recurrent unit network with the attention mechanism, and combine the subsequent loss function to perform negative feedback conditions on the parameters in the feature extraction module, thereby effectively enhancing the characterization of features related to hydrogen concentration in the feature extraction process, while suppressing interference features, thereby improving the quality of feature data extracted by the hydrogen sensor calibration model, providing more accurate input for subsequent hydrogen concentration prediction, and improving the adaptability of the hydrogen sensor calibration model to complex interference environments.
[0089] S103: Predicting, by the hydrogen concentration prediction module, the corrected second hydrogen concentration data corresponding to each of the electrical signal data according to the characteristic data.
[0090] Furthermore, in some embodiments of the present application, predicting, by the hydrogen concentration prediction module, the corrected second hydrogen concentration data corresponding to each of the electrical signal data according to the characteristic data includes:
[0091] Inputting the feature data into the first fully connected layer of the first preset number of layers in sequence, and taking the mean of the data output by the last first fully connected layer in the channel dimension to obtain the global feature;
[0092] The second hydrogen concentration is obtained by combining the global features through a second fully connected layer.
[0093] Preferably, in some embodiments of the present application, the step of sequentially inputting the feature data into a first preset number of first fully connected layers, and aggregating the data output by the last first fully connected layer in the channel dimension to obtain the global feature includes:
[0094] The feature data with a shape of (5, 128) is processed layer by layer through four first fully connected layers, where each layer uses the ReLU activation function for nonlinear enhancement. At this time, the data shape output by the last first fully connected layer is still (5, 128); the data output by the last first fully connected layer is further averaged in the channel dimension to obtain a global feature with a shape of (1, 128); finally, the global feature with a shape of (1, 128) is input into a second fully connected layer, thereby outputting a hydrogen concentration prediction value with a shape of (1, 1), i.e., the second hydrogen concentration.
[0095] The above examples demonstrate that this application utilizes a fully connected layer combined with global feature aggregation to fully capture the global feature information in the electrical signal data, preventing the impact of local feature loss on the prediction results. By using mean aggregation, the hydrogen concentration prediction module can focus on the overall trend of hydrogen concentration. This, combined with the dynamic feature-enhanced feature data, significantly improves the accuracy and stability of hydrogen concentration prediction.
[0096] S104: Predicting, by the countermeasure module, a plurality of interference signals corresponding to each of the electrical signal data according to the characteristic data; wherein each of the interference signals corresponds to an interference factor.
[0097] Furthermore, in some embodiments of the present application, predicting, by the countermeasure module, a plurality of interference signals corresponding to each of the electrical signal data according to the feature data includes:
[0098] Wherein, the interference signal includes a temperature interference signal and a humidity interference signal; the countermeasure module includes a temperature compensation submodule and a humidity compensation submodule;
[0099] By means of the temperature compensation submodule, the characteristic data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into a third fully connected layer of a second preset number of layers to obtain the temperature interference signal;
[0100] The characteristic data is flattened into a one-dimensional vector through the humidity compensation submodule, and the one-dimensional vector is sequentially input into a fourth fully connected layer of a third preset number of layers to obtain the humidity interference signal.
[0101] Preferably, in some embodiments of the present application, the temperature compensation submodule flattens the feature data into a one-dimensional vector, and sequentially inputs the one-dimensional vector into a third fully connected layer of a second preset number of layers to obtain the temperature interference signal, including:
[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 fed into two third-tier fully connected layers, where it changes from shape (1, 640) to (1, 256) and then to (1, 64). Finally, this one-dimensional vector of shape (1, 64) is fed into one third-tier fully connected layer, resulting in a temperature prediction value of shape (1, 1), i.e., 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 are effectively suppressed, the temperature prediction value output by the temperature compensation submodule will be smaller. Therefore, the temperature compensation submodule can be combined with the 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 the present application, the humidity compensation submodule flattens the feature data into a one-dimensional vector, and sequentially inputs the one-dimensional vector into a fourth fully connected layer of a third preset number of layers to obtain the humidity interference signal, including:
[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 fed into two fourth-layer fully connected layers, transforming the one-dimensional vector from shape (1, 640) to (1, 256) and then (1, 64). Finally, the one-dimensional vector of shape (1, 64) is fed into one fourth-layer fully connected layer, yielding a humidity prediction value of shape (1, 1), i.e., 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 are effectively suppressed, the humidity prediction value output by the humidity compensation submodule will be smaller. Therefore, the humidity compensation submodule can be combined with 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] It can be seen from the above embodiments that the present application splits the countermeasure module into independent temperature compensation sub-module and humidity compensation sub-module, and performs signal prediction for temperature and humidity interference respectively, so that the hydrogen sensor calibration model can independently learn the characteristic laws of each interference factor, thereby achieving accurate compensation for temperature and humidity interference, improving the pertinence and reliability of the compensation effect, and combining the temperature and humidity interference loss that integrates the interference loss and the joint prediction error loss, effectively coupling the influence of multiple interference factors on the hydrogen concentration prediction results, and improving the accuracy and stability of the final hydrogen concentration prediction.
[0106] S105: Obtain prediction error loss according to each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtain countermeasure loss according to each of the interference signals.
[0107] Furthermore, in some embodiments of the present application, obtaining a prediction error loss according to each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining a countermeasure loss according to each of the interference signals, includes:
[0108] The resistance loss includes temperature resistance loss and humidity resistance loss;
[0109] 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;
[0110] Calculating the temperature interference loss according to each of the temperature interference signals;
[0111] The humidity interference loss is calculated according to each of the humidity interference signals.
[0112] Preferably, in some embodiments of the present application, the calculating the mean square error value according to each of the first hydrogen concentration data and each of the second hydrogen concentration data includes:
[0113] The calculation formula of the mean square error value is:
[0114]
[0115] Among them, L conc is the mean square error value, which is also the prediction error loss; y i is the first hydrogen concentration data, i.e., the actual hydrogen concentration value collected from the standard hydrogen concentration generating unit; is the second hydrogen concentration data, and is also the hydrogen concentration prediction value output by the hydrogen prediction module; N is the number of samples.
[0116] Preferably, in some embodiments of the present application, the temperature interference loss is calculated based on each temperature interference signal, and an average value of the temperature interference signal corresponding to each sample data can be calculated, and the average value is used as the temperature interference loss.
[0117] Preferably, in some embodiments of the present application, the humidity interference loss is calculated based on each humidity interference signal, and an average value of the humidity interference signals corresponding to each sample data can be calculated, and the average value is used as the humidity interference loss.
[0118] It can be seen from the above embodiments that the present 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 improve 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 real 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 to non-target factors such as temperature and humidity.
[0119] S106: Calculating the temperature and humidity resistance loss according to a preset weight parameter combination, the prediction error loss, and the resistance loss, and optimizing the parameters of the hydrogen sensor calibration model according to the temperature and humidity resistance loss.
[0120] Furthermore, in some embodiments of the present application, the calculation of the temperature and humidity resistance loss according to the preset weight parameter combination, the prediction error loss, and the resistance loss includes:
[0121] Determining weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss, respectively, according to the weight parameter combination, and calculating a 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 the present application, the calculation formula for the temperature and humidity resistance loss is specifically:
[0124] L adv = -α·log P temp -β·log P hum +γ·L conc
[0125] Among them, L adv is the temperature and humidity loss; α is the weight of the temperature compensation task; P temp is the temperature interference loss; β is the weight of the humidity compensation task; P hum is the humidity interference loss; γ is the weight of the hydrogen concentration prediction task; L conc It should be noted that the combination of α, β and γ is the weight parameter combination, the value of which can be determined by presetting in advance, and the optimal weight parameter combination can be determined by the method in the hydrogen sensor calibration method in the embodiment of the present application.
[0126] It can be seen from the above embodiments that the present application achieves the dual optimization goal of the hydrogen sensor calibration model parameters by combining the prediction error loss, temperature interference loss and humidity interference loss, and introducing a weighted summation combination of weight parameters. It not only reduces the direct error of hydrogen concentration prediction, but also suppresses the influence of interference signals through adversarial training, and ultimately improves the robustness and generalization ability of the model in multiple interference scenarios.
[0127] In summary, it can be seen that compared with the prior art, the hydrogen sensor calibration model training method provided in the embodiment of the present application has the following beneficial effects:
[0128] Since the hydrogen concentration prediction module needs to rely on the feature data extracted from the electrical signal data to accurately predict the second hydrogen concentration data, if there are too many relevant features representing the interference signal in the extracted feature data, the final predicted hydrogen concentration result will be inaccurate. In order to simultaneously suppress the relevant features of multiple interference signals in the feature data, an adversarial module is added to independently identify the relevant features of each interference signal in the feature data, and further negatively feedback adjust the parameters of the hydrogen sensor calibration model through the temperature and humidity adversarial loss including adversarial loss and prediction error loss, so as to achieve the simultaneous suppression of the relevant feature performance of different interference signals during the feature extraction process, and enable the hydrogen concentration prediction module to effectively identify the features related to hydrogen concentration in the feature data, thereby improving the detection accuracy of the hydrogen sensor calibration model under multiple interference factors. In addition, the present application designs independent compensation modules for temperature and humidity interference signals respectively, which improves the pertinence and accuracy of the compensation effect; achieves the maximum confusion of temperature and humidity signals through the adversarial loss function, and reduces the influence of various interferences on hydrogen concentration prediction; significantly improves the overall performance of the model by integrating compensation and concentration prediction into a unified optimization target; finally, through fine temperature and humidity compensation, the model can work stably in complex environments and improve model robustness.
[0129] refer to Figure 3 , is a hydrogen sensor calibration method provided in the embodiments of the present application. In some embodiments of the present application, the method is Figure 4 The hydrogen sensor calibration system shown in the figure includes a sensor test chamber, a temperature and humidity control unit, a standard hydrogen concentration generating unit, a data acquisition and signal processing unit, and a control and calculation unit.
[0130] Preferably, in some embodiments of the present application, the sensor test chamber is an enclosed space in which environmental conditions can be strictly controlled, and is used to place the hydrogen sensor. Specifically, the cabin body of the sensor test chamber has good sealing properties to ensure that the hydrogen sensor is in a stable environment; in addition, a sensor fixing bracket is arranged in the cabin body of the sensor test chamber to place 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 the present 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 adjust 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; further, the temperature and humidity control unit monitors in real time and feeds back to the control system through a temperature and humidity sensor, and the temperature and humidity sensor is installed inside the sensor test chamber.
[0132] Preferably, in some embodiments of the present 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 accurately set by the flow controller, and the gas is fully mixed by the gas mixing device before entering the sensor test chamber.
[0133] Preferably, in some embodiments of the present application, the data acquisition and signal processing unit is responsible for collecting the electrical signal data output by the hydrogen sensor, and is also responsible for collecting 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 it. Specifically, the electrical signal data output by the hydrogen sensor is amplified, filtered and digitized through the signal conditioning circuit; and the output data of each sensor is further stably recorded through a data acquisition (DAQ) module or a microcontroller (MCU).
[0134] Preferably, in some embodiments of the present application, the control and calculation unit is used to execute the hydrogen sensor calibration model training method proposed in the embodiments of the present application to obtain the optimal hydrogen sensor calibration model parameters, and store the optimal parameters to realize the calibration of the hydrogen sensor.
[0135] Furthermore, the hydrogen sensor calibration method includes S201 to S203, specifically:
[0136] S201: sequentially taking out a weight parameter combination from a preset weight parameter combination set as a preset weight parameter combination, and training a preset hydrogen sensor calibration model according to the preset weight parameter combination in combination with any one of the hydrogen sensor calibration model training methods in the embodiments of the present application.
[0137] Preferably, in some embodiments of the present application, S201 is executed by the control and computing unit.
[0138] S202: Selecting a first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through training.
[0139] Preferably, in some embodiments of the present application, the step of selecting a first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through training includes:
[0140] After optimizing each weight parameter combination on the training set, the hydrogen sensor calibration model evaluates the accuracy of hydrogen concentration prediction on an independent validation set and compares the results by combining the weighted effects of each task's losses. This process selects the weight parameter combination that performs best on the validation set. The hydrogen sensor calibration model trained using this optimal weight parameter combination becomes the first hydrogen sensor calibration model.
[0141] S203: Inputting the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model to implement calibration of the hydrogen sensor.
[0142] Furthermore, in some embodiments of the present application, before inputting the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model, it also includes: amplifying the electrical signal data through the data acquisition and signal processing unit, and filtering and digitizing the amplified electrical signal data.
[0143] The electrical signal data is amplified, filtered and digitally preprocessed before calibration, which effectively eliminates the noise interference of the original signal and improves the signal-to-noise ratio of the signal, providing a more reliable input basis for subsequent feature extraction and model prediction, reducing error transmission, and further ensuring the accuracy and stability of hydrogen sensor calibration.
[0144] Furthermore, the hydrogen sensor calibration system specifically calibrates the hydrogen sensor by: securing the hydrogen sensor in a test chamber during calibration; precisely adjusting the chamber environment through a temperature and humidity control unit to provide a controllable and repeatable environment under varying temperature and humidity conditions; then, delivering hydrogen of a known concentration through a standard hydrogen concentration generator to create a set hydrogen concentration scenario within the chamber; then, collecting the output values of each sensor and environmental parameters through a data acquisition and signal processing unit, and transmitting the data to a control and calculation unit; and finally, running steps S201 to S203 in the control and calculation unit to fit and calculate the collected data to obtain the optimal model parameters. After calibration, these parameters can be stored and used to provide accurate temperature and humidity compensation for the sensor in practical applications.
[0145] In summary, compared to the prior art, the hydrogen sensor calibration method provided in the embodiments of the present application has the following beneficial effects: Because differences in weight parameter combinations affect the loss function setting, and thus the performance of the ultimately trained hydrogen sensor calibration model, by traversing multiple sets of weight parameter combinations to train multiple candidate models and screening the calibration model with the best performance, the advantages of hyperparameter search are utilized to simultaneously determine the optimal weight parameter combination and obtain the best-performing hydrogen sensor calibration model, 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-mentioned 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 a confrontation 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] Furthermore, in some embodiments of the present application, the data acquisition module 301 is used to collect a plurality of electrical signal data output by the hydrogen sensor and first hydrogen concentration data of the space in which the hydrogen sensor 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 based on the feature data through the hydrogen concentration prediction module; the second prediction module 304 is used to predict a plurality of interference signals corresponding to each of the electrical signal data based on the feature data through the countermeasure module; wherein each of the interference signals corresponds to an interference factor; the loss calculation module 305 is used to obtain a prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and to obtain a countermeasure loss based on each of the interference signals; the loss model parameter tuning module 306 is used to calculate the temperature and humidity countermeasure loss based on a preset weight parameter combination, the prediction error loss, and the countermeasure loss, and optimize the parameters of the hydrogen sensor calibration model based on the temperature and humidity countermeasure loss.
[0148] Furthermore, in some embodiments of the present application, the feature extraction module extracts feature data from each of the electrical signal data, including: 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 features related to hydrogen concentration in the dynamic feature information through an attention mechanism, and suppressing interference features to obtain the feature data.
[0149] Furthermore, in some embodiments of the present application, the hydrogen concentration prediction module predicts the corrected second hydrogen concentration data corresponding to each of the electrical signal data based on the characteristic data, including: inputting the characteristic data into the first fully connected layer of a first preset number of layers in sequence, and taking the mean aggregation of the data output by the last layer of the first fully connected layer in the channel dimension to obtain global features; and obtaining the second hydrogen concentration through the second fully connected layer in combination with the global features.
[0150] Furthermore, in some embodiments of the present application, the adversarial module predicts several interference signals corresponding to each of the electrical signal data based on the characteristic data, including: wherein the interference signal includes a temperature interference signal and a humidity interference signal; the adversarial module includes a temperature compensation submodule and a humidity compensation submodule; through the temperature compensation submodule, the characteristic data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into the second fully connected layer of the second preset number of layers to obtain the temperature interference signal; through the humidity compensation submodule, the characteristic data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into the third fully connected layer of the third preset number of layers to obtain the humidity interference signal.
[0151] Furthermore, in some embodiments of the present application, 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 resistance loss is obtained based on each of the interference signals, including: 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; the temperature interference loss is calculated based on each of the temperature interference signals; and the humidity interference loss is calculated based on each of the humidity interference signals.
[0152] Furthermore, in some embodiments of the present application, the temperature and humidity countermeasure loss is calculated based on a preset weight parameter combination, the prediction error loss, and the countermeasure loss, including: determining the weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss according to 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 can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present application, and it can implement the hydrogen sensor calibration model training method provided by any of the above-mentioned method embodiments of the present application.
[0154] In summary, it can be seen that compared with the prior art, the hydrogen sensor calibration model training device provided in the embodiment of the present application has the following beneficial effects:
[0155] Since the hydrogen concentration prediction module needs to rely on the feature data extracted from the electrical signal data to accurately predict the second hydrogen concentration data, if there are too many relevant features representing the interference signal in the extracted feature data, the final predicted hydrogen concentration result will be inaccurate. In order to simultaneously suppress the relevant features of multiple interference signals in the feature data, an adversarial module is added to independently identify the relevant features of each interference signal in the feature data, and further negatively feedback adjust the parameters of the hydrogen sensor calibration model through the temperature and humidity adversarial loss including adversarial loss and prediction error loss, so as to achieve the simultaneous suppression of the relevant feature performance of different interference signals during the feature extraction process, and enable the hydrogen concentration prediction module to effectively identify the features related to hydrogen concentration in the feature data, thereby improving the detection accuracy of the hydrogen sensor calibration model under multiple interference factors. In addition, the present application designs independent compensation modules for temperature and humidity interference signals respectively, which improves the pertinence and accuracy of the compensation effect; achieves the maximum confusion of temperature and humidity signals through the adversarial loss function, and reduces the influence of various interferences on hydrogen concentration prediction; significantly improves the overall performance of the model by integrating compensation and concentration prediction into a unified optimization target; finally, through fine temperature and humidity compensation, the model can work stably in complex environments and improve model robustness.
[0156] like Figure 6 As shown, based on the above-mentioned hydrogen sensor calibration method embodiment, 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 the present application, the model training module 401 is used to sequentially take out a weight parameter combination from a preset weight parameter combination set as a preset weight parameter combination, and train the preset hydrogen sensor calibration model according to the preset weight parameter combination in combination with the hydrogen sensor calibration model training device as described in any one of the embodiments of the present application; the model screening module 402 is used to screen the first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through training; the calibration module 403 is used to input the electrical signal data output by the hydrogen sensor into the first hydrogen sensor calibration model to realize calibration of the hydrogen sensor.
[0158] Furthermore, in some embodiments of the present 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 can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present application, and it can implement the hydrogen sensor calibration method provided by any of the above-mentioned method embodiments of the present application.
[0160] In summary, compared to the prior art, the hydrogen sensor calibration device provided in the embodiments of the present application has the following beneficial effects: Because differences in weight parameter combinations affect the loss function setting, and thus the performance of the ultimately trained hydrogen sensor calibration model, by traversing multiple sets of weight parameter combinations to train multiple candidate models and screening the calibration model with the best performance, the advantages of hyperparameter search are utilized to simultaneously determine the optimal weight parameter combination and obtain the optimal hydrogen sensor calibration model, 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 may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided herein, the connection relationship between the modules indicates that there is a communication connection between them, which may be implemented as one or more communication buses or signal lines. Those skilled in the art may understand and implement the present invention without inventive effort.
[0162] Based on the above-mentioned embodiments of the hydrogen sensor calibration or calibration model training method, another embodiment of the present 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, the hydrogen sensor calibration or calibration model training method of any embodiment of the present application is implemented.
[0163] For example, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more module elements may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0164] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0165] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.
[0166] Based on the above method embodiments, another embodiment of the present application provides a computer-readable storage medium, including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the hydrogen sensor calibration or calibration model training method described in any one of the above method embodiments of the present application.
[0167] Wherein, the module / unit integrated in the device / terminal equipment, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium, etc.
Claims
1. A hydrogen sensor calibration model training method, characterized in that: The hydrogen sensor calibration model includes a feature extraction module, a hydrogen concentration prediction module, and a countermeasure module. The method includes: collecting a plurality of electrical signal data output by the hydrogen sensor and first hydrogen concentration data of the space in which the hydrogen sensor is located when the hydrogen sensor outputs the electrical signal data; Extracting feature data from each of the electrical signal data by the feature extraction module; Predicting, by the hydrogen concentration prediction module, the corrected second hydrogen concentration data corresponding to each of the electrical signal data according to the characteristic data; Predicting, by the countermeasure module, a plurality of interference signals corresponding to each of the electrical signal data based on the characteristic data; wherein each of the interference signals corresponds to an interference factor; Obtaining a prediction error loss according to each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining a countermeasure loss according to each of the interference signals; The temperature and humidity resistance loss is calculated according to a preset weight parameter combination, the prediction error loss, and the resistance loss, and the parameters of the hydrogen sensor calibration model are optimized according to the temperature and humidity resistance loss.
2. A hydrogen sensor calibration model training method according to claim 1, characterized in that: The extracting feature data from each of the electrical signal data by 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; The features related to hydrogen concentration in the dynamic feature information are enhanced through an attention mechanism, and interference features are suppressed to obtain the feature data.
3. A hydrogen sensor calibration model training method according to claim 1, characterized in that: The method of predicting the corrected second hydrogen concentration data corresponding to each of the electrical signal data according to the characteristic data by the hydrogen concentration prediction module includes: Inputting the feature data into the first fully connected layer of the first preset number of layers in sequence, and taking the mean of the data output by the last first fully connected layer in the channel dimension to obtain the global feature; The second hydrogen concentration is obtained by combining the global features through a second fully connected layer.
4. A hydrogen sensor calibration model training method according to any one of claims 1 to 3, characterized in that: The countermeasure module predicts several interference signals corresponding to the electrical signal data according to the characteristic data, include: Wherein, the interference signal includes a temperature interference signal and a humidity interference signal; the countermeasure module includes a temperature compensation submodule and a humidity compensation submodule; By means of the temperature compensation submodule, the characteristic data is flattened into a one-dimensional vector, and the one-dimensional vector is sequentially input into a third fully connected layer of a second preset number of layers to obtain the temperature interference signal; The characteristic data is flattened into a one-dimensional vector through the humidity compensation submodule, and the one-dimensional vector is sequentially input into a fourth fully connected layer of a third preset number of layers to obtain the humidity interference signal.
5. A hydrogen sensor calibration model training method according to claim 4, characterized in that: The obtaining of prediction error loss according to each of the first hydrogen concentration data and each of the second hydrogen concentration data, and obtaining of countermeasure loss according to each of the interference signals, includes: The resistance loss includes temperature resistance loss and humidity resistance 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 according to each of the temperature interference signals; The humidity interference loss is calculated according to each of the humidity interference signals.
6. A hydrogen sensor calibration model training method according to claim 5, characterized in that: The calculating of the temperature and humidity resistance loss according to the preset weight parameter combination, the prediction error loss, and the resistance loss includes: Determining weights corresponding to the prediction error loss, the temperature interference loss, and the humidity interference loss, respectively, according to the weight parameter combination, and calculating a 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.
7. A hydrogen sensor calibration method, characterized in that: include: Sequentially selecting a weight parameter combination from a preset weight parameter combination set as a preset weight parameter combination, and training a preset hydrogen sensor calibration model according to the preset weight parameter combination in combination with the hydrogen sensor calibration model training method according to any one of claims 1 to 6; Selecting the first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through training; The electrical signal data output by the hydrogen sensor is input into the first hydrogen sensor calibration model to implement calibration of the hydrogen sensor.
8. A hydrogen sensor calibration method according to claim 7, 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.
9. 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 a countermeasure 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 configured to acquire a plurality of electrical signal data output by the hydrogen sensor and first hydrogen concentration data of the space in which the hydrogen sensor is located when outputting the electrical signal data; The first feature data extraction module is used to extract feature data from each of the electrical signal data through the feature extraction module; The first prediction module is configured to predict, based on the characteristic data, the corrected second hydrogen concentration data corresponding to each of the electrical signal data using the hydrogen concentration prediction module; The second prediction module is configured to predict, through the countermeasure module, a plurality of interference signals corresponding to each of the electrical signal data based on the characteristic data; wherein each of the interference signals corresponds to an interference factor; The loss calculation module is configured to obtain a prediction error loss based on each of the first hydrogen concentration data and each of the second hydrogen concentration data, and to obtain a countermeasure 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 a 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.
10. A hydrogen sensor calibration device, characterized in that: include: Model training module, model screening module and calibration module; The model training module is configured to sequentially select a weight parameter combination from a preset weight parameter combination set as a preset weight parameter combination, and train a preset hydrogen sensor calibration model according to the preset weight parameter combination in combination with the hydrogen sensor calibration model training device according to claim 9; The model screening module is used to screen a first hydrogen sensor calibration model with the best performance from all hydrogen sensor calibration models obtained through 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 achieve calibration of the hydrogen sensor.
Citation Information
Patent Citations
Self-calibration gas sensor
CN101368927A
Hydrogen sensor off-line calibration method based on deep learning
CN116720421A
Calibration concentration selection method for gas sensor array
US20240102979A1
AU2020102518A4
Cited By
Sensor signal attenuation calibration method, device and equipment and storage medium
CN121306340A
Sensor signal attenuation calibration method, apparatus, device, and storage medium
CN121306340B