A soil multi-parameter sensor time series data calibration method based on an encoding mechanism
By employing self-supervised and supervised training methods based on coding mechanisms, the data from electromagnetic soil sensors are calibrated, thus resolving the issue of sensor measurement data bias and improving the accuracy and reliability of soil condition analysis.
Patent Information
- Application Number
- CN202411547968.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-11-01
AI Technical Summary
Electromagnetic soil sensors are easily affected by their own performance and the environment when monitoring soil parameters, which can lead to measurement data deviations and reduce the reliability of soil condition analysis.
A soil multi-parameter sensor time-series data calibration method based on an encoding mechanism is adopted. Through self-supervised training of the self-attention module and supervised fine-tuning of the data calibration module, the calibration model is trained using a small amount of labeled data, and the target temporal and spatial features are extracted for data calibration.
It improves the accuracy and reliability of soil condition analysis, ensures the precision of calibration data, and reduces the need for label data.
Smart Images

Figure CN119510709B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of sensor calibration technology, and more specifically, to a method for calibrating time-series data of a multi-parameter soil sensor based on an encoding mechanism, a training method for a data calibration model, and a calibration method for measurement data. Background Technology
[0002] Soil sensors are a general term for sensors that monitor soil moisture. They can be categorized as follows: soil moisture sensors, soil moisture meters, soil hygrometers, soil moisture meters, soil moisture sensors, soil temperature sensors, and soil salinity sensors. Electromagnetic soil sensors can be deployed over large areas at high density to form a grid-like monitoring network, allowing for focused and dense deployment in key areas. They are characterized by their ability to collect high spatiotemporal resolution data. However, the sensing elements of electromagnetic sensors are limited by their own performance or affected by the environment, making the measured soil parameters prone to deviations, which reduces the reliability of subsequent soil condition analyses. Therefore, calibration of the measured data is necessary. Summary of the Invention
[0003] In view of this, this disclosure provides a method for calibrating time-series data of soil multi-parameter sensors based on an encoding mechanism, a method for training a data calibration model, a method for calibrating measurement data, an apparatus, an electronic device, a storage medium, and a program product.
[0004] One aspect of this disclosure provides a soil multi-parameter sensor time-series data calibration method based on an encoding mechanism, comprising: acquiring target measurement data for a target soil measured within a target time period, wherein the target measurement data includes measurement data for a target attribute of the target soil and measurement data for related attributes of the target soil, the related attributes representing soil attributes that influence the target attribute; inputting the target measurement data into a target calibration model and outputting target calibration data for the target attribute, wherein the target calibration model is obtained by self-supervised training of the self-attention module of the calibration model using first training sample data while keeping the network parameters of the data calibration module of the calibration model unchanged, to obtain an intermediate model; and obtaining the intermediate model by supervised fine-tuning of the data calibration module of the intermediate model using second training sample data while keeping the network parameters of the self-attention module of the intermediate model unchanged, wherein the amount of data in the second training sample data is less than the amount of data in the first training sample data.
[0005] According to embodiments of this disclosure, inputting target measurement data into a target calibration model and outputting target calibration data for target attributes includes: inputting target measurement data into the target calibration model, extracting features from the target measurement data to obtain target temporal features and target spatial features, wherein the target spatial features characterize the correlation between related attributes and target attributes; and calibrating the data based on the target temporal features and target spatial features to obtain target calibration data.
[0006] According to embodiments of this disclosure, feature extraction of target measurement data to obtain target temporal features and target spatial features includes: slicing the target measurement data according to a preset slice length to obtain at least one target slice sequence; performing position encoding processing on each target slice sequence to obtain a target encoding sequence for each target slice sequence; and performing feature extraction on each target encoding sequence to obtain target temporal features and target spatial features for each target encoding sequence.
[0007] According to embodiments of this disclosure, the target attribute includes soil moisture content, and the related attributes include at least one of the following: soil temperature, soil water potential, soil electrical conductivity, and soil pH.
[0008] According to embodiments of this disclosure, the target measurement data is obtained using a soil sensor.
[0009] According to embodiments of this disclosure, the first training sample data includes a first training sample sequence;
[0010] With the network parameters of the calibration module of the calibration model remaining unchanged, the self-attention module of the calibration model is self-supervised trained using the first training sample data to obtain an intermediate model. This includes: inputting the first training sample sequence into the self-attention module; masking the first training sample sequence to obtain a masked sample sequence; performing positional encoding on the masked sample sequence to obtain an encoded masked sample sequence; extracting features from the encoded masked sample sequence to output the first sample temporal features and the first sample spatial features; decoding and reconstructing the first sample temporal features and the first sample spatial features to obtain a reconstructed sample sequence; determining the first loss information for the self-attention module based on the masked sample sequence and the reconstructed sample sequence; and iteratively adjusting the network parameters of the self-attention module using the first loss information until the first loss information satisfies the first iteration stopping condition, and using the network obtained when the first iteration stopping condition is satisfied as the intermediate model.
[0011] According to embodiments of this disclosure, before masking the first training sample sequence, the method further includes: slicing the first training sample sequence using a preset slice length to obtain at least one sample slice sequence; and masking each sample slice sequence to obtain a masked sample sequence for each sample slice sequence.
[0012] According to embodiments of this disclosure, the second training sample data includes a second training sample sequence and sample labels for the second training sample sequence. While keeping the network parameters of the self-attention module of the intermediate model unchanged, supervised fine-tuning of the intermediate model using the second training sample data includes: inputting the second training sample sequence into the self-attention module of the intermediate model, outputting second sample temporal features and second sample spatial features; inputting the second sample temporal features and second sample spatial features into the data calibration module of the intermediate model, outputting a sample calibration sequence; determining second loss information based on the sample calibration sequence and sample labels; iteratively adjusting the network parameters of the data calibration module using the second loss information until the second loss information satisfies a second iteration stopping condition, and using the network obtained when the second iteration stopping condition is satisfied as the target calibration model.
[0013] Another aspect of this disclosure provides a training method for a data calibration model, wherein the data calibration model includes a self-attention module and a data calibration module. The method includes: performing self-supervised training on the calibration model using first training sample data while keeping the network parameters of the data calibration module unchanged to obtain an intermediate model; and performing supervised training on the intermediate model using second training sample data while keeping the network parameters of the self-attention module of the intermediate model unchanged to obtain a trained calibration model, wherein the amount of data in the second training sample data is less than the amount of data in the first training sample data.
[0014] Another aspect of this disclosure provides a calibration method for measurement data, applied to a data calibration platform including at least one calibration model. The method includes: in response to a calibration request for target soil data, acquiring calibration data from the calibration request, the calibration data including measurement data for a target attribute and measurement data for related attributes, the related attributes representing soil attributes that influence the target attribute; in response to a selection operation of a target calibration model among at least one calibration model, invoking the target calibration model, wherein the target calibration model is trained by the above method; inputting the calibration data into the target calibration model, and outputting target calibration data for the target attribute.
[0015] Another aspect of this disclosure provides a soil multi-parameter sensor time-series data calibration device based on an encoding mechanism, comprising:
[0016] The first acquisition module is used to acquire target measurement data for the target soil within the target time period. The target measurement data includes measurement data for the target soil attribute and measurement data for related attributes of the target soil. The related attributes represent soil attributes that have an impact on the target attribute. The first calibration module is used to input the target measurement data into the target calibration model and output target calibration data for the target attribute. The target calibration model is obtained by self-supervised training of the self-attention module of the calibration model using the first training sample data while keeping the network parameters of the data calibration module of the calibration model unchanged, to obtain an intermediate model. Then, while keeping the network parameters of the self-attention module of the intermediate model unchanged, the data calibration module of the intermediate model is obtained by supervised fine-tuning using the second training sample data. The amount of data in the second training sample data is less than that in the first training sample data.
[0017] Another aspect of this disclosure provides a training apparatus for a data calibration model, wherein the data calibration model includes a self-attention module and a data calibration module. The apparatus includes: a self-supervised training module for performing self-supervised training on the calibration model using first training sample data to obtain an intermediate model while keeping the network parameters of the data calibration module unchanged; and a supervised training module for performing supervised training on the intermediate model using second training sample data to obtain a trained calibration model while keeping the network parameters of the self-attention module of the intermediate model unchanged, wherein the amount of data in the second training sample data is less than the amount of data in the first training sample data.
[0018] Another aspect of this disclosure provides a calibration apparatus for measurement data, applied to a data calibration platform. The data calibration platform includes at least one calibration model. The apparatus includes: a second acquisition module, configured to acquire data to be calibrated in a calibration request for target soil data, the data to be calibrated including measurement data for a target attribute and measurement data for related attributes, the related attributes representing soil attributes that influence the target attribute; an invocation module, configured to invoke a target calibration model in response to a selection operation of a target calibration model among the at least one calibration model, wherein the target calibration model is trained using the method described above; and a second calibration module, configured to input the data to be calibrated into the target calibration model and output target calibration data for the target attribute.
[0019] Another aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the methods described above.
[0020] Another aspect of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are used to implement the methods described above.
[0021] Another aspect of this disclosure provides a computer program product including computer-executable instructions that, when executed, are used to implement the methods described above.
[0022] According to embodiments of this disclosure, a technique is employed to acquire target measurement data for target soil measured within a target time period. This target measurement data includes measurement data of target attributes and related attributes. The target measurement data is then input into a target calibration model, which outputs target calibration data for the target attributes. This model calibrates the target measurement data with high accuracy, thereby improving the reliability of soil condition analysis. Furthermore, the target calibration model is obtained by self-supervised training of the self-attention module of the calibration model using first training sample data, while keeping the network parameters of the self-attention module unchanged. Then, while keeping the network parameters of the self-attention module of the intermediate model unchanged, supervised fine-tuning of the data calibration module of the intermediate model is performed using second training sample data. The amount of data in the second training sample data is less than that in the first training sample data. By self-supervised training of the self-attention module using the first training sample data, the self-attention module learns the temporal characteristics of the data. Then, supervised fine-tuning of the data calibration module using labeled second training sample data requires only a small amount of second training sample data to obtain good calibration results, thus making the calibration data more accurate. Attached Figure Description
[0023] 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:
[0024] Figure 1 An exemplary system architecture for applying a coding mechanism-based soil multi-parameter sensor time-series data calibration method according to embodiments of the present disclosure is illustrated.
[0025] Figure 2 A flowchart illustrating a soil multi-parameter sensor time-series data calibration method based on an embodiment of the present disclosure is shown schematically.
[0026] Figure 3 A flowchart illustrating a feature extraction method according to an embodiment of the present disclosure is shown schematically.
[0027] Figure 4A schematic diagram illustrates the principle of a soil multi-parameter sensor time-series data calibration method based on an embodiment of the present disclosure;
[0028] Figure 5 A flowchart illustrating a self-supervised training method according to an embodiment of the present disclosure is shown schematically.
[0029] Figure 6 A flowchart illustrating a supervised training method according to an embodiment of the present disclosure is shown schematically.
[0030] Figure 7 A schematic diagram illustrating a training method for a target calibration model according to an embodiment of the present disclosure is shown.
[0031] Figure 8 A flowchart illustrating a training method for a data calibration model according to an embodiment of the present disclosure is shown schematically.
[0032] Figure 9 A flowchart illustrating a calibration method for measurement data according to another embodiment of this disclosure is shown schematically;
[0033] Figure 10 A block diagram of a soil multi-parameter sensor time-series data calibration apparatus based on an encoding mechanism according to an embodiment of the present disclosure is shown schematically.
[0034] Figure 11 A block diagram of a training apparatus for a data calibration model according to an embodiment of the present disclosure is shown schematically.
[0035] Figure 12 A block diagram schematically illustrates a calibration apparatus for measurement data according to another embodiment of the present disclosure; and
[0036] Figure 13 A block diagram of an electronic device suitable for implementing the methods described above, according to embodiments of the present disclosure, is illustrated schematically. Detailed Implementation
[0037] 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.
[0038] 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.
[0039] 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.
[0040] 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.).
[0041] In the embodiments disclosed herein, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0042] In the embodiments disclosed herein, user authorization or consent is obtained before acquiring or collecting user personal information.
[0043] Figure 1 An exemplary system architecture 100, illustrating an embodiment of the present disclosure, is shown where a coding mechanism-based soil multi-parameter sensor time-series data calibration method can be applied. 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.
[0044] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal device 101, terminal device 102, terminal device 103, network 104, and server 105. Network 104 serves as a medium for providing communication links between terminal device 101, terminal device 102, terminal device 103, and server 105. Network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0045] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social media platforms (for example only).
[0046] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0047] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 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.
[0048] It should be noted that the calibration method for measurement data provided in this embodiment can generally be executed by server 105. Correspondingly, the calibration device for measurement data provided in this embodiment can generally be located in server 105. The calibration method for measurement data provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103, and / or server 105. Correspondingly, the calibration device for measurement data provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103, and / or server 105. Alternatively, the calibration method for measurement data provided in this embodiment can also be executed by terminal device 101, terminal device 102, or terminal device 103, or by other terminal devices different from terminal devices 101, 102, or 103. Accordingly, the calibration device for measurement data provided in this embodiment of the present disclosure may also be located in terminal device 101, terminal device 102 or terminal device 103, or in other terminal devices different from terminal device 101, terminal device 102 or terminal device 103.
[0049] For example, the target measurement data may originally be stored in any one of terminal device 101, terminal device 102, or terminal device 103 (e.g., terminal device 101, but not limited thereto), or it may be stored on an external storage device and imported into terminal device 101. Then, terminal device 101 may locally execute the calibration method for the measurement data provided in the embodiments of this disclosure, or send the target measurement data to other terminal devices, servers, or server clusters, and have the other terminal devices, servers, or server clusters that receive the target measurement data execute the calibration method for the measurement data provided in the embodiments of this disclosure.
[0050] 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.
[0051] Figure 2 A flowchart illustrating a soil multi-parameter sensor time-series data calibration method based on an embodiment of the present disclosure is shown.
[0052] like Figure 2 As shown, the method includes operations S210~S220.
[0053] In operation S210, target measurement data for the target soil is acquired within the target time period. This target measurement data includes measurement data for the target soil's target attributes and measurement data for related attributes of the target soil. Related attributes characterize soil properties that influence the target attributes.
[0054] In operation S220, target measurement data is input into the target calibration model, and target calibration data for the target attributes is output. The target calibration model is obtained by self-supervised training of the self-attention module of the calibration model using first training sample data, while keeping the network parameters of the data calibration module of the calibration model unchanged. Then, with the network parameters of the self-attention module of the intermediate model unchanged, supervised fine-tuning of the data calibration module of the intermediate model is performed using second training sample data. The amount of data in the second training sample data is less than that in the first training sample data.
[0055] According to embodiments of this disclosure, the target attribute may include soil moisture content, and the related attributes include at least one of the following: soil temperature, soil water potential, soil electrical conductivity, and soil pH.
[0056] According to embodiments of this disclosure, the target measurement data can be obtained using a soil sensor. The soil sensor can be an electromagnetic soil sensor.
[0057] For example, a soil moisture sensor is used to measure soil moisture content, a soil temperature sensor is used to measure soil temperature, a soil water potential sensor is used to measure soil water potential, a soil electrical conductivity sensor is used to measure soil electrical conductivity, and a soil pH sensor is used to measure soil pH.
[0058] According to embodiments of this disclosure, the target time period can be arbitrarily set according to calibration requirements, such as one day, two days, one week, etc.
[0059] According to embodiments of this disclosure, a technique is employed to acquire target measurement data for target soil measured within a target time period. This target measurement data includes measurement data of target attributes and related attributes. The target measurement data is then input into a target calibration model, which outputs target calibration data for the target attributes. This model calibrates the target measurement data with high accuracy, thereby improving the reliability of soil condition analysis. Furthermore, the target calibration model is obtained by self-supervised training of the self-attention module of the calibration model using first training sample data, while keeping the network parameters of the self-attention module unchanged. Then, while keeping the network parameters of the self-attention module of the intermediate model unchanged, supervised fine-tuning of the data calibration module of the intermediate model is performed using second training sample data. The amount of data in the second training sample data is less than that in the first training sample data. By self-supervised training of the self-attention module using the first training sample data, the self-attention module learns the temporal characteristics of the data. Then, supervised fine-tuning of the data calibration module using labeled second training sample data requires only a small amount of second training sample data to obtain good calibration results, thus making the calibration data more accurate.
[0060] According to embodiments of this disclosure, it may further include: performing vector transformation on the target measurement data to obtain a target input vector, wherein the target input vector is a multi-dimensional, time-aligned vector.
[0061] According to embodiments of this disclosure, inputting target measurement data into a target calibration model and outputting target calibration data for target attributes includes: inputting target measurement data into a target calibration model, extracting features from the target measurement data to obtain target temporal features and target spatial features; and calibrating the data based on the target temporal features and target spatial features to obtain target calibration data.
[0062] According to embodiments of this disclosure, the target calibration model may include a self-attention module and a data calibration module, wherein the self-attention module is used to extract temporal and spatial features from the target measurement data, and the data calibration module is used for data calibration.
[0063] According to embodiments of this disclosure, inputting target measurement data into a target calibration model and outputting target calibration data for target attributes includes: inputting the target input vector into a self-attention module, extracting features from the target input vector to obtain target temporal features and target spatial features; inputting the target temporal features and target spatial features into a data calibration module for data calibration, and outputting target calibration data.
[0064] Figure 3 A flowchart illustrating a feature extraction method according to an embodiment of the present disclosure is shown schematically.
[0065] like Figure 3 As shown, this embodiment includes operations S310 to S330.
[0066] In operation S310, the target measurement data is sliced according to the preset slice length to obtain at least one target slice sequence.
[0067] According to embodiments of this disclosure, the preset slice length can be set according to actual needs. For example, the preset slice length may include 50 measurement values, 60 measurement values, etc.
[0068] In operation S320, position encoding is performed on each target slice sequence to obtain the target encoding sequence for each target slice sequence.
[0069] In operation S330, feature extraction is performed on each target coding sequence to obtain the target temporal features and target spatial features of each target coding sequence.
[0070] According to embodiments of this disclosure, the self-attention module may include a slicing layer, a position encoding layer, a self-attention layer, and a feedforward connection layer.
[0071] According to embodiments of this disclosure, inputting the target input vector into a self-attention module and extracting features from the target input vector to obtain target temporal features and target spatial features may further include: inputting the target input vector into a slicing layer and slicing the target input vector according to a preset slice length to obtain at least one target slice sequence; inputting the at least one target slice sequence into a position encoding layer and performing position encoding on each target slice sequence to obtain a target encoding sequence for each target slice sequence; inputting the target encoding sequence for each target slice sequence into a self-attention layer for self-attention feature extraction to obtain a self-attention feature matrix; and inputting the self-attention feature matrix into a feedforward connection layer to output target sequence features and target spatial features.
[0072] According to embodiments of this disclosure, the feedforward connection layer may include two fully connected layers.
[0073] Figure 4The schematic diagram illustrates the principle of a soil multi-parameter sensor time-series data calibration method based on an embodiment of the present disclosure.
[0074] like Figure 4 As shown, in this embodiment, the target attribute for the target soil is soil moisture content, and related attributes include soil temperature, soil water potential, soil electrical conductivity, and soil pH. First, the soil moisture content of the target soil is measured using a soil moisture sensor 410, yielding a soil moisture content value 411; the soil temperature is measured using a soil temperature sensor 420, yielding a soil temperature value 421; the soil water potential is measured using a soil water potential sensor 430, yielding a soil water potential value 431; the soil electrical conductivity is measured using a soil electrical conductivity sensor 440, yielding a soil electrical conductivity value 441; and the soil pH is measured using a soil pH sensor 450, yielding a soil pH value 451. It should be noted that, according to the preset target time period and preset measurement interval, the soil moisture content value 411, soil temperature value 421, soil water potential value 431, soil electrical conductivity value 441, and soil pH value 451 are all measured as a series of values at the specified measurement intervals. Then, soil moisture content 411, soil temperature 421, soil water potential 431, soil electrical conductivity 441, and soil pH 451 are acquired to obtain target measurement data 460. Next, the target measurement data is vector-transformed to obtain target input vector 470, where M represents the measurement interval. Then, the target input vector is input into the self-attention module 481 of the target calibration model 480 for feature extraction, yielding target temporal features and target spatial features 482. Finally, the target temporal features and target spatial features 482 are input into the data calibration module 483 of the target calibration model 480 for data calibration, outputting target calibration data 490.
[0075] According to embodiments of this disclosure, various parameters of the soil are measured using a soil sensor. The soil data with large deviations obtained at this time is input into a target calibration model for calibration. Multiple soil parameters, including temperature, water potential, electrical conductivity, and pH, are used to calibrate the measured soil moisture content, thereby calibrating the moisture content data with large deviations measured by the soil sensor to a smaller deviation range.
[0076] Figure 5 A flowchart illustrating a self-supervised training method according to an embodiment of the present disclosure is shown.
[0077] The training method in this embodiment is obtained by self-supervised training of the self-attention module of the calibration model using the first training sample data, while keeping the network parameters of the calibration module of the calibration model unchanged. Specifically, it includes, for example: Figure 5 Operations S510 to S570 are shown.
[0078] In operation S510, the first training sample sequence is sliced using a preset slice length to obtain at least one sample slice sequence.
[0079] According to embodiments of this disclosure, the self-attention module includes a slicing layer, which can be used to slice the first training sample sequence to obtain at least one sample slice sequence.
[0080] According to embodiments of this disclosure, the first training sample sequence may include measurement data for the target attribute and measurement data for related attributes.
[0081] According to embodiments of this disclosure, the target attribute may be soil moisture content, and related attributes may be soil temperature, soil water potential, soil electrical conductivity, and soil pH. Therefore, the first training sample sequence may include sequences with five dimensions.
[0082] For example, a first training sample sequence is constructed using multiple soil parameters measured by different soil sensors. Problems such as sensor drift and sensitivity degradation gradually worsen over time. Therefore, considering the influence of historical measurement data on the current sensor values, the first training sample sequence is obtained by aligning the multi-dimensional historical measurement values according to time. The time step of the first training sample sequence is fixed at M, for example, 1, and the input vector has N dimensions, specifically five dimensions: soil moisture content, temperature, water potential, electrical conductivity, and pH.
[0083] According to embodiments of this disclosure, slicing a first training sample sequence using a preset slice length to obtain at least one sample slice sequence may include: using a sliding window with a preset operation length of S to slice the first training sample sequence at any given time position to obtain at least one sample slice sequence.
[0084] In operation S520, each sample slice sequence is masked to obtain a masked sample sequence for each sample slice sequence.
[0085] According to embodiments of this disclosure, the self-attention module may further include a masking layer, which is used to mask each sample slice sequence to obtain a masked sample sequence for each sample slice sequence.
[0086] According to embodiments of this disclosure, masking each sample slice sequence may include: for each sample slice sequence, randomly deleting data contained in the sample slice according to a preset masking ratio to obtain a masked sample sequence, denoted as... Specifically, the preset mask ratio can be 20%.
[0087] In operation S530, position encoding processing is performed on the mask sample sequence to obtain the encoded mask sample sequence.
[0088] According to embodiments of this disclosure, the self-attention module may further include a position encoding layer, which is used to perform position encoding processing on the mask sample sequence to obtain an encoded mask sample sequence.
[0089] According to embodiments of this disclosure, the positional coding layer stores the relative or absolute positions of data in the masked sample sequence. The output of the positional coding layer is represented by PE, and the dimension of PE is the same as the dimension of the input embedding, i.e., the masked sample sequence input to the positional coding layer. The calculation formula is as follows:
[0090] (1);
[0091] (2);
[0092] Where pos represents the position of the current data in the masked sample sequence, d represents the dimension of PE, 2i represents an even dimension, and 2i+1 represents an odd dimension (i.e., 2i≤d, 2i+1≤d). Formulas (1) and (2) enable PE to adapt to sequences that are longer than all time series in the training set, allowing the model to easily calculate the relative position.
[0093] In operation S540, feature extraction is performed on each encoded masked sample sequence, and the first sample temporal feature and the first sample spatial feature of each masked sample sequence are output.
[0094] According to embodiments of this disclosure, the self-attention module may further include a self-attention sub-module, which extracts features from each encoded masked sample sequence and outputs the first sample temporal features and the first sample spatial features of each masked sample sequence.
[0095] According to embodiments of this disclosure, a self-attention submodule may consist of k (k≥1) sequentially connected blocks. Each block includes a multi-head attention layer and a feedforward connection layer.
[0096] The multi-head attention layer is formed by combining multiple Self-Attention layers. The input to Self-Attention is the encoded masked sample sequence, denoted as...
[0097] Linear matrix transformation can be used. , , After obtaining the matrices Q, K, and V, the output of Self-Attention can be calculated using the following formula:
[0098] (3);
[0099] in, , , The matrix was randomly generated using Xavier initialization methods. Let Q and K be the number of columns, i.e., the vector dimension. The formula calculates the inner product of each row vector in matrices Q and K; to prevent the inner product from becoming too large, it is divided by . The square root of.
[0100] The multi-head attention layer contains multiple self-attention layers. It utilizes a self-attention submodule to extract features from each encoded masked sample sequence, outputting the first sample temporal features and first sample spatial features for each masked sample sequence. This can include: firstly, the input... The data is passed to multiple different Self-Attention mechanisms, resulting in multiple output matrices. Subsequently, the multi-head attention mechanism will combine multiple output matrices. By splicing them together, we obtain the output of the multi-head attention mechanism. E is fed into the feedforward layer to obtain the temporal feature representation of the first sample. The feedforward layer can be a two-layer fully connected layer, coupled with a Gaussian error linear unit (GELU) activation function to implement the feedforward operation. The corresponding formula is as follows:
[0101] (4).
[0102] In operation S550, the temporal features of the first sample are decoded and reconstructed to obtain the reconstructed sample sequence.
[0103] According to embodiments of this disclosure, the reconstruction module can be used to decode and reconstruct the temporal features of the first sample to obtain a reconstructed sample sequence.
[0104] According to embodiments of this disclosure, the reconstruction module can consist of a projection layer, an activation and normalization layer, and a prediction head, forming a decoder for decoding and reconstruction processing. The corresponding formula is as follows:
[0105] (5);
[0106] (6);
[0107] in This refers to the reconstructed sample sequence obtained from the reconstruction.
[0108] In operation of S560, the first loss information for the self-attention module is determined based on the masked sample sequence and the reconstructed sample sequence.
[0109] When operating S570, the network parameters of the self-attention module are iteratively adjusted using the first loss information until the first loss information meets the first iteration stopping condition, and the network obtained when the first iteration stopping condition is met is used as an intermediate model.
[0110] According to embodiments of this disclosure, the first loss information may be the mean absolute error or root mean square error between the masked sample sequence and the reconstructed sample sequence.
[0111] The temporal features of the samples are learned by minimizing the mean absolute error or root mean square error between the reconstructed sample sequence and the masked sample sequence. The self-attention module is then trained to obtain an intermediate model.
[0112] According to embodiments of this disclosure, the first iteration stopping condition may be that the mean absolute error or the root mean square error reaches a first preset value.
[0113] According to embodiments of this disclosure, the self-attention module may further include a linear layer and a normalization layer. The above method may further include mapping the masked sample sequence to a higher-dimensional space through a linear layer, and using a normalization layer to normalize the values in the higher-dimensional space to obtain a normalized masked sample sequence D, expressed as the following formula (7):
[0114] Equation (7).
[0115] It should be noted that during the data calibration process using the trained data after the model training is completed, no data masking or decoding reconstruction operations are performed.
[0116] Figure 6 A flowchart illustrating a supervised training method according to an embodiment of the present disclosure is shown schematically.
[0117] The training method in this embodiment is obtained by supervising the intermediate model using second training sample data while keeping the network parameters of the self-attention module of the intermediate model unchanged. Specifically, it includes, for example... Figure 6 Operations S610 to S640 are shown.
[0118] In operation S610, the second training sample sequence is input into the self-attention module of the intermediate model, and the second sample temporal features and the second sample spatial features are output.
[0119] According to embodiments of this disclosure, the second training sample data includes a second training sample sequence and sample labels for the second training sample sequence. The second training sample sequence includes measurement data for the target attribute and measurement data for related attributes.
[0120] Sample labels can be obtained by using high-precision soil sensors to acquire accurate measurements of soil moisture content.
[0121] In operation S620, the temporal features and spatial features of the second sample are input into the data calibration module of the intermediate model, and the sample calibration sequence is output.
[0122] According to embodiments of this disclosure, the data calibration module may include three gated recurrent unit (GRU) layers, one dropout layer, and two fully connected layers.
[0123] According to embodiments of this disclosure, the second sample temporal features and the second sample spatial features are... The data calibration module of the intermediate model is input to obtain the sample calibration sequence, denoted as .
[0124] The formula is as follows:
[0125] (8);
[0126] In operation S630, second loss information is determined based on the sample calibration sequence and sample label.
[0127] In operation S640, the network parameters of the data calibration module are iteratively adjusted using the second loss information until the second loss information meets the second iteration stopping condition, and the network obtained when the second iteration stopping condition is met is used as the target calibration model.
[0128] According to embodiments of this disclosure, the second loss information may be the MSE between the sample calibration sequence and the sample label.
[0129] The temporal characteristics of the samples are learned by minimizing the mean absolute error or root mean square error of the sample calibration sequence and sample labels. The data calibration module is then fine-tuned in a supervised manner to obtain the target calibration model.
[0130] According to embodiments of this disclosure, the second iteration stopping condition may be that the mean absolute error or the root mean square error reaches a second preset value.
[0131] Figure 7 A schematic diagram illustrating a training method for a target calibration model according to an embodiment of the present disclosure is shown.
[0132] like Figure 7As shown, the training method of the target calibration model in this embodiment includes a self-supervised pre-training part for the self-attention module 720 and a supervised fine-tuning part for the data calibration module 730. First, a training sample sequence 710 is obtained, consisting of multiple soil measurement parameters that change over time. The training sample sequence 710 is input into the self-attention module 720, where a slicing layer is used to slice the training sample sequence 710, resulting in a sample slice sequence. This sample slice sequence is then input into a masking layer for masking, resulting in a masked sample sequence. Position encoding is then performed on the masked sample sequence to obtain an encoded masked sample sequence. The encoded masked sample sequence is then mapped to a higher space through a linear mapping and normalization layer, and the values in the higher space are normalized before being input into a multi-head attention layer for feature extraction, resulting in an output matrix. Finally, the output matrix is sequentially processed through a residual connection and normalization layer, a feedforward connection layer, and another residual connection and normalization layer to obtain the sample temporal features. Then, the time-series features of the samples... The decoder 740, consisting of a projection layer, an activation and normalization layer, and a prediction head, is input to reconstruct the masked samples, obtaining a reconstructed sample sequence. Then, the network parameters of the self-attention module 720 are iteratively adjusted based on the reconstructed sample sequence and the masked sample sequence. After the self-attention module 720 is trained, its network parameters are fixed, and supervised fine-tuning by the data calibration module 730 is performed. The temporal features output by the trained self-attention module 720 are then processed. The gated recurrent unit layer, the discard layer, and the fully connected layer of the data calibration module 730 are input sequentially, and the sample calibration sequence is output. Then, the network parameters of the data calibration module 730 are iteratively adjusted based on the sample calibration sequence and sample labels to finally obtain the target calibration model.
[0133] According to embodiments of this disclosure, by considering the influence of time variations and multiple soil parameters on the measurement results of electromagnetic soil sensors, this disclosure constructs a feature set by quantifiable indicators affecting the measurement results of electromagnetic soil sensors and historical values of soil sensor measurements. This feature set is the input to the target calibration model, and the true value is the result of the sample label being tested using industry standards.
[0134] In one embodiment, the training of the target calibration model may include self-supervised pre-training and supervised fine-tuning. First, a large amount of unlabeled first training sample data is required. Self-supervised pre-training is performed using a self-attention mechanism to obtain multi-dimensional temporal features of the first training sample data and generate a high-level representation that can contain temporal features. Then, a small amount of second training sample data containing ground truth is used for fine-tuning of the target calibration model.
[0135] The model training method of this disclosure, because it obtains the temporal characteristics of the training data during the pre-training stage, results in faster convergence speed compared to traditional models during fine-tuning training. Therefore, it ensures the effectiveness of calibration data even with only a small amount of ground-value training data and obtains relatively more accurate soil data even without sensor calibration. Users can use the model on the established calibration platform, selecting the soil data to be calibrated and then selecting the model to obtain the calibration results of the template calibration model.
[0136] According to embodiments of this disclosure, an end-to-end deep learning model is used to calibrate measurement data collected by uncalibrated electromagnetic soil sensors to obtain measurement results with smaller deviations, providing cleaner data for subsequent soil data analysis and improving reliability. By learning the temporal features of a large amount of observation data through a masked self-attention mechanism, better results can be obtained with only a small amount of label data for fine-tuning, solving the problem of model effectiveness when a large amount of label data cannot be obtained.
[0137] According to embodiments of this disclosure, during long-term use of soil sensors, sensor measurement results may drift. In such cases, the calibration model of the relevant technology requires a large amount of labeled data for retraining. However, obtaining a large amount of labeled data is quite difficult. The model training method provided in this disclosure has good transferability because it learns the characteristics of sensor measurements in the time dimension during the pre-training stage. After the sensor drifts, only a small amount of labeled data is needed for secondary calibration to continue to function. Therefore, it can extend the service life of soil sensors to a certain extent.
[0138] In some embodiments, the target calibration model can be implemented using the PyTorch platform. The loss function uses metrics such as mean absolute error and root mean square error to evaluate the model. The ratio of the pre-training dataset to the fine-tuning training dataset to the test dataset is 6:2:2. The hyperparameters can be set as follows: a sample mask rate of 0.2, a sliding window size of 50, a stride of 1, a batch size of 256, 50 pre-training epochs, 100 fine-tuning epochs, and the optimization function is set to Adam. The model is finally saved in pt format.
[0139] Figure 8 A flowchart illustrating a training method for a data calibration model according to an embodiment of the present disclosure is shown.
[0140] like Figure 8 As shown, the data calibration model in this embodiment includes a self-attention module and a data calibration module, and the training method includes operations S810 to S820.
[0141] When operating the S810, with the network parameters of the data calibration module remaining unchanged, the calibration model is self-supervised and trained using the first training sample data to obtain an intermediate model.
[0142] When operating the S820, while keeping the network parameters of the self-attention module of the intermediate model unchanged, supervised training is performed on the intermediate model using the second training sample data to obtain a trained calibration model. The amount of data in the second training sample data is less than the amount of data in the first training sample data.
[0143] It should be noted that the training method of the data calibration model in the embodiments of this disclosure is similar to the training method of the target calibration model in the calibration method of measurement data in the embodiments of this disclosure, and will not be described again here.
[0144] Figure 9 A flowchart illustrating a calibration method for measurement data according to another embodiment of this disclosure is shown schematically.
[0145] The measurement data calibration method of this embodiment can be applied to a data calibration platform, which includes at least one calibration model. The measurement data calibration method of this embodiment can include, for example, […]. Figure 9 Operations S910 to S930 are shown.
[0146] In operation S910, in response to a calibration request for target soil data, the calibration data to be calibrated in the calibration request is acquired. The calibration data includes measurement data for the target attribute and measurement data for related attributes, which characterize soil properties that influence the target attribute.
[0147] In operation S920, in response to the selection operation of a target calibration model among at least one calibration model, the target calibration model is invoked. The target calibration model is obtained by utilizing... Figure 8 The method shown is used for training.
[0148] When operating the S930, the data to be calibrated is input into the target calibration model, and the target calibration data for the target attributes is output.
[0149] According to the embodiments of this disclosure, the use of calibration models establishes a sensor data calibration platform, which simplifies the process of using calibration models. Users only need to select the time range of the soil data to be calibrated on the platform and select the calibration number corresponding to the calibration model to obtain the calibrated soil moisture content data within the time range corresponding to the model.
[0150] Figure 10 A block diagram of a soil multi-parameter sensor time-series data calibration apparatus based on an encoding mechanism according to an embodiment of the present disclosure is shown schematically.
[0151] like Figure 10 As shown, the apparatus 1000 in this embodiment includes a first acquisition module 1010 and a first calibration module 1020.
[0152] The first acquisition module 1010 is used to acquire target measurement data for the target soil within the target time period. The target measurement data includes measurement data for the target attribute of the target soil and measurement data for related attributes of the target soil. The related attributes characterize soil attributes that have an impact on the target attribute.
[0153] The first calibration module 1020 is used to input target measurement data into the target calibration model and output target calibration data for the target attributes. The target calibration model is obtained by self-supervised training of the self-attention module of the calibration model using first training sample data, while keeping the network parameters of the data calibration module of the calibration model unchanged. Then, while keeping the network parameters of the self-attention module of the intermediate model unchanged, it is obtained by supervised fine-tuning of the data calibration module of the intermediate model using second training sample data. The amount of data in the second training sample data is less than that in the first training sample data. It should be noted that the calibration device for measurement data in the embodiments of this disclosure corresponds to the calibration method for measurement data in the embodiments of this disclosure. The description of the calibration device for measurement data is specifically referred to in the calibration method for measurement data, and will not be repeated here.
[0154] Figure 11 A block diagram of a training apparatus for a data calibration model according to an embodiment of the present disclosure is shown schematically.
[0155] like Figure 11 As shown, the training device 1100 of this embodiment includes a self-supervised training module 1110 and a supervised training module 1120.
[0156] The self-supervised training module 1110 is used to perform self-supervised training on the calibration model using the first training sample data while keeping the network parameters of the data calibration module unchanged, so as to obtain an intermediate model.
[0157] The supervised training module 1120 is used to perform supervised training on the intermediate model using the second training sample data while keeping the network parameters of the self-attention module of the intermediate model unchanged, so as to obtain a trained calibration model. The amount of data in the second training sample data is less than the amount of data in the first training sample data.
[0158] It should be noted that the training device for the data calibration model in the embodiments of this disclosure corresponds to the training method for the data calibration model in the embodiments of this disclosure. For a detailed description of the training device for the data calibration model, please refer to the training method for the data calibration model, which will not be repeated here.
[0159] Figure 12 A block diagram of a calibration apparatus for measurement data according to another embodiment of the present disclosure is shown schematically.
[0160] like Figure 12 As shown, the calibration device 1200 of this embodiment includes a second acquisition module 1210, a recall module 1220, and a second calibration module 1230.
[0161] The second acquisition module 1210 is used to acquire the data to be calibrated in the calibration request in response to the calibration request for the target soil data. The data to be calibrated includes measurement data for the target attribute and measurement data for related attributes. The related attributes characterize the soil attributes that have an impact on the target attribute.
[0162] Module 1220 is used to invoke the target calibration model in response to a selection operation for at least one target calibration model in the calibration models, wherein the target calibration model is trained using the method described above.
[0163] The second calibration module 1230 is used to input the data to be calibrated into the target calibration model and output the target calibration data for the target attributes.
[0164] It should be noted that the calibration device for measurement data in the embodiments of this disclosure corresponds to the calibration method for measurement data in the embodiments of this disclosure. For a detailed description of the calibration device for measurement data, please refer to the calibration method for measurement data, which will not be repeated here.
[0165] Figure 13 A block diagram of an electronic device suitable for implementing the methods described above, according to embodiments of the present disclosure, is illustrated schematically. Figure 13 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0166] like Figure 13As shown, an electronic device 1300 according to an embodiment of the present disclosure includes a processor 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage portion 1308 into a random access memory (RAM) 1303. The processor 1301 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 1301 may also include onboard memory for caching purposes. The processor 1301 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.
[0167] RAM 1303 stores various programs and data required for the operation of electronic device 1300. Processor 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. Processor 1301 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1302 and / or RAM 1303. It should be noted that the programs may also be stored in one or more memories other than ROM 1302 and RAM 1303. Processor 1301 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.
[0168] According to embodiments of this disclosure, the electronic device 1300 may further include an input / output (I / O) interface 1305, which is also connected to a bus 1304. The system 1300 may also include one or more of the following components connected to the input / output (I / O) interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the input / output (I / O) interface 1305 as needed. A removable medium 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1310 as needed so that computer programs read from it can be installed into the storage section 1308 as needed.
[0169] 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 1309, and / or installed from removable medium 1311. When the computer program is executed by processor 1301, 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.
[0170] 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.
[0171] 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.
[0172] For example, according to embodiments of this disclosure, a computer-readable storage medium may include one or more memories other than the ROM 1302 and / or RAM 1303 described above.
[0173] 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 methods provided in the embodiments of this disclosure.
[0174] When the computer program is executed by the processor 1301, 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.
[0175] 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 1309, and / or installed from the removable medium 1311. 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.
[0176] 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).
[0177] 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.
[0178] 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 method for calibrating time-series data of soil multi-parameter sensors based on an encoding mechanism, comprising: Acquire target measurement data for target soil measured within a target time period, wherein the target measurement data includes measurement data for target attributes of the target soil and measurement data for related attributes of the target soil, and the related attributes characterize soil attributes that have an impact on the target attributes; The target measurement data is input into the target calibration model, and the target calibration data for the target attribute is output. The target calibration model is obtained by self-supervised training of the self-attention module of the calibration model using the first training sample data while keeping the network parameters of the data calibration module of the calibration model unchanged, to obtain an intermediate model. Then, the data calibration module of the intermediate model is obtained by supervised fine-tuning using the second training sample data while keeping the network parameters of the self-attention module of the intermediate model unchanged. The amount of data in the second training sample data is less than that in the first training sample data.
2. The method according to claim 1, wherein, The step of inputting the target measurement data into the target calibration model and outputting target calibration data for the target attribute includes: The target measurement data is input into the target calibration model, and feature extraction is performed on the target measurement data to obtain target temporal features and target spatial features, wherein the target spatial features characterize the correlation between relevant attributes and target attributes; Data calibration is performed based on the target temporal features and the target spatial features to obtain the target calibration data.
3. The method according to claim 2, wherein, The step of extracting features from the target measurement data to obtain target temporal features and target spatial features includes: The target measurement data is sliced according to a preset slice length to obtain at least one target slice sequence; Position encoding is performed on each of the target slice sequences to obtain a target encoding sequence for each target slice sequence; and Feature extraction is performed on each of the target coding sequences to obtain the target temporal features and target spatial features of each target coding sequence.
4. The method according to claim 1, wherein, The target attribute includes soil moisture content, and the related attributes include at least one of the following: soil temperature, soil water potential, soil electrical conductivity, and soil pH.
5. The method according to claim 1, wherein, The target measurement data was obtained using a soil sensor.
6. The method according to claim 1, wherein, The first training sample data includes a first training sample sequence; While keeping the network parameters of the calibration module of the calibration model unchanged, the self-attention module of the calibration model is self-supervised and trained using the first training sample data to obtain an intermediate model, including: The first training sample sequence is input into the self-attention module, and the first training sample sequence is masked to obtain a masked sample sequence. The mask sample sequence is subjected to position encoding to obtain the encoded mask sample sequence; Feature extraction is performed on the encoded masked sample sequence to output the first sample temporal feature and the first sample spatial feature; The temporal features and spatial features of the first sample are decoded and reconstructed to obtain a reconstructed sample sequence. Based on the masked sample sequence and the reconstructed sample sequence, a first loss information for the self-attention module is determined; and The network parameters of the self-attention module are iteratively adjusted using the first loss information until the first loss information meets the first iteration stopping condition, and the network obtained when the first iteration stopping condition is met is used as the intermediate model.
7. The method according to claim 6, further comprising, before performing masking processing on the first training sample sequence: The first training sample sequence is sliced using a preset slice length to obtain at least one sample slice sequence. Each of the sample slice sequences is masked to obtain a masked sample sequence for each sample slice sequence.
8. The method according to claim 1, wherein, The second training sample data includes a second training sample sequence and sample labels for the second training sample sequence; The step of performing supervised fine-tuning of the intermediate model using the second training sample data while keeping the network parameters of the self-attention module of the intermediate model unchanged includes: The second training sample sequence is input into the self-attention module of the intermediate model, and the second sample temporal features and the second sample spatial features are output. The second sample temporal features and the second sample spatial features are input into the data calibration module of the intermediate model, and the sample calibration sequence is output. The second loss information is determined based on the sample calibration sequence and the sample label; The network parameters of the data calibration module are iteratively adjusted using the second loss information until the second loss information meets the second iteration stopping condition, and the network obtained when the second iteration stopping condition is met is taken as the target calibration model.
9. A training method for a data calibration model, wherein, The data calibration model includes a self-attention module and a data calibration module, and the method includes: With the network parameters of the data calibration module remaining unchanged, the calibration model is self-supervised and trained using the first training sample data to obtain an intermediate model. With the network parameters of the self-attention module of the intermediate model remaining unchanged, the intermediate model is subjected to supervised training using the second training sample data to obtain a trained calibration model, wherein the amount of data in the second training sample data is less than the amount of data in the first training sample data; the trained calibration model is used to calibrate the input data to be calibrated for the target attribute and output the target calibration data for the target attribute. The data to be calibrated is determined by the following operation: in response to the calibration request for the target soil data, the data to be calibrated in the calibration request is obtained. The data to be calibrated includes measurement data for the target attribute and measurement data for related attributes, wherein the related attributes characterize soil attributes that have an impact on the target attribute.
10. A method for calibrating measurement data, applied to a data calibration platform, the data calibration platform including at least one calibration model, the method comprising: In response to a calibration request for target soil data, the calibration data to be calibrated in the calibration request is obtained. The calibration data to be calibrated includes measurement data for the target attribute and measurement data for related attributes, wherein the related attributes characterize soil attributes that have an impact on the target attribute. In response to a selection operation for a target calibration model among at least one calibration model, the target calibration model is invoked, wherein the target calibration model is trained using the method of claim 9; The data to be calibrated is input into the target calibration model, and target calibration data for the target attribute is output.
Citation Information
Patent Citations
Urban rail train wheel set abrasion loss prediction method based on self-supervised learning
CN118153432A