Soil spectrum detection method and device based on reversible calculation
By adding simulated noise to the soil spectral data and mapping it to the latent space, combining the inverse operation of the reversible neural network to extract and screen soil spectral characteristics, the problem of inaccurate soil spectral detection in the existing technology is solved, and higher detection accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202510105250.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2045-01-23
AI Technical Summary
When the existing technology uses spectral analysis to detect soil total nitrogen and organic matter, the problem of overlapping spectral peaks and wide effective information bands is prone to occur, resulting in inaccurate soil spectral detection results.
A method based on reversible calculations is used to extract multiple soil spectral features by adding simulated noise to the soil spectral data and mapping the data after adding simulated noise to the latent space. Then, these features are screened through inverse operations of the reversible neural network to obtain target features to detect the content of total nitrogen and organic matter in the soil spectral data.
Improves the accuracy of soil spectral detection and enables rapid, efficient and accurate measurement of properties of different soil types.
Smart Images

Figure CN119555624A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of soil property detection, and in particular to a soil spectrum detection method and device based on reversible calculation. Background Art
[0002] As the most basic means of production in agricultural production, soil plays the role of a link in the circulation of matter and energy during the growth and reproduction of crops. It directly provides more than 80% of the calories, about 75% of the protein and most of the fiber required for human production. Therefore, rapid, accurate and efficient testing of soil properties is of great significance to the growth and reproduction of crops.
[0003] At present, soil property detection is still mainly based on chemical methods, which face risks such as long detection cycle, complex operation, great human interference, and environmental pollution. In this regard, soil property detection methods based on spectral detection technology have good application prospects due to their advantages such as rapidity, non-destructiveness, and environmental friendliness.
[0004] Among the related technologies, spectral analysis has a strong response to the state of soil components (such as particle size, moisture content, etc.) and is usually selected for the detection of soil total nitrogen and organic matter. However, due to the complex structure and rich composition of the soil, the near-infrared spectrum is often easily affected, resulting in problems such as spectral peak overlap and wide effective information band, resulting in poor spectral detection effect and inaccurate soil property detection.
[0005] Therefore, how to extract effective information from soil spectra to improve soil property detection is an urgent problem to be solved. Summary of the invention
[0006] The present invention provides a soil spectrum detection method and device based on reversible calculation, which are used to solve the problem that when the existing technology uses spectral analysis method to detect total nitrogen and organic matter in soil, spectral peaks are easily overlapped and the effective information spectrum band is wide, resulting in inaccurate soil spectrum detection results, thereby improving the accuracy of soil spectrum detection.
[0007] The present invention provides a soil spectrum detection method based on reversible calculation, comprising: Based on reversible calculation, simulated noise is added to soil spectral data, and the soil spectral data after adding simulated noise is mapped to latent space to obtain a variety of soil spectral features; The plurality of soil spectral features are screened by an inverse operation of the reversible calculation to obtain a target feature, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectral data.
[0008] According to a soil spectrum detection method based on reversible calculation provided by the present invention, the reversible calculation is implemented by a reversible neural network, wherein the reversible neural network includes a forward transformation layer; the loss function of the reversible neural network is determined based on the standard normal distribution as prior knowledge; The simulated noise is added to the soil spectral data based on reversible calculation, and the soil spectral data after adding the simulated noise is mapped to the latent space to obtain a variety of soil spectral features including: Based on the forward conversion layer, simulated noise is added to the soil spectral data using the following formula, and the soil spectral data after adding simulated noise is mapped to the latent space to obtain the feature latent space: ; in, is the soil spectral data, is the number of transformation layers of the reversible neural network, represents the probability distribution within a single transformation layer, For the Soil spectral data converted by conversion layer, For the Soil spectral data converted by conversion layer, For the Soil spectral data converted by conversion layer, For the The distribution probability corresponding to the soil spectral data converted by the conversion layer, is the distribution probability of soil spectral data; det is the determinant; When the reversible neural network reaches a maximum number of iterations or the gradient change satisfies an early stopping threshold, the plurality of soil spectral features are obtained from the feature latent space.
[0009] According to a soil spectrum detection method based on reversible calculation provided by the present invention, the reversible calculation is implemented by a reversible neural network, and the reversible neural network includes a reverse transformation layer; the loss function of the reversible neural network is determined based on the standard normal distribution as prior knowledge; The target features obtained by screening the multiple soil spectral features through the inverse operation of the reversible calculation include: The multiple soil spectral features are inversely transformed based on the inverse transformation layer to obtain a reconstructed feature, and the multiple soil spectral features are screened according to the similarity between the reconstructed feature and the multiple soil spectral features to obtain the target feature.
[0010] According to a soil spectrum detection method based on reversible calculation provided by the present invention, the soil spectrum data is near-infrared spectrum data; The soil spectral data is obtained by the following steps: The soil sample to be tested is air-dried, impurity-removed, and ground to obtain a standard soil sample; The standard soil sample is subjected to near infrared spectrum scanning to obtain the near infrared spectrum data.
[0011] According to a soil spectrum detection method based on reversible calculation provided by the present invention, after obtaining the target feature, the method further includes: The target features are calculated and analyzed based on a soil property detection model to obtain the total nitrogen content and the organic matter content; the soil property detection model is obtained based on pre-training.
[0012] The present invention also provides a soil spectrum detection device based on reversible calculation, comprising: A latent space acquisition module is used to add simulated noise to soil spectral data based on reversible calculation, and map the soil spectral data after adding simulated noise to the latent space to obtain a variety of soil spectral features; The feature screening module is used to screen the multiple soil spectral features through the inverse operation of the reversible calculation to obtain the target feature to detect the content of at least one of total nitrogen and organic matter in the soil spectral data.
[0013] According to a soil spectrum detection device based on reversible calculation provided by the present invention, the device also includes: The soil detection module is used to calculate and analyze the target features based on a soil property detection model after the target features are obtained, so as to obtain the total nitrogen content and the organic matter content; the soil property detection model is obtained based on pre-training.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the soil spectrum detection method based on reversible calculation as described above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the soil spectrum detection method based on reversible calculation as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the soil spectrum detection method based on reversible calculation as described above is implemented.
[0017] The soil spectrum detection method and device based on reversible calculation provided by the present invention add simulated noise to soil spectrum data through reversible calculation, map the soil spectrum data after adding simulated noise to latent space and extract multiple soil spectrum features to obtain characteristic latent space; screen the characteristic latent space by performing an inverse transformation operation on the characteristic latent space through reversible calculation to obtain target features, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectrum data, thereby improving the accuracy of soil spectrum detection, and further being able to provide fast, efficient and accurate measurement for soil properties of different soil types. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is one of the flow charts of the soil spectrum detection method based on reversible calculation provided by the present invention.
[0020] Figure 2 This is the second flow chart of the soil spectrum detection method based on reversible calculation provided by the present invention.
[0021] Figure 3 This is the third flow chart of the soil spectrum detection method based on reversible calculation provided by the present invention.
[0022] Figure 4 This is the fourth flow chart of the soil spectrum detection method based on reversible calculation provided by the present invention.
[0023] Figure 5 It is a structural schematic diagram of a soil spectrum detection device based on reversible calculation provided by the present invention.
[0024] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] Combine the following Figure 1-Figure 5The present invention describes a soil spectrum detection method and device based on reversible calculation.
[0027] Figure 1 is one of the flow charts of the soil spectrum detection method based on reversible calculation provided by the present invention, such as Figure 1 As shown, the soil spectrum detection method based on reversible calculation includes the following steps: Step 110: adding simulated noise to the soil spectral data based on reversible calculation, and mapping the soil spectral data after adding the simulated noise to the latent space to obtain a variety of soil spectral features.
[0028] In this step, the soil spectrum data includes near-infrared spectrum data or infrared spectrum data of the soil.
[0029] Taking soil spectrum data as near infrared spectrum data as an example, the soil spectrum data is obtained through the following steps: (1) The soil sample to be tested is air-dried, impurity-removed, and ground to obtain a standard soil sample.
[0030] In this embodiment, the air-drying operation includes spreading the soil sample evenly on a clean, uncontaminated surface, ensuring that the sample thickness is moderate to promote uniform drying; the impurity removal operation includes carefully screening the soil sample using manual or mechanical methods (such as sieves) to remove visible impurities; the grinding operation includes grinding the soil sample to a desired particle size (usually less than 0.149 mm) using a grinder or mortar, ensuring a uniform particle size distribution; and filling the processed soil sample into a soil sample mold for near-infrared spectroscopy scanning.
[0031] (2) Performing near infrared spectroscopy scanning on the standard soil sample to obtain the near infrared spectroscopy data.
[0032] In this embodiment, the ground soil sample is evenly placed on the sample stage (or sample cup, sample pool) of the spectrometer to ensure the representativeness of the spectral data; the soil sample is evenly filled to an appropriate height and compacted to eliminate gaps; the spectrometer is started, and the standard soil sample is scanned by near-infrared spectrum according to the set parameters to obtain near-infrared spectrum data.
[0033] In this embodiment, reversible computing can be achieved through reversible neural networks (INNs); the reversible neural network calculates output through forward propagation and can accurately restore input through back propagation.
[0034] In one embodiment, the reversible neural network includes an affine coupling layer. The working principle of the affine coupling layer is to divide the input data into two parts, and then transform the two parts through a learning function and couple them in an alternating manner. The output is the connection of the two parts of the transformed data.
[0035] It should be noted that the mapping from input to output of the reversible neural network is bijective, that is, there is an inverse mapping, and the loss function of the reversible neural network can be determined based on the standard normal distribution as prior knowledge.
[0036] In this embodiment, a reversible neural network can be trained by the following steps: (1) Obtain sample soil spectral data and perform appropriate preprocessing on the input data, such as normalization and denoising, to ensure data quality and consistency.
[0037] (2) construct reversible blocks and connect them into a network, where each reversible block contains two learning functions (such as affine transformation) for transforming and coupling two parts of the input data; (3) Define the supervised loss of the forward process and the unsupervised loss of the reverse process according to the task requirements and network characteristics; (4) Input the sample soil spectral data into the reversible block, use the back propagation algorithm and optimization methods such as gradient descent to train the network, update the network parameters to minimize the loss function, and when the network converges, obtain a reversible neural network that can be used for soil analysis.
[0038] Figure 2 This is the second flow chart of the soil spectrum detection method based on reversible calculation provided by the present invention. Figure 2 In the embodiment shown, the reversible neural network includes multiple forward transformation layers (output is ) and multiple inverse transformation layers (output is ); divide the training batches and random conditions according to the original spectral data to construct training samples; then input the training samples into the reversible neural network, and each forward transformation layer is fitted according to the simulated noise distribution characteristics in the sample data to obtain simulated noise. In the process of forward propagation of the network, the simulated noise is added to the soil spectral data layer by layer and the data is mapped to the latent space to obtain the characteristic latent space (expressed as ), and extract the corresponding soil spectral features from the feature latent space.
[0039] In this embodiment, reversible computing is implemented by a reversible neural network, which includes a positive transformation layer; the loss function of the reversible neural network is determined based on the standard normal distribution as prior knowledge; the positive function of the positive transformation layer is expressed as: ; in, For the Soil spectral data converted by conversion layer, For the Conversion layer converted soil spectral data.
[0040] Specifically, various soil spectral characteristics are obtained through the following steps: (1) Based on the forward transformation layer, simulated noise is added to the soil spectral data layer by layer using the following formula, and the soil spectral data after adding simulated noise is mapped to the latent space to obtain the feature latent space: ; in, is the soil spectral data, is the number of transformation layers of the reversible neural network, represents the probability distribution within a single transformation layer, For the Soil spectral data converted by conversion layer, For the Soil spectral data converted by conversion layer, For the Soil spectral data converted by conversion layer, For the The simulated noise corresponding to the soil spectral data converted by the conversion layer; is the distribution probability of soil spectral data; det Is the determinant.
[0041] (2) When the reversible neural network reaches a maximum number of iterations or the gradient change satisfies an early stopping threshold, a plurality of soil spectral features are obtained from the feature latent space.
[0042] In this embodiment, when the reversible neural network reaches the maximum number of iterations or the gradient change meets the early stopping threshold, multiple soil spectral features are obtained.
[0043] In this embodiment, the maximum number of iterations can be set according to user requirements.
[0044] In this embodiment, the input data is forward propagated through multiple reversible layers, each layer accepts the output of the previous layer as input and applies a reversible transformation to produce a new output that contains both the information of the original data and the features learned by the layer; the input data is mapped to a new feature space (mapping result), in which the data is represented as a series of feature vectors that capture different aspects and attributes of the input data.
[0045] It should be noted that the simulated noise conforms to the Gaussian distribution characteristics. In each network layer, random noise simulated by a neural network composed of a three-layer linear model and a ReLU activation function is added to the input soil spectral data layer by layer. Finally, the soil spectral data with added simulated noise is mapped to the latent space to obtain the corresponding feature latent space, and then a variety of soil spectral characteristics are obtained.
[0046] Step 120 , screening multiple soil spectral features through inverse operation of reversible calculation to obtain target features to detect the content of at least one of total nitrogen and organic matter in soil spectral data.
[0047] In this step, reversible computing is implemented by a reversible neural network, which also includes a reverse transformation layer. The inverse function of the reverse transformation layer is expressed as: ; In this embodiment, a plurality of soil spectral features are inversely transformed based on the inverse transformation layer to obtain a reconstructed feature, and the plurality of soil spectral features are screened according to the similarity between the reconstructed feature and the plurality of soil spectral features to obtain a target feature.
[0048] In this embodiment, the similarity between the reconstructed feature and the various soil spectral features may be determined by a cosine similarity calculation.
[0049] In this embodiment, if the reconstructed feature obtained by the reversible neural network through the inverse operation has a similarity close to or higher than a specified threshold with respect to the corresponding feature vector of the feature latent space, the reconstructed feature can be used as the target feature.
[0050] exist Figure 2 In the embodiment shown, each inverse transformation layer of the reversible neural network (output is ) The feature latent space (represented as ) are inversely operated in turn to obtain the reconstructed spectral features (expressed as ).
[0051] In this embodiment, target features are obtained from the feature latent space, and soil property indicators such as soil total nitrogen and organic matter are calculated using these features, thereby calculating the content of soil total nitrogen and organic matter in the soil.
[0052] The soil spectral detection method based on reversible calculation provided by the embodiment of the present invention adds simulated noise to soil spectral data through reversible calculation, maps the soil spectral data after adding the simulated noise to the latent space and extracts a variety of soil spectral features; screens the various soil spectral features through the inverse operation of the reversible calculation to obtain the target feature, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectral data, thereby improving the accuracy of soil spectral detection, and thus being able to provide fast, efficient and accurate measurement of soil properties of different soil types.
[0053] In some embodiments, after obtaining the target features, the soil spectral detection method based on reversible calculation also includes: calculating and analyzing the target features based on a soil property detection model to obtain the total nitrogen content and the organic matter content; the soil property detection model is obtained based on pre-training.
[0054] In this embodiment, the soil property detection model is obtained through the following steps: (1) Obtain sample soil spectral data and perform appropriate preprocessing on the input data, such as normalization and denoising, to ensure data quality and consistency.
[0055] (2) Extract soil property characteristics such as total nitrogen content and organic matter content from the sample soil spectral data, use the above soil property characteristics as input, and construct a mathematical model based on the total nitrogen content and organic matter content; or use the sample soil spectral data to iteratively train the existing machine learning model (such as random forest or artificial neural network) to obtain a usable soil property detection model.
[0056] In this embodiment, the loss function of the machine learning model can be determined according to task requirements and network characteristics. For example, for a random forest or an artificial neural network, the loss function can be a cross entropy loss function, etc.
[0057] In this embodiment, feature screening is performed on the acquired latent space variables to obtain spectral information that is more suitable for the soil property detection task, and a soil property detection model is constructed to output soil total nitrogen and organic matter values.
[0058] Figure 3 This is the third flow chart of the soil spectrum detection method based on reversible calculation provided by the present invention. Figure 3 In the illustrated embodiment, the data variables in the converted latent space are used as input, and the latent space variables are calculated and analyzed by the soil property detection model, so as to obtain the total nitrogen and organic matter content of the soil as the detection result output; since the original spectral data is mapped into the latent space, the difference between the spectral data of soil samples with different nutrient contents will be more directly manifested, which is convenient for the soil property detection model to obtain effective spectral features, thereby improving the soil nutrient detection effect.
[0059] The soil spectral detection method based on reversible calculation provided in the embodiment of the present invention calculates and analyzes the target characteristics based on the soil property detection model to obtain the total nitrogen content and organic matter content, thereby improving the efficiency of soil property detection.
[0060] Figure 4 This is a fourth flow chart of the soil spectrum detection method based on reversible calculation provided by the present invention. Figure 4 In the illustrated embodiment, the sample to be tested is air-dried, impurity-removed, ground, and the like to obtain a standard soil sample (i.e., sample) that can be used for collection by a near-infrared spectrometer, and the sample is loaded into a soil sample mold; the standard soil sample is scanned by a lens of a near-infrared detector, and the near-infrared spectrum information obtained by the scan is sent to a terminal device, and the terminal device performs near-infrared spectrum information processing tasks, including data preparation, feature space conversion (specifically, the original spectral data is subjected to simulated noise addition via a reversible neural network, and the features obtained by reconstructing the inverse operation of the reversible transformation are used to evaluate the quality of the data in the latent space, and then the feature data in the latent space are used for feature screening to obtain effective features), model construction (constructing a soil property detection model) and result output (inputting effective features into the soil property detection model and outputting corresponding soil property indicators); the light source and optical fiber are used to provide lighting conditions for the near-infrared spectrometer to scan the sample.
[0061] The soil spectrum detection device based on reversible calculation provided by the present invention is described below. The soil spectrum detection device based on reversible calculation described below and the soil spectrum detection method based on reversible calculation described above can be referred to each other.
[0062] Figure 5 is a schematic diagram of the structure of the soil spectrum detection device based on reversible calculation provided by the present invention, such as Figure 5 As shown, the soil spectrum detection device based on reversible calculation includes: a latent space acquisition module 510 and a feature screening module 520.
[0063] A latent space acquisition module 510 is used to add simulated noise to the soil spectral data based on reversible calculation, and map the soil spectral data after adding the simulated noise to the latent space to obtain a variety of soil spectral features; The feature screening module 520 is used to screen a plurality of soil spectral features through an inverse operation of a reversible calculation to obtain a target feature so as to detect the content of at least one of total nitrogen and organic matter in the soil spectral data.
[0064] The soil spectrum detection device based on reversible calculation provided by the embodiment of the present invention adds simulated noise to soil spectrum data through reversible calculation, maps the soil spectrum data after adding the simulated noise to the latent space and extracts a variety of soil spectrum features; screens the various soil spectrum features through the inverse operation of the reversible calculation to obtain the target feature, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectrum data, thereby improving the accuracy of soil spectrum detection, and thus being able to provide fast, efficient and accurate measurement for soil properties of different soil types.
[0065] exist Figure 5 In the illustrated embodiment, the soil spectrum detection device based on reversible calculation further includes: a soil detection module 530 .
[0066] The soil detection module 530 is used to calculate and analyze the target features based on the soil property detection model after obtaining the target features, so as to obtain the total nitrogen content and the organic matter content; the soil property detection model is obtained based on pre-training.
[0067] The soil spectrum detection device based on reversible calculation provided by the embodiment of the present invention calculates and analyzes the target characteristics based on the soil property detection model to obtain the total nitrogen content and the organic matter content, thereby improving the efficiency of soil property detection.
[0068] Figure 6 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a soil spectrum detection method based on reversible calculation, the method comprising: adding simulated noise to soil spectrum data based on reversible calculation, and mapping the soil spectrum data after adding simulated noise to the latent space to obtain a plurality of soil spectrum features; screening a plurality of soil spectrum features through the inverse operation of the reversible calculation to obtain the target feature to detect the content of at least one of total nitrogen and organic matter in the soil spectrum data.
[0069] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0070] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the soil spectral detection method based on reversible calculation provided by the above methods. The method includes: adding simulated noise to soil spectral data based on reversible calculation, and mapping the soil spectral data after adding simulated noise to latent space to obtain multiple soil spectral features; screening multiple soil spectral features through inverse operations of reversible calculation to obtain target features to detect the content of at least one of total nitrogen and organic matter in the soil spectral data.
[0071] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the soil spectral detection method based on reversible calculation provided by the above-mentioned methods, the method comprising: adding simulated noise to soil spectral data based on reversible calculation, and mapping the soil spectral data after adding the simulated noise to a latent space to obtain a plurality of soil spectral features; screening the plurality of soil spectral features through an inverse operation of the reversible calculation to obtain a target feature to detect the content of at least one of total nitrogen and organic matter in the soil spectral data.
[0072] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A soil spectrum detection method based on reversible calculation, characterized in that: include: Based on reversible calculation, simulated noise is added to soil spectral data, and the soil spectral data after adding simulated noise is mapped to latent space to obtain a variety of soil spectral features; The plurality of soil spectral features are screened by an inverse operation of the reversible calculation to obtain a target feature, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectral data.
2. The soil spectrum detection method based on reversible calculation according to claim 1 is characterized in that: The reversible calculation is implemented by a reversible neural network, wherein the reversible neural network includes a forward transformation layer; the loss function of the reversible neural network is determined based on a standard normal distribution as prior knowledge; The simulated noise is added to the soil spectral data based on reversible calculation, and the soil spectral data after adding the simulated noise is mapped to the latent space to obtain a variety of soil spectral features including: Based on the forward conversion layer, simulated noise is added to the soil spectral data using the following formula, and the soil spectral data after adding simulated noise is mapped to the latent space to obtain the feature latent space: ; in, is the soil spectral data, is the number of transformation layers of the reversible neural network, represents the probability distribution within a single transformation layer, For the Soil spectral data converted by conversion layer, For the Soil spectral data converted by conversion layer, For the Soil spectral data converted by conversion layer, For the The distribution probability corresponding to the soil spectral data converted by the conversion layer, is the distribution probability of soil spectral data; det is the determinant; When the reversible neural network reaches a maximum number of iterations or the gradient change satisfies an early stopping threshold, the plurality of soil spectral features are obtained from the feature latent space.
3. The soil spectrum detection method based on reversible calculation according to claim 1 is characterized in that: The reversible calculation is implemented by a reversible neural network, and the reversible neural network includes a reverse transformation layer; the loss function of the reversible neural network is determined based on the standard normal distribution as prior knowledge; The target features obtained by screening the multiple soil spectral features through the inverse operation of the reversible calculation include: The multiple soil spectral features are inversely transformed based on the inverse transformation layer to obtain a reconstructed feature, and the multiple soil spectral features are screened according to the similarity between the reconstructed feature and the multiple soil spectral features to obtain the target feature.
4. The soil spectrum detection method based on reversible calculation according to any one of claims 1-2, characterized in that: The soil spectrum data is near infrared spectrum data; The soil spectral data is obtained by the following steps: The soil sample to be tested is air-dried, impurity-removed, and ground to obtain a standard soil sample; The standard soil sample is subjected to near infrared spectrum scanning to obtain the near infrared spectrum data.
5. The soil spectrum detection method based on reversible calculation according to claim 1 is characterized in that: After obtaining the target feature, the method further includes: The target features are calculated and analyzed based on a soil property detection model to obtain the total nitrogen content and the organic matter content; the soil property detection model is obtained based on pre-training.
6. A soil spectrum detection device based on reversible calculation, characterized in that: include: A latent space acquisition module is used to add simulated noise to soil spectral data based on reversible calculation, and map the soil spectral data after adding simulated noise to the latent space to obtain a variety of soil spectral features; The feature screening module is used to screen the multiple soil spectral features through the inverse operation of the reversible calculation to obtain the target feature to detect the content of at least one of total nitrogen and organic matter in the soil spectral data.
7. The soil spectrum detection device based on reversible calculation according to claim 6 is characterized in that: The device also includes: A soil detection module is used to calculate and analyze the target features based on a soil property detection model after the target features are obtained, so as to obtain the total nitrogen content and the organic matter content; the soil property detection model is obtained based on pre-training.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the soil spectrum detection method based on reversible calculation as described in any one of claims 1 to 5 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the soil spectrum detection method based on reversible calculation as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Soil heavy metal element content predicting method based on terahertz spectrum and deep automatic encoder
CN107179291A
Multi-substance parameter detection device and method
CN113358593A
Soil total nitrogen content detection method and device, electronic equipment and storage medium
CN118518655A
Near-infrared detection method for soil organic matter and total nitrogen content by comparing neural network
CN119044108A
Soil micro-plastic detection method based on self-supervised hyperspectral image classification
CN119131478A
Cited By
Vehicle-mounted soil nutrient detection system and method based on comparative learning
CN120908134A