Low-cost gas sensor data calibration method based on supervised learning

Through the data calibration method based on supervised learning, the self-supervised learning and timing calibration modules are used to solve the problem of data quality degradation in deployment and use of low-cost gas sensors, improving the accuracy and stability of data calibration, and extending the use of equipment life.

CN119310242AActive Publication Date: 2025-01-14INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411456655.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-14
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

During the deployment and use of low-cost gas sensors, the performance of sensitive materials is susceptible to environmental conditions, resulting in drift and accuracy degradation, making it difficult to avoid data quality problems.

Method used

Using a supervised learning method, through the self-supervised learning module and the timing calibration module, the spatio-temporal and spatial distribution law of the sample sequence to be calibrated is mined, combined with the reference sample sequence obtained by the environmental base station or high-precision sensor, the data calibration model is constructed, and the measurement and measurement are captured. The shared information and intrinsic relationships between reference sequences are performed to perform data calibration.

Benefits of technology

It improves the accuracy and stability of low-cost gas sensor data calibration, extends detection accuracy and service life, and achieves cost reduction and efficiency improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119310242A_ABST
    Figure CN119310242A_ABST
Patent Text Reader

Abstract

The invention provides a supervised learning-based low-cost gas sensor data calibration method, which can be applied to the fields of computer technology and sensing technology. The data calibration model training method comprises the steps of obtaining a to-be-calibrated sample sequence and a reference sample sequence for a target object; training a self-supervised learning module by using the to-be-calibrated sample sequence to obtain a trained self-supervised learning module; and under the condition of keeping the model parameters of the trained self-supervised learning module unchanged, training the time sequence calibration module by using the to-be-calibrated sample sequence and the reference sample sequence to obtain a data calibration model for the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology and sensor technology, and more specifically, to a low-cost gas sensor data calibration method based on supervised learning. Background Art

[0002] A gas sensor is a device that converts information such as the composition and concentration of a gas into information that can be used by users, instruments, computers, etc.

[0003] In combination with IoT technology in agricultural production scenarios, gas sensors (e.g., hydrogen sulfide (H2S) sensors, ammonia (NH3) sensors, and fine particulate matter (PM2.5) sensors, etc.) can remotely monitor various gas components in the environment and collect data. Through further real-time data analysis, producers can adjust operations such as irrigation, fertilization, and ventilation to adapt to current environmental conditions. Low-cost gas sensors have the advantages of high temporal resolution, low cost, and easy deployment, making them the first choice in agricultural production monitoring scenarios.

[0004] However, low-cost gas sensors are not calibrated before leaving the factory, and as they are deployed and used for a period of time, the performance of their sensitive materials is affected by environmental conditions, and gas sensors inevitably experience data quality problems such as drift and decreased accuracy.

[0005] In the process of realizing the concept of the present disclosure, the inventors found that the change law of sensitive materials can be determined through certain experimental schemes, and the change of environmental factors in the same scene has a certain time periodicity, so the measurement data of low-cost gas sensors has an inherent internal distribution law. The data of low-cost environmental gas sensors can be optimized by post-deployment calibration.

[0006] Therefore, the inventors considered that the time-space invariant distribution patterns of the measurement data could be mined based on self-supervised deep learning network modeling, and then the measurement values ​​obtained by the environmental base station or high-precision sensors could be used as a reference to construct a deep learning calibration fine-tuning model to capture the shared information and intrinsic relationship between the measurement and reference sequences, thereby forming an environmental modeling calibration scheme. Summary of the invention

[0007] In view of this, the present disclosure provides a low-cost gas sensor data calibration method based on supervised learning.

[0008] According to one aspect of the present disclosure, a method for training a low-cost gas sensor data calibration model is provided, comprising: obtaining a sample sequence to be calibrated and a reference sample sequence for a target object; training a self-supervised learning module using the sample sequence to be calibrated to obtain a trained self-supervised learning module; and, while keeping the model parameters of the trained self-supervised learning module unchanged, training a timing calibration module using the sample sequence to be calibrated and the reference sample sequence to obtain a data calibration model for the target object.

[0009] According to an embodiment of the present disclosure, the above-mentioned self-supervised learning module includes a mask network and a feature extraction network.

[0010] According to an embodiment of the present disclosure, the self-supervised learning module is trained using the above-mentioned sample sequence to be calibrated to obtain a trained self-supervised learning module, including: using the above-mentioned mask network to process the above-mentioned sample sequence to be calibrated according to a mask length determined based on a preset mask rate to obtain a masked sample sequence; inputting the above-mentioned masked sample sequence into the above-mentioned feature extraction network to obtain a first output sample sequence; and, according to the above-mentioned masked sample sequence and the above-mentioned first output sample sequence, adjusting the model parameters of the above-mentioned feature extraction network to obtain the above-mentioned trained self-supervised learning module.

[0011] According to an embodiment of the present disclosure, the above-mentioned feature extraction network includes a first sub-network, a first attention encoding network, a second sub-network and a third sub-network.

[0012] According to an embodiment of the present disclosure, the above-mentioned inputting the masked sample sequence into the above-mentioned feature extraction network to obtain the first output sample sequence includes: inputting the above-mentioned masked sample sequence into the above-mentioned first sub-network to obtain a first processing result, wherein the above-mentioned first sub-network includes a first linear layer and a first normalization layer; inputting the above-mentioned first processing result into the above-mentioned first attention encoding network to obtain a first encoding result; inputting the above-mentioned first encoding result into the above-mentioned second sub-network to obtain a second processing result, wherein the above-mentioned second sub-network includes a second normalization layer, a second linear layer, a third normalization layer, a first random inactivation layer and a third linear layer; and, inputting the above-mentioned second processing result into the above-mentioned third sub-network to obtain the above-mentioned output sample sequence, wherein the above-mentioned third sub-network includes a first gated recurrent unit, a second random inactivation layer, a fourth linear layer and a fifth linear layer.

[0013] According to an embodiment of the present disclosure, the above-mentioned first attention encoding network includes a first position encoding subnetwork and a first encoder, and the above-mentioned first encoder includes multiple first encoding blocks.

[0014] According to an embodiment of the present disclosure, the above-mentioned first processing result is input into the above-mentioned first attention encoding network to obtain the first encoding result, which includes: inputting the above-mentioned first processing result into the above-mentioned first position encoding subnetwork to obtain a position encoding sequence; and, inputting the above-mentioned position encoding sequence into the above-mentioned multiple first encoding blocks in sequence to obtain the above-mentioned first encoding result, wherein the above-mentioned first encoding block includes a first attention layer, a first residual connection layer, a fourth normalization layer, a first feedforward connection layer, a second residual connection layer and a fifth normalization layer.

[0015] According to an embodiment of the present disclosure, the model parameters of the feature extraction network are adjusted according to the masked sample sequence and the first output sample sequence to obtain the trained self-supervised learning module, including: determining a second sub-sample sequence at a corresponding position in the first output sample sequence according to the masked first sub-sample sequence in the masked sample sequence; determining a first difference between the first sub-sample sequence and the second sub-sample sequence; adjusting the model parameters of the feature extraction network to converge the first difference; and using the feature extraction network in which the mask network and the first difference converge as the trained self-supervised learning module.

[0016] According to an embodiment of the present disclosure, while keeping the model parameters of the trained self-supervised learning module unchanged, the timing calibration module is trained using the sample sequence to be calibrated and the reference sample sequence to obtain a data calibration model for the target object, including: inputting the sample vector to be calibrated into the trained self-supervised learning module to obtain a second output sample sequence; inputting the second output sample sequence into the timing calibration module to obtain a third output sample sequence; adjusting the model parameters of the timing calibration module according to the third output sample sequence and the reference sample sequence to obtain an adjusted timing calibration module; and determining the data calibration model based on the trained self-supervised learning module and the adjusted timing calibration module.

[0017] According to an embodiment of the present disclosure, the above-mentioned timing calibration module includes a fourth sub-network, a second attention encoding network, a fifth sub-network and a fully connected layer.

[0018] According to an embodiment of the present disclosure, the above-mentioned second output sample sequence is input into the above-mentioned timing calibration module to obtain the third output sample sequence, which includes: inputting the above-mentioned second output sample sequence into the above-mentioned fourth sub-network to obtain a third processing result, wherein the above-mentioned fourth sub-network includes a sixth linear layer and a sixth normalization layer; inputting the above-mentioned third processing result into the above-mentioned second attention encoding network to obtain a second encoding result, wherein the above-mentioned second attention encoding network includes a second position encoding sub-network and a second encoder, and the above-mentioned second encoder includes a plurality of second encoding blocks, and the above-mentioned second encoding block includes a second attention layer, a third residual connection layer, a seventh normalization layer, a second feedforward connection layer, a fourth residual connection layer and an eighth normalization layer; inputting the above-mentioned second encoding result into the above-mentioned fifth sub-network to obtain a third processing result, wherein the above-mentioned fifth sub-network includes a third random inactivation layer, a seventh linear layer and an eighth linear layer; and, inputting the above-mentioned third processing result into the above-mentioned fully connected layer to obtain the above-mentioned third output sample sequence.

[0019] According to an embodiment of the present disclosure, the model parameters of the timing calibration module are adjusted according to the third output sample sequence and the reference sample sequence to obtain the adjusted timing calibration module, including: determining the second difference based on the root mean square difference and the shape distortion difference between the third output sample sequence and the reference sample sequence; adjusting the model parameters of the timing calibration module to converge the second difference; and using the timing calibration model under the condition that the second difference converges as the adjusted timing calibration model.

[0020] According to an embodiment of the present disclosure, the above-mentioned acquisition of the to-be-calibrated sample sequence and the reference sample sequence for the target object includes: determining an initial sample sequence based on the to-be-calibrated data for the target object collected by the low-cost sensor, wherein the initial sample sequence includes a plurality of positions arranged in chronological order, each of the above positions corresponding to the data of the above target object and the data of at least one other object; for each of the above positions, according to the relationship between the sampling rate of the data of the above other object and a preset sampling rate threshold, processing the data of the above other object to obtain an intermediate sample sequence; and, according to the relationship between the data of the above other object and the preset object threshold, processing the above intermediate sample sequence to obtain the above-mentioned to-be-calibrated sample sequence.

[0021] According to one aspect of the present disclosure, a low-cost gas sensor data calibration method is provided, comprising: acquiring data to be calibrated, wherein the feature dimension of the data to be calibrated is consistent with the feature dimension of input data during training; processing the data to be calibrated to obtain a sequence to be calibrated; and inputting the sequence to be calibrated into a data calibration model to obtain a data calibration result, wherein the data calibration model is trained using a training method for a data calibration model.

[0022] According to another aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described in the present disclosure.

[0023] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored. When the executable instructions are executed by a processor, the processor implements the method described in the present disclosure.

[0024] According to another aspect of the present disclosure, a computer program product is provided. The computer program product includes computer executable instructions. When the computer executable instructions are executed, they are used to implement the method described in the present disclosure.

[0025] According to the embodiments of the present disclosure, by combining the model structure of self-supervised learning and supervised learning with a reference sample sequence, a relatively general data calibration model is established using a large number of target object's sample sequences to be calibrated, aiming to build a general data calibration model for low-cost gas sensors in environments without true values ​​or with limited true values. In this process, the time-space invariant distribution law of the sample sequence to be calibrated is mined through self-supervised deep learning network modeling, and then the reference sample sequence obtained by the environmental base station or high-precision sensor is used as a reference to build a data calibration model to capture the shared information and intrinsic relationship between the sample sequence to be calibrated and the reference sample sequence, which can improve the quality of the data calibration model finally obtained and help improve the accuracy of subsequent data calibration. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0027] Figure 1 The system architecture of the training method and data calibration method of the low-cost gas sensor data calibration model according to the embodiment of the present disclosure is schematically shown;

[0028] Figure 2 A flowchart of a method for training a low-cost gas sensor data calibration model according to an embodiment of the present disclosure is schematically shown;

[0029] Figure 3 An example schematic diagram schematically shows a process of obtaining a sample sequence to be calibrated according to an embodiment of the present disclosure;

[0030] Figure 4An example schematic diagram schematically illustrates a training process of a low-cost gas sensor data calibration model according to an embodiment of the present disclosure;

[0031] Figure 5A An example schematic diagram schematically illustrates a training process of a self-supervised learning module according to an embodiment of the present disclosure;

[0032] Figure 5B An exemplary schematic diagram of a first gated cycle unit according to an embodiment of the present disclosure is schematically shown;

[0033] Figure 5C An example schematic diagram of a first attention encoding network according to an embodiment of the present disclosure is schematically shown;

[0034] Figure 6 An example schematic diagram schematically shows a training process of a timing calibration module according to an embodiment of the present disclosure;

[0035] Figure 7 A flowchart of a low-cost gas sensor data calibration method according to an embodiment of the present disclosure is schematically shown;

[0036] Figure 8 A block diagram of a training device for a low-cost gas sensor data calibration model according to an embodiment of the present disclosure is schematically shown;

[0037] Fig. 9 A block diagram schematically shows a low-cost gas sensor data calibration device according to an embodiment of the present disclosure; and

[0038] Fig.10 A block diagram of an electronic device suitable for implementing a training method for a low-cost gas sensor data calibration model and a low-cost gas sensor data calibration method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0039] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0040] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0041] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0042] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0043] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0044] Gas sensors are devices that convert information such as gas composition and concentration into information that can be used by users, instruments, computers, etc. By combining IoT technology in agricultural production scenarios, gas sensors can remotely monitor various gas components in the environment and collect data.

[0045] In one example, low-cost gas sensors are the first choice in agricultural production scenarios due to their advantages such as high time resolution, low cost and easy deployment.

[0046] In the process of realizing the concepts disclosed herein, the inventors discovered that there are at least the following problems in the related art: as the deployment and use time goes by, the performance of the sensitive materials of low-cost gas sensors is easily affected by environmental conditions, resulting in inevitable data quality problems such as drift and decreased accuracy.

[0047] In order to at least partially solve the technical problems existing in the related art, the present disclosure provides a low-cost gas sensor data calibration method based on supervised learning, which can be applied to the fields of computer technology and sensor technology. The training method of the low-cost gas sensor data calibration model includes: obtaining a sample sequence to be calibrated and a reference sample sequence for a target object; training a self-supervised learning module using the sample sequence to be calibrated to obtain a trained self-supervised learning module; and, while keeping the model parameters of the trained self-supervised learning module unchanged, training a timing calibration module using the sample sequence to be calibrated and the reference sample sequence to obtain a data calibration model for the target object.

[0048] Figure 1 The system architecture of the training method of the low-cost gas sensor data calibration model and the low-cost gas sensor data calibration method according to the embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0049] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0050] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0051] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0052] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0053] It should be noted that the training method of the low-cost gas sensor data calibration model and the low-cost gas sensor data calibration method provided in the embodiments of the present disclosure can generally be performed by the server 105. Accordingly, the training device of the low-cost gas sensor data calibration model and the low-cost gas sensor data calibration device provided in the embodiments of the present disclosure can generally be set in the server 105. The training method of the low-cost gas sensor data calibration model and the low-cost gas sensor data calibration method provided in the embodiments of the present disclosure can also be performed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the training device of the low-cost gas sensor data calibration model and the low-cost gas sensor data calibration device provided in the embodiments of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0054] Alternatively, the training method of the low-cost gas sensor data calibration model and the low-cost gas sensor data calibration method provided in the embodiments of the present disclosure may also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or may also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the training device of the low-cost gas sensor data calibration model and the low-cost gas sensor data calibration device provided in the embodiments of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or may be provided in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.

[0055] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0056] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.

[0057] Figure 2 The flowchart of the training method of the low-cost gas sensor data calibration model according to the embodiment of the present disclosure is schematically shown.

[0058] like Figure 2 As shown, the training method 200 of the low-cost gas sensor data calibration model includes operations S210 to S230.

[0059] In operation S210 , a to-be-calibrated sample sequence and a reference sample sequence for a target object are acquired.

[0060] In operation S220, the self-supervised learning module is trained using the sample sequence to be calibrated to obtain a trained self-supervised learning module.

[0061] In operation S230, while keeping the model parameters of the trained self-supervised learning module unchanged, the timing calibration module is trained using the sample sequence to be calibrated and the reference sample sequence to obtain a data calibration model for the target object.

[0062] The target object may refer to the ambient gas to be measured. The reference sample sequence refers to the accurate label of the measured ambient gas. The sample sequence to be calibrated refers to the sequence of the measured ambient gas with lower accuracy. The method of obtaining the sample sequence to be calibrated and the reference sample sequence can be configured according to actual business needs and is not limited here. For example, a low-cost sensor may be used to collect the data to be calibrated of the ambient gas, and the data to be calibrated may be processed to obtain the sample sequence to be calibrated. Alternatively, a standard collection station may be used to collect reference data of the ambient gas, and the reference data may be processed to obtain a reference sample sequence.

[0063] The data calibration model can be used to calibrate the sequence to be calibrated to obtain accurate results. The training process of the data calibration model includes a self-supervised learning stage and a precise timing calibration stage. The self-supervised learning stage can be used to train to obtain a trained self-supervised learning module. The precise timing calibration stage can be used to train to obtain a data calibration model when the model parameters of the trained self-supervised learning module are fixed.

[0064] In the self-supervised learning stage, the self-supervised learning module can be trained using the sample sequence to be calibrated to obtain a trained self-supervised learning module. The specific structure of the self-supervised learning module can be configured according to actual business needs and is not limited here. For example, the structure of the self-supervised learning module may include at least one of the following: an input layer, a feature extraction layer, an aggregation layer, a loss function, and an output layer.

[0065] In a specific example, a self-supervised learning module can be constructed through a self-attention encoding mechanism and a gated recurrent unit, so that the self-supervised learning module can be used to learn the complex distribution patterns of time series data collected by a large number of low-cost gas sensors that change with time and environment, and save the structure and parameters of the trained self-supervised learning module.

[0066] In the precise timing calibration stage, the structure and parameters of the trained self-supervised learning module can be frozen, and a new timing calibration module can be added. The timing calibration module is trained using the sample sequence to be calibrated and the reference sample sequence to obtain a data calibration model for the target object. The specific structure of the timing calibration module can be configured according to actual business needs and is not limited here. For example, the structure of the timing calibration module may include at least one of the following: a linear layer, a normalization layer, an attention encoding network, a random inactivation layer, a gated recurrent unit, an attention layer, a feedforward connection layer, and a fully connected layer.

[0067] In a specific example, a timing calibration module can be constructed through a self-attention encoding mechanism, the timing calibration module is trained by using a sample sequence to be calibrated and a reference sample sequence, and a data calibration model is determined based on a trained self-supervised learning module with fixed parameters and a trained timing calibration module.

[0068] According to the embodiments of the present disclosure, by combining the model structure of self-supervised learning and supervised learning with a reference sample sequence, a relatively general data calibration model is established using a large number of target object's sample sequences to be calibrated, aiming to build a general data calibration model for low-cost gas sensors in environments without true values ​​or with limited true values. In this process, the time-space invariant distribution law of the sample sequence to be calibrated is mined through self-supervised deep learning network modeling, and then the reference sample sequence obtained by the environmental base station or high-precision sensor is used as a reference to build a data calibration model to capture the shared information and intrinsic relationship between the sample sequence to be calibrated and the reference sample sequence, which can improve the quality of the data calibration model finally obtained and help improve the accuracy of subsequent data calibration.

[0069] Reference below Figure 3 , Figure 4 , Figure 5A , Figure 5B , Figure 5C and Figure 6, the training method 200 of the low-cost gas sensor data calibration model according to an embodiment of the present invention is further described.

[0070] Figure 3 An example schematic diagram of a process of obtaining a sample sequence to be calibrated according to an embodiment of the present disclosure is schematically shown.

[0071] like Figure 3 As shown, in 300, a low-cost sensor 301 can be used to collect data 302 to be calibrated for a target object, and an initial sample sequence 303 is determined based on the data 302 to be calibrated. The initial sample sequence 303 may include multiple positions arranged in time order, and each position corresponds to data of the target object and data of at least one other object. For example, taking the second position 304 as an example, the position 304 corresponds to data 304_1 of the target object and data 304_2 of the other object.

[0072] In one example, the dimension of the initial sample sequence 303 can be determined based on literature research and the types of environmental sensors deployed in actual production sites, or can be determined based on quantifiable factors in the entire environment. The initial sample sequence 303 can be recorded as X ori .

[0073] After obtaining the initial sample training 303, the initial sample training 303 can be time aligned and outliers can be removed. Time alignment refers to unifying the number of measurement points of each environmental parameter to address the problem of different numbers of measurement points caused by different sampling rates of different environmental parameters. Outlier removal refers to removing outliers from the data at each time point to obtain usable data.

[0074] For example, in the time alignment process, for position 304, the data 304_2 of other objects can be processed according to the relationship between the sampling rate of the data 304_2 of other objects and the preset sampling rate threshold 305 to obtain the intermediate sample sequence 306. In one example, the sampling rate of the data to be calibrated can be used as the basis, the data with too low sampling rate is supplemented by cubic spline difference, and the data with too high sampling rate is coarse-grained by the mean method. The final data length is fixed to M, which is related to the time interval and is preferably more than 100,000.

[0075] Alternatively, in the process of removing outliers, the intermediate sample sequence 306 can be processed according to the relationship between the data 304_2 of other objects and the preset object threshold 307 to obtain the sample sequence to be calibrated 308. In one example, if the data at each time point is zero or exceeds 95% of the sensor measurement threshold, the data at that time point is excluded from the available data. If there are N quantifiable interference factors, including the measurement value of the sensor itself, the sample sequence to be calibrated 308 can be recorded as X pred , whose dimension is M×N.

[0076] According to the embodiments of the present disclosure, for each position in the initial sample sequence, by processing the data of other objects according to the relationship between the sampling rate of the data of other objects and the preset sampling rate threshold, dynamic adjustment can be achieved for the inconsistent sampling rate, thereby ensuring the integrity of the sample data. On this basis, by processing the intermediate sample sequence according to the relationship between the data of other objects and the preset object threshold, irrelevant or low-quality data can be effectively eliminated, thereby improving the data quality of the final sample sequence to be calibrated.

[0077] Figure 4 An example schematic diagram of a training process of a low-cost gas sensor data calibration model according to an embodiment of the present disclosure is schematically shown.

[0078] like Figure 4 As shown, in 400, the to-be-calibrated data 401 and the reference data of the target object may be acquired, and a to-be-calibrated sample sequence 402 corresponding to the to-be-calibrated data and a reference sample sequence 405 corresponding to the reference data may be determined respectively.

[0079] In the self-supervised learning stage, the to-be-calibrated sample sequence 402 may be used to train the self-supervised learning module 403 to obtain a trained self-supervised learning module 404 .

[0080] In the precise timing calibration stage, the timing calibration module 406 can be trained using the sample sequence 402 to be calibrated and the reference sample sequence 405 while keeping the model parameters of the trained self-supervised learning module 404 unchanged, so as to obtain a data calibration model 407 for the target object.

[0081] Figure 5A An example schematic diagram of the training process of the self-supervised learning module according to an embodiment of the present disclosure is schematically shown.

[0082] like Figure 5AAs shown, in 500A, the self-supervised learning module can realize feature extraction and enhancement based on a combination of a self-attention encoding mechanism, a multi-linear layer, and a gated recurrent unit. For example, the self-supervised learning module may include a mask network 502 and a feature extraction network, and the feature extraction network may include a first sub-network 504, a first attention encoding network 505, a second sub-network 506, and a third sub-network 507.

[0083] The mask network 502 can be used to perform mask operations, the first sub-network 504 can be used to perform shallow feature learning, the first attention encoding network 505 can be used to perform attention encoding, the second sub-network 506 can be used to perform feature consolidation, and the third sub-network 507 can be used to perform temporal feature re-learning.

[0084] After obtaining the sample sequence to be calibrated 501, the mask network 502 can be used to process the sample sequence to be calibrated 501 according to the mask length determined based on the preset mask rate to obtain a masked sample sequence 503. The mask network 502 can use the Span Masking mechanism to mask the data of a continuous time window (i.e., a "Span" or fragment). The preset mask rate can be 0.15. A starting position is randomly selected in the sample sequence to be calibrated 501, and then a Span is selected according to the mask length, and all data in the selected Span is set to zero. The masked sample sequence 503 after the masking operation is recorded as X mask .

[0085] After obtaining the masked sample sequence 503, the masked sample sequence 503 can be processed in sequence by the first sub-network 504, the first attention encoding network 505, the second sub-network 506 and the third sub-network 507 to obtain an output sample sequence 508. The specific structures of the first sub-network 504, the first attention encoding network 505, the second sub-network 506 and the third sub-network 507 can be configured according to actual business needs and are not limited here.

[0086] For example, the first sub-network 504 maps the masked sample sequence 503 to the hidden representation X through a learnable embedding module E In a specific implementation, the first sub-network 504 may include a first linear layer 504_1 and a first normalization layer 504_2. By inputting the masked sample sequence 503 into the first sub-network 504, the original input X mask ∈R M×N Embed, get X E ∈R M×SThe first processing result of S represents the dimension of the hidden embedding. The first normalization layer 504_2 can use a layer normalization method to calculate the mean and variance of the output features of the linear layer neurons and normalize the output according to these statistics. Layer normalization is an effective regularization method that can improve the training process by reducing internal covariate shift.

[0087] Alternatively, the second sub-network 506 may include a second normalization layer 506_1, a second linear layer 506_2, a third normalization layer 506_3, a first random inactivation layer 506_4, and a third linear layer 506_5. The second normalization layer 506_1 and the third normalization layer 506_3 may adopt a layer normalization method, and the dropout rate of the first random inactivation layer 506_4 (i.e., the dropout layer) may be 0.2. The first encoding result obtained by processing the first attention encoding network 505 is input into the second sub-network 506 to obtain a second processing result.

[0088] Alternatively, the third sub-network 507 may include a first gated recurrent unit 507_1, a second random dropout layer 507_2, a fourth linear layer 507_3, and a fifth linear layer 507_4. The output dimension of the fifth linear layer 507_4 is N. By inputting the second processing result into the third sub-network 507, an output sample sequence 508 is obtained. The dropout rate of the second random dropout layer 507_2 (i.e., the dropout layer) may be 0.2.

[0089] According to an embodiment of the present disclosure, by using the first linear layer and the first normalization layer of the first sub-network to perform preliminary processing on the masked sample sequence, it is helpful to extract useful features from the original data and reduce data redundancy. By using the first attention encoding network to process the first processing result, it is possible to focus on the important parts of the input and improve the ability to capture key features. By using the second sub-network to consolidate the features of the first encoding result and using the third sub-network to re-learn the temporal features of the second processing result, the feature extraction and representation capabilities of the model can be improved.

[0090] Figure 5B An example schematic diagram of a first gated cycle unit according to an embodiment of the present disclosure is schematically shown.

[0091] like Figure 5B As shown, in 500B, x t Represents the input data at the current moment, h t-1 The implicit state output at the historical time t-1 is represented. The structure of the first gated recurrent unit 507_1 may include an update gate and a reset gate, and the update gate is used to implement the forgetting and selective memory of the neural network.

[0092] In one example, the update gate determines how much historical information and current information to use to update the current implicit state. For example, the update gate at time t can be shown as follows (1).

[0093]

[0094] in, Characterizes the gated update signal, whose size determines the memory degree of the candidate hidden state, Represents the implicit state of history, Represents the input data at time t, Representation weight matrix, Characterizes the sigmoid function.

[0095] In another example, the reset gate determines how much historical information is retained. For example, the reset gate at time t can be shown as follows (2).

[0096]

[0097] in, Characterizes the reset signal. The larger its value is, the more historical information needs to be remembered. is the weight matrix.

[0098] The candidate hidden state is responsible for integrating the information features of the input data and historical data. This operation is related to the reset signal obtained by the reset gate. Under the action of the update gate and the reset gate, the candidate hidden state and the hidden output state at the current moment can be shown as follows (3) and (4).

[0099]

[0100] in, Represents the candidate hidden state at the current moment, Represents the implicit output state at the current moment, Characterize the forgetting process, The closer it is to 1, the more information from the previous moment will be forgotten; Representing memory processes, The size of determines the degree of memory of the candidate hidden state.

[0101] Figure 5C An example schematic diagram of a first attention encoding network according to an embodiment of the present disclosure is schematically shown.

[0102] like Figure 5C As shown, in 500C, the first attention encoding network 505 may include a first position encoding subnetwork 505_1 and a first encoder 505_2. The first encoder 505_2 may include M first encoding blocks 509. M is a positive integer greater than 1. For example, M may be 3.

[0103] After obtaining the first processing result 506, the first processing result 506 can be input into the first position encoding subnetwork 505_1 to obtain a position encoding sequence that stores the relative or absolute position in the sequence. The dimension of the position encoding sequence is the same as the dimension of the input embedding. The first position encoding subnetwork 505_1 enables the position encoding sequence to adapt to sequences longer than all time series in the training set, allowing the model to easily calculate the relative position. In an example, the calculation method of the first position encoding subnetwork 505_1 is shown in the following equations (5) and (6).

[0104]

[0105] in, Characterizes positional coding sequences, Represents the position of the current data in the sequence, The dimension that represents the positional encoding sequence, Represents even dimensions, , Characterize odd dimensions, .

[0106] After obtaining the position coding sequence, the position coding sequence can be sequentially input into a plurality of first coding blocks 505_2 connected in sequence to obtain a first coding result 510. The specific structure of the first coding block 505_2 can be configured according to actual business needs and is not limited here. For example, the first coding block 509 may include a first attention layer 509_1, a first residual connection layer 509_2, a fourth normalization layer 509_3, a first feedforward connection layer 509_4, a second residual connection layer 509_5, and a fifth normalization layer 509_6.

[0107] In one example, the first attention layer 509_1 can adopt a multi-head attention mechanism, including multiple self-attention layers. The input of the self-attention layer is the sum of the output results of the word embedding encoding and the position encoding, denoted by X input_attention For example, the linear transformation matrix W can be used Q , W K and W V Q, K, and V are calculated to calculate the output of the self-attention layer. The output of the self-attention layer is calculated as shown in the following formula (7).

[0108]

[0109] in, is the number of columns of the Q and K matrices, i.e., the vector dimension. To prevent the inner product from being too large, the inner product of each row vector of the matrices Q and K can be calculated and divided by The square root of .

[0110] In the first attention layer 509_1, the input X input_attention Passed to multiple different self-attentions respectively, multiple output matrices X are calculated attention_z , use the multi-head attention mechanism to splice them together, and then pass them into a linear layer to get the final output X of the multi-head attention mechanism attention_m The matrix X output by the multi-head attention mechanism attention_m Its input matrix X input_attention The dimensions are the same.

[0111] In another example, the first residual connection layer 509_2 enables the deep network to focus on learning the difference between input and output (i.e., residual), so that it is easier to learn the changes introduced by the first attention layer 509_1. The fourth normalization layer 509_3 can convert the input of the neurons in the previous layer into the same mean and variance, so as to accelerate convergence. The input of the fourth normalization layer 509_3 is the output X of the first attention layer 509_1. attention_m , the output of the fourth normalization layer 509_3 is X L .

[0112] In another example, the first feed-forward connection layer 509_4 may be two fully connected layers, the activation function of the first fully connected layer is ReLU, and the second fully connected layer does not use an activation function. The input of the first feed-forward connection layer 509_4 is the output X of the fourth normalization layer 509_3. L , the output of the first feed-forward connection layer 509_4 is X F The calculation method of the first feed-forward connection layer 509_4 is shown in the following formula (8).

[0113]

[0114] in, is the coefficient matrix of the first fully connected layer, is the bias of the first fully connected layer, is the bias of the first fully connected layer.

[0115] In another example, the second residual connection layer 509_5 enables the deep network to focus on learning the difference between input and output (i.e., residual), so that it is easier to learn the changes introduced by the first feedforward connection layer 509_4. The fifth normalization layer 509_6 can convert the input of the neurons in the previous layer into the same mean and variance, thereby accelerating convergence. The input of the fifth normalization layer 509_6 is the output X of the first feedforward connection layer 509_4. F , the output of the fifth normalization layer 509_6 is the first encoding result 510.

[0116] According to the embodiments of the present disclosure, by inputting the first processing result into the first position encoding subnetwork, position information can be effectively added to the input data, thereby helping the model understand the order and relative relationship of the data and improving the contextual understanding ability of the sequence. On this basis, by using multiple first encoding blocks to process the position encoding sequence layer by layer, the complex relationship in the data can be captured more comprehensively, and the expression ability of the first encoding result can be improved.

[0117] Continue to see Figure 5A After obtaining the first output sample sequence 508, the second subsample sequence at the corresponding position in the first output sample sequence 508 can be determined according to the masked first subsample sequence in the masked sample sequence 503. A first difference between the first subsample sequence and the second subsample sequence is determined. The model parameters of the feature extraction network are adjusted so that the first difference converges. On this basis, the mask network 502 and the feature extraction network in the case of convergence of the first difference can be used as a trained self-supervised learning module.

[0118] The first difference can be configured according to actual business needs and is not limited here. For example, the first difference can be obtained by evaluating the model training process based on the mean square error (MSE) indicator. The model can be implemented in code based on the pytorch platform, with a ratio of 8:2 between the training data set and the test data set. The hyperparameters of the model can be set as follows: batch-size is 64, epochs is 100, and the optimization function is Adam. Finally, the model parameters of the trained self-supervised learning module that achieves the minimum loss on the training set are saved in pt format.

[0119] According to an embodiment of the present disclosure, by using the masked first subsample sequence in the masked sample sequence to determine the second subsample sequence, and determining the first difference between the first subsample sequence and the second subsample sequence, the model can focus on the changes of important features and signals, and enhance the recognition and understanding of potential information in the data. On this basis, by adjusting the model parameters of the feature extraction network to converge the first difference, the model achieves self-optimization of the input data.

[0120] Figure 6 An example schematic diagram of a training process of a timing calibration module according to an embodiment of the present disclosure is schematically shown.

[0121] like Figure 6As shown, in 600, the timing calibration module can realize feature decoding and measurement value calibration based on the combination of attention decoding mechanism and multi-linear layer. For example, the timing calibration module may include a fourth sub-network 604, a second attention encoding network 605, a fifth sub-network 607 and a fully connected layer 608. The fourth sub-network 604 can be used for feature shallow learning, the second attention encoding network 605 can be used for attention encoding, and the fifth sub-network 607 can be used for feature consolidation.

[0122] After obtaining the sample vector 601 to be calibrated, the sample vector 601 to be calibrated can be input into the trained self-supervised learning module 602 to obtain a second output sample sequence. The trained self-supervised learning module 602 can be a model structure saved in the self-supervised learning stage, and the parameters of the trained self-supervised learning module 602 are frozen in the precise timing calibration stage.

[0123] After obtaining the second output sample sequence, the fourth sub-network 604, the second attention encoding network 605, the fifth sub-network 607 and the fully connected layer 608 can be used to process the second output sample sequence in sequence to obtain a third output sample sequence 609. The specific structures of the fourth sub-network 604, the second attention encoding network 605, the fifth sub-network 607 and the fully connected layer 608 can be configured according to actual business needs, and will not be repeated here.

[0124] For example, the fourth sub-network 604 may include a sixth linear layer 604_1 and a sixth normalization layer 604_2. By inputting the second output sample sequence into the fourth sub-network 604, a third processing result is obtained.

[0125] Alternatively, the second attention encoding network 605 may include a second position encoding subnetwork 605_1 and a second encoder 605_2. The second encoder 605_2 may include N second encoding blocks 606. N is a positive integer greater than 1. For example, N may be 3. Each second encoding block 606 may include a second attention layer 606_1, a third residual connection layer 606_2, a seventh normalization layer 606_3, a second feedforward connection layer 606_4, a fourth residual connection layer 606_5, and an eighth normalization layer 606_6. By inputting the third processing result into the second attention encoding network 605, a second encoding result is obtained.

[0126] Alternatively, the fifth sub-network 607 may include a third random inactivation layer 607_1, a seventh linear layer 607_2, and an eighth linear layer 607_3. The second encoding result is input to the fifth sub-network 607 to obtain a third processing result. On this basis, the third processing result can be input to the fully connected layer 608 to obtain a third output sample sequence 609.

[0127] According to an embodiment of the present disclosure, by using the sixth linear layer and the sixth normalization layer of the fourth sub-network to perform preliminary processing on the second output sample sequence, it is helpful to extract useful features from the original data and reduce data redundancy. By using the second attention encoding network to process the third processing result, it is possible to focus on the important parts of the input and improve the ability to capture key features. By using the fifth sub-network to consolidate the features of the second encoding result, the feature extraction and representation capabilities of the model can be improved.

[0128] After obtaining the third output sample sequence 609, a second difference may be determined based on the root mean square difference and the shape distortion difference between the third output sample sequence 609 and the reference sample sequence. The model parameters of the timing calibration module are adjusted to converge the second difference. On this basis, the timing calibration model in the case where the second difference converges may be used as the adjusted timing calibration model.

[0129] The second difference can be configured according to actual business needs and is not limited here. For example, the second difference can be obtained by training and evaluating the model based on an indicator combining the root mean square error and the shape and time distortion loss. The calculation method of the second difference can be shown in the following formula (9).

[0130]

[0131] in, Characterizes the root mean square error loss, Characterize shape and time distortion losses, is 0.095, is 0.9.

[0132] The model can also be implemented in code based on the pytorch platform. The ratio of the training data set to the test data set is 8:2. The hyperparameters of the model can be set as follows: batch-size is 64, epochs is 200, and the optimization function is Adam. Finally, the model parameters of the trained timing calibration module that achieves the minimum loss on the training set are saved in pt format.

[0133] According to an embodiment of the present disclosure, by implementing parameter freezing on a trained self-supervised learning module and using the third output sample sequence and the reference sample sequence to train an accurate timing calibration module, the timing calibration module can be effectively driven to converge to a more optimal solution, thereby improving the overall performance and accuracy of the data calibration model.

[0134] The above are merely exemplary embodiments, but are not limited thereto, and may also include other data calibration model training methods known in the art, as long as the quality of the data calibration model can be improved.

[0135] Figure 7The flowchart of the low-cost gas sensor data calibration method according to the embodiment of the present disclosure is schematically shown.

[0136] like Figure 7 As shown, the low-cost gas sensor data calibration method 700 includes operations S710-S730.

[0137] In operation S710, data to be calibrated is obtained, and the feature dimension of the data to be calibrated needs to be consistent with the feature dimension of the input data during training.

[0138] In operation S720, the data to be calibrated is processed to obtain a sequence to be calibrated.

[0139] In operation S730, the sequence to be calibrated is input into a data calibration model to obtain a data calibration result, wherein the data calibration model is trained using a training method for a data calibration model.

[0140] The data to be calibrated refers to the measurement data collected by the low-cost gas sensor. After obtaining the data to be calibrated, the data to be calibrated can be processed to obtain a sequence to be calibrated. The dimension of the sequence to be calibrated is M×N. For example, an initial sequence can be determined based on the data to be calibrated, and the initial sequence includes multiple positions arranged in time order, and each position corresponds to the data of the target object and the data of at least one other object. For each position, according to the relationship between the sampling rate of the data of the other objects and the preset sampling rate threshold, the data of the other objects are processed to obtain an intermediate sequence. On this basis, according to the relationship between the data of the other objects and the preset object threshold, the intermediate sequence is processed to obtain the sequence to be calibrated.

[0141] After obtaining the sequence to be calibrated, the batch-size can be set to 1 to load the trained data calibration model. The trained data calibration model is used to calibrate the sequence to be calibrated of the measurement data collected by the low-cost gas sensor to obtain a data calibration result with the same accuracy as the high-precision sensor.

[0142] According to the embodiments of the present disclosure, by calibrating the data to be calibrated of the low-cost gas sensor by using the soft-hard method, the accuracy of the obtained data calibration results can be improved, thereby improving the detection accuracy and service life of the low-cost gas sensor, and achieving cost reduction and efficiency improvement.

[0143] The above are only exemplary embodiments, but are not limited thereto, and may also include other data calibration methods known in the art as long as the accuracy of the data calibration result can be improved.

[0144] Figure 8 A block diagram of a training device for a low-cost gas sensor data calibration model according to an embodiment of the present disclosure is schematically shown.

[0145] like Figure 8 As shown, the training device 800 for the low-cost gas sensor data calibration model may include a first acquisition module 810 , a first training module 820 , and a second training module 830 .

[0146] The first acquisition module 810 is used to acquire a to-be-calibrated sample sequence and a reference sample sequence for the target object.

[0147] The first training module 820 is used to train the self-supervised learning module using the sample sequence to be calibrated to obtain a trained self-supervised learning module.

[0148] The second training module 830 is used to train the timing calibration module using the sample sequence to be calibrated and the reference sample sequence while keeping the model parameters of the trained self-supervised learning module unchanged, so as to obtain a data calibration model for the target object.

[0149] According to an embodiment of the present disclosure, the self-supervised learning module includes a mask network and a feature extraction network.

[0150] According to an embodiment of the present disclosure, the first training module 820 may include a first processing submodule, a first input submodule and a first adjustment submodule.

[0151] The first processing submodule is used to process the sample sequence to be calibrated by using a mask network according to a mask length determined based on a preset mask rate to obtain a masked sample sequence.

[0152] The first input submodule is used to input the masked sample sequence into the feature extraction network to obtain a first output sample sequence.

[0153] The first adjustment submodule is used to adjust the model parameters of the feature extraction network according to the masked sample sequence and the first output sample sequence to obtain a trained self-supervised learning module.

[0154] According to an embodiment of the present disclosure, the feature extraction network includes a first sub-network, a first attention encoding network, a second sub-network and a third sub-network.

[0155] According to an embodiment of the present disclosure, the first input submodule may include a first input unit, a second input unit, a third input unit, and a fourth input unit.

[0156] The first input unit is used to input the masked sample sequence into the first sub-network to obtain a first processing result, wherein the first sub-network includes a first linear layer and a first normalization layer.

[0157] The second input unit is used to input the first processing result into the first attention encoding network to obtain a first encoding result.

[0158] The third input unit is used to input the first encoding result into the second sub-network to obtain a second processing result, wherein the second sub-network includes a second normalization layer, a second linear layer, a third normalization layer, a first random inactivation layer and a third linear layer.

[0159] The fourth input unit is used to input the second processing result into the third sub-network to obtain an output sample sequence, wherein the third sub-network includes a first gated recurrent unit, a second random inactivation layer, a fourth linear layer and a fifth linear layer.

[0160] According to an embodiment of the present disclosure, the first attention encoding network includes a first position encoding subnetwork and a first encoder, and the first encoder includes multiple first encoding blocks.

[0161] According to an embodiment of the present disclosure, the second input unit may include a first input sub-unit and a second input sub-unit.

[0162] The first input subunit is used to input the first processing result into the first position encoding subnetwork to obtain a position encoding sequence.

[0163] The second input subunit is used to input the position coding sequence into multiple first coding blocks in sequence to obtain a first coding result, wherein the first coding block includes a first attention layer, a first residual connection layer, a fourth normalization layer, a first feedforward connection layer, a second residual connection layer and a fifth normalization layer.

[0164] According to an embodiment of the present disclosure, the first adjustment submodule may include a first determining unit, a second determining unit, a first adjusting unit, and a third determining unit.

[0165] The first determining unit is configured to determine a second subsample sequence at a corresponding position in the first output sample sequence according to the masked first subsample sequence in the masked sample sequence.

[0166] The second determining unit is configured to determine a first difference between the first sub-sample sequence and the second sub-sample sequence.

[0167] The first adjustment unit is used to adjust the model parameters of the feature extraction network to converge the first difference.

[0168] The third determining unit is used to use the mask network and the feature extraction network in the first difference convergence case as a trained self-supervised learning module.

[0169] According to an embodiment of the present disclosure, the second training module 830 may include a second input submodule, a third input submodule, a second adjustment submodule, and a first determination submodule.

[0170] The second input submodule is used to input the sample vector to be calibrated into the trained self-supervised learning module to obtain a second output sample sequence.

[0171] The third input submodule is used to input the second output sample sequence into the timing calibration module to obtain a third output sample sequence.

[0172] The second adjustment submodule is used to adjust the model parameters of the timing calibration module according to the third output sample sequence and the reference sample sequence to obtain an adjusted timing calibration module.

[0173] The first determination submodule is used to determine a data calibration model based on the trained self-supervised learning module and the adjusted timing calibration module.

[0174] According to an embodiment of the present disclosure, the timing calibration module includes a fourth sub-network, a second attention encoding network, a fifth sub-network and a fully connected layer.

[0175] According to an embodiment of the present disclosure, the third input submodule may include a fifth input unit, a sixth input unit, a seventh input unit, and an eighth input unit.

[0176] The fifth input unit is used to input the second output sample sequence into the fourth sub-network to obtain a third processing result, wherein the fourth sub-network includes a sixth linear layer and a sixth normalization layer.

[0177] The sixth input unit is used to input the third processing result into the second attention encoding network to obtain a second encoding result, wherein the second attention encoding network includes a second position encoding subnetwork and a second encoder, the second encoder includes multiple second encoding blocks, and the second encoding block includes a second attention layer, a third residual connection layer, a seventh normalization layer, a second feedforward connection layer, a fourth residual connection layer and an eighth normalization layer.

[0178] The seventh input unit is used to input the second encoding result into the fifth sub-network to obtain a third processing result, wherein the fifth sub-network includes a third random deactivation layer, a seventh linear layer and an eighth linear layer.

[0179] The eighth input unit is used to input the third processing result into the fully connected layer to obtain a third output sample sequence.

[0180] According to an embodiment of the present disclosure, the second adjustment submodule may include a fourth determining unit, a second adjusting unit, and a fifth determining unit.

[0181] The fourth determining unit is configured to determine a second difference based on a root mean square difference and a shape distortion difference between the third output sample sequence and the reference sample sequence.

[0182] The second adjustment unit is used to adjust the model parameters of the timing calibration module to converge the second difference.

[0183] The fifth determining unit is configured to use the timing calibration model in the second difference convergence situation as the adjusted timing calibration model.

[0184] According to an embodiment of the present disclosure, the first acquisition module 810 may include a second determination submodule, a second processing submodule and a third processing submodule.

[0185] The second determination submodule is used to determine an initial sample sequence based on the data to be calibrated for the target object collected by the low-cost sensor, wherein the initial sample sequence includes a plurality of positions arranged in chronological order, and each position corresponds to the data of the target object and the data of at least one other object.

[0186] The second processing submodule is used to process the data of other objects at each position according to the relationship between the sampling rate of the data of other objects and a preset sampling rate threshold to obtain an intermediate sample sequence.

[0187] The third processing submodule is used to process the intermediate sample sequence according to the relationship between the data of other objects and the preset object threshold, so as to obtain the sample sequence to be calibrated.

[0188] Fig. 9 A block diagram of a low-cost gas sensor data calibration device according to an embodiment of the present disclosure is schematically shown.

[0189] like Fig. 9 As shown, the low-cost gas sensor data calibration device 900 may include a second acquisition module 910 , a processing module 920 and a calibration module 930 .

[0190] The second acquisition module 910 is used to acquire the data to be calibrated. The feature dimension of the data to be calibrated needs to be consistent with the feature dimension of the input data during training.

[0191] The processing module 920 is used to process the data to be calibrated to obtain a sequence to be calibrated.

[0192] The calibration module 930 is used to input the sequence to be calibrated into the data calibration model to obtain a data calibration result, wherein the data calibration model is trained using the data calibration model training device 800.

[0193] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0194] For example, any of the first acquisition module 810, the first training module 820 and the second training module 830, or any of the second acquisition module 910, the processing module 920 and the calibration module 930 can be combined in one module / unit / sub-unit for implementation, or any of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first acquisition module 810, the first training module 820 and the second training module 830, or the second acquisition module 910, the processing module 920 and the calibration module 930 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the first acquisition module 810, the first training module 820 and the second training module 830, or the second acquisition module 910, the processing module 920 and the calibration module 930 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.

[0195] It should be noted that the training device part of the data calibration model in the embodiment of the present disclosure corresponds to the training method part of the data calibration model in the embodiment of the present disclosure, and the description of the training device part of the data calibration model specifically refers to the training method part of the data calibration model, which will not be repeated here. The data calibration device part in the embodiment of the present disclosure corresponds to the data calibration method part in the embodiment of the present disclosure, and the description of the data calibration device part specifically refers to the data calibration method part, which will not be repeated here.

[0196] Fig.10 A block diagram of an electronic device suitable for implementing a training method for a data calibration model and a data calibration method according to an embodiment of the present disclosure is schematically shown. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0197] like Fig.10 As shown, the computer electronic device 1000 according to the embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1009 to the random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.

[0198] In RAM 1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0199] According to an embodiment of the present disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The electronic device 1000 may further include one or more of the following components connected to the input / output (I / O) interface 1005: an input portion 1006 including a keyboard, a mouse, etc.; an output portion 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk, etc.; and a communication portion 1009 including a network interface card such as a LAN card, a modem, etc. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the input / output (I / O) interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage portion 1008 as needed.

[0200] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0201] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0202] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0203] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 1002 and / or the RAM 1003 described above and / or one or more memories other than the ROM 1002 and the RAM 1003 .

[0204] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the training method of the data calibration model and the data calibration method provided by the embodiment of the present disclosure.

[0205] When the computer program is executed by the processor 1001, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0206] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0207] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0208] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0209] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A low-cost gas sensor data calibration model training method, comprising: Acquire a sample sequence to be calibrated and a reference sample sequence for the target object; Using the sample sequence to be calibrated to train the self-supervised learning module to obtain a trained self-supervised learning module; as well as While keeping the model parameters of the trained self-supervised learning module unchanged, the timing calibration module is trained using the sample sequence to be calibrated and the reference sample sequence to obtain a data calibration model for the target object.

2. The method according to claim 1, wherein: The self-supervised learning module includes a mask network and a feature extraction network; The step of training the self-supervised learning module by using the sample sequence to be calibrated to obtain a trained self-supervised learning module comprises: Using the mask network, according to a mask length determined based on a preset mask rate, the sample sequence to be calibrated is processed to obtain a masked sample sequence; Inputting the masked sample sequence into the feature extraction network to obtain a first output sample sequence; and According to the masked sample sequence and the first output sample sequence, the model parameters of the feature extraction network are adjusted to obtain the trained self-supervised learning module.

3. The method according to claim 2, wherein: The feature extraction network includes a first sub-network, a first attention encoding network, a second sub-network and a third sub-network; Inputting the masked sample sequence into the feature extraction network to obtain a first output sample sequence comprises: Inputting the masked sample sequence into the first sub-network to obtain a first processing result, wherein the first sub-network includes a first linear layer and a first normalization layer; Inputting the first processing result into the first attention encoding network to obtain a first encoding result; Inputting the first encoding result into the second sub-network to obtain a second processing result, wherein the second sub-network includes a second normalization layer, a second linear layer, a third normalization layer, a first random inactivation layer and a third linear layer; and The second processing result is input into the third sub-network to obtain the output sample sequence, wherein the third sub-network includes a first gated recurrent unit, a second random inactivation layer, a fourth linear layer and a fifth linear layer.

4. The method according to claim 3, wherein: The first attention encoding network includes a first position encoding subnetwork and a first encoder, and the first encoder includes a plurality of first encoding blocks; Inputting the first processing result into the first attention encoding network to obtain a first encoding result includes: Inputting the first processing result into the first position encoding subnetwork to obtain a position encoding sequence; and The position coding sequence is sequentially input into the multiple first coding blocks to obtain the first coding result, wherein the first coding block includes a first attention layer, a first residual connection layer, a fourth normalization layer, a first feedforward connection layer, a second residual connection layer and a fifth normalization layer.

5. The method according to claim 2, wherein: The step of adjusting the model parameters of the feature extraction network according to the masked sample sequence and the first output sample sequence to obtain the trained self-supervised learning module comprises: Determining a second subsample sequence at a corresponding position in the first output sample sequence according to a masked first subsample sequence in the masked sample sequence; determining a first difference between the first subsample sequence and the second subsample sequence; adjusting model parameters of the feature extraction network to converge the first difference; and The mask network and the feature extraction network in the first difference convergence condition are used as the trained self-supervised learning module.

6. The method according to any one of claims 1 to 5, wherein: The step of training the timing calibration module by using the sample sequence to be calibrated and the reference sample sequence while keeping the model parameters of the trained self-supervised learning module unchanged to obtain a data calibration model for the target object comprises: Inputting the sample vector to be calibrated into the trained self-supervised learning module to obtain a second output sample sequence; Inputting the second output sample sequence into the timing calibration module to obtain a third output sample sequence; adjusting the model parameters of the timing calibration module according to the third output sample sequence and the reference sample sequence to obtain an adjusted timing calibration module; and The data calibration model is determined based on the trained self-supervised learning module and the adjusted timing calibration module.

7. The method according to claim 6, wherein: The timing calibration module includes a fourth sub-network, a second attention encoding network, a fifth sub-network and a fully connected layer; Inputting the second output sample sequence into the timing calibration module to obtain a third output sample sequence comprises: Inputting the second output sample sequence into the fourth sub-network to obtain a third processing result, wherein the fourth sub-network includes a sixth linear layer and a sixth normalization layer; Inputting the third processing result into the second attention encoding network to obtain a second encoding result, wherein the second attention encoding network includes a second position encoding subnetwork and a second encoder, the second encoder includes a plurality of second encoding blocks, and the second encoding block includes a second attention layer, a third residual connection layer, a seventh normalization layer, a second feedforward connection layer, a fourth residual connection layer and an eighth normalization layer; Inputting the second encoding result to the fifth sub-network to obtain a third processing result, wherein the fifth sub-network includes a third random deactivation layer, a seventh linear layer, and an eighth linear layer; and The third processing result is input into the fully connected layer to obtain the third output sample sequence.

8. The method according to claim 6, wherein: The step of adjusting the model parameters of the timing calibration module according to the third output sample sequence and the reference sample sequence to obtain an adjusted timing calibration module comprises: determining a second difference based on a root mean square difference and a shape distortion difference between the third output sample sequence and the reference sample sequence; adjusting a model parameter of the timing calibration module to converge the second difference; and The timing calibration model obtained when the second difference converges is used as the adjusted timing calibration model.

9. The method according to claim 1, wherein: The obtaining of a to-be-calibrated sample sequence and a reference sample sequence for the target object comprises: Determine an initial sample sequence according to the to-be-calibrated data for the target object collected by the low-cost sensor, wherein the initial sample sequence includes a plurality of positions arranged in time sequence, and each of the positions corresponds to the data of the target object and the data of at least one other object; For each of the positions, according to the relationship between the sampling rate of the data of the other objects and a preset sampling rate threshold, the data of the other objects are processed to obtain an intermediate sample sequence; and According to the relationship between the data of the other objects and the preset object threshold, the intermediate sample sequence is processed to obtain the sample sequence to be calibrated.

10. A low-cost gas sensor data calibration method, comprising: Acquire data to be calibrated, wherein the feature dimension of the data to be calibrated is consistent with the feature dimension of input data during training; Processing the data to be calibrated to obtain a sequence to be calibrated; and The sequence to be calibrated is input into a data calibration model to obtain a data calibration result, wherein the data calibration model is trained using the method according to claims 1 to 9.

Citation Information

Patent Citations

  • Metal-oxide gas sensor array concentration detecting method based on drift compensation

    CN102944583A

  • Remote calibration method and system for gas sensor

    CN111812181A

  • Gas sensing device and method for determining calibrated measurement of concentration of target gas

    CN114778609A

  • Gas sensing device and method for determining calibrated measurement of concentration of target gas

    CN115219651A

  • IMU original data denoising method based on self-supervised learning neural network model

    CN116628421A