Soil organic matter spectral anti-interference inversion method, device, equipment and medium

By constructing a soil spectral library with multiple moisture content gradients and a conditional generative adversarial network model, soil moisture and organic matter characteristics are decoupled, the influence of soil moisture interference on spectral inversion is resolved, and accurate, rapid, in-situ non-destructive monitoring of soil organic matter content is achieved, thereby improving the robustness and adaptability of the model.

CN122157834APending Publication Date: 2026-06-05SOUTH CHINA AGRICULTURAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTH CHINA AGRICULTURAL UNIVERSITY
Filing Date
2026-01-23
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In the existing visible-near-infrared spectral inversion process of soil organic matter, the soil moisture interference separation technology has problems such as the disconnect between data-driven logic and soil optical laws, the separation process of moisture interference and the subsequent quantitative modeling process, and insufficient ability to deal with nonlinear interference coupling relationship. As a result, it is impossible to achieve accurate, rapid, in-situ non-destructive monitoring of soil organic matter content.

Method used

A method for anti-interference inversion of soil organic matter spectra is adopted. By setting standardized spectral acquisition conditions, a soil spectral library with multiple moisture content gradients is constructed. Combined with principal component analysis and orthogonal complementary spatial projection matrix, a feature extraction backbone network model is used to decouple the feature vectors of water and organic matter. A conditional generative adversarial network model is constructed to perform intelligent mapping and interference separation. Finally, the soil organic matter content is output through a deep regression model.

Benefits of technology

The model achieves accurate prediction of soil organic matter content under extreme water conditions, improving the model's interpretability, anti-interference ability, and cross-domain generalization performance, thus meeting the needs of modern agriculture for high-throughput, low-cost, and in-situ non-destructive monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122157834A_ABST
    Figure CN122157834A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of soil organic matter spectrum anti-interference inversion method, device, equipment and medium, method is: regulation multiple moisture content gradient and simulating natural water infiltration state, collection visible-near infrared spectrum, determination organic matter content, build soil spectrum library;Separate source domain and target domain spectrum, construct moisture interference subspace by principal component analysis, obtain orthogonal spectrum by orthogonal transformation;Using feature extraction backbone network and double-task separation head, decouple out moisture representation vector and organic matter potential feature vector;Splice orthogonal spectrum and moisture representation vector to generate condition vector, realize spectrum mapping and separate interference spectrum by conditional generative adversarial network;Integrate the above process to build soil moisture elimination reconstruction spectrum model and verify;With the dry reference spectrum output by the model as the core input, combined with organic matter potential feature vector, quantitative calculation is carried out by depth regression model, and the predicted value of soil organic matter content is output, and anti-interference inversion is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of soil testing and spectral analysis technology, specifically to a method for anti-interference inversion of soil organic matter spectra, a corresponding device, electronic equipment, and a computer-readable storage medium. Background Technology

[0002] Soil organic matter, as a core component of the soil carbon pool, a key hub for soil nutrient cycling, and an important supporting factor for soil structural stability, requires precise measurement of its content. This is a fundamental prerequisite for soil fertility evaluation, precision fertilization guidance, regional and global carbon storage estimation, and simulation of ecosystem carbon cycle processes. It is of great significance for the sustainable development of modern agriculture, soil environmental quality monitoring, and global climate change research.

[0003] Currently, methods for determining soil organic matter content are mainly divided into two categories: traditional chemical analysis methods and modern spectroscopic analysis methods. Among them, traditional wet chemical and dry burning methods, such as potassium dichromate oxidation-external heating method and high-temperature ignition loss method, are recognized by the industry as the benchmark methods for determining soil organic matter content. However, they have inherent technical defects: the analysis process is time-consuming, with the pretreatment and detection cycle of a single sample usually taking several hours to tens of hours; reagent consumption is large, and some reagents are highly corrosive and toxic, which can easily cause secondary environmental pollution; the sample is irreversibly destroyed during the detection process, and the sample cannot be reused; at the same time, these methods rely on offline laboratory detection, which cannot achieve in-situ, real-time monitoring in the field, and it is even more difficult to complete the spatial continuous observation of soil organic matter over a large area. They can hardly meet the growing demand of modern agricultural production and soil environmental management for high-throughput, low-cost, in-situ non-destructive, and rapid monitoring.

[0004] To overcome the shortcomings of traditional chemical analysis methods, visible-near-infrared diffuse reflectance spectroscopy has emerged. With its outstanding advantages such as fast analysis speed, no need for complex sample pretreatment, ability to perform in-situ live measurement, no reagent pollution, and ability to simultaneously invert multiple soil properties, this technology has become the most promising technical means in the field of rapid estimation of soil organic matter content. Its application scenarios have gradually covered multiple fields such as farmland soil monitoring, regional carbon storage surveys, and ecological environment assessment.

[0005] The core theoretical basis for inverting soil organic matter content using visible-near-infrared diffuse reflectance spectroscopy is that the main components of soil organic matter (such as humic acid, cellulose, lignin, etc.) and the hydrogen-containing functional groups such as CH, OH, and NH contained in inorganic components (such as clay minerals, soil moisture, etc.) will produce characteristic overtone absorption and combination absorption in the visible-near-infrared band (400-2500nm), forming unique spectral response characteristics. By measuring the Vis-NIR diffuse reflectance spectrum of soil samples, extracting spectral characteristic parameters, and establishing a quantitative relationship model between spectral reflectance and soil organic matter content, the indirect inversion of soil organic matter content can be achieved.

[0006] However, soil, as a complex multiphase mixture (solid, liquid, and gas phases coexisting), has a Vis-NIR diffuse reflectance spectral signal that is the result of the combined effects of various factors such as soil physical properties, chemical properties, and mineral composition. This makes it susceptible to various interference factors, among which soil moisture is the most significant confounding variable affecting the accuracy of soil organic matter spectral inversion, model robustness, and generalization ability. Specifically, the OH bonds in soil moisture exhibit strong characteristic absorption peaks in the near-infrared band (approximately 1450 nm and 1940 nm). Furthermore, soil moisture alters the refractive index and scattering characteristics of soil particle surfaces, as well as the aggregation state between soil particles, resulting in a wide range of nonlinear modulation effects across the entire visible-near-infrared spectral range (especially the short-wave near-infrared region). This nonlinear modulation effect interacts with the characteristic spectral absorption signal of soil organic matter in complex synergistic or antagonistic ways, leading to frequent occurrences of "same substance, different spectra" and "different spectra, same substance" phenomena. This causes the characteristic spectral signal of soil organic matter to be masked or distorted by moisture interference, severely affecting the accuracy of spectral parameter extraction. Consequently, the established quantitative inversion model contains significant errors and fails to meet the practical needs of precise monitoring.

[0007] To address the aforementioned soil moisture interference problem, various interference separation and spectral preprocessing methods have been proposed to weaken or eliminate the influence of moisture on soil organic matter spectral inversion. These methods can be mainly divided into two categories: one is the traditional preprocessing method based on linear projection, with external parameter orthogonalization (EPO) as a typical example. This type of method orthogonally separates moisture-related variability information in the spectrum through mathematical linear projection operations, thereby achieving interference reduction; the other is the data-driven deep learning method, with generative adversarial networks (GANs) as a typical example. This type of method attempts to simulate soil spectra without moisture interference through generative models, thereby achieving interference separation and organic matter inversion.

[0008] However, the existing interference separation methods mentioned above still have obvious technical shortcomings and fail to fundamentally solve the problem of nonlinear interference of soil moisture. The specific deficiencies are as follows:

[0009] 1. Traditional linear preprocessing methods (such as EPO) are essentially linear projection techniques that can only handle simple linear interference coupling relationships. They cannot adapt to the complex nonlinear modulation effects of soil moisture on the spectrum and have limited decoupling effects on the nonlinear coupling interference between water and organic matter spectral signals. At the same time, as an isolated preprocessing module, this type of method lacks a deep collaborative mechanism with subsequent quantitative modeling algorithms (such as partial least squares regression (PLSR), convolutional neural networks (CNN), etc.). The separated water interference information is simply removed and not fully utilized to guide the structural optimization and parameter adjustment of the subsequent model, resulting in the model's robustness and generalization ability still needing improvement.

[0010] 2. Deep learning-based interference separation methods (typically based on existing Generative Adversarial Networks (GANs)) lack robust data constraint mechanisms and targeted condition guidance strategies. In the field of visible-near-infrared spectral inversion of soil organic matter, most existing GAN-based solutions use external interference parameters such as soil moisture content as simple numerical labels input into the model. They fail to use the moisture interference subspace features obtained through precise mathematical methods as structural constraints in the spectral generation process. As a result, although the "soil spectrum without moisture interference" generated by the model has certain similarities to the real soil spectrum without moisture in terms of statistical characteristics, it may deviate from the basic laws of soil optics (such as the position and intensity ratio of the characteristic absorption peaks of functional groups of soil organic matter and inorganic components). This results in technical defects such as weak interpretability and insufficient model robustness, making it difficult to adapt to actual engineering application scenarios with different soil types and different moisture content ranges.

[0011] In summary, existing water interference separation techniques in the visible-near-infrared spectral inversion process of soil organic matter generally suffer from core technical problems such as a disconnect between data-driven logic and soil optical laws, a separation between the water interference separation process and the subsequent quantitative modeling process, and insufficient ability to handle nonlinear interference coupling relationships. These techniques fail to achieve accurate decoupling of soil moisture from the nonlinear interference of organic matter characteristic spectra, and are therefore unable to meet the practical application requirements for accurate, rapid, in-situ non-destructive monitoring of soil organic matter content. Summary of the Invention

[0012] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for anti-interference inversion of soil organic matter spectra, a corresponding device, electronic equipment and computer-readable storage medium.

[0013] The technical solution of the present invention to solve the above-mentioned technical problems is:

[0014] A method for anti-interference inversion of soil organic matter spectra, comprising the following steps:

[0015] Step 1: After preprocessing the soil sample, set standardized spectral acquisition conditions, adjust the soil sample to multiple moisture content gradients and simulate natural water infiltration state, determine the organic matter content of the soil sample, acquire the visible light-near infrared spectrum of the soil sample, preprocess the acquired visible light-near infrared spectrum, and construct a soil spectral library containing multiple moisture content gradients, corresponding organic matter content and soil moisture content labels.

[0016] Step 2: Extract dry soil spectra as the source domain and wet soil spectra as the target domain from the soil spectral library. Merge the spectral data of the source and target domains and perform principal component analysis in conjunction with soil moisture content labels. Extract the first few principal components that are highly correlated with moisture changes to form a moisture interference subspace. Calculate the orthogonal complement projection matrix of the moisture interference subspace. Use the orthogonal complement projection matrix to perform a linear transformation on the spectrum of the target domain to be processed to obtain the orthogonalized spectrum.

[0017] Step 3: Construct a feature extraction backbone network model, using the orthogonalized spectrum as input to the feature extraction backbone network model, and obtain a high-dimensional integrated deep feature vector through the feature extraction backbone network model; decouple the high-dimensional integrated deep feature vector into a water characterization vector and an organic matter potential feature vector by setting a dual-task characterization separator at the end of the feature extraction backbone network model.

[0018] Step 4: Concatenate the orthogonalized spectrum with the moisture characterization vector along the feature dimension to generate a conditional vector to guide the spectral mapping;

[0019] Step 5: Construct a conditional generative adversarial network model with a gradient inversion layer. Guided by conditional vectors, the model achieves intelligent mapping from wet soil spectrum to dry reference spectrum. Through conditional reconstruction by the generator and adversarial learning by the discriminator, based on the difference between the generated dry reference spectrum and the original wet soil spectrum, the interfering spectrum containing only moisture interference information is simultaneously separated.

[0020] Step 6: Integrate steps 1-5 to complete the construction of the soil moisture loss reconstruction spectral model; by constructing a hierarchical validation set covering the entire moisture content range, use multi-dimensional quantitative indicators to conduct comprehensive performance verification of the soil moisture loss reconstruction spectral model.

[0021] Step 7: Using the dry reference spectrum output by the soil moisture removal reconstruction spectral model as input, and combining it with the organic matter potential feature vector obtained in Step 3, input them together into the deep regression model for quantitative calculation through regression modeling, and output the predicted value of soil organic matter content, thus completing the entire spectral anti-interference inversion process.

[0022] Preferably, in step 1, the observation angle is set to 90°, the zenith angle of the light source is 30°, and the azimuth angle is 0° as standardized spectral acquisition conditions. After pretreatment, the soil sample is passed through a 100-mesh sieve. Experimental pure water is sprayed evenly onto the soil sample using a spray bottle to simulate the natural infiltration process. Based on the maximum saturated weight moisture content of the soil determined in the pre-experiment as 55%, 12 moisture gradients with a gradient interval of 5% from 0% to 55% are set, and the soil samples are treated with water in sequence. The content of soil organic matter is determined by potassium dichromate oxidation heating method. The visible-near infrared spectrum of the soil in the range of 350-2500 nm is collected by a spectrometer. Each soil sample needs to be measured 10 times.

[0023] Preferably, in step 1, the visible-near-infrared spectrum is smoothed using the Savitzky-Golay convolution smoothing algorithm, and the smoothed visible-near-infrared spectrum is then transformed using a standard normal variable.

[0024] Preferably, in step 3, the feature extraction backbone network model consists of multiple layers of one-dimensional convolutional layers, nonlinear activation function layers, and pooling layers stacked sequentially; wherein, the one-dimensional convolutional layers are used to capture subtle patterns of local absorption valleys and reflection peaks in the spectral curve, as well as the correlation between these subtle patterns; the pooling layers are used to compress the dimensionality of the feature data output by the one-dimensional convolutional layers, while simultaneously extracting global and abstract features from the spectrum; the output of the feature extraction backbone network model is a high-dimensional comprehensive deep feature vector after deep encoding of the orthogonal spectrum.

[0025] Preferably, in step 3, the dual-task representation separation head includes a first fully connected sub-network and a second fully connected sub-network set at the end of the feature extraction backbone network model and connected in parallel. The first fully connected sub-network takes a high-dimensional integrated deep feature vector as input and has a Sigmoid activation function layer at its end. The Sigmoid activation function layer outputs a water representation vector, and the value range of each element in the water representation vector is [0,1]. The second fully connected sub-network takes a high-dimensional integrated deep feature vector as input and maps and outputs an organic matter potential feature vector.

[0026] Preferably, in step 5, the generator adopts a U-Net architecture, including an encoder, a decoder, and a conditional injection unit. The encoder consists of four downsampling blocks stacked layer by layer. Each downsampling block contains a one-dimensional convolutional layer, a batch normalization layer, and an activation function layer, used for feature extraction and layer-by-layer compression of the input wet soil spectrum. The decoder consists of four upsampling blocks stacked layer by layer. Each upsampling block contains a transposed convolutional layer, a batch normalization layer, and an activation function layer, used for upsampling spectral features and gradually restoring spectral details. A skip connection structure is established between the decoder and the encoder to transmit the feature maps output from each layer of the encoder to the corresponding resolution layer of the decoder and fuse them with the upsampling features of the decoder. The conditional injection unit receives the conditional vector and maps it into a multi-scale conditional embedding using a fully connected layer. The multi-scale conditional embedding is concatenated with the feature maps output from each layer of the encoder along the channel dimension to inject conditional information.

[0027] The discriminator has a multi-task structure, including a common feature extractor and two parallel discriminant heads. The common feature extractor consists of three convolutional layers with strides, used to extract shared features of the spectrum. The two parallel discriminant heads are a ground truth discriminant head and a domain discriminant head. The ground truth discriminant head outputs a single-valued probability through a fully connected layer to determine the authenticity of the input spectrum. The input of the domain discriminant head is connected to a gradient inversion layer, which inverts the gradient sign during backpropagation to achieve adversarial domain adaptation.

[0028] Preferably, in step 6, a stratified validation set covering the entire moisture content range of 5%-55% is constructed, and stratified sampling is performed according to moisture content gradients of 15%, 35%, and 50%; multi-scale one-dimensional convolution is introduced to extract spectral features, and the convolution kernels of the multi-scale one-dimensional convolution are 3, 5, and 7; a gradient inversion layer is used to achieve cross-domain feature alignment, and a dynamic correction weight is generated through an adaptive gating mechanism; during validation, the correlation between reflectance and moisture content in the corrected 1450nm and 1940nm bands is calculated to evaluate the effect of moisture interference suppression; the signal-to-noise ratio in the 2200nm band is calculated to evaluate the quality of organic matter signals; root mean square error and coefficient of determination are used to quantify the spectral reconstruction accuracy; the robustness of the soil moisture elimination reconstruction spectral model is verified by grouping according to moisture content intervals, and the correction error of samples with moisture content greater than the preset value is statistically analyzed.

[0029] A soil organic matter spectral anti-interference inversion device, comprising:

[0030] The spectral library construction module is used to preprocess soil samples, set standardized spectral acquisition conditions, adjust the soil samples to multiple moisture content gradients and simulate natural water infiltration, determine the organic matter content of the soil samples, acquire the visible light-near infrared spectrum of the soil samples, preprocess the acquired visible light-near infrared spectrum, and construct a soil spectral library containing multiple moisture content gradients, corresponding organic matter content, and soil moisture content labels.

[0031] The orthogonalized spectrum acquisition module is used to extract dry soil spectra as the source domain and wet soil spectra as the target domain from the soil spectral library, merge the spectral data of the source domain and the target domain, and perform principal component analysis in conjunction with soil moisture content labels. The first few principal components that are highly correlated with moisture changes are extracted to form a moisture interference subspace. The orthogonal complement space projection matrix of the moisture interference subspace is calculated, and the spectrum of the target domain to be processed is linearly transformed using the orthogonal complement space projection matrix to obtain the orthogonalized spectrum.

[0032] The feature extraction and decoupling module is used to construct a feature extraction backbone network model, taking the orthogonalized spectrum as the input of the feature extraction backbone network model, and obtaining a high-dimensional comprehensive deep feature vector through the feature extraction backbone network model; and decoupling the high-dimensional comprehensive deep feature vector into a water characterization vector and an organic matter potential feature vector through a dual-task characterization separation head set at the end of the feature extraction backbone network model.

[0033] The conditional vector generation module is used to concatenate the orthogonalized spectrum with the moisture characterization vector in the feature dimension to generate a conditional vector for guiding spectral mapping.

[0034] The spectral mapping and interference separation module is used to construct a conditional generative adversarial network model with a gradient inversion layer. Guided by conditional vectors, it realizes intelligent mapping from wet soil spectrum to dry reference spectrum. Through conditional reconstruction of the generator and adversarial learning of the discriminator, based on the difference between the generated dry reference spectrum and the original wet soil spectrum, it simultaneously separates the interference spectrum containing only moisture interference information.

[0035] The model building and validation module integrates the workflow and corresponding model modules of the spectral library building module, orthogonal spectrum acquisition module, feature extraction and decoupling module, conditional vector generation module, and spectral mapping and interference separation module to complete the construction of the soil moisture elimination reconstruction spectral model; it also builds a hierarchical validation set covering the entire moisture content range and uses multi-dimensional quantitative indicators to perform comprehensive performance validation of the soil moisture elimination reconstruction spectral model.

[0036] The organic matter inversion module takes the dry reference spectrum output by the soil moisture removal reconstruction spectral model as input, and combines it with the potential organic matter feature vector obtained by the feature extraction and decoupling module. It then inputs this feature vector into the deep regression model to perform quantitative calculations through regression modeling and outputs the predicted value of soil organic matter content.

[0037] An electronic device includes a central processing unit and a memory, the central processing unit being configured to invoke and run a computer program stored in the memory to perform the steps of the soil organic matter spectral anti-interference inversion method.

[0038] A computer-readable storage medium stores, in the form of computer-readable instructions, a computer program implemented according to the aforementioned soil organic matter spectral anti-interference inversion method, which, when invoked by a computer, executes the steps included in the corresponding method.

[0039] Compared with the prior art, the present invention has the following advantages:

[0040] The soil organic matter spectral anti-interference inversion method of this invention establishes an end-to-end collaborative optimization mechanism between mathematical orthogonalization (EPO), deep learning representation (1D-CNN feature decoupling), and adversarial generation (CGAN spectral reconstruction). This breaks the limitation of the existing technology where the three are independent and difficult to work together. Even under extreme water conditions (water content > 40%), it can still achieve accurate prediction of soil organic matter content, and ultimately achieve a comprehensive synergistic improvement in model interpretability, anti-interference ability, and cross-domain generalization performance. Attached Figure Description

[0041] Figure 1 This is a schematic flowchart of the soil organic matter spectral anti-interference inversion method of the present invention.

[0042] Figure 2 This is a schematic diagram of the structure of a conditional generative adversarial network model.

[0043] Figure 3 This is a map showing the prediction accuracy of soil organic matter. Detailed Implementation

[0044] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0045] Example 1

[0046] See Figures 1-3 The soil organic matter spectral anti-interference inversion method of the present invention includes the following steps:

[0047] Step 1: After preprocessing the soil sample, set standardized spectral acquisition conditions, adjust the soil sample to multiple moisture content gradients and simulate natural water infiltration state, determine the organic matter content of the soil sample, acquire the visible light-near infrared spectrum of the soil sample, preprocess the acquired visible light-near infrared spectrum, and construct a soil spectral library containing multiple moisture content gradients, corresponding organic matter content and soil moisture content labels.

[0048] In this embodiment, the observation angle was set to 90°, the zenith angle of the light source to 30°, and the azimuth angle to 0° as standardized spectral acquisition conditions. After pretreatment, the soil samples were passed through a 100-mesh sieve. Experimental purified water was sprayed evenly onto the soil samples using a spray bottle to simulate the natural infiltration process. Based on the pre-experimental determination that the maximum saturated weight moisture content of the soil is 55%, 12 moisture gradients with a gradient interval of 5% were set, and the soil samples were treated with water sequentially. The soil organic matter content was determined by the potassium dichromate oxidation heating method. The visible-near infrared spectrum of the soil in the range of 350-2500 nm was collected using an ASD Fied Spec 4 Hi-Res spectrometer. Each soil sample needed to be measured 10 times.

[0049] Next, the visible-near-infrared spectrum is smoothed using the Savitzky-Golay convolution smoothing algorithm. The Savitzky-Golay convolution smoothing formula is as follows:

[0050] ;

[0051] In the formula: For the first Smooth output at each position; The original signal is in Centered on the left and right The input value in the neighborhood of each point, It is determined by the window length The optimal weight coefficients of Savitzky-Golay are determined by the order of the fitting polynomial. The entire Savitzky-Golay convolution smoothing formula represents the smoothing result obtained by weighted summation of the original signal points in the neighborhood.

[0052] To eliminate the effects of light scattering and path length differences caused by the moisture gradient, a standard normal transformation was further applied to the smoothed visible-near-infrared spectra. This standard normal transformation, by correcting the baseline shift and amplitude variations in each sample's spectrum, effectively reduces interference caused by inconsistencies between sample conditions and measurement parameters. The formula for the standard normal transformation is as follows:

[0053] ;

[0054] In the formula: It is a standard normal variable. It is a random variable that follows a normal distribution. It is the mean of the original distribution. It is the standard deviation of the original distribution. The formula for transforming the entire standard normal variable means subtracting the mean from the original variable and then dividing by the standard deviation, thereby transforming it into a standard normal variable with a mean of 0 and a standard deviation of 1.

[0055] Finally, a soil spectral library (SD) was constructed, which includes multiple moisture content gradients, corresponding organic matter content, and soil moisture content labels.

[0056] Step 2: To achieve mathematical separation of the influence of moisture in the spectrum, dry soil spectra are extracted from the soil spectral library as the source domain and moist soil spectra as the target domain. After uniformly assigning a moisture content label of 0 to the dry soil spectra, the spectral data of the source and target domains are merged, and principal component analysis is performed using the moisture content labels of all soil samples. The first few principal components (e.g., total absorption intensity factor, moisture-organic matter interaction factor, moisture microstate factor) highly correlated with moisture changes are extracted to form a moisture interference subspace. The orthogonal complement projection matrix of this moisture interference subspace is calculated. The orthogonal complement projection matrix is ​​used to perform a linear transformation on the target domain spectrum to be processed, obtaining an orthogonalized spectrum with some moisture interference removed. This effectively suppresses linear variations caused by moisture, providing anti-interference input for subsequent deep feature extraction.

[0057] Step 3: Construct a feature extraction backbone network model, using the orthogonalized spectrum as input to the feature extraction backbone network model, and obtain a high-dimensional integrated deep feature vector through the feature extraction backbone network model; decouple the high-dimensional integrated deep feature vector into a water characterization vector and an organic matter potential feature vector by setting a dual-task characterization separator at the end of the feature extraction backbone network model.

[0058] The feature extraction backbone network model is constructed using a one-dimensional convolution algorithm. It is a single-branch one-dimensional convolutional neural network specifically designed for visible-near-infrared spectroscopy. Its core function is to receive the orthogonalized spectrum after external parameter orthogonalization processing. This invention achieves in-depth mining and intelligent decoupling of spectral features, providing a high-quality feature foundation for subsequent anti-interference inversion of soil organic matter. Unlike traditional convolutional neural networks, which are designed for single feature extraction, the core design goal of the feature extraction backbone network model in this invention is to achieve intelligent feature decoupling. Specifically, it decouples orthogonalized spectra after preliminary moisture suppression processing. In the process, two types of feature representations with different spectral data changes were further explored and accurately separated, corresponding to soil moisture-related features and soil organic matter-related features, respectively. This achieved the initial separation of water interference features and organic matter effective features, laying the foundation for the accurate decoupling of the subsequent dual-task characterization separation head.

[0059] The formula for one-dimensional convolution is as follows:

[0060] ;

[0061] In the formula, It is the first Each output channel is in position The convolution result, It is the first Each input channel is in position The signal value, It is the first The output channel and the first Each input channel is located at the convolution kernel position. The weight, It is the first The bias of each output channel, the formula for the entire one-dimensional convolution is to sum the weighted input signals and weights at all input channels and all convolution kernel positions, and then add the bias to obtain the final output.

[0062] In this embodiment, the feature extraction backbone network model consists of multiple layers of one-dimensional convolutional layers, ReLU nonlinear activation function layers, and pooling layers stacked sequentially to form a complete pipeline for learning spectral deep features. The one-dimensional convolutional layers capture subtle patterns of local absorption valleys and reflection peaks in the spectral curve, as well as the correlations between these subtle patterns. The pooling layers compress the dimensionality of the feature data output by the one-dimensional convolutional layers, while simultaneously extracting global and abstract features from the spectrum. The output of this feature extraction backbone network model is a high-dimensional comprehensive deep feature vector that integrates the orthogonal spectrum after deep encoding. The residual nonlinear complex pattern information.

[0063] After obtaining the high-dimensional integrated deep feature vector, feature decoupling is achieved by setting a dual-task representation separation head at the end of the feature extraction backbone network model. The dual-task representation separation head includes a first fully connected subnetwork and a second fully connected subnetwork set at the end of the feature extraction backbone network model and connected in parallel. The first fully connected subnetwork and the second fully connected subnetwork have similar structures but different objectives. The first fully connected subnetwork takes the high-dimensional integrated deep feature vector as input and has a Sigmoid activation function layer at its end, which outputs a water content representation vector. The moisture characterization vector Each element in the matrix has a value range of [0,1], which is used to quantify the residual nonlinear moisture interference intensity after orthogonalizing the spectrum through orthogonal complementary spatial projection matrix processing, transforming the interference degree that is difficult to describe intuitively into a computable semantic vector; the second fully connected sub-network takes a high-dimensional comprehensive deep feature vector as input and maps the output organic matter latent feature vector. The organic matter potential feature vector The aim is to remove the confounding effects of moisture and other interfering factors, and focus on encoding core spectral feature patterns closely related to soil organic matter content, providing a pure semantic representation for the final content inversion.

[0064] Step 4: Concatenate the orthogonalized spectrum with the moisture characterization vector along the feature dimension to generate a conditional vector to guide the spectral mapping;

[0065] In this embodiment, to achieve controllable and accurate spectral mapping of the subsequent conditional generative adversarial network (CGAN) model, a guided conditional vector synthesis step is required to organically integrate the output results of the aforementioned feature extraction and decoupling processes, forming a guided signal rich in multi-level information. The specific synthesis process is as follows: the initial input feature extraction backbone network model and the orthogonalized spectrum containing physical correction information are combined. The water characterization vector, obtained from the feature extraction backbone network model itself, is used to quantify the intensity of water disturbance. The feature dimension is concatenated for fusion processing, and this concatenation operation generates a conditional vector. Its expression is The condition vector It is a highly information-fusion guiding signal, possessing both mathematical correction characteristics and deep learning intelligent recognition characteristics. Simultaneously, the condition vector... This system incorporates both the linear interference removal results obtained from the original spectrum through external parameter orthogonalization (EPO) mathematical processing, fully preserving the effective correction information in the spectrum, and the quantitative evaluation information of nonlinear residual moisture interference intelligently identified by deep learning algorithms. This achieves a comprehensive fusion of linear interference removal results and nonlinear interference quantitative information. This conditional vector, rich in multi-level and multi-type information, This will serve as the core guiding signal for the generator in the subsequent Conditional Generative Adversarial Network (CGAN), providing the generator with a clear, specific, and quantifiable guiding target. This effectively avoids the blindness of the traditional generative mapping process, enabling the generator to complete the controllable and precise reconstruction from the wet soil spectrum to the dry reference spectrum under strong semantic guidance.

[0066] Step 5: Construct a conditional generative adversarial network model with a gradient inversion layer. Guided by conditional vectors, the model achieves intelligent mapping from wet soil spectrum to dry reference spectrum. Through conditional reconstruction by the generator and adversarial learning by the discriminator, based on the difference between the generated dry reference spectrum and the original wet soil spectrum, the interfering spectrum containing only moisture interference information is simultaneously separated.

[0067] In this embodiment, the generator adopts a U-Net architecture adapted to one-dimensional spectral data. The generator includes an encoder and a decoder. The encoder consists of four downsampling blocks stacked layer by layer. Each downsampling block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function layer, used to compress the dimension and resolution of the input wet soil spectrum layer by layer. The decoder consists of four upsampling blocks stacked layer by layer. Each upsampling block contains a transposed convolutional layer, a batch normalization layer, and a ReLU activation function layer, used to progressively recover spectral details. A skip connection structure is constructed between the decoder and the encoder to transmit the feature maps output by each layer of the encoder to the corresponding resolution layer of the decoder and fuse them with the upsampling features of the decoder.

[0068] In addition, the generator is also equipped with a condition injection unit, which is used to receive condition vectors. The multi-scale conditional embedding is mapped to a multi-scale conditional embedding using a fully connected layer. The multi-scale conditional embedding is then concatenated with the feature maps output by each layer of the encoder in the channel dimension to inject conditional information, so that the generation process is guided by prior and quantitative water characterization throughout.

[0069] The discriminator has a multi-task structure, comprising a common feature extractor and two parallel discriminant heads. The common feature extractor consists of three convolutional layers with strides, which branch into two discriminant heads: a ground truth discriminant head and a domain discriminant head. The ground truth discriminant head outputs a single value through a fully connected layer to determine the authenticity of the spectrum. The input of the domain discriminant head is connected to a gradient inversion layer, which inverts the gradient sign during backpropagation to achieve adversarial domain adaptation, forcing the generator to learn domain-invariant features.

[0070] Step 6: Steps 1-5 are completed sequentially, including soil spectral preprocessing, suppression of linear water interference, feature extraction and decoupling, condition-guided spectral mapping and interference separation. The above processes and corresponding model modules are integrated to complete the construction of the soil moisture elimination reconstruction spectral model. A hierarchical validation set covering the entire water content range is constructed, and multi-dimensional quantitative indicators are used to conduct comprehensive performance verification of the soil moisture elimination reconstruction spectral model.

[0071] In this embodiment, to verify the accuracy of the soil moisture removal reconstruction spectral model, a stratified validation set covering the full moisture content range of 5%-55% was constructed, and stratified sampling was performed according to the moisture content gradients of 15%, 35%, and 50%. Multi-scale one-dimensional convolution (convolution kernels 3, 5, and 7) was introduced to extract spectral features, and gradient inversion layer (GRL) was used to achieve cross-domain feature alignment. Dynamically corrected weights were generated through an adaptive gating mechanism.

[0072] During verification, the correlation between reflectance and water content in the corrected 1450nm and 1940nm bands was calculated to evaluate the water interference suppression effect.

[0073] ;

[0074] In the formula: For reflectivity, Moisture content;

[0075] Calculate the signal-to-noise ratio in the 2200nm band to evaluate the signal quality of organic matter;

[0076] ;

[0077] In the formula: For signal power, Noise power;

[0078] The root mean square error and coefficient of determination are used to quantify the accuracy of spectral reconstruction.

[0079] ;

[0080] ;

[0081] In the formula: For predicted values, The actual value;

[0082] The robustness of the soil moisture removal reconstruction spectral model is verified by grouping samples according to moisture content range. The correction error of samples with moisture content greater than the preset value (>40%) is statistically analyzed to achieve a comprehensive evaluation of the performance of the soil moisture removal reconstruction spectral model. Based on the evaluation results, the difference between the generated dry reference spectrum and the real dry spectrum, as well as the adversarial loss of the discriminator, can be calculated using the loss function. The network parameters of the feature extraction backbone network model and the conditional generative adversarial network model are updated through the backpropagation algorithm until the preset convergence condition is met or the maximum number of iterations is reached. The trained soil moisture removal reconstruction spectral model is then determined and saved.

[0083] Step 7: Using the dry reference spectrum output by the soil moisture removal reconstruction spectral model as the core input, and combining it with the organic matter potential feature vector obtained by decoupling the feature extraction backbone network, the two types of input data are spliced ​​and fused according to their feature dimensions, and then input into the deep regression model. Through the deep regression model, regression modeling and quantitative calculation are performed, and finally, an accurate predicted value of soil organic matter content is output, thus completing the entire soil organic matter spectral anti-interference inversion process.

[0084] Finally, through its innovative technical architecture and training mechanism, this invention achieves significant breakthroughs in the accuracy, robustness, and practicality of soil organic matter spectral inversion, specifically as follows:

[0085] Firstly, compared with existing methods, the core of this invention lies in designing a cascaded processing framework of "mathematical preprocessing correction - feature decoupling - adversarial generation". First, the orthogonal complementary spatial projection matrix algorithm is used to mathematically remove the linear variation components related to water in the spectrum, providing mathematical changes for subsequent processing. Then, a dedicated 1D-CNN network is used to extract deep features from the orthogonalized spectrum after processing by the orthogonal complementary spatial projection matrix, and explicitly decouples it into a water characterization vector that quantifies the intensity of water interference and an organic matter feature vector that carries organic matter information. Finally, the mathematical change results and the quantified interference information are fused into a conditional vector to guide the generator in the conditional generative adversarial network model to reconstruct the spectrum. This ensures that the interference removal process has clear mathematical direction and interpretability, thereby avoiding the difficulty of modeling complex coupling relationships in the traditional end-to-end black box model and realizing the layer-by-layer fine-grained removal of linear to nonlinear interference.

[0086] Secondly, this invention constructs a closed-loop learning paradigm that integrates mathematical constraints with data-driven approaches. The orthogonal complementary spatial projection matrix algorithm provides mathematical constraints consistent with spectral principles, while the deep learning model performs nonlinear compensation and feature learning on this basis, enhancing the model's adaptability to complex real-world environments. Specifically, the gradient inversion layer mechanism introduced in the conditional generative adversarial network model forces the generator to learn "domain-invariant features" through adversarial training, its theoretical basis being distribution alignment in domain adaptation. This enables the model not only to fit the data but also to fundamentally learn invariant patterns under disturbance conditions, thus maintaining stable predictive performance even when facing new soil types. Furthermore, the joint optimization of the generator's multi-objective loss functions (adversarial loss, domain adaptation loss, and reconstruction loss) ensures that the model converges to a balance point that is both faithful to the data patterns and possesses high discriminative ability. To further verify the model's robustness, this invention performs performance verification on the soil moisture removal reconstruction spectral model by grouping it according to moisture content ranges. At the same time, it focuses on statistically analyzing the correction error of samples with high moisture content (>40%), which fully verifies the stability of the soil moisture removal reconstruction spectral model in a wide moisture content range, especially in complex interference scenarios with high moisture content, further confirming the practicality of the soil moisture removal reconstruction spectral model's strong generalization ability.

[0087] Thirdly, on a test set covering a wide range of moisture gradients from 0% to 40%, the prediction determination coefficient (R²) of this invention reached 0.81, and the root mean square error (RMSE) was 2.7 g / kg. All indicators are superior to traditional PLSR, 1D-CNN and ordinary generative adversarial networks. Combined with the validation by grouping according to moisture content intervals and the statistical results of error correction for high moisture content (>40%) samples, this further confirms the stability and reliability of this invention in the full moisture content range and under complex interference scenarios, highlighting its engineering practical value and effectively adapting to diverse moisture content scenarios in actual soil testing.

[0088] Example 2

[0089] The soil organic matter spectral anti-interference inversion device of the present invention includes:

[0090] The spectral library construction module is used to preprocess soil samples, set standardized spectral acquisition conditions, adjust the soil samples to multiple moisture content gradients and simulate natural water infiltration, determine the organic matter content of the soil samples, acquire the visible light-near infrared spectrum of the soil samples, preprocess the acquired visible light-near infrared spectrum, and construct a soil spectral library containing multiple moisture content gradients, corresponding organic matter content, and soil moisture content labels.

[0091] The orthogonalized spectrum acquisition module is used to extract dry soil spectra as the source domain and wet soil spectra as the target domain from the soil spectral library, merge the spectral data of the source domain and the target domain, and perform principal component analysis in conjunction with soil moisture content labels. The first few principal components that are highly correlated with moisture changes are extracted to form a moisture interference subspace. The orthogonal complement space projection matrix of the moisture interference subspace is calculated, and the spectrum of the target domain to be processed is linearly transformed using the orthogonal complement space projection matrix to obtain the orthogonalized spectrum.

[0092] The feature extraction and decoupling module is used to construct a feature extraction backbone network model, taking the orthogonalized spectrum as the input of the feature extraction backbone network model, and obtaining a high-dimensional comprehensive deep feature vector through the feature extraction backbone network model; and decoupling the high-dimensional comprehensive deep feature vector into a water characterization vector and an organic matter potential feature vector through a dual-task characterization separation head set at the end of the feature extraction backbone network model.

[0093] The conditional vector generation module is used to concatenate the orthogonalized spectrum with the moisture characterization vector in the feature dimension to generate a conditional vector for guiding spectral mapping.

[0094] The spectral mapping and interference separation module is used to construct a conditional generative adversarial network model with a gradient inversion layer. Guided by conditional vectors, it realizes intelligent mapping from wet soil spectrum to dry reference spectrum. Through conditional reconstruction of the generator and adversarial learning of the discriminator, based on the difference between the generated dry reference spectrum and the original wet soil spectrum, it simultaneously separates the interference spectrum containing only moisture interference information.

[0095] The model building and validation module integrates the workflow and corresponding model modules of the spectral library building module, orthogonal spectrum acquisition module, feature extraction and decoupling module, conditional vector generation module, and spectral mapping and interference separation module to complete the construction of the soil moisture elimination reconstruction spectral model; it also builds a hierarchical validation set covering the entire moisture content range and uses multi-dimensional quantitative indicators to perform comprehensive performance validation of the soil moisture elimination reconstruction spectral model.

[0096] The organic matter inversion module takes the dry reference spectrum output by the soil moisture removal reconstruction spectral model as input, and combines it with the potential organic matter feature vector obtained by the feature extraction and decoupling module. It then inputs this feature vector into the deep regression model to perform quantitative calculations through regression modeling and outputs the predicted value of soil organic matter content.

[0097] Example 3

[0098] The electronic device of the present invention includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to perform the steps of the soil organic matter spectral anti-interference inversion method.

[0099] Example 4

[0100] The computer-readable storage medium of the present invention stores, in the form of computer-readable instructions, a computer program implemented according to the soil organic matter spectral anti-interference inversion method, which, when called by a computer, executes the steps included in the corresponding method.

[0101] The above are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above content. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for anti-interference inversion of soil organic matter spectra, characterized in that, Includes the following steps: Step 1: After preprocessing the soil sample, set standardized spectral acquisition conditions, adjust the soil sample to multiple moisture content gradients and simulate natural water infiltration state, determine the organic matter content of the soil sample, acquire the visible light-near infrared spectrum of the soil sample, preprocess the acquired visible light-near infrared spectrum, and construct a soil spectral library containing multiple moisture content gradients, corresponding organic matter content and soil moisture content labels. Step 2: Extract dry soil spectra as the source domain and wet soil spectra as the target domain from the soil spectral library. Merge the spectral data of the source and target domains and perform principal component analysis in conjunction with soil moisture content labels. Extract the first few principal components that are highly correlated with moisture changes to form a moisture interference subspace. Calculate the orthogonal complement projection matrix of the moisture interference subspace. Use the orthogonal complement projection matrix to perform a linear transformation on the spectrum of the target domain to be processed to obtain the orthogonalized spectrum. Step 3: Construct a feature extraction backbone network model, using the orthogonalized spectrum as input to the feature extraction backbone network model, and obtain a high-dimensional integrated deep feature vector through the feature extraction backbone network model; decouple the high-dimensional integrated deep feature vector into a water characterization vector and an organic matter potential feature vector by setting a dual-task characterization separator at the end of the feature extraction backbone network model. Step 4: Concatenate the orthogonalized spectrum with the moisture characterization vector along the feature dimension to generate a conditional vector to guide the spectral mapping; Step 5: Construct a conditional generative adversarial network model with a gradient inversion layer. Guided by conditional vectors, the model achieves intelligent mapping from wet soil spectrum to dry reference spectrum. Through conditional reconstruction by the generator and adversarial learning by the discriminator, based on the difference between the generated dry reference spectrum and the original wet soil spectrum, the interfering spectrum containing only moisture interference information is simultaneously separated. Step 6: Integrate steps 1-5 to complete the construction of the soil moisture loss reconstruction spectral model; by constructing a hierarchical validation set covering the entire moisture content range, use multi-dimensional quantitative indicators to conduct comprehensive performance verification of the soil moisture loss reconstruction spectral model. Step 7: Using the dry reference spectrum output by the soil moisture removal reconstruction spectral model as input, and combining it with the organic matter potential feature vector obtained in Step 3, input them together into the deep regression model for quantitative calculation through regression modeling, and output the predicted value of soil organic matter content, thus completing the entire spectral anti-interference inversion process.

2. The soil organic matter spectral anti-interference inversion method according to claim 1, characterized in that, In step 1, the observation angle was set to 90°, the zenith angle of the light source to 30°, and the azimuth angle to 0° as standardized spectral acquisition conditions. After pretreatment, the soil samples were passed through a 100-mesh sieve. Experimental purified water was sprayed evenly onto the soil samples using a spray bottle to simulate the natural infiltration process. Based on the maximum saturated weight moisture content of the soil determined in the pre-experiment, which was 55%, 12 moisture gradients were set with a gradient interval of 5% from 0% to 55%, and the soil samples were treated with water in sequence. The content of soil organic matter was determined by the potassium dichromate oxidation heating method. The visible-near infrared spectrum of the soil in the range of 350-2500 nm was collected using a spectrometer. Each soil sample needed to be measured 10 times.

3. The soil organic matter spectral anti-interference inversion method according to claim 2, characterized in that, In step 1, the visible-near-infrared spectrum is smoothed using the Savitzky-Golay convolution smoothing algorithm, and then the smoothed visible-near-infrared spectrum is transformed using a standard normal variable.

4. The soil organic matter spectral anti-interference inversion method according to claim 3, characterized in that, In step 3, the feature extraction backbone network model consists of multiple layers of one-dimensional convolutional layers, nonlinear activation function layers, and pooling layers stacked sequentially. The one-dimensional convolutional layers are used to capture subtle patterns of local absorption valleys and reflection peaks in the spectral curve, as well as the correlations between these subtle patterns. The pooling layers are used to compress the dimensionality of the feature data output by the one-dimensional convolutional layers, while simultaneously extracting global and abstract features from the spectrum. The output of the feature extraction backbone network model is a high-dimensional comprehensive deep feature vector obtained by deep encoding the orthogonalized spectrum.

5. The soil organic matter spectral anti-interference inversion method according to claim 4, characterized in that, In step 3, the dual-task representation separation head includes a first fully connected sub-network and a second fully connected sub-network set at the end of the feature extraction backbone network model and connected in parallel. The first fully connected sub-network takes a high-dimensional integrated deep feature vector as input and has a Sigmoid activation function layer at its end. The Sigmoid activation function layer outputs a water representation vector, and the value range of each element in the water representation vector is [0,1]. The second fully connected sub-network takes a high-dimensional integrated deep feature vector as input and maps and outputs an organic matter potential feature vector.

6. The soil organic matter spectral anti-interference inversion method according to claim 5, characterized in that, In step 5, the generator adopts a U-Net architecture, including an encoder, a decoder, and a conditional injection unit. The encoder consists of four downsampling blocks stacked layer by layer. Each downsampling block contains a one-dimensional convolutional layer, a batch normalization layer, and an activation function layer, used for feature extraction and layer-by-layer compression of the input moist soil spectrum. The decoder consists of four upsampling blocks stacked layer by layer. Each upsampling block contains a transposed convolutional layer, a batch normalization layer, and an activation function layer, used for upsampling spectral features and gradually restoring spectral details. A skip connection structure is established between the decoder and the encoder to transmit the feature maps output from each layer of the encoder to the corresponding resolution layer of the decoder and fuse them with the upsampling features of the decoder. The conditional injection unit receives the conditional vector and maps it into a multi-scale conditional embedding using a fully connected layer. The multi-scale conditional embedding is concatenated with the feature maps output from each layer of the encoder along the channel dimension to inject conditional information. The discriminator has a multi-task structure, including a common feature extractor and two parallel discriminant heads. The common feature extractor consists of three convolutional layers with strides, used to extract shared features of the spectrum. The two parallel discriminant heads are a ground truth discriminant head and a domain discriminant head. The ground truth discriminant head outputs a single-valued probability through a fully connected layer to determine the authenticity of the input spectrum. The input of the domain discriminant head is connected to a gradient inversion layer, which inverts the gradient sign during backpropagation to achieve adversarial domain adaptation.

7. The soil organic matter spectral anti-interference inversion method according to claim 6, characterized in that, In step 6, a stratified validation set covering the entire moisture content range of 5%-55% is constructed, and stratified sampling is performed according to moisture content gradients of 15%, 35%, and 50%. Multi-scale one-dimensional convolution is introduced to extract spectral features, with convolution kernels of 3, 5, and 7. A gradient inversion layer is used to achieve cross-domain feature alignment, and a dynamic correction weight is generated through an adaptive gating mechanism. During validation, the correlation between reflectance and moisture content in the corrected 1450nm and 1940nm bands is calculated to evaluate the moisture interference suppression effect. The signal-to-noise ratio in the 2200nm band is calculated to evaluate the organic matter signal quality. Root mean square error and coefficient of determination are used to quantify the spectral reconstruction accuracy. The robustness of the soil moisture loss reconstruction spectral model was verified by grouping the samples by moisture content range, and the correction error of samples with moisture content greater than the preset value was statistically analyzed.

8. A soil organic matter spectral anti-interference inversion device, characterized in that, include: The spectral library construction module is used to preprocess soil samples, set standardized spectral acquisition conditions, adjust the soil samples to multiple moisture content gradients and simulate natural water infiltration, determine the organic matter content of the soil samples, acquire the visible light-near infrared spectrum of the soil samples, preprocess the acquired visible light-near infrared spectrum, and construct a soil spectral library containing multiple moisture content gradients, corresponding organic matter content, and soil moisture content labels. The orthogonalized spectrum acquisition module is used to extract dry soil spectra as the source domain and wet soil spectra as the target domain from the soil spectral library, merge the spectral data of the source domain and the target domain, and perform principal component analysis in conjunction with soil moisture content labels. The first few principal components that are highly correlated with moisture changes are extracted to form a moisture interference subspace. The orthogonal complement space projection matrix of the moisture interference subspace is calculated, and the spectrum of the target domain to be processed is linearly transformed using the orthogonal complement space projection matrix to obtain the orthogonalized spectrum. The feature extraction and decoupling module is used to construct a feature extraction backbone network model, taking the orthogonalized spectrum as the input of the feature extraction backbone network model, and obtaining a high-dimensional comprehensive deep feature vector through the feature extraction backbone network model; and decoupling the high-dimensional comprehensive deep feature vector into a water characterization vector and an organic matter potential feature vector through a dual-task characterization separation head set at the end of the feature extraction backbone network model. The conditional vector generation module is used to concatenate the orthogonalized spectrum with the moisture characterization vector in the feature dimension to generate a conditional vector for guiding spectral mapping. The spectral mapping and interference separation module is used to construct a conditional generative adversarial network model with a gradient inversion layer. Guided by conditional vectors, it realizes intelligent mapping from wet soil spectrum to dry reference spectrum. Through conditional reconstruction of the generator and adversarial learning of the discriminator, based on the difference between the generated dry reference spectrum and the original wet soil spectrum, it simultaneously separates the interference spectrum containing only moisture interference information. The model building and validation module integrates the workflow and corresponding model modules of the spectral library building module, orthogonal spectrum acquisition module, feature extraction and decoupling module, conditional vector generation module, and spectral mapping and interference separation module to complete the construction of the soil moisture elimination reconstruction spectral model; it also builds a hierarchical validation set covering the entire moisture content range and uses multi-dimensional quantitative indicators to perform comprehensive performance validation of the soil moisture elimination reconstruction spectral model. The organic matter inversion module takes the dry reference spectrum output by the soil moisture removal reconstruction spectral model as input, and combines it with the potential organic matter feature vector obtained by the feature extraction and decoupling module. It then inputs this feature vector into the deep regression model to perform quantitative calculations through regression modeling and outputs the predicted value of soil organic matter content.

9. An electronic device comprising a central processing unit and a memory, characterized in that, The central processing unit is used to call and run a computer program stored in the memory to perform the steps of the soil organic matter spectral anti-interference inversion method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implementing the soil organic matter spectral anti-interference inversion method according to any one of claims 1 to 7, which, when called by a computer, executes the steps included in the corresponding method.