Soil Spectral Detection Method and Device Based on Reversible Computing

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 more efficient soil attribute detection is achieved.

CN119555624BActive Publication Date: 2025-05-30INTELLIGENT EQUIPMENT RESEARCH CENTER BEIJING ACADEMY OF AGRICULTURE AND FORESTRY SCIENCES
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510105250.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-30
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

When the existing technology uses spectral analysis to detect soil total nitrogen and organic matter, it is easy to have problems such as overlapping spectral peaks and wide effective information bands, resulting in inaccurate soil spectral detection results.

Method used

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 added 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.

Benefits of technology

It improves the accuracy of soil spectral detection and enables faster, efficient and accurate measurement of properties of different soil types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119555624B_ABST
    Figure CN119555624B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of soil property detection, and provides a soil spectral detection method and device based on reversible computing. The method includes: adding simulated noise to soil spectral data based on reversible computing, and mapping the soil spectral data with added simulated noise to a latent space to extract various soil spectral features; screening the various soil spectral features through the inverse operation of reversible computing to obtain target features, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectral data. The method of the present invention improves the accuracy of soil spectral detection, and thus can provide rapid, efficient and accurate measurement for the soil properties of different soil types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of soil property detection, and in particular to a soil spectral detection method and device based on reversible computing. Background Art

[0002] Soil, as the most basic production material in agricultural production, plays the role of a link in the material and energy cycle during the growth and reproduction of crops. It directly provides more than 80% of the heat, about 75% of the protein, and most of the fibers required for human production. Therefore, quickly, accurately, and efficiently detecting soil properties is of great significance for the growth and reproduction of crops.

[0003] Currently, soil property detection still mainly relies on chemical methods, which face risks such as long detection cycles, complex operations, large 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] In related technologies, spectral analysis methods have a strong response to the state of soil composition components (such as particle size, moisture content, etc.) and are usually selected for the detection of total nitrogen and organic matter in soil. However, due to the complex structure and rich composition of soil, near-infrared spectra are often easily affected, resulting in problems such as spectral peak overlap and wide effective information spectral bands, leading to poor spectral detection effects and inaccurate soil property detection.

[0005] Therefore, how to extract effective information from soil spectra to improve the soil property detection effect is an urgent problem to be solved currently. Summary of the Invention

[0006] The present invention provides a soil spectral detection method and device based on reversible computing, which are used to solve the problems of spectral peak overlap and wide effective information spectral bands that easily occur when detecting total nitrogen and organic matter in soil by spectral analysis methods in the prior art, resulting in inaccurate soil spectral detection results, and improve the accuracy of soil spectral detection.

[0007] The present invention provides a soil spectral detection method based on reversible computing, including:

[0008] Adding simulated noise to soil spectral data based on reversible computing, and mapping the soil spectral data with added simulated noise to a latent space to obtain various soil spectral features;

[0009] Screening the various soil spectral features through the inverse operation of the reversible computing to obtain target features for detecting the content of at least one of total nitrogen and organic matter in the soil spectral data.

[0010] A soil spectral detection method based on reversible computing provided by the present invention, wherein the reversible computing is implemented through a reversible neural network. The reversible neural network includes a forward transformation layer; the loss function of the reversible neural network is determined based on the prior knowledge of the standard normal distribution.

[0011] The reversible computing adds simulated noise to the soil spectral data and maps the soil spectral data with added simulated noise to the latent space, obtaining various soil spectral features including:

[0012] Based on the forward transformation layer, the following formula is used to add simulated noise to the soil spectral data and map the soil spectral data with added simulated noise to the latent space, obtaining the feature latent space:

[0013] ;

[0014] where 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, is the soil spectral data transformed by the transformation layer, is the soil spectral data transformed by the transformation layer, is the soil spectral data transformed by the transformation layer, is the distribution probability corresponding to the soil spectral data transformed by the transformation layer, is the distribution probability of the soil spectral data; is the determinant;

[0015] In the case where the reversible neural network reaches the maximum number of iterations or the gradient change satisfies the early stopping threshold, the various soil spectral features are obtained from the feature latent space.

[0016] A soil spectral detection method based on reversible computing provided by the present invention, wherein the reversible computing is implemented through a reversible neural network. The reversible neural network includes an inverse transformation layer; the loss function of the reversible neural network is determined based on the prior knowledge of the standard normal distribution.

[0017] The various soil spectral features are screened through the inverse operation of the reversible computing, obtaining target features including:

[0018] Based on the inverse transformation layer, an inverse transformation is performed on the various soil spectral features to obtain reconstructed features, and the various soil spectral features are screened according to the similarity between the reconstructed features and the various soil spectral features, obtaining the target features.

[0019] A soil spectral detection method based on reversible computing provided by the present invention, wherein the soil spectral data is near-infrared spectral data;

[0020] The soil spectral data is obtained through the following steps:

[0021] Air-dry, remove impurities, and grind the soil sample to be detected to obtain a standard-state soil sample;

[0022] Perform near-infrared spectral scanning on the standard-state soil sample to obtain the near-infrared spectral data.

[0023] A soil spectral detection method based on reversible computing provided by the present invention, after obtaining the target feature, the method further includes:

[0024] Calculating and analyzing the target feature based on a soil property detection model to obtain the content of total nitrogen and the content of organic matter; the soil property detection model is based on pre-training.

[0025] The present invention also provides a soil spectral detection device based on reversible computing, including:

[0026] A latent space acquisition module, configured to add simulated noise to soil spectral data based on reversible computing and map the soil spectral data with added simulated noise to a latent space to obtain various soil spectral features;

[0027] A feature screening module, configured to screen the various soil spectral features through the inverse operation of the reversible computing to obtain a target feature for detecting the content of at least one of total nitrogen and organic matter in the soil spectral data.

[0028] A soil spectral detection device based on reversible computing provided by the present invention, the device further includes:

[0029] A soil detection module, configured to calculate and analyze the target feature based on a soil property detection model after obtaining the target feature to obtain the content of total nitrogen and the content of organic matter; the soil property detection model is based on pre-training.

[0030] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, it implements the soil spectral detection method based on reversible computing as described in any one of the above.

[0031] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for soil spectral detection based on reversible computing as described in any one of the above is implemented.

[0032] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the method for soil spectral detection based on reversible computing as described in any one of the above is implemented.

[0033] The method and device for soil spectral detection based on reversible computing provided by the present invention add simulated noise to soil spectral data through reversible computing, map the soil spectral data after adding the simulated noise to a latent space, extract various soil spectral features, and obtain a feature latent space; perform an inverse transformation operation on the feature latent space through reversible computing to screen the feature latent space, obtain target features, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectral data, improve the accuracy of soil spectral detection, and further be able to provide fast, efficient, and accurate measurements for the soil properties of different soil types. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0035] Figure 1 is one of the schematic flowcharts of the method for soil spectral detection based on reversible computing provided by the present invention.

[0036] Figure 2 is the second schematic flowchart of the method for soil spectral detection based on reversible computing provided by the present invention.

[0037] Figure 3 is the third schematic flowchart of the method for soil spectral detection based on reversible computing provided by the present invention.

[0038] Figure 4 is the fourth schematic flowchart of the method for soil spectral detection based on reversible computing provided by the present invention.

[0039] Figure 5 is the schematic structural diagram of the device for soil spectral detection based on reversible computing provided by the present invention.

[0040] Figure 6 is the schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0041] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.

[0042] The following will describe Figures 1-5 the method and device for soil spectral detection based on reversible computing of the present invention.

[0043] Figure 1 is one of the schematic flowcharts of the method for soil spectral detection based on reversible computing provided by the present invention. As Figure 1 shown, the method for soil spectral detection based on reversible computing includes the following steps:

[0044] Step 110: Add simulated noise to the soil spectral data based on reversible computing, and map the soil spectral data after adding the simulated noise to the latent space to obtain various soil spectral features.

[0045] In this step, the soil spectral data includes near-infrared spectral data or infrared spectral data of the soil, etc.

[0046] Taking the soil spectral data as near-infrared spectral data as an example, the soil spectral data is obtained through the following steps:

[0047] (1) Perform air-drying, impurity-removing, and grinding operations on the soil sample to be detected to obtain a standard-state soil sample.

[0048] In this embodiment, the air-drying operation includes evenly spreading the soil sample on a clean and pollution-free surface, ensuring an appropriate sample thickness to promote uniform drying; the impurity-removing operation includes carefully screening the soil sample using manual or mechanical methods (such as a sieve) to remove visible impurities; the grinding operation includes using a grinder or mortar to grind the soil sample to the required particle size (usually less than 0.149 mm), ensuring a uniform particle size distribution; filling the processed soil sample into a soil sample mold for near-infrared spectral scanning.

[0049] (2) Perform near-infrared spectral scanning on the standard-state soil sample to obtain the near-infrared spectral data.

[0050] In this embodiment, the ground soil sample is evenly placed on the sample stage (or sample cup, sample cell) 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 voids; the spectrometer is started, and near-infrared spectral scanning is performed on the standard-state soil sample according to the set parameters to obtain the near-infrared spectral data.

[0051] In this embodiment, reversible computing can be implemented through Invertible Neural Networks (INNs); the invertible neural network calculates the output through forward propagation and can accurately recover the input through backpropagation.

[0052] In one embodiment, the invertible neural network includes an Affine Coupling Layer. The working principle of the Affine Coupling Layer is to divide the input data into two parts, then transform these two parts through a learning function, and couple them in an alternating manner. The output is the concatenation of the two transformed parts of the data.

[0053] It should be noted that the mapping of the invertible neural network from input to output is bijective, that is, there is an inverse mapping. The loss function of the invertible neural network can be determined based on the prior knowledge of the standard normal distribution.

[0054] In this embodiment, an invertible neural network can be trained through the following steps:

[0055] (1) Obtain sample soil spectral data and perform appropriate preprocessing on the input data, such as normalization, denoising, etc., to ensure the quality and consistency of the data;

[0056] (2) Construct invertible blocks and connect them into a network. Each invertible block contains two learning functions (such as affine transformation) for transforming and coupling the two parts of the input data;

[0057] (3) Define the supervised loss in the forward process and the unsupervised loss in the reverse process according to the task requirements and network characteristics;

[0058] (4) Input the sample soil spectral data into the invertible block, and use optimization methods such as backpropagation algorithm and gradient descent to train the network, update the network parameters to minimize the loss function. When the network converges, an invertible neural network for soil analysis can be obtained.

[0059] Figure 2 is the second schematic diagram of the process of the soil spectral detection method based on reversible computing provided by the present invention. In Figure 2 In the shown embodiment, the invertible neural network includes multiple forward transformation layers (the output is ) and multiple inverse transformation layers (the output is ); training samples are constructed according to the division of training batches, random situations, etc. of the original spectral data; then the training samples are input into the invertible neural network. Each forward transformation layer fits according to the characteristics of the simulated noise distribution in the sample data to obtain the simulated noise. During the 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 feature latent space (denoted as ), and extract the corresponding soil spectral features from the feature latent space.

[0060] In this embodiment, the reversible calculation is implemented by a reversible neural network, and the reversible neural network includes a forward transformation layer; the loss function of the reversible neural network is determined based on the prior knowledge of the standard normal distribution; the forward function of the forward transformation layer is expressed as:

[0061] ;

[0062] Wherein, is the soil spectral data transformed by the transformation layer, is the soil spectral data transformed by the transformation layer.

[0063] Specifically, multiple soil spectral features are obtained through the following steps:

[0064] (1) Based on the forward transformation layer, add simulated noise to the soil spectral data layer by layer using the following formula, and map the soil spectral data after adding the simulated noise to the latent space to obtain the feature latent space:

[0065] ;

[0066] Wherein, 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, is the soil spectral data transformed by the transformation layer, is the soil spectral data transformed by the transformation layer, is the soil spectral data transformed by the transformation layer, is the soil spectral data transformed by the transformation layer corresponding to the simulated noise; is the distribution probability of the soil spectral data; is the determinant.

[0067] (2) When the reversible neural network reaches the maximum number of iterations or the gradient change satisfies the early stopping threshold, obtain multiple soil spectral features from the feature latent space.

[0068] In this embodiment, when the reversible neural network reaches the maximum number of iterations or the gradient change satisfies the early stopping threshold, multiple soil spectral features are obtained.

[0069] In this embodiment, the maximum number of iterations can be set according to user requirements.

[0070] In this embodiment, the input data undergoes forward propagation through multiple reversible layers. Each layer takes the output of the previous layer as input and applies a reversible transformation to generate a new output, which contains both the information of the original data and the features learned through this 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.

[0071] It should be noted that the simulated noise conforms to the Gaussian distribution characteristics. Random noise simulated by a neural network composed of a three-layer linear model and the ReLU activation function is added layer by layer to the input soil spectral data in each network layer. Finally, the soil spectral data with added simulated noise is mapped to the latent space to obtain the corresponding feature latent space, and thus various soil spectral features are obtained.

[0072] Step 120: Screen the various soil spectral features through the inverse operation of reversible calculation to obtain the target features for detecting the content of at least one of total nitrogen and organic matter in the soil spectral data.

[0073] In this step, the reversible calculation is implemented through a reversible neural network. The reversible neural network also includes an inverse transformation layer, and the inverse function of the inverse transformation layer is expressed as:

[0074] ;

[0075] In this embodiment, an inverse transformation is performed on the various soil spectral features based on the inverse transformation layer to obtain the reconstructed features, and the various soil spectral features are screened according to the similarity between the reconstructed features and the various soil spectral features to obtain the target features.

[0076] In this embodiment, the similarity between the reconstructed features and the various soil spectral features can be determined by calculating the cosine similarity.

[0077] In this embodiment, if the similarity between the reconstructed features obtained by the reverse operation of the reversible neural network and the corresponding feature vectors in the feature latent space is close to or higher than the specified threshold, then the reconstructed features can be used as the target features.

[0078] In Figure 2 the shown embodiment, each inverse transformation layer (the output is ) of the reversible neural network performs an inverse operation on each feature vector in the feature latent space (represented as ) in sequence to obtain the reconstructed spectral features (represented as ).

[0079] In this embodiment, target features are obtained from the feature latent space, and soil property indicators such as total nitrogen and organic matter in the soil are calculated using these features, and then the contents of total nitrogen and organic matter in the soil are calculated.

[0080] The soil spectral detection method based on reversible computing provided by the embodiment of the present invention adds simulated noise to soil spectral data through reversible computing, maps the soil spectral data with added simulated noise to the latent space and extracts various soil spectral features; performs screening on various soil spectral features through the inverse operation of reversible computing to obtain target features, so as to detect the content of at least one of total nitrogen and organic matter in the soil spectral data, improving the accuracy of soil spectral detection, and thus being able to provide fast, efficient and accurate measurement for soil properties of different soil types.

[0081] In some embodiments, after obtaining the target features, the soil spectral detection method based on reversible computing further includes: calculating and analyzing the target features based on a soil property detection model to obtain the content of total nitrogen and the content of organic matter; the soil property detection model is obtained based on pre-training.

[0082] In this embodiment, the soil property detection model is obtained through the following steps:

[0083] (1) Obtain sample soil spectral data, and perform appropriate preprocessing on the input data, such as normalization, denoising, etc., to ensure the quality and consistency of the data.

[0084] (2) Extract soil property features such as total nitrogen content features and organic matter content features from the sample soil spectral data, use the above soil property features as input, and construct a mathematical model with the total nitrogen content and the organic matter content; or use the sample soil spectral data to perform iterative training on an existing machine learning model (such as a random forest or an artificial neural network) to obtain an available soil property detection model.

[0085] In this embodiment, the loss function of the machine learning model can be determined according to the 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.

[0086] In this embodiment, by performing feature screening on the obtained latent space variables, more suitable spectral information for the soil property detection task is obtained, and a soil property detection model is constructed to output the values of total nitrogen and organic matter in the soil.

[0087] Figure 3 is the third flow diagram of the soil spectral detection method based on reversible computing provided by the present invention. In Figure 3In the illustrated embodiment, taking the data variables in the transformed latent space as the input, the soil property detection model calculates and analyzes the latent space variables, and outputs the total nitrogen and organic matter content of the soil as the detection results; since the original spectral data is mapped into the latent space, the differences between the spectral data of soil samples with different nutrient contents will be more directly revealed, facilitating the soil property detection model to obtain effective spectral features, thereby improving the soil nutrient detection effect.

[0088] The soil spectral detection method based on reversible computing provided by the embodiment of the present invention calculates and analyzes the target features through the soil property detection model, obtains the total nitrogen content and the organic matter content, and improves the soil property detection efficiency.

[0089] Figure 4 is the fourth flow diagram of the soil spectral detection method based on reversible computing provided by the present invention. In Figure 4 the illustrated embodiment, the sample to be detected is air-dried, decontaminated, ground and other operations are performed to obtain a standard-state soil sample (i.e., the sample) that can be used for near-infrared spectrometer collection, and it is filled into the soil sample mold; the standard-state soil sample is scanned through the lens of the near-infrared detector, and the scanned near-infrared spectral information is sent to the terminal device. The terminal device executes the near-infrared spectral information processing task, including data preparation, feature space conversion (specifically, the original spectral data is added with simulated noise through a reversible neural network, and the quality of the data in the latent space is evaluated by the features reconstructed through the inverse operation of the reversible transformation, and then the effective features are obtained by feature screening using the feature data in the latent space), model construction (constructing a soil property detection model) and result output (inputting the effective features into the soil property detection model and outputting the corresponding soil property indicators); the light source and the optical fiber are used to provide illumination conditions for the near-infrared spectrometer to scan the sample.

[0090] The soil spectral detection device based on reversible computing provided by the present invention will be described below. The soil spectral detection device based on reversible computing described below can be mutually referred to the soil spectral detection method described above.

[0091] Figure 5 is the structural diagram of the soil spectral detection device based on reversible computing provided by the present invention. As Figure 5 shown, the soil spectral detection device based on reversible computing includes: a latent space acquisition module 510 and a feature screening module 520.

[0092] The latent space acquisition module 510 is used to add simulated noise to the soil spectral data based on reversible computing, and map the soil spectral data after adding the simulated noise to the latent space to obtain various soil spectral features;

[0093] A feature screening module 520 is configured to screen a variety of soil spectral features through the inverse operation of reversible computing to obtain target features for detecting the content of at least one of total nitrogen and organic matter in soil spectral data.

[0094] The soil spectral detection device based on reversible computing provided by the embodiments of the present invention adds simulated noise to soil spectral data through reversible computing, maps the soil spectral data with added simulated noise to a latent space, and extracts a variety of soil spectral features; screens a variety of soil spectral features through the inverse operation of reversible computing to obtain target features for detecting the content of at least one of total nitrogen and organic matter in soil spectral data, improving the accuracy of soil spectral detection, and thus being able to provide fast, efficient, and accurate measurements for the soil properties of different soil types.

[0095] In Figure 5 the illustrated embodiment, the soil spectral detection device based on reversible computing further includes: a soil detection module 530.

[0096] The soil detection module 530 is configured to, after obtaining the target features, calculate and analyze the target features based on a soil property detection model to obtain the content of total nitrogen and the content of organic matter; the soil property detection model is obtained through pre-training.

[0097] The soil spectral detection device based on reversible computing provided by the embodiments of the present invention obtains the total nitrogen content and the organic matter content by calculating and analyzing the target features based on a soil property detection model, improving the efficiency of soil property detection.

[0098] Figure 6 is a schematic structural diagram of an electronic device provided by the present invention. As Figure 6 shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640. Among them, 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 logic instructions in the memory 630 to execute a soil spectral detection method based on reversible computing, and the method includes: adding simulated noise to soil spectral data through reversible computing, mapping the soil spectral data with added simulated noise to a latent space to obtain a variety of soil spectral features; screening a variety of soil spectral features through the inverse operation of reversible computing to obtain target features for detecting the content of at least one of total nitrogen and organic matter in soil spectral data.

[0099] In addition, when the logical instructions in the above-mentioned memory 630 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0100] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that 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 computing provided by the above-mentioned various methods. The method includes: adding simulated noise to soil spectral data based on reversible computing, and mapping the soil spectral data after adding the simulated noise to a latent space to obtain various soil spectral features; screening the various soil spectral features through the inverse operation of reversible computing to obtain target features for detecting the content of at least one of total nitrogen and organic matter in the soil spectral data.

[0101] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the soil spectral detection method based on reversible computing provided by the above-mentioned various methods. The method includes: adding simulated noise to soil spectral data based on reversible computing, and mapping the soil spectral data after adding the simulated noise to a latent space to obtain various soil spectral features; screening the various soil spectral features through the inverse operation of reversible computing to obtain target features for detecting the content of at least one of total nitrogen and organic matter in the soil spectral data.

[0102] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.

[0103] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable 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.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment 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; The reversible computation is implemented by a reversible neural network; the reversible neural network calculates output by forward propagation and can accurately restore input by back propagation, and the mapping of the reversible neural network from input to output is bijective; The reversible neural network is used to fit the simulated noise distribution characteristics in the sample data through each forward transformation layer to obtain simulated noise, and in the process of network forward propagation, the simulated noise is added to the soil spectral data layer by layer and the data is mapped to the latent space, and multiple soil spectral features are extracted from the feature latent space; The simulated noise conforms to the Gaussian distribution characteristics, and the simulated noise is determined by adding random noise to the soil spectral data layer by layer based on each network layer of the reversible neural network, and the random noise is obtained by simulating a neural network, and the neural network includes a 3-layer linear model and a ReLU activation function; After obtaining the target feature, the method further includes: Calculating and analyzing the target characteristics 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.

2. The soil spectrum detection method based on reversible calculation according to claim 1 is characterized in that: The reversible neural network 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 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 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. A soil spectrum detection device based on reversible calculation, using the soil spectrum detection method based on reversible calculation as claimed in claim 1, 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; A feature screening module, used for screening the plurality of soil spectral features through 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; The simulated noise conforms to the Gaussian distribution characteristics, and the simulated noise is determined by adding random noise to the soil spectral data layer by layer based on each network layer of the reversible neural network, and the random noise is obtained by simulating a neural network, and the neural network includes a 3-layer linear model and a ReLU activation function; 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.

6. 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 4 is implemented.

7. 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 4 is implemented.

Citation Information

Patent Citations

  • Near-infrared detection method for soil organic matter and total nitrogen content by comparing neural network

    CN119044108A