Low cost gas sensor data calibration method based on supervised learning

By combining self-supervised learning and a time-series calibration module, a data calibration model is constructed, which solves the drift and accuracy degradation problems of low-cost gas sensors under environmental changes, and improves the accuracy and stability of data calibration.

CN119310242BActive Publication Date: 2025-12-16INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Low-cost gas sensors are susceptible to environmental conditions during deployment and use, leading to drift and decreased accuracy, making it difficult to avoid data quality issues.

Method used

By combining a self-supervised learning module and a time-series calibration module, a data calibration model is constructed using the sequence of samples to be calibrated and a reference sample sequence for training. This model captures the spatiotemporal invariant distribution pattern of gas sensor measurement data, thereby improving the accuracy of data calibration.

Benefits of technology

This improves the data calibration accuracy of low-cost gas sensors and enhances measurement accuracy and stability under environmental changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119310242B_ABST
    Figure CN119310242B_ABST
Patent Text Reader

Abstract

The 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 sensing technology. The training method of the data calibration model comprises: obtaining a to-be-calibrated sample sequence and a reference sample sequence for a target object; training a self-supervised learning module using the to-be-calibrated sample sequence to obtain a trained self-supervised learning module; and training a time sequence calibration module using the to-be-calibrated sample sequence 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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of computer technology and sensing technology, and more specifically, to a low-cost gas sensor data calibration method based on supervised learning. Background Technology

[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 agricultural production scenarios, combining IoT technology with gas sensors (such as hydrogen sulfide (H2S) sensors, ammonia (NH3) sensors, and fine particulate matter (PM2.5) sensors) enables remote monitoring of various gas components in the environment and data collection. 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, with their advantages of high temporal resolution, low cost, and ease of deployment, have become the preferred choice for agricultural production monitoring.

[0004] However, low-cost gas sensors are not calibrated at the factory, and as they are deployed and used over time, the performance of their sensitive materials is affected by environmental conditions, making it difficult for gas sensors to avoid data quality problems such as drift and decreased accuracy.

[0005] In realizing this disclosed concept, the inventors discovered that the variation patterns of sensitive materials can be determined through specific experimental procedures. Environmental factors within the same scenario exhibit a certain time periodicity, thus the measurement data from low-cost gas sensors possess inherent distribution patterns. Post-deployment calibration can be used to optimize the data from low-cost environmental gas sensors.

[0006] Therefore, the inventors considered that they could model and mine the spatiotemporally invariant distribution patterns of measurement data based on self-supervised deep learning networks, and then use the measurement values ​​obtained by environmental base stations or high-precision sensors 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, thus forming an environmental modeling calibration scheme. Summary of the Invention

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

[0008] According to one aspect of this disclosure, a training method for a low-cost gas sensor data calibration model is provided, comprising: acquiring a sequence of samples to be calibrated and a reference sequence for a target object; training a self-supervised learning module using the sequence of samples 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 time-series calibration module using the sequence of samples to be calibrated and the reference sequence to obtain a data calibration model for the target object.

[0009] According to embodiments of this disclosure, the self-supervised learning module includes a masking network and a feature extraction network.

[0010] According to embodiments of this disclosure, training the self-supervised learning module using the sample sequence to be calibrated to obtain the trained self-supervised learning module includes: processing the sample sequence to be calibrated using the masking network according to a mask length determined based on a preset masking rate to obtain a masked sample sequence; inputting the masked sample sequence into the feature extraction network to obtain a first output sample sequence; and 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.

[0011] According to embodiments of this disclosure, the 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 embodiments of this disclosure, the above-mentioned inputting the masked sample sequence into the feature extraction network to obtain a first output sample sequence includes: 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 deactivation layer, and a third linear layer; and inputting the second processing result into the third sub-network to obtain the above-mentioned output sample sequence, wherein the third sub-network includes a first gated recurrent unit, a second random deactivation layer, a fourth linear layer, and a fifth linear layer.

[0013] According to embodiments of this disclosure, the first attention coding network includes a first position coding subnetwork and a first encoder, wherein the first encoder includes a plurality of first coding blocks.

[0014] According to an embodiment of this disclosure, the above-mentioned inputting the first processing result into the first attention encoding network to obtain the first encoding result includes: inputting the first processing result into the first position encoding sub-network to obtain a position encoding sequence; and sequentially inputting the position encoding sequence into the plurality of first encoding blocks to obtain the first encoding result, wherein the 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 embodiments of this disclosure, adjusting the model parameters of the feature extraction network based on the masked sample sequence and the first output sample sequence to obtain the trained self-supervised learning module includes: determining a second sub-sample sequence at a corresponding position in the first output sample sequence based on 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 masked network and the feature extraction network under the condition of convergence of the first difference as the trained self-supervised learning module.

[0016] According to embodiments of this disclosure, the above-mentioned method of training a time-series 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, to obtain a data calibration model for the target object, includes: 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 time-series calibration module to obtain a third output sample sequence; adjusting the model parameters of the time-series calibration module based on the third output sample sequence and the reference sample sequence to obtain an adjusted time-series calibration module; and determining the data calibration model based on the trained self-supervised learning module and the adjusted time-series calibration module.

[0017] According to embodiments of this disclosure, the timing calibration module includes a fourth sub-network, a second attention coding network, a fifth sub-network, and a fully connected layer.

[0018] According to embodiments of this disclosure, the above-mentioned inputting the second output sample sequence to the timing calibration module to obtain the third output sample sequence includes: inputting the second output sample sequence to 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 to the second attention coding network to obtain a second coding result, wherein the second attention coding network includes a second position coding sub-network and a second encoder, wherein the second encoder includes a plurality of second coding blocks, wherein the second coding 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 coding 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 inputting the third processing result to the fully connected layer to obtain the third output sample sequence.

[0019] According to embodiments of this disclosure, adjusting the model parameters of the time-series calibration module based on the third output sample sequence and the reference sample sequence to obtain an adjusted time-series calibration module includes: determining a second difference based on the root mean square difference and shape distortion difference between the third output sample sequence and the reference sample sequence; adjusting the model parameters of the time-series calibration module to converge the second difference; and using the time-series calibration model under the condition of convergence of the second difference as the adjusted time-series calibration model.

[0020] According to embodiments of this disclosure, obtaining the calibration sample sequence and reference sample sequence for the target object includes: determining an initial sample sequence based on calibration data for the target object collected by a low-cost sensor, wherein the initial sample sequence includes multiple positions arranged in chronological order, each position corresponding to data of the target object and data of at least one other object; for each position, processing the data of the other object based on the relationship between the sampling rate of the other object and a preset sampling rate threshold to obtain an intermediate sample sequence; and processing the intermediate sample sequence based on the relationship between the data of the other object and a preset object threshold to obtain the calibration sample sequence.

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

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

[0023] According to another aspect of this disclosure, a computer-readable storage medium is provided having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods described in this disclosure.

[0024] According to another aspect of this disclosure, a computer program product is provided, which includes computer-executable instructions that, when executed, are used to perform the methods described in this disclosure.

[0025] According to embodiments of this disclosure, a relatively general data calibration model is established by combining a model structure of self-supervised learning and supervised learning with reference sample sequences, using a large number of target object calibration sample sequences. This aims to construct a general data calibration model for low-cost gas sensors in environments where true values ​​are unavailable or limited. In this process, the spatiotemporally invariant distribution patterns of the calibration sample sequences are mined through modeling using a self-supervised deep learning network. Then, reference sample sequences acquired by environmental base stations or high-precision sensors are used as a reference to construct a data calibration model that captures the shared information and intrinsic relationships between the calibration sample sequences and the reference sample sequences. This improves the quality of the final data calibration model and helps enhance the accuracy of subsequent data calibration. Attached Figure Description

[0026] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0027] Figure 1 The schematic diagram illustrates a training method and a system architecture for a low-cost gas sensor data calibration model that can be applied according to embodiments of the present disclosure;

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

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

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

[0031] Figure 5A The illustration shows an example diagram of the training process of a self-supervised learning module according to an embodiment of the present disclosure;

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

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

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

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

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

[0037] Figure 9 A block diagram of a low-cost gas sensor data calibration apparatus according to embodiments of the present disclosure is schematically shown; and

[0038] Figure 10 A block diagram of an electronic device suitable for implementing a low-cost gas sensor data calibration model and an embodiment of the present disclosure is shown schematically. Detailed Implementation

[0039] The embodiments of the present disclosure will now 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 disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0040] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

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

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

[0043] In the technical solution of this invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information) 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. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0044] A gas sensor is a device that converts information such as the composition and concentration of gases into data that can be used by users, instruments, and computers. By integrating IoT technology into 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 have become the preferred choice in agricultural production scenarios due to their advantages such as high time resolution, low cost, and ease of deployment.

[0046] In realizing the present invention, the inventors discovered at least the following problems in the related technology: as the deployment and use time increases, the performance of the sensitive material of the low-cost gas sensor is easily affected by environmental conditions, which inevitably leads to data quality problems such as drift and decreased accuracy.

[0047] To at least partially address the technical problems existing in related technologies, this 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 for this low-cost gas sensor data calibration model includes: acquiring a sequence of samples to be calibrated and a reference sample sequence for the target object; training a self-supervised learning module using the sequence of samples 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 time-series calibration module using the sequence of samples to be calibrated and the reference sample sequence to obtain a data calibration model for the target object.

[0048] Figure 1 The illustration schematically depicts a training method for a low-cost gas sensor data calibration model and a system architecture for the low-cost gas sensor data calibration method, according to embodiments of the present disclosure. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this 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 serves as a medium for providing communication links 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 or wireless communication links, or fiber optic cables, etc.

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

[0051] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0052] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received 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 devices.

[0053] It should be noted that the training method and calibration method for the low-cost gas sensor data calibration model provided in this disclosure can generally be executed by server 105. Correspondingly, the training device and calibration device for the low-cost gas sensor data calibration model provided in this disclosure can generally be located in server 105. The training method and calibration method for the low-cost gas sensor data calibration model provided in this disclosure can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the training device and calibration device for the low-cost gas sensor data calibration model provided in this disclosure can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0054] Alternatively, the training method and calibration method for the low-cost gas sensor data calibration model provided in this disclosure can also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Correspondingly, the training device and calibration device for the low-cost gas sensor data calibration model provided in this disclosure can also be located in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or 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 shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0056] It should be noted that the sequence numbers of the operations in the following methods are for descriptive purposes only and should not be considered as indicating the execution order of the operations. Unless explicitly stated otherwise, the method does not need to be executed in the exact order shown.

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

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

[0059] In operation S210, the sample sequence to be calibrated and the reference sample sequence for the target object are obtained.

[0060] In operation S220, the self-supervised learning module is trained using the sequence of samples to be calibrated, resulting in a trained self-supervised learning module.

[0061] In operation S230, while keeping the model parameters of the trained self-supervised learning module unchanged, the time-series 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 can refer to the ambient gas to be measured. The reference sample sequence refers to the accurate label of the measured ambient gas. The calibration sample sequence refers to a sequence of ambient gases with lower accuracy. The methods for obtaining the calibration sample sequence and the reference sample sequence can be configured according to actual business needs and are not limited here. For example, low-cost sensors can be used to collect calibration data of the ambient gas, and this data can be processed to obtain the calibration sample sequence. Alternatively, reference data of the ambient gas can be collected using a standard data acquisition station, and this reference data can be processed to obtain the reference sample sequence.

[0063] Data calibration models can be used to calibrate sequences to obtain accurate results. The training process of a data calibration model includes a self-supervised learning phase and an exact time-series calibration phase. The self-supervised learning phase is used to train a trained self-supervised learning module. The exact time-series calibration phase is used to train the data calibration model with the model parameters of the trained self-supervised learning module fixed.

[0064] In the self-supervised learning stage, the self-supervised learning module can be trained using the sequence of samples to be calibrated, resulting in 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: input layer, feature extraction layer, aggregation layer, loss function, and output layer.

[0065] In a specific example, a self-supervised learning module can be constructed using a self-attention encoding mechanism and a gated recurrent unit. This allows the module to learn the complex distribution patterns of time-series data collected by a large number of low-cost gas sensors as they change over time and in the environment, and to 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. Using the sample sequence to be calibrated and the reference sample sequence, the timing calibration module is trained 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: linear layer, normalization layer, attention encoding network, random deactivation layer, gated recurrent unit, attention layer, feedforward connection layer, and fully connected layer.

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

[0068] According to embodiments of this disclosure, a relatively general data calibration model is established by combining a model structure of self-supervised learning and supervised learning with reference sample sequences, using a large number of target object calibration sample sequences. This aims to construct a general data calibration model for low-cost gas sensors in environments where true values ​​are unavailable or limited. In this process, the spatiotemporally invariant distribution patterns of the calibration sample sequences are mined through modeling using a self-supervised deep learning network. Then, reference sample sequences acquired by environmental base stations or high-precision sensors are used as a reference to construct a data calibration model that captures the shared information and intrinsic relationships between the calibration sample sequences and the reference sample sequences. This improves the quality of the final data calibration model and helps enhance the accuracy of subsequent data calibration.

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

[0070] Figure 3 The illustration shows an example schematic diagram of the process for obtaining a sample sequence to be calibrated according to an embodiment of the present disclosure.

[0071] like Figure 3 As shown in section 300, a low-cost sensor 301 can be used to collect calibration data 302 for the target object, and an initial sample sequence 303 can be determined based on the calibration data 302. The initial sample sequence 303 may include multiple positions arranged in chronological order, each position corresponding to data of the target object and data of at least one other object. For example, taking the second position 304 as an example, 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 review and the types of environmental sensors deployed in actual production sites, or it can be determined based on all quantifiable factors in the environment. The initial sample sequence 303 can be denoted as X. ori .

[0073] After obtaining the initial training sample 303, time alignment and outlier removal can be performed on this initial training sample 303. Time alignment refers to unifying the number of measurement points for each environmental parameter to address the issue of different sampling rates for different environmental parameters. Outlier removal refers to removing outliers from the data at each time point to obtain usable data.

[0074] For example, during time alignment, for position 304, the data 304_2 of other objects can be processed based on the relationship between the sampling rate of the data 304_2 of other objects and the preset sampling rate threshold 305 to obtain an intermediate sample sequence 306. In one example, the sampling rate of the data to be calibrated can be used as the standard. Data with too low a sampling rate is padded with cubic spline interpolation, and data with too high a sampling rate is coarsened using the mean. The final data length is fixed at M, which is related to the time interval and is preferably more than 100,000.

[0075] Alternatively, during outlier removal, the intermediate sample sequence 306 can be processed based on the relationship between the data of other objects 304_2 and the preset object threshold 307 to obtain the sample sequence 308 to be calibrated. 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 usable data. Assuming there are N quantifiable interference factors, including the sensor's own measurement values, the sample sequence 308 to be calibrated can be denoted as X. pred Its dimensions are M×N.

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

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

[0078] like Figure 4 As shown, in 400, the calibration data 401 and reference data of the target object can be obtained, and the calibration sample sequence 402 corresponding to the calibration data and the reference sample sequence 405 corresponding to the reference data can be determined respectively.

[0079] In the self-supervised learning stage, the self-supervised learning module 403 can be trained using the sample sequence 402 to be calibrated, resulting in a trained self-supervised learning module 404.

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

[0081] Figure 5A The illustration shows an example diagram of the training process of a self-supervised learning module according to an embodiment of the present disclosure.

[0082] like Figure 5AAs shown, in the 500A, the self-supervised learning module can achieve feature extraction and enhancement based on a combination of self-attention encoding mechanism, multilinear layers, and gated recurrent units. For example, the self-supervised learning module may include a masking 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 masking network 502 can be used for masking operations, the first sub-network 504 can be used for shallow feature learning, the first attention encoding network 505 can be used for attention encoding, the second sub-network 506 can be used for feature consolidation, and the third sub-network 507 can be used for temporal feature relearning.

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

[0085] After obtaining the masked sample sequence 503, the first sub-network 504, the first attention coding network 505, the second sub-network 506, and the third sub-network 507 can be used sequentially to process the masked sample sequence 503 to obtain the output sample sequence 508. The specific structures of the first sub-network 504, the first attention coding 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 subnetwork 504 maps the masked sample sequence 503 to the hidden representation X through learnable embedding modules. 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 is transformed. mask ∈R M×N Embedding, to obtain X E ∈R M×SThe first processing result. S represents the dimension of the hidden embedding. The first normalization layer 504_2 can employ layer normalization to calculate the mean and variance of the output features of the linear layer neurons and normalize the output based on these statistics. Layer normalization is an effective regularization method that can improve the training process by reducing the internal covariate bias.

[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 deactivation layer 506_4, and a third linear layer 506_5. The second normalization layer 506_1 and the third normalization layer 506_3 may employ layer normalization, and the dropout rate of the first random deactivation layer 506_4 (i.e., the dropout layer) may be 0.2. A second processing result is obtained by inputting the first encoding result processed by the first attention encoding network 505 into the second sub-network 506.

[0088] Alternatively, the third sub-network 507 may include a first gated recurrent unit 507_1, a second random deactivation 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, the output sample sequence 508 is obtained. The dropout rate of the second random deactivation layer 507_2 (i.e., the dropout layer) can be 0.2.

[0089] According to embodiments of this disclosure, preliminary processing of the masked sample sequence using a first linear layer and a first normalization layer of a first sub-network helps extract useful features from the original data and reduces data redundancy. Processing the first processing result using a first attention encoding network focuses on important parts of the input, improving the ability to capture key features. Strengthening the first encoding result using a second sub-network and relearning the temporal features of the second processing result using a third sub-network enhances the model's feature extraction and representation capabilities.

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

[0091] like Figure 5B As shown, in 500B, x t h represents the input data at the current moment. t-1 The output represents the hidden state at time t-1. The structure of the first gated recurrent unit 507_1 can include update gates and reset gates, using update gating to implement forgetting and selective memory in the neural network.

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

[0093]

[0094] in, The gating update signal represents the degree to which candidate hidden states are remembered. Representing the implicit state of history The input data at time t, Characterizing the 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 represented by equation (2) below.

[0096]

[0097] in, This represents the reset signal; a larger value indicates that more historical information needs to be remembered. This is the weight matrix.

[0098] The candidate hidden state is responsible for fusing 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 time can be represented by the following equations (3) and (4).

[0099]

[0100] in, Represents the candidate latent state at the current moment. Represents the implicit output state at the current moment. Characterizing the forgetting process, The closer it is to 1, the more information from the previous moment will be forgotten; Representing the memory process, The size of the value determines the degree to which candidate latent states are remembered.

[0101] Figure 5C An example schematic diagram of a first attention encoding network according to an embodiment of the present disclosure is 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 can be 3.

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

[0104]

[0105] in, Characterizing positional coding sequences, This represents the current position of the data in the sequence. The dimension representing the position-encoded sequence. The dimension representing even numbers, , Representing odd-numbered dimensions, .

[0106] After obtaining the position encoding sequence, the position encoding sequence can be sequentially input into multiple sequentially connected first encoding blocks 505_2 to obtain the first encoding result 510. The specific structure of the first encoding block 505_2 can be configured according to actual business needs and is not limited here. For example, the first encoding 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 employ a multi-head attention mechanism, including multiple self-attention layers. The input to the self-attention layer is the sum of the outputs of the word embedding encoding and the positional encoding, denoted as X. input_attention For example, a linear matrix W can be used. Q W K and W V Q, K, and V are calculated to determine the output of the self-attention layer. The output of the self-attention layer is calculated as shown in equation (7).

[0108]

[0109] in, Let Q and K be the number of columns, i.e., the vector dimensions. To prevent the inner product from becoming too large, we can calculate the inner product of the vectors in each row of matrices Q and K and divide by . The square root of.

[0110] In the first attention layer 509_1, the input X can be... input_attention The signals are passed to multiple different self-attention points, and multiple output matrices X are calculated. attention_z They are concatenated together using a multi-head attention mechanism and then fed into a linear layer to obtain the final output X of the multi-head attention mechanism. attention_m The matrix X output by the multi-head attention mechanism attention_m With its input matrix X input_attention They have the same dimensions.

[0111] In another example, the first residual connection layer 509_2 allows the deep network to focus on learning the difference between input and output (i.e., the residual), making it easier to learn the changes introduced by the first attention layer 509_1. The fourth normalization layer 509_3 transforms the inputs of neurons in the previous layer into those with the same mean and variance, thereby accelerating 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 feedforward layer 509_4 can be two fully connected layers. The first fully connected layer uses ReLU activation, while the second fully connected layer does not use an activation function. The input to the first feedforward layer 509_4 is the output X of the fourth normalization layer 509_3. L The output of the first feedforward connection layer 509_4 is X F The calculation method for the first feedforward connection layer 509_4 is shown in the following formula (8).

[0113]

[0114] in, It is the coefficient matrix of the first fully connected layer. It is the bias of the first fully connected layer. It 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 the input and output (i.e., the residual), making it easier to learn the changes introduced by the first feedforward connection layer 509_4. The fifth normalization layer 509_6 can transform the inputs of the neurons in the previous layer into those with 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 embodiments of this disclosure, by inputting the first processing result into the first positional encoding subnetwork, positional information can be effectively added to the input data, thereby helping the model understand the order and relative relationships of the data and improving the contextual understanding ability of the sequence. Furthermore, by utilizing multiple first encoding blocks to process the positional encoding sequence layer by layer, the complex relationships in the data can be captured more comprehensively, enhancing the expressive power of the first encoding result.

[0117] See also Figure 5A After obtaining the first output sample sequence 508, a second sub-sample sequence at the corresponding position in the first output sample sequence 508 can be determined based on the masked first sub-sample sequence in the masked sample sequence 503. A first difference between the first and second sub-sample sequences is determined. The model parameters of the feature extraction network are adjusted to make the first difference converge. Based on this, the masking network 502 and the feature extraction network under the condition 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) metric. The model can be implemented on the PyTorch platform, with a training dataset to test dataset ratio of 8:2. The model's hyperparameters can be set as follows: batch size of 64, epochs of 100, and the optimization function Adam. Finally, the model parameters of the self-supervised learning module that achieves the minimum loss on the training set will be saved in pt format.

[0119] According to embodiments of this disclosure, by utilizing a masked first sub-sample sequence in a masked sample sequence to determine a second sub-sample sequence, and identifying a first difference between the first and second sub-sample sequences, the model can focus on changes in important features and signals, enhancing the identification and understanding of potential information in the data. Based on this, 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 The illustration shows an example schematic diagram of the training process of a timing calibration module according to an embodiment of the present disclosure.

[0121] like Figure 6As shown in Figure 600, the temporal calibration module can achieve feature decoding and measurement calibration based on a combination of attention decoding mechanism and multilinear layers. For example, the temporal 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 shallow feature 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, it can be input into the trained self-supervised learning module 602 to obtain the second output sample sequence. The trained self-supervised learning module 602 can be the model structure saved in the self-supervised learning stage, and its parameters are frozen in the precise temporal calibration stage.

[0123] After obtaining the second output sample sequence, the fourth sub-network 604, the second attention coding network 605, the fifth sub-network 607, and the fully connected layer 608 can be used to process the second output sample sequence sequentially to obtain the third output sample sequence 609. The specific structure of the fourth sub-network 604, the second attention coding 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 elaborated here.

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

[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 can 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, the second encoding result is obtained.

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

[0127] According to embodiments of this disclosure, preliminary processing of the second output sample sequence using the sixth linear layer and sixth normalization layer of the fourth sub-network helps extract useful features from the original data and reduces data redundancy. Processing the third processing result using a second attention encoding network focuses on important parts of the input, improving the ability to capture key features. Strengthening the second encoding result using a fifth sub-network enhances the model's feature extraction and representation capabilities.

[0128] After obtaining the third output sample sequence 609, the second difference can be determined based on the root mean square difference and shape distortion difference between the third output sample sequence 609 and the reference sample sequence. The model parameters of the time series calibration module are adjusted to make the second difference converge. Based on this, the time series calibration model with the second difference converged can be used as the adjusted time series 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 index that combines root mean square error and shape and time distortion loss. The calculation method of the second difference can be shown in the following equation (9).

[0130]

[0131] in, Characterizing the root mean square error loss, Characterizing shape and temporal distortion loss, It is 0.095. It is 0.9.

[0132] The model can also be implemented using the PyTorch platform. The ratio of the training dataset to the test dataset 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 time calibration module that achieves the minimum loss on the training set will be saved in pt format.

[0133] According to embodiments of this disclosure, by implementing parameter freezing on a trained self-supervised learning module and using a third output sample sequence and a reference sample sequence to train an accurate time-series calibration module, the time-series calibration module can be effectively driven to converge toward a better 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. Other training methods for data calibration models known in the art may also be included, as long as they can improve the quality of the data calibration model.

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

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

[0137] When operating the S710, acquire the data to be calibrated. The feature dimensions of the data to be calibrated need to be consistent with the feature dimensions of the input data during training.

[0138] The S720 is used to process the data to be calibrated, resulting in the calibration sequence.

[0139] When operating S730, the sequence to be calibrated is input into the data calibration model to obtain the data calibration result. The data calibration model is trained using the data calibration model training method.

[0140] The data to be calibrated refers to the measurement data acquired by a low-cost gas sensor. After obtaining the data to be calibrated, it can be processed to obtain the calibration sequence. The dimension of the calibration sequence is M×N. For example, based on the data to be calibrated, an initial sequence can be determined, which includes multiple positions arranged in chronological order, each position corresponding to data of the target object and data of at least one other object. For each position, based on the relationship between the sampling rate of the other object's data and a preset sampling rate threshold, the data of the other object is processed to obtain an intermediate sequence. Based on this, the intermediate sequence is processed according to the relationship between the data of the other object and a preset object threshold to obtain the calibration sequence.

[0141] After obtaining the calibration sequence, the batch-size can be set to 1 to load the trained data calibration model. The trained data calibration model is then used to calibrate the calibration sequence of measurement data collected by the low-cost gas sensor, yielding calibration results comparable to those of a high-precision sensor.

[0142] According to embodiments of this disclosure, by using a soft-to-hard approach to calibrate the calibration data of a low-cost gas sensor, the accuracy of the obtained calibration results can be improved, thereby increasing the detection accuracy and lifespan of the low-cost gas sensor and achieving cost reduction and efficiency improvement.

[0143] The above are merely exemplary embodiments, but are not limited thereto. Other data calibration methods known in the art may also be included, as long as they can improve the accuracy of the data calibration results.

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

[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 the sample sequence to be calibrated and the reference sample sequence for the target object.

[0147] The first training module 820 is used to train the self-supervised learning module using the sequence of samples to be calibrated, so as to obtain the trained self-supervised learning module.

[0148] The second training module 830 is used to train the time-series 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 embodiments of this disclosure, the self-supervised learning module includes a masking network and a feature extraction network.

[0150] According to embodiments of this 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 using a masking network and according to the mask length determined based on a preset masking 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 the first output sample sequence.

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

[0154] According to embodiments of this 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 embodiments of this 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 the 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 the first encoding result.

[0158] The third input unit is used to input the first encoding result into the second sub-network to obtain the second processing result. The second sub-network includes a second normalization layer, a second linear layer, a third normalization layer, a first random deactivation 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 the output sample sequence. The third sub-network includes a first gated recurrent unit, a second random deactivation layer, a fourth linear layer, and a fifth linear layer.

[0160] According to embodiments of this disclosure, the first attention coding network includes a first position coding subnetwork and a first encoder, the first encoder including a plurality of first coding blocks.

[0161] According to embodiments of this disclosure, the second input unit may include a first input subunit and a second input subunit.

[0162] The first input sub-unit is used to input the first processing result into the first position coding sub-network to obtain the position coding sequence.

[0163] The second input subunit is used to sequentially input the position encoding sequence into multiple first encoding blocks to obtain a first encoding result. The 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.

[0164] According to embodiments of this 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 used to determine the second sub-sample sequence at the corresponding position in the first output sample sequence based on the masked first sub-sample sequence in the masked sample sequence.

[0166] The second determining unit is used to determine the first difference between the first subsample sequence and the second subsample sequence.

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

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

[0169] According to embodiments of this 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 the 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 the third output sample sequence.

[0172] The second adjustment submodule is used to adjust the model parameters of the time series calibration module based on the third output sample sequence and the reference sample sequence, so as to obtain the adjusted time series calibration module.

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

[0174] According to embodiments of this disclosure, the timing calibration module includes a fourth sub-network, a second attention coding network, a fifth sub-network, and a fully connected layer.

[0175] According to embodiments of this 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 the third processing result. 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 coding network to obtain the second coding result. The second attention coding network includes a second position coding sub-network and a second encoder. The second encoder includes multiple second coding blocks. The second coding 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 the third processing result. 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 the third output sample sequence.

[0180] According to embodiments of this 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 used to determine the second difference based on the root mean square difference and 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 so that the second difference converges.

[0183] The fifth determining unit is used to take the time series calibration model under the second difference convergence case as the adjusted time series calibration model.

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

[0185] The second determining submodule is used to determine an initial sample sequence based on the calibration data of the target object collected by the low-cost sensor. The initial sample sequence includes multiple positions arranged in chronological order, each position corresponding 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 location based on the relationship between the sampling rate of the data of other objects and the preset sampling rate threshold, so as to obtain an intermediate sample sequence.

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

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

[0189] like Figure 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, and the feature dimensions of the data to be calibrated need to be consistent with the feature dimensions of the input data during training.

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

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

[0193] Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be implemented by dividing them into multiple modules. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as hardware circuitry, such as a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a System-on-Chip, a System-on-a-Substrate, a System-on-Package, an Application-Specific Integrated Circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.

[0194] For example, any multiple 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 combined into one module / unit / subunit, or any one of these modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least some of the functionality of one or more of these modules / units / subunits can be combined with at least some of the functionality of other modules / units / subunits and implemented in one module / unit / subunit. According to embodiments of this 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 hardware circuitry, 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-package, an application-specific integrated circuit (ASIC), or any other reasonable method of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. 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, which, when run, can perform corresponding functions.

[0195] It should be noted that the training device part of the data calibration model in the embodiments of this disclosure corresponds to the training method part of the data calibration model in the embodiments of this disclosure. For a detailed description of the training device part of the data calibration model, please refer to the training method part of the data calibration model, and it will not be repeated here. Similarly, the data calibration device part in the embodiments of this disclosure corresponds to the data calibration method part of the embodiments of this disclosure. For a detailed description of the data calibration device part, please refer to the data calibration method part, and it will not be repeated here.

[0196] Figure 10 A block diagram illustrating a training method for implementing a data calibration model and an electronic device for implementing the data calibration method, according to embodiments of the present disclosure, is shown schematically. Figure 10 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0197] like Figure 10 As shown, a computer electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage portion 1009 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include 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 an embodiment of the present disclosure.

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

[0199] According to embodiments of this disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to a bus 1004. The electronic device 1000 may also include one or more of the following components connected to the input / output (I / O) interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 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 disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.

[0200] According to embodiments of this disclosure, the method flow according to embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by processor 1001, it performs the functions defined in the system of embodiments of this disclosure. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0201] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0202] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

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

[0204] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this disclosure. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the training method and data calibration method of the data calibration model provided in the embodiments of this disclosure.

[0205] When the computer program is executed by the processor 1001, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

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

[0207] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0208] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not expressly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0209] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A training method for a low-cost gas sensor data calibration model, comprising: Acquire a calibrated sample sequence and a reference sample sequence for the target object, wherein the calibrated sample sequence is a measurement value acquired by a low-cost gas sensor, and the reference sample sequence is a reference value acquired by an environmental base station or a high-precision sensor; The self-supervised learning module is trained using the sample sequence to be calibrated to extract the spatiotemporally invariant distribution pattern of the sample sequence, resulting in a trained self-supervised learning module; and While keeping the model parameters of the trained self-supervised learning module unchanged, the time-series calibration module is trained using the sample sequence to be calibrated and the reference sample sequence to capture the shared information and intrinsic relationship between the measured values ​​and the reference values, thereby obtaining a data calibration model for the target object. This includes: 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 time-series calibration module to obtain a third output sample sequence; adjusting the model parameters of the time-series calibration module based on the third output sample sequence and the reference sample sequence to obtain an adjusted time-series calibration module; and determining the data calibration model based on the trained self-supervised learning module and the adjusted time-series calibration module. The data calibration model is used to calibrate the measurement data collected by the low-cost gas sensor to obtain a data calibration result with accuracy comparable to that of the environmental base station or the high-precision sensor.

2. The method according to claim 1, wherein, The self-supervised learning module includes a masking network and a feature extraction network; The step of training the self-supervised learning module using the sample sequence to be calibrated, in order to extract the spatiotemporally invariant distribution pattern of the sample sequence to be calibrated, and obtaining the trained self-supervised learning module includes: Using the masking network, the sample sequence to be calibrated is processed according to the mask length determined based on a preset masking rate to obtain a masked sample sequence; The masked sample sequence is input into the feature extraction network to obtain a first output sample sequence; and Based on 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; The step of inputting the masked sample sequence into the feature extraction network to obtain the first output sample sequence includes: The masked sample sequence is input 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; The first processing result is input into the first attention encoding network to obtain the first encoding result; The first encoding result is input 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 deactivation 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 deactivation layer, a fourth linear layer, and a fifth linear layer.

4. The method according to claim 3, wherein, The first attention coding network includes a first position coding subnetwork and a first encoder, wherein the first encoder includes a plurality of first coding blocks; The step of inputting the first processing result into the first attention encoding network to obtain the first encoding result includes: The first processing result is input into the first position encoding sub-network to obtain the position encoding sequence; and The position encoding sequence is sequentially input into the plurality of first encoding blocks to obtain the first encoding result, wherein the 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.

5. The method according to claim 2, wherein, The step of adjusting the model parameters of the feature extraction network based on the masked sample sequence and the first output sample sequence to obtain the trained self-supervised learning module includes: Based on the first sub-sample sequence that is masked in the masked sample sequence, determine the second sub-sample sequence at the corresponding position in the first output sample sequence; Determine the first difference between the first subsample sequence and the second subsample sequence; Adjust the model parameters of the feature extraction network to bring the first difference to convergence; and The masking network and the feature extraction network under the first difference convergence condition are used as the trained self-supervised learning module.

6. The method according to claim 1, wherein, The timing calibration module includes a fourth sub-network, a second attention coding network, a fifth sub-network, and a fully connected layer; The step of inputting the second output sample sequence into the timing calibration module to obtain the third output sample sequence includes: The second output sample sequence is input into the fourth sub-network to obtain the third processing result, wherein the fourth sub-network includes a sixth linear layer and a sixth normalization layer; The third processing result is input into the second attention coding network to obtain the second coding result. The second attention coding network includes a second position coding sub-network and a second encoder. The second encoder includes multiple second coding blocks. The second coding 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. The second encoding result is input 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; and The third processing result is input into the fully connected layer to obtain the third output sample sequence.

7. The method according to claim 1, wherein, The step of adjusting the model parameters of the time series calibration module based on the third output sample sequence and the reference sample sequence to obtain the adjusted time series calibration module includes: The second difference is determined based on the root mean square difference and shape distortion difference between the third output sample sequence and the reference sample sequence; Adjust the model parameters of the timing calibration module to bring the second difference to convergence; and The time-series calibration model under the second difference convergence condition is used as the adjusted time-series calibration model.

8. The method according to claim 1, wherein, The process of obtaining the calibration sample sequence and the reference sample sequence for the target object includes: Based on the calibration data of the target object collected by the low-cost sensor, an initial sample sequence is determined, wherein the initial sample sequence includes multiple positions arranged in chronological order, and each position corresponds to data of the target object and data of at least one other object. For each of the aforementioned locations, based on 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 Based on 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.

9. 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 the input data during training; The data to be calibrated is processed to obtain the calibration sequence; and The sequence to be calibrated is input into the data calibration model to obtain the data calibration result, wherein the data calibration model is trained using the method according to claims 1 to 8.

Citation Information

Patent Citations

  • Remote calibration method and system for gas sensor

    CN111812181A