Cross-environment soil moisture estimation method, system and model training method thereof
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HARBIN INST OF TECH
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-29
Smart Images

Figure CN121703146B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of material state detection technology, and in particular to a method, system and model training method for estimating soil moisture across environments. Background Technology
[0002] Accurate and real-time acquisition of soil moisture information is crucial for applications such as modern agricultural irrigation and disaster early warning.
[0003] Traditional soil moisture detection methods (such as the drying and weighing method) offer high accuracy, but they suffer from inherent drawbacks such as being time-consuming, labor-intensive, and difficult to implement on a large scale for continuous monitoring. To address these shortcomings, a non-contact intelligent sensing solution based on millimeter-wave radar has been developed. This technology processes the echo signals acquired by millimeter-wave radar using a neural network model to estimate soil moisture, and it offers the potential for easy deployment.
[0004] However, this technology faces performance challenges in practical deployment: its performance heavily depends on the consistency between the model training environment and the application environment. When the data distribution differs between the training environment (source environment) and the actual application environment (target environment) due to differences in physical conditions such as soil type and surface morphology, the neural network model in this technology lacks an effective cross-environment adaptive mechanism, resulting in a sharp decline in the model's generalization ability and an inability to achieve accurate humidity estimation in the target environment.
[0005] Therefore, there is an urgent need in this field for a new method that can fundamentally improve the model's ability to adapt across environments in order to realize the large-scale and reliable application of this millimeter-wave radar-based soil moisture sensing technology. Summary of the Invention
[0006] This application proposes an unsupervised domain-adaptive cross-environment soil moisture estimation scheme, which aims to solve the problem that existing millimeter-wave radar moisture sensing technology based on neural network models lacks an effective cross-environment adaptive mechanism, resulting in insufficient generalization ability in the target environment.
[0007] The first aspect of this application provides a method for training a cross-environment soil moisture estimation model, comprising:
[0008] Acquire humidity-tagged echo signal data collected by millimeter-wave radar in the source environment, and untagged echo signal data collected in the target environment;
[0009] The echo signal data of the source environment and the target environment are preprocessed to generate feature representations for model training;
[0010] A soil moisture estimation model is constructed and trained using labeled feature representations of the source environment and unlabeled feature representations of the target environment. The training process includes at least employing a weighted multiple nearest neighbor contrastive loss function to achieve fine-grained feature distribution alignment across environments. The weighted multiple nearest neighbor contrastive loss function is calculated as follows: first, based on the similarity between samples, multiple nearest neighbors of the target environment sample in the source environment sample and their ranking positions are determined; then, weights are assigned to each nearest neighbor based on the ranking positions, and the loss is calculated based on the assigned weights.
[0011] In some embodiments of this application, training the soil moisture estimation model includes:
[0012] In addition to the weighted multiple nearest neighbor contrastive loss function, the intra-domain contrastive loss function, the label distance-driven contrastive loss function, the domain discriminant loss function, and the regression loss function are also optimized in a coordinated manner to improve the model’s cross-environment adaptive capability from four aspects: feature discriminability, feature space structure, domain invariance, and prediction accuracy.
[0013] In some embodiments of this application, the weighted multiple nearest neighbor contrast loss function The expression is:
[0014] ,
[0015] in, For temperature parameters, Indicates the first in the target environment Query characteristics of each sample Indicates the first in the source environment Query characteristics of each sample Represents the key features of samples in the target environment. and For sample index, Values range from 1 to batch size , The value ranges from 1 to the nearest neighbor number k. ( This represents the operation of finding the k nearest neighbors in the features of the source domain;
[0016] For the first j The weight of the nearest neighbor, whose value varies with the sorting order. j The weight decreases as the distance increases, to ensure that the nearest neighbor sample has a higher weight in the loss function.
[0017] In some embodiments of this application, the intra-domain contrastive loss function includes a source-domain contrastive loss function used to enhance the clustering and discriminative properties of sample features within the source environment. Its expression is:
[0018] ,
[0019] in, (·) represents a fully connected layer. For temperature parameters, and A view of different features of the source environment sample. Indicates query characteristics, Indicates key features, For the first in the source environment Key features of a negative sample and For sample index, Values range from 1 to batch size , The value ranges from 1 to the number of negative samples N; the intra-domain contrastive loss function also includes a target-domain contrastive loss function to enhance the clustering and discriminative properties of sample features within the target environment. Its expression is:
[0020] ,
[0021] in, (·) represents a fully connected layer. For temperature parameters, and Different feature views of the target environment sample Indicates query characteristics, Indicates key features, For the first in the target environment Key features of a negative sample and For sample index, Values range from 1 to batch size , The value ranges from 1 to the number of negative samples N.
[0022] In some embodiments of this application, the label distance drives the contrastive loss function. The expression is:
[0023] ,
[0024] in, For sample-based and The weights determined by the distance between labels and The first in each batch The and the first Feature representation of a sample Temperature coefficient, superscript This represents the transpose of a vector. and For sample index, Values range from 1 to batch size , representing the current sample, j takes values from 1 to B and , indicating the comparison sample.
[0025] In some embodiments of this application, the domain discriminant loss function The expression is:
[0026] ,
[0027] in, The sample index ranges from 1 to the batch size. , Let cross-entropy be the loss function. For domain discriminator, It is a gradient inversion layer. and These are the sample characteristics of the source environment and the target environment, respectively. and These are the domain labels for the source environment and the target environment, respectively.
[0028] In some embodiments of this application, the preprocessing of the echo signal data of the source environment and the target environment includes:
[0029] For millimeter-wave radar echo signal strength data, it is divided according to its transmission time point. The echo signal data corresponding to each transmission time point is processed into a sample, where each sample is represented as a two-dimensional signal matrix. The dimension of the two-dimensional signal matrix includes the number of frequency bands and the number of virtual antennas.
[0030] Data augmentation is performed on the two-dimensional signal matrix, the data augmentation including adding random noise to the two-dimensional signal matrix;
[0031] High-dimensional features are extracted from the data-augmented samples.
[0032] A second aspect of this application provides a cross-environmental soil moisture estimation system, comprising:
[0033] Millimeter-wave radar is used to transmit signals to the soil surface and receive echo signals.
[0034] The processor is communicatively connected to the millimeter-wave radar and is used to run a soil moisture estimation model to process the echo signal into a soil moisture estimate, wherein the soil moisture estimation model is trained according to the method described in the first aspect of the embodiments of this application.
[0035] An output device, connected to the processor, is used to output the estimated soil moisture value.
[0036] In some embodiments of this application, the millimeter-wave radar is positioned above the soil area to be measured, and the pointing and height of its transmitting and receiving antennas are configured to remain constant during data acquisition to eliminate interference to the signal caused by changes in height and angle.
[0037] A third aspect of this application provides a method for estimating soil moisture across environmental conditions, including:
[0038] Acquire echo signals of the soil sampled by millimeter-wave radar;
[0039] The echo signal is preprocessed to generate a feature representation that is compatible with the soil moisture estimation model described in the first aspect of the present application.
[0040] The feature representation is input into the soil moisture estimation model trained according to the method of the first aspect of the present application, and the moisture value of the soil to be tested is output.
[0041] In summary, the training method, system, and method for cross-environment soil moisture estimation provided in the embodiments of this application, by introducing the weighted multiple nearest neighbor contrastive loss function (WNNCL), offer a core technical means to achieve fine-grained distribution alignment of source and target environment samples within the feature space. By applying this method, the model acquires cross-environment feature adaptive capability, thereby solving the problem of insufficient generalization ability in the target environment caused by the lack of cross-environment adaptive capability in existing technologies. Furthermore, by constructing a collaborative optimization framework, WNNCL and intra-domain contrastive loss are integrated. By jointly training label distance-driven contrastive loss, domain discriminative loss, and regression loss, a multi-faceted and multi-layered technical effect of optimizing the feature space structure is achieved. Specifically, intra-domain contrastive loss enhances the discriminativeness of features within each environment, providing a clearer basis for cross-environment alignment; label distance-driven loss explicitly utilizes label similarity to constrain the feature space, enhancing the correlation between features and humidity values; domain discriminative loss globally prompts the feature encoder to generate domain-invariant features, complementing the local alignment of WNNCL; and finally, regression loss ensures that all feature learning serves accurate humidity prediction. The synergistic effect of these multiple loss functions addresses the alignment blind spots or limitations that may exist with a single loss function, making the cross-environment adaptive mechanism more effective, robust, and stable, and significantly improving the model's estimation accuracy and generalization performance in unknown target environments. Attached Figure Description
[0042] The features and advantages of this application will become clearer with reference to the accompanying drawings, which are illustrative and should not be construed as limiting the application in any way. In the drawings:
[0043] Figure 1 This is a schematic diagram of a cross-environment soil moisture estimation system according to some embodiments of this application;
[0044] Figure 2 This is a schematic diagram of the structure of a cross-environment soil moisture estimation model according to some embodiments of this application;
[0045] Figure 3 This is a flowchart illustrating a training method for a cross-environment soil moisture estimation model according to some embodiments of this application;
[0046] Figure 4 This is a flowchart illustrating a cross-environmental soil moisture estimation method according to some embodiments of this application. Detailed Implementation
[0047] In the following detailed description, numerous specific details of this application are illustrated by example to provide a thorough understanding of the relevant disclosure. However, it will be apparent to those skilled in the art that this application can be practiced without these details. It should be understood that the terms “system,” “apparatus,” “unit,” and / or “module” used in this application are one way of distinguishing different parts, elements, sections, or components at different levels in a sequential arrangement. However, these terms may be replaced with other expressions if other expressions can achieve the same purpose.
[0048] It should be understood that when a device, unit, or module is referred to as being "on," "connected to," or "coupled to" another device, unit, or module, it may be directly connected to or coupled to or communicate with other devices, units, or modules, or there may be intermediate devices, units, or modules present, unless the context explicitly indicates otherwise. For example, the term "and / or" as used herein includes any one and all combinations of one or more of the relevant listed items.
[0049] The terminology used in this application is for the purpose of describing specific embodiments only and is not intended to limit the scope of this application. As shown in the specification and claims of this application, unless the context clearly indicates otherwise, words such as "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate that explicitly identified features, integrals, steps, operations, elements, and / or components are included, and such expressions do not constitute an exclusive list, and other features, integrals, steps, operations, elements, and / or components may also be included.
[0050] Referring to the following description and accompanying drawings, these and other features and characteristics, operating methods, functions of related structural elements, combinations of parts, and economics of manufacture of this application can be better understood, wherein the description and drawings form part of the specification. However, it is clearly understood that the drawings are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. It is understood that the drawings are not drawn to scale.
[0051] Various structural diagrams are used in this application to illustrate various variations of the embodiments according to this application. It should be understood that the preceding or following structures are not intended to limit this application. The scope of protection of this application is determined by the claims.
[0052] Soil moisture is crucial for crop growth, affecting not only the physical properties of the soil but also limiting nutrient dissolution and transfer as well as microbial activity. Accurate prediction of soil moisture can provide important guidance for agricultural irrigation, disaster response, and other related tasks.
[0053] Soil moisture sensing schemes based on millimeter-wave radar estimate moisture by analyzing the interaction between radar echo signals and soil moisture, demonstrating the potential for convenient deployment. However, millimeter-wave radar is highly susceptible to multipath interference during soil detection. Due to differences in spatial structure and surface materials in different environments, the propagation path of radar signals and the distribution of echo energy will also change, thus affecting the distribution of frequency domain features. Therefore, in practical applications of millimeter-wave radar for soil moisture sensing, different environmental conditions will lead to significant differences in radar echo signals, resulting in a shift in data distribution. This domain shift caused by environmental differences means that a model trained in a specific environment (source environment), if directly applied to another environment (target environment), will lack cross-environment adaptability, causing the extracted features to lose discriminative power, ultimately resulting in a significant decrease in predictive performance, i.e., insufficient generalization ability.
[0054] To address the issues of data distribution shifts caused by environmental differences and insufficient cross-environment adaptability of the model, this application proposes a collaborative optimization architecture that integrates feature extraction and transfer learning, named mmSoilNet-DA. This model structure fully combines deep feature encoding capabilities with cross-environment adaptive mechanisms, achieving full alignment of feature distributions between the source and target environments and enhancing feature discrimination capabilities, thereby improving the system's generalization ability for soil moisture perception across different environments.
[0055] The following will combine Figure 1 The system hardware deployment shown is Figure 2 The model architecture shown will be used to explain the implementation process of the embodiments of this application in detail.
[0056] Figure 1 This is a schematic diagram of a cross-environmental soil moisture estimation system according to some embodiments of this application. For example... Figure 1 As shown, the cross-environment soil moisture estimation system mainly includes: millimeter-wave radar, processor, and output device.
[0057] The millimeter-wave radar, as the core sensing device, is positioned directly above the soil, with both its transmitting and receiving antennas precisely facing the soil surface. During the signal strength acquisition phase, the millimeter-wave radar sensor transmits radar signals to the soil surface via its transmitting antenna. These signals are reflected by the soil surface and then received by the sensor's receiving antenna. In some embodiments of this application, to ensure consistent sensing conditions, the height and angle of the millimeter-wave radar sensor are fixed to eliminate interference caused by differences in height and angle.
[0058] The processor is communicatively connected to the millimeter-wave radar and is used to receive and process radar echo signals. The processor stores and runs the soil moisture estimation model (i.e., the mmSoilNet-DA model) as described in the embodiments of this application. The processor is configured to perform the following core operations: control the millimeter-wave radar to acquire data; preprocess the received raw echo signals into feature representations; input the feature representations into the soil moisture estimation model; and output an estimated value of soil moisture.
[0059] The output device is connected to the processor and is used to receive and present the estimated soil moisture value calculated by the processor. The output device may take the form of a local display screen, a data storage unit, or a wireless transmission module, etc., and is used to feed the results back to the user or an upstream control system.
[0060] The system's workflow is as follows: The millimeter-wave radar transmits signals to the soil and collects echoes according to a set period; the echo signals are transmitted to the processor; the processor processes the echo signals in real time and extracts feature representations, and the built-in algorithm model (mmSoilNet-DA model) estimates humidity based on the feature representations; finally, the estimation results are displayed or reported by the output device.
[0061] like Figure 2 As shown, the mmSoilNet-DA model proposed in this application is a neural network model that integrates deep feature encoding and unsupervised domain adaptive mechanisms. Figure 3 This is a flowchart illustrating a training method for the model according to some embodiments of this application. For example... Figure 3 As shown, the method includes:
[0062] S310 acquires echo signal data with humidity tags collected by millimeter-wave radar in the source environment, and untagged echo signal data collected in the target environment.
[0063] Specifically, the training involves acquiring millimeter-wave radar echo signal strength data, wherein the millimeter-wave radar echo signal strength data refers to the millimeter-wave radar echo signal strength data emitted by the millimeter-wave radar towards the soil surface and reflected by the soil surface, including millimeter-wave radar echo signal strength data with humidity tags collected in the source environment and millimeter-wave radar echo signal strength data without humidity tags collected in the target environment.
[0064] S320, preprocess the echo signal data of the source environment and the target environment to generate feature representations for model training.
[0065] S320 is used to preprocess and extract features from the millimeter-wave radar echo signal intensity data to generate feature representations for model training. This process includes the following steps:
[0066] First, a signal strength matrix is generated. Specifically, the signal strength of each frequency band of the echo signal is obtained through Fourier transform, and then the recorded data is organized into a data set according to the signal transmission time, number of frequency bands, and number of virtual antennas. For each specific transmission time point in this data set, the corresponding data generates a signal strength matrix. In this embodiment, this matrix is specifically represented as a two-dimensional matrix, the dimensions of which include the number of frequency bands and the number of virtual antennas. Each training and test sample corresponds to such a two-dimensional matrix.
[0067] Subsequently, feature extraction is performed on the two-dimensional matrix. To further improve the model's robustness, data augmentation can be introduced before feature extraction. This data augmentation includes, for example, adding random noise to the two-dimensional matrix. Specifically:
[0068] Taking the source domain as an example, for each input sample X s Two views X are generated using data augmentation. q s and X k s One of the views is accessed via the Encoder. q Extract features to obtain Z q s Another view is through the encoder. k Extract features to obtain Z k s They are then stored in a queue as a sample library for the contrastive learning module.
[0069] Z q s = Encoder q (Augment(X s ))
[0070] Z k s = Encoder k (Augment(X s ))
[0071] Augment(·) represents the data augmenter, which uses data augmentation techniques such as adding noise to the data to generate an enhanced view. Encoder(·) is the feature encoder, which is used to extract high-dimensional features from the data samples.
[0072] S330, Construct and train a neural network model. The neural network model is trained using the labeled feature representation of the source environment and the unlabeled feature representation of the target environment. The training includes at least using a weighted multiple nearest neighbor contrastive loss function to achieve fine-grained feature distribution alignment across environments. The weighted multiple nearest neighbor contrastive loss function is calculated as follows: First, based on the similarity between samples, determine the multiple nearest neighbors of the target environment sample in the source environment sample and their ranking positions; then, assign weights to each nearest neighbor based on the ranking positions, and calculate the loss based on the assigned weights.
[0073] This step utilizes labeled feature representations of the source environment and unlabeled feature representations of the target environment to train a neural network model to obtain a soil moisture estimation model. Considering that millimeter-wave radar echo signals are significantly affected by the environment, this application introduces a contrastive learning module to improve feature representation capabilities and intra-domain discriminability, such as... Figure 2 As shown, the contrastive learning module includes:
[0074] Weighted k-Nearest Neighbor Contrastive Loss (referred to as...) ):
[0075] To enhance the robustness and representation alignment capability of the original nearest neighbor contrastive learning, this application introduces a weighted top-k nearest neighbor contrastive loss function (WNNCL) to improve fine-grained alignment of cross-domain features. Traditional nearest neighbor contrastive loss uses only the single nearest neighbor of the target domain sample in the source domain as a positive sample, which may introduce errors due to randomness or noise. Therefore, this application proposes to extend this to the top k nearest neighbors and designs a weighting mechanism based on proximity ranking to fully exploit structural information in the local feature space. Specifically, based on the features of the target domain samples... Take its top-k nearest neighbor samples in the source domain feature batch, that is As Positive samples are used for learning, while the remaining samples are used as negative samples for comparative learning. This further guides the target domain features to align with the source domain features, mitigating the differences in feature distribution between domains. Using top... Using k-nearest neighbors as positive samples can effectively average the structural information of neighboring regions, reduce the risk of misjudgment, and improve the discriminator's generalization ability to target samples. The introduction of multiple positive samples allows the target sample to simultaneously align with multiple feature points with similar semantics in the source domain during training, further promoting structural alignment across feature spaces and helping the model learn more discriminative semantic embedding representations. The expression is:
[0076]
[0077] in, For temperature parameters, Indicates the first in the target environment Query characteristics of each sample Indicates the first in the source environment Query characteristics of each sample Represents the key features of samples in the target environment. and For sample index, Values range from 1 to batch size , The value ranges from 1 to the nearest neighbor number k. ( This represents the operation of finding the k nearest neighbors in the features of the source domain;
[0078] w j is the weight of the j-th nearest neighbor. This weight ensures that closer neighbors have a greater weight in contrastive learning, effectively improving the semantic consistency and robustness of feature alignment. In some embodiments of this application, w j The expression is as follows:
[0079]
[0080] In other embodiments of this application, the contrastive learning module further includes:
[0081] Intra-domain contrast loss ( , ):
[0082] Intra-domain contrastive loss performs contrastive learning within both the source and target domains, enhancing the clustering and discriminative properties of features within their respective domains.
[0083]
[0084]
[0085] in, For batch size, (·) represents a fully connected layer. For temperature parameters, and A view of different features of the source environment sample. and These are different feature views of the target environment sample. and
[0086] These are the contrastive loss functions in the source domain and the contrastive loss functions in the target domain, respectively.
[0087] Label distance driven contrast loss ( )
[0088] Label distance-driven contrastive loss aims to optimize the structure of the feature space, causing samples with similar labels to cluster in the representation space, while samples with dissimilar labels are relatively dispersed, thus forming an embedding space that conforms to the label continuity constraint. The expression for label distance-driven contrastive loss is:
[0089]
[0090] in, For batch size, For sample-based and The weights determined by the distance between labels and The first in each batch The and the first Feature representation of a sample Temperature coefficient, superscript This represents the transpose of a vector.
[0091] This loss function essentially optimizes the structure of the feature space, causing samples with similar labels to cluster in the representation space, while samples with dissimilar labels are relatively dispersed, thus forming an embedding space that conforms to the label continuity constraint. In this way, The loss effectively guides the model to learn more structured feature representations during the training phase, significantly improving the model's inference ability and smoothness in unlabeled regions. Especially when facing samples in the test set located at or outside the edge of the training label distribution, the model can still output reasonable and stable prediction results, reducing prediction bias and local fluctuations, thereby improving overall regression performance and generalization ability.
[0092] Domain discriminant loss ( ):
[0093] To further enhance cross-domain generalization capabilities, some embodiments of this application also introduce a domain adversarial module. This module includes a domain discriminator, used to determine whether the features generated by the feature encoder belong to the source domain or the target domain. The domain discriminant loss is optimized through adversarial training. This forces the feature encoder to produce features with domain invariance, further aligning the feature distributions of the source and target domains. Domain discrimination loss. The expression is:
[0094] ,
[0095] in, For batch size, Let cross-entropy be the loss function. and These are the sample characteristics of the source environment and the target environment, respectively. and These are the domain labels for the source environment and the target environment, respectively. For domain discriminator, It is a gradient inversion layer, specifically implemented as a two-layer multilayer perceptron.
[0096] Regression loss:
[0097] Finally, the obtained high-dimensional features Soil moisture is predicted using a moisture estimation module. Specifically, a multilayer perceptron network is used to model the aforementioned features, thereby achieving regression prediction of soil moisture.
[0098] ,
[0099] in, This represents the predicted soil moisture value output by the neural network. This represents the high-dimensional features generated by the feature encoder module. MLP stands for Multilayer Perceptron Network, used for regression modeling. This represents the learnable parameters of the network.
[0100] For the humidity estimation results, this application uses mean squared error (MSE) as the loss function to constrain the training process of the model. This process includes calculating the error between the initial prediction result and the true value, and evaluating the error of the optimized prediction result.
[0101]
[0102] Where MSE(·) represents the mean squared error loss function, and Y is the model's predicted output for soil moisture in the sample. This corresponds to the actual soil moisture value. During model training, the Adam optimization algorithm is used to update the parameters, and the learning rate is set to 0.001 to improve the stability and convergence of the training process.
[0103] In summary, during the training of the soil moisture estimation model, cross-environmental adaptability is achieved through the collaborative optimization of weighted multiple nearest neighbor contrastive loss, intra-domain contrastive loss, label distance-driven contrastive loss, domain discriminant loss, and regression loss. Specifically, the weighted multiple nearest neighbor contrastive loss function provides a core mechanism for fine-grained feature distribution alignment across environments by calculating the weighted multiple nearest neighbors of the target environment sample in the source environment feature space. Building upon this, the intra-domain contrastive loss enhances the discriminative power of features within both the source and target environments, providing a clearer basis for comparison. The label distance-driven contrastive loss optimizes the feature space structure based on label similarity, enhancing the correlation between feature representations and moisture values. The domain discriminant loss, through adversarial training, prompts the feature encoder to generate domain-invariant features, complementing the core mechanism. Finally, the regression loss ensures that all feature learning serves the core task of accurate moisture prediction. The synergistic effect of these multiple loss functions addresses the alignment blind spots or limitations that may exist with a single loss function, resulting in a more comprehensive, robust, and stable cross-environmental adaptability, significantly improving estimation accuracy and generalization performance in unknown target environments.
[0104] The above combination Figure 2 The training method for the cross-environment soil moisture estimation model is described in detail. Through the above training process, a soil moisture estimation model with cross-environment adaptability (i.e., the trained mmSoilNet-DA model) can be obtained.
[0105] The following section will explain how to use the trained model to estimate soil moisture in unknown environments. Figure 4 This is a flowchart illustrating a cross-environmental soil moisture estimation method according to some embodiments of this application. Figure 1 The processor executes. For example... Figure 4 As shown, the cross-environmental soil moisture estimation method mainly includes:
[0106] S410 acquires the echo signal of the soil sampled by millimeter-wave radar.
[0107] S420, the echo signal is preprocessed to generate a feature representation that is compatible with the soil moisture estimation model described in S310-S330.
[0108] This step is similar to S320. The frequency band signal strength must be obtained according to the Fourier transform, and the echo signal must be processed into a two-dimensional matrix form and the feature representation extracted according to the transmission time, number of frequency bands and number of virtual antennas, so as to serve as the model input.
[0109] S430, input the feature representation into the soil moisture estimation model trained according to the method described in S310-S330, and output the moisture value of the soil to be tested.
[0110] One embodiment of this application verifies the effectiveness of the proposed unsupervised domain adaptive cross-environment soil moisture estimation algorithm (mmSoilNet-DA) through comparative experiments. The experiments aim to demonstrate that the algorithm can significantly improve the model's generalization ability for soil moisture prediction in unknown target environments.
[0111] The experiment collected soil samples at 40 different moisture levels from three datasets with significant environmental differences, denoted as environments E1, E2, and E3. In the cross-environment transfer assessment, each experiment selected one environment as the source domain for supervised training and another environment as the target domain for unsupervised adaptation and prediction performance testing. For example, using E1 as the source domain to train the model and testing it on the target domain E2 constitutes an E1→E2 cross-domain prediction task. In the experiment, all comparison models used the exact same data preprocessing procedures and performance evaluation metrics. The models compared included the baseline model mmSoilNet (without an unsupervised domain adaptation module) and the complete model mmSoilNet-DA proposed in this application.
[0112] Table 1 presents the prediction performance metrics of different models across various cross-environment tasks. "E1 to E2" indicates that the model was trained in the source domain E1 and tested in the target domain E2. Overall, the mmSoilNet-DA model significantly outperforms the baseline model mmSoilNet in all six cross-environment tasks. Specifically: the mean absolute error (MAE) of mmSoilNet-DA is reduced by approximately 6.52 percentage points compared to the baseline model (from 11.22% to 4.70%); the root mean square error (RMSE) is significantly reduced from 13.59% to 5.97%, indicating a greatly enhanced ability of the model to control prediction errors, particularly its ability to suppress large error samples; the coefficient of determination (R²) increases from an average of -0.41 to +0.73, turning from negative to positive, demonstrating a significant improvement in the model's generalization ability after introducing the unsupervised domain adaptation mechanism, enabling it to better perform soil moisture prediction tasks across different environments.
[0113] Table 1 Comparison of Predictive Indicators of Different Models
[0114]
[0115] Experimental results show that the original model suffers from severe performance degradation and poor generalization ability in cross-environment scenarios. In contrast, the mmSoilNet-DA model proposed in this application, by introducing an unsupervised domain adaptation mechanism, significantly mitigates the impact of inconsistent data distribution between the source and target environments, enabling more stable and accurate humidity prediction in multiple target environments. These experimental results fully validate the effectiveness and generalization ability of the proposed method in real-world complex scenarios.
[0116] In summary, the training method, system, and method for cross-environment soil moisture estimation provided in the embodiments of this application, by introducing the weighted multiple nearest neighbor contrastive loss function (WNNCL), offer a core technical means to achieve fine-grained distribution alignment of source and target environment samples within the feature space. By applying this method, the model acquires cross-environment feature adaptive capability, thereby solving the problem of insufficient generalization ability in the target environment caused by the lack of cross-environment adaptive capability in existing technologies. Furthermore, by constructing a collaborative optimization framework, WNNCL and intra-domain contrastive loss are integrated. By jointly training label distance-driven contrastive loss, domain discriminative loss, and regression loss, a multi-faceted and multi-layered technical effect of optimizing the feature space structure is achieved. Specifically, intra-domain contrastive loss enhances the discriminativeness of features within each environment, providing a clearer basis for cross-environment alignment; label distance-driven loss explicitly utilizes label similarity to constrain the feature space, enhancing the correlation between features and humidity values; domain discriminative loss globally prompts the feature encoder to generate domain-invariant features, complementing the local alignment of WNNCL; and finally, regression loss ensures that all feature learning serves accurate humidity prediction. The synergistic effect of these multiple loss functions addresses the alignment blind spots or limitations that may exist with a single loss function, making the cross-environment adaptive mechanism more effective, robust, and stable, and significantly improving the model's estimation accuracy and generalization performance in unknown target environments.
[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding descriptions in the foregoing device embodiments, and will not be repeated here.
[0118] Although the subject matter described herein is provided in the general context of execution on a computer system in conjunction with an operating system and applications, those skilled in the art will recognize that other implementations can also be executed in conjunction with other types of program modules. Generally, program modules include routines, programs, components, data structures, and other types of structures that perform specific tasks or implement specific abstract data types. Those skilled in the art will understand that the subject matter described herein can be practiced using other computer system configurations, including handheld devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframes, etc., and can also be used in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules may reside on both local and remote memory storage devices.
[0119] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0120] It should be understood that the specific embodiments described above are merely illustrative or explanatory of the principles of this application and do not constitute a limitation thereof. Therefore, any modifications, equivalent substitutions, improvements, etc., made without departing from the spirit and scope of this application should be included within the protection scope of this application. Furthermore, the appended claims are intended to cover all variations and modifications falling within the scope and boundaries of the appended claims, or equivalent forms of such scope and boundaries.
Claims
1. A training method for a cross-environment soil moisture estimation model, characterized in that, include: Acquire humidity-tagged echo signal data collected by millimeter-wave radar in the source environment, and untagged echo signal data collected in the target environment; The echo signal data of the source environment and the target environment are preprocessed to generate feature representations for model training; A soil moisture estimation model is constructed and trained using labeled feature representations of the source environment and unlabeled feature representations of the target environment. The training includes employing a weighted multiple nearest neighbor comparison loss function to achieve fine-grained feature distribution alignment across environments. The weighted multiple nearest neighbor comparison loss function is calculated as follows: first, based on the similarity between samples, multiple nearest neighbors of the target environment sample in the source environment sample and their ranking positions are determined; then, weights are assigned to each nearest neighbor based on the ranking positions, and the loss is calculated based on the assigned weights. Among them, the weighted multiple nearest neighbor contrast loss function The expression is: , in, For temperature parameters, Indicates the first in the target environment Query characteristics of each sample Indicates the first in the source environment Query characteristics of each sample Represents the key features of samples in the target environment. and For sample index, Values range from 1 to batch size , The value ranges from 1 to the nearest neighbor number k. ( This represents the operation of finding the k nearest neighbors in the features of the source domain. For the first j The weight of the nearest neighbor, whose value varies with the sorting order. j The weight decreases as the distance increases, to ensure that the nearest neighbor sample has a higher weight in the loss function.
2. The method according to claim 1, characterized in that, The training of the soil moisture estimation model includes: In addition to the weighted multiple nearest neighbor contrastive loss function, the intra-domain contrastive loss function, the label distance-driven contrastive loss function, the domain discriminant loss function, and the regression loss function are also optimized in a coordinated manner to improve the model’s cross-environment adaptive capability from four aspects: feature discriminability, feature space structure, domain invariance, and prediction accuracy.
3. The method according to claim 2, characterized in that, The intra-domain contrastive loss function includes an intra-domain contrastive loss function used to enhance the clustering and discriminative properties of sample features within the source environment. Its expression is: , in, (·) represents a fully connected layer. For temperature parameters, and A view of different features of the source environment sample. Indicates query characteristics, Indicates key features, For the first in the source environment Key features of a negative sample and For sample index, Values range from 1 to batch size , The value ranges from 1 to the number of negative samples N; The intra-domain contrastive loss function also includes a target intra-domain contrastive loss function for enhancing the clustering and discriminative properties of sample features within the target environment. Its expression is: , in, (·) represents a fully connected layer. For temperature parameters, and Different feature views of the target environment sample Indicates query characteristics, Indicates key features, For the first in the target environment Key features of a negative sample and For sample index, Values range from 1 to batch size , The value ranges from 1 to the number of negative samples N.
4. The method according to claim 2, characterized in that, The tag distance-driven contrast loss function The expression is: , in, For sample-based and The weights determined by the distance between labels and The first in each batch The and the first Feature representation of a sample Temperature coefficient, superscript This represents the transpose of a vector. and For sample index, Values range from 1 to batch size , representing the current sample, j takes values from 1 to B and , indicating the comparison sample.
5. The method according to claim 2, characterized in that... The domain discriminant loss function The expression is: , in, The sample index ranges from 1 to the batch size. , Let cross-entropy be the loss function. For domain discriminator, It is a gradient inversion layer. and These are the sample characteristics of the source environment and the target environment, respectively. and These are the domain labels for the source environment and the target environment, respectively.
6. The method according to claim 1, characterized in that, The preprocessing of the echo signal data from the source and target environments includes: For millimeter-wave radar echo signal strength data, it is divided according to its transmission time point. The echo signal data corresponding to each transmission time point is processed into a sample, where each sample is represented as a two-dimensional signal matrix. The dimension of the two-dimensional signal matrix includes the number of frequency bands and the number of virtual antennas. Data augmentation is performed on the two-dimensional signal matrix, the data augmentation including adding random noise to the two-dimensional signal matrix; High-dimensional features are extracted from the data-augmented samples.
7. A cross-environment soil moisture estimation system, characterized in that, include: Millimeter-wave radar is used to transmit signals to the soil surface and receive echo signals. A processor, communicatively connected to the millimeter-wave radar, is configured to run a soil moisture estimation model to process the echo signal into a soil moisture estimate, wherein the soil moisture estimation model is trained according to the method of any one of claims 1-6; An output device, connected to the processor, is used to output the estimated soil moisture value.
8. The system according to claim 7, characterized in that: The millimeter-wave radar is positioned above the soil area to be measured, and the pointing and height of its transmitting and receiving antennas are configured to remain constant during data acquisition to eliminate interference to the signal caused by changes in height and angle.
9. A method for estimating soil moisture across environmental conditions, characterized in that, include: Acquire echo signals of the soil sampled by millimeter-wave radar; The echo signal is preprocessed to generate a feature representation that is compatible with the soil moisture estimation model obtained by the training method of any one of claims 1-6; The feature representation is input into the soil moisture estimation model trained by the method according to any one of claims 1-6, and the moisture value of the soil to be tested is output.
Citation Information
Patent Citations
Soil humidity sensing system and method based on millimeter wave radar
CN120468180A
New intention discovery method based on dual-temperature confidence weight cluster representation learning
CN121144516A