Soil nutrient detection method and device based on vehicle-mounted two-channel soil spectrum
By integrating a dual-channel near-infrared spectrometer on the vehicle-mounted equipment and processing soil spectral data in combination with artificial neural network models, the problem of low efficiency and accuracy of soil total nitrogen and organic matter detection in the existing technology is solved, and efficient and accurate soil nutrient detection is achieved.
Patent Information
- Application Number
- CN202510148216.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, the detection efficiency and accuracy of soil total nitrogen and organic matter content are relatively low, and there are problems such as long detection cycle, complex operation, large human interference and environmental pollution.
Using a detection method based on vehicle-mounted dual-channel soil spectrum, two near-infrared spectrometers were driven by vehicle-mounted equipment to collect soil spectral data, and the data was processed using artificial neural network models to calculate the average value of the feature vector to obtain soil nutrient detection results.
It improves the accuracy and efficiency of soil nutrient detection, and achieves rapid, real-time and non-destructive testing of soil total nitrogen and organic matter content, simplifies operation and reduces the risk of environmental pollution.
Smart Images

Figure CN119643504A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of soil detection, and in particular to a soil nutrient detection method and device based on a vehicle-mounted dual-channel soil spectrum. Background Art
[0002] The growth and reproduction of crops cannot be separated from the supply of nutrients such as total nitrogen and organic matter in the soil. Rapid, timely and effective large-scale testing of total nitrogen and organic matter content in the soil will be of great benefit to guiding the effective recycling of cultivated land.
[0003] However, the current detection of soil total nitrogen and organic matter content is still mainly based on chemical detection methods. This type of method has problems such as long detection cycle, complex operation, large human interference and environmental pollution, which leads to low detection efficiency and accuracy of soil total nitrogen and organic matter content. Summary of the invention
[0004] The present invention provides a soil nutrient detection method and device based on a vehicle-mounted dual-channel soil spectrum, which are used to solve the technical problem of low detection efficiency and accuracy of soil total nitrogen and organic matter content in the prior art.
[0005] The present invention provides a soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum, comprising the following steps: A first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in a horizontal direction and start collecting at the same time; the horizontal distance between the first position and the second position is within a preset distance range; Based on the first soil spectrum data and the second soil spectrum data, obtaining a first eigenvector corresponding to the first soil spectrum data and a second eigenvector corresponding to the second soil spectrum data through an artificial neural network model; Obtaining a target feature vector by calculating an average value of the first feature vector and the second feature vector; Based on the target feature vector, the soil nutrient detection results of the first position and the second position are obtained through the trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
[0006] According to a soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum provided by the present invention, the training step of the target neural network model includes: Based on multiple location points in the farmland soil, multiple soil spectrum data are collected; each location point corresponds to a piece of soil spectrum data; Two different Gaussian random noises are added to each soil spectral data to generate a first historical soil spectral data and a second historical soil spectral data corresponding to each position point; the first historical soil spectral data is used to simulate the spectral data of the first position in the farmland soil, and the second historical soil spectral data is used to simulate the spectral data of the second position in the farmland soil; Based on a first historical soil spectrum data and a second historical soil spectrum data corresponding to each location point, a plurality of historical soil spectrum data samples are obtained; each historical soil spectrum data sample includes a first historical soil spectrum data and a second historical soil spectrum data corresponding to a location point; Based on each historical soil spectral data sample, a feature vector group corresponding to each historical soil spectral data sample is obtained through an artificial neural network model; each feature vector group includes a first feature vector corresponding to the first historical soil spectral data and a second feature vector corresponding to the second historical soil spectral data; Obtain a target feature vector corresponding to each feature vector group by calculating an average value of a first feature vector and a second feature vector in each feature vector group; Based on the target feature vectors corresponding to all feature vector groups, the target neural network model is trained to obtain a trained target neural network model.
[0007] According to a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum provided by the present invention, the target neural network model includes any one of a support vector machine, XGBoost and a random forest.
[0008] According to a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum provided by the present invention, based on the first soil spectrum data and the second soil spectrum data, a first eigenvector corresponding to the first soil spectrum data and a second eigenvector corresponding to the second soil spectrum data are obtained through an artificial neural network model, including: Based on the first soil spectral data and the second soil spectral data, obtaining an initial first eigenvector corresponding to the first soil spectral data and an initial second eigenvector corresponding to the second soil spectral data through an input layer in an artificial neural network model; Based on the initial first eigenvector and the initial second eigenvector, obtaining a first intermediate eigenvector corresponding to the initial first eigenvector and a second intermediate eigenvector corresponding to the initial second eigenvector through a hidden layer in an artificial neural network model; Based on the first feature vector in the middle and the second feature vector in the middle, obtaining feature similarity between the first feature vector in the middle and the second feature vector in the middle through an output layer in the artificial neural network model; Based on the feature similarity, updating the parameters of the artificial neural network model through back propagation to obtain a trained artificial neural network model; Based on the trained artificial neural network model, a final first eigenvector corresponding to the first soil spectral data and a final second eigenvector corresponding to the second soil spectral data are obtained.
[0009] According to a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum provided by the present invention, the vehicle-mounted device drives a first near-infrared spectrometer to collect first soil spectrum data at a first position in a farmland area to be tested, and the vehicle-mounted device drives a second near-infrared spectrometer to collect second soil spectrum data at a second position in the farmland area to be tested, including: Pre-processing the interaction unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the earth-breaking unit, and the cleaning unit; The preprocessed interaction unit sends a spectrum acquisition instruction according to a preset sampling interval and sampling time, and the preprocessed first auxiliary detection unit initializes and corrects the preprocessed first near-infrared spectrometer, and the preprocessed second auxiliary detection unit initializes and corrects the preprocessed second near-infrared spectrometer; Based on the spectral acquisition instruction, the vehicle-mounted equipment tows the pre-treated soil-breaking unit to break, level and mix the surface soil of the farmland area to be tested, and tows the pre-treated cleaning unit to remove large gravel and stubble that is not easy to break in the farmland area to obtain a flat ground; Based on the leveled ground, the first near-infrared spectrometer that has been initialized and calibrated is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be tested, and the second near-infrared spectrometer that has been initialized and calibrated is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be tested.
[0010] According to a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum provided by the present invention, the interactive unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the soil breaking unit and the cleaning unit are pre-processed, including: The crop residues and residual soil on the interactive unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the soil-breaking unit and the cleaning unit are removed by a cleaning water gun installed on the cleaning water tank.
[0011] The present invention also provides a soil nutrient detection device based on a vehicle-mounted dual-channel soil spectrum, comprising the following modules: The acquisition module is used to drive a first near-infrared spectrometer to acquire first soil spectral data at a first position in the farmland area to be measured through a vehicle-mounted device, and to drive a second near-infrared spectrometer to acquire second soil spectral data at a second position in the farmland area to be measured through a vehicle-mounted device; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in a horizontal direction and start acquisition at the same time; the horizontal distance between the first position and the second position is within a preset distance range; A feature module, used for obtaining a first feature vector corresponding to the first soil spectrum data and a second feature vector corresponding to the second soil spectrum data through an artificial neural network model based on the first soil spectrum data and the second soil spectrum data; A target module, configured to obtain a target feature vector by calculating an average value of the first feature vector and the second feature vector; A detection module is used to obtain soil nutrient detection results at the first position and the second position based on the target feature vector through a trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the method for detecting soil nutrient based on vehicle-mounted dual-channel soil spectrum as described above is implemented.
[0013] 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 nutrient detection method based on vehicle-mounted dual-channel soil spectroscopy as described in any one of the above is implemented.
[0014] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned soil nutrient detection methods based on vehicle-mounted dual-channel soil spectroscopy.
[0015] The present invention provides a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum. First, a first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in a farmland area to be tested, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be tested. Then, based on the first soil spectral data and the second soil spectral data, a first eigenvector corresponding to the first soil spectral data and a second eigenvector corresponding to the second soil spectral data are obtained through an artificial neural network model. The target eigenvector is determined by calculating the average value of the first eigenvector and the second eigenvector. In this process, data is collected in a dual-channel parallel manner by two near-infrared spectrometers, which can exclude interference data caused by farmland soil topographic factors (for example, soil water content, sand and stone and crop residues at different positions of the farmland will cause different spectral noises), and the reliability of the target eigenvector is improved by calculating the average value. Then, the soil nutrient detection results at the first position and the second position are obtained through the trained target neural network model, thereby improving the accuracy of detecting the total nitrogen content and organic matter content of farmland soil nutrients. In addition, vehicle-mounted equipment can be used to conduct on-the-go testing in farmland, which is simple and quick to operate, thus achieving accurate, efficient, non-destructive and environmentally friendly testing of soil nutrients. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] Figure 1 It is a flow chart of a soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum provided by the present invention.
[0018] Figure 2 It is a structural schematic diagram of a vehicle-mounted dual-channel soil spectrum acquisition system provided by the present invention.
[0019] Figure 3 It is a structural schematic diagram of the detection unit provided by the present invention.
[0020] Figure 4 The present invention provides a vehicle-mounted dual-channel soil spectral data collection process schematic diagram.
[0021] Figure 5 It is a schematic diagram of a feature extraction process based on vehicle-mounted dual-channel soil spectral data provided by the present invention.
[0022] Figure 6It is a structural schematic diagram of a soil nutrient detection device based on a vehicle-mounted dual-channel soil spectrum provided by the present invention.
[0023] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] The growth and reproduction of crops cannot be separated from the supply of nutrients such as total nitrogen and organic matter in the soil. Rapid, timely and effective large-scale detection of total nitrogen and organic matter content in the soil is of great benefit to guiding the effective recycling of cultivated land. Therefore, it is very important to study rapid and effective methods suitable for large-scale detection of total nitrogen and organic matter in farmland.
[0025] However, the current detection of soil total nitrogen and organic matter is still mainly based on chemical detection methods, which generally have problems such as long detection cycle, complex operation, great human interference, and environmental pollution.
[0026] Near-infrared spectroscopy is one of the important components of spectral analysis. It can reflect the combined frequency and double frequency information of CH, NH and other groups. At the same time, near-infrared is cheaper than other spectral technologies, so it is often used for soil total nitrogen and organic matter detection.
[0027] In the existing technology, the soil nutrient detection method based on near-infrared technology is limited by the carrier and collection range, and can only perform single-point soil nutrient detection. Therefore, it cannot meet the needs of a large monitoring range and a wide application range in the detection of total nitrogen and organic matter in farmland soil.
[0028] In order to solve the above problems, the present invention provides a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum. Specifically, the vehicle-mounted soil total nitrogen and organic matter content detection equipment and system are mounted on a tractor or other traction unit, which realizes soil leveling, impurity removal and detection and measurement through a soil-breaking unit, a cleaning unit and a detection unit during driving, and is aimed at tasks such as soil total nitrogen and organic matter detection in large-scale farmland, and can realize rapid, real-time and effective on-the-go detection of soil total nitrogen and organic matter content in the field.
[0029] 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.
[0030] Combine the following Figures 1 to 7 The present invention describes a soil nutrient detection method and device based on a vehicle-mounted dual-channel soil spectrum.
[0031] Figure 1 FIG. 1 is a flow chart of a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum provided by the present invention. Figure 1 As shown, the method comprises the following steps: Step 101: driving a first near-infrared spectrometer by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and driving a second near-infrared spectrometer by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in the horizontal direction and start collecting at the same time; the horizontal distance between the first position and the second position is within a preset distance range.
[0032] Specifically, in order to adapt to the large-scale working environment in the wild farmland area, in an embodiment of the present invention, a vehicle-mounted dual-channel soil spectrum acquisition system is provided to apply a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum provided by the present invention. Figure 2 FIG. 1 is a schematic diagram of the structure of a vehicle-mounted dual-channel soil spectrum acquisition system provided by the present invention. Figure 2 The vehicle-mounted dual-channel soil spectrum acquisition system at least includes: a traction unit, a soil breaking unit, a cleaning unit, a detection unit and a cleaning water tank.
[0033] The traction unit is a vehicle-mounted device, which can be an agricultural machine or vehicle suitable for traveling in the farmland, such as a tractor. On the one hand, the vehicle-mounted device pulls other equipment (including soil-breaking units, cleaning units, detection units, and clean water tanks) forward, and on the other hand, it can also provide power support for the operation of other equipment through a series of transmission systems (such as mechanical transmission or power transmission).
[0034] The soil-breaking unit is used to break up, level and mix the surface soil in the farmland area to be tested. The soil-breaking unit specifically includes three parts: rake teeth or blades, a transmission system and an adjustment unit. Among them, the rake teeth or blades are used to break up larger soil clods, and cut up surface weeds and crop residues and mix them into the soil to form a fine soil structure, and finally achieve surface leveling; the transmission system is used to drive the rake teeth or blades to rotate through the power output shaft of the traction unit to achieve the forward movement and rotation of the soil-breaking unit; the adjustment unit is used to control the rotation speed and depth of the rake teeth according to the predetermined operating range, and perform standardized operations.
[0035] The cleaning unit consists of a set of sturdy grid rakes, which are used to remove impurities such as large gravel and stubble that are not easy to break. The surface soil of the farmland treated by the soil breaking unit contains fewer stones and stubble. When the traction unit moves, it drives the grid rake to move. The grid rake can drag large stones and stubble to one side to obtain flat soil that is convenient for spectral detection.
[0036] Figure 3 is a schematic diagram of the structure of the detection unit provided by the present invention, such as Figure 3 As shown. The detection unit consists of two identical and independently working spectral detection units, a communication unit, a calculation unit, a display / touch unit, a control unit, and two auxiliary detection units (i.e., a first auxiliary detection unit and a second auxiliary detection unit). The detection unit is used to perform spectral scanning on farmland soil according to the set control instructions, collect soil spectral data, and calculate based on the soil spectral data to output the total nitrogen content and organic matter content in the soil nutrients.
[0037] The spectrum detection unit is composed of a spectrometer, a light source, a collimator, a lens (including coating, which can pass the 900-1700nm band), etc., and is used to collect spectral data of farmland soil. Since the near-infrared spectrum can reflect the combined frequency and double frequency information of groups such as CH and NH, and the price of near-infrared is relatively cheap compared to other spectral technologies, in the embodiment of the present invention, a near-infrared spectrometer is used as an example of the spectrometer in the spectrum detection unit for explanation.
[0038] The two independent spectral detection units correspond to the first near-infrared spectrometer and the second near-infrared spectrometer, respectively. Through the first near-infrared spectrometer and the second near-infrared spectrometer, the soil spectral data at two locations can be obtained simultaneously, thereby providing a basis for the subsequent stable spectral feature extraction. The light source is used to generate a stable, uniform, and continuous light signal, the collimator is used to converge the light and adjust the direction and angle of the light to ensure that the light signal enters the near-infrared spectrometer, and the lens is used to receive the spectral signal in the 900-1700nm band.
[0039] The communication unit is used to locate through satellite communication, obtain the position information of the spectral detection unit in real time, and bind the position information with the corresponding soil spectral data, thereby providing a basis for subsequent detection of soil nutrient information at any location in the farmland.
[0040] The display / touch unit is used to display information through the display screen, facilitate human-computer interaction, and realize the formulation and issuance of control instructions (such as spectrum acquisition instructions).
[0041] The control unit is used to control the spectral detection unit to collect soil spectral data according to a control instruction (such as a spectral acquisition instruction), for example, through a timing switch, to control the spectral detection unit to collect soil spectral data according to a sampling time interval set in the spectral acquisition instruction, and to store the soil spectral data collected by the spectral detection unit.
[0042] The auxiliary detection unit specifically includes a micro pneumatic gun, a black and white background pick, a soft brush, a sleeve, etc. The auxiliary detection unit is used to create conditions suitable for soil spectrum detection and initialize and calibrate the spectrometer before collecting soil spectrum data.
[0043] The calculation unit is used to read the soil spectrum data collected by the spectrum detection unit from the control unit, perform subsequent calculation processing, and finally output the total nitrogen content and organic matter content in the soil nutrients.
[0044] The clean water tank is used to store water for equipment cleaning, and provides cleaning and treatment of key equipment components before and after the equipment is operated. At the same time, it can provide counterweights for the detection unit to ensure the effective operation of the equipment.
[0045] In an embodiment of the present invention, a first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured. That is, by starting the vehicle-mounted device (such as a tractor), the spectrometers in the two spectral detection units are driven to collect soil spectral data. The two identical and independently working spectral detection units are parallel in the horizontal direction, and simultaneously start to collect soil spectral data of two adjacent positions (i.e., the first position and the second position) in the farmland according to a preset sampling period or sampling distance, wherein the horizontal distance d between the first position and the second position is within a preset distance range, which can be seen in Figure 3 ,According to the experimental results, the soil properties of two adjacent places in the ,farmland within the preset distance are almost the same, and the corresponding ,soil nutrient information can be considered to be the same.
[0046] Therefore, the embodiment of the present invention collects soil spectral data at two adjacent positions in the farmland through a vehicle-mounted dual-channel method to obtain first soil spectral data at the first position and second soil spectral data at the second position. The first soil spectral data and the second soil spectral data can be compared with each other, thereby eliminating interference data caused by farmland soil topographic factors (for example, soil moisture, sand and crop residues at different positions in the farmland will cause different spectral noises), thereby improving the reliability and accuracy of the data.
[0047] Step 102: Based on the first soil spectrum data and the second soil spectrum data, a first eigenvector corresponding to the first soil spectrum data and a second eigenvector corresponding to the second soil spectrum data are obtained through an artificial neural network model.
[0048] Specifically, the first soil spectral data and the second soil spectral data are input into the artificial neural network model. The spectral noise data caused by farmland soil topography factors in the first soil spectral data and the second soil spectral data can be eliminated through the artificial neural network model, so that the first eigenvector corresponding to the first soil spectral data and the second eigenvector corresponding to the second soil spectral data can be output quickly and accurately.
[0049] In the embodiment of the present invention, the first eigenvector represents the feature representation corresponding to the soil nutrient information at the first position after the noise is removed, and the second eigenvector represents the feature representation corresponding to the soil nutrient information at the second position after the noise is removed. Therefore, when the soil properties at the first position and the second position are almost the same and the corresponding soil nutrient information can be considered to be the same, the first eigenvector and the second eigenvector have a high degree of similarity and accuracy and can be further processed later.
[0050] Step 103: Obtain a target feature vector by calculating an average value of the first feature vector and the second feature vector.
[0051] Specifically, by calculating the average value of the first eigenvector and the second eigenvector, a eigenvector that can reliably and accurately characterize the soil nutrient information corresponding to the first position and the second position is further obtained, and this is used as the target eigenvector, thereby improving the reliability and accuracy of subsequent soil nutrient information detection.
[0052] In some embodiments, since the first eigenvector and the second eigenvector have high similarity and accuracy, in order to reduce the amount of calculation and speed up the detection speed, the first eigenvector or the second eigenvector can be directly used as the target eigenvector to detect soil nutrient information.
[0053] Step 104: Based on the target feature vector, the soil nutrient detection results of the first position and the second position are obtained through the trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
[0054] Specifically, the target feature vector is input into the trained target neural network model, and the soil nutrient detection results at the first position and the second position can be accurately and quickly output through the target neural network model, and the soil nutrient detection results include the total nitrogen content and organic matter content of the soil. Among them, the target neural network model is trained based on multiple historical soil spectral data samples.
[0055] In an embodiment of the present invention, the soil nutrient information at different locations in the farmland area to be tested can be detected by repeating the above steps 101 to 104, so as to obtain a distribution map of farmland soil nutrients, provide more reliable and effective guidance for farmland fertilization and recycling, and improve the utilization rate of farmland resources.
[0056] The present invention provides a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum. First, a first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in a farmland area to be tested, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be tested, thereby realizing efficient data collection in a large-scale working environment in a field farmland area. Then, based on the first soil spectral data and the second soil spectral data, a first eigenvector corresponding to the first soil spectral data and a second eigenvector corresponding to the second soil spectral data are obtained through an artificial neural network model. A target eigenvector is determined by calculating the average value of the first eigenvector and the second eigenvector. In this process, data is collected in a dual-channel parallel manner by two near-infrared spectrometers, so that interference data caused by farmland soil topography factors (for example, soil water content, sand and stone, and crop residues at different positions of the farmland may cause different spectral noises) can be excluded, and the reliability of the target eigenvector is improved by calculating the average value. Then, the soil nutrient detection results at the first position and the second position are obtained through the trained target neural network model, thereby improving the accuracy of detecting the total nitrogen content and organic matter content of farmland soil nutrients. In addition, vehicle-mounted equipment can be used to conduct on-the-go testing in farmland. The operation is simple and quick, and no destructive sampling is required, thus achieving accurate, efficient, non-destructive and environmentally friendly testing of soil nutrients.
[0057] Optionally, the step of driving a first near-infrared spectrometer by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and driving a second near-infrared spectrometer by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured, comprises: Pre-processing the interaction unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the earth-breaking unit, and the cleaning unit; The preprocessed interaction unit sends a spectrum acquisition instruction according to a preset sampling interval and sampling time, and the preprocessed first auxiliary detection unit initializes and corrects the preprocessed first near-infrared spectrometer, and the preprocessed second auxiliary detection unit initializes and corrects the preprocessed second near-infrared spectrometer; Based on the spectral acquisition instruction, the vehicle-mounted equipment tows the pre-treated soil-breaking unit to break, level and mix the surface soil of the farmland area to be tested, and tows the pre-treated cleaning unit to remove large gravel and stubble that is not easy to break in the farmland area to obtain a flat ground; Based on the leveled ground, the first near-infrared spectrometer that has been initialized and calibrated is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be tested, and the second near-infrared spectrometer that has been initialized and calibrated is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be tested.
[0058] Specifically, Figure 4 The present invention provides a vehicle-mounted dual-channel soil spectral data collection process diagram. Figure 4 shown.
[0059] In the process of collecting farmland soil spectral data, first of all, it is necessary to pre-process the interactive unit (i.e., display / touch unit), the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the soil-breaking unit, and the cleaning unit, that is, to clean the equipment with a cleaning water gun.
[0060] Then, the preprocessed interactive unit sets parameters according to the preset sampling interval and sampling time interval (i.e., data acquisition interval), and uses the set parameters as the spectrum acquisition instruction. Then, the spectrum acquisition instruction is sent through the interactive unit, and the preprocessed first auxiliary detection unit performs initialization correction (i.e., black and white background correction) on the preprocessed first near-infrared spectrometer, and the preprocessed second auxiliary detection unit performs initialization correction (i.e., black and white background correction) on the preprocessed second near-infrared spectrometer.
[0061] The auxiliary detection unit includes a micro pneumatic gun, a black and white background pick, a soft brush, and a sleeve, etc. The initialization correction includes: the auxiliary detection unit controls the rotation of the measuring disk with the black and white background plate through the black and white background pick (the soft brush at a specific position will clean the black and white background plate during the rotation), respectively obtains the black background value and the white background value, thereby determining the initialization value of the near-infrared spectrometer, and starts the micro pneumatic gun in the sleeve to blow air into it to prevent floating soil from entering the detection chamber to interfere with the measurement, thereby completing the initialization correction of the near-infrared spectrometer.
[0062] Then, the control unit receives the spectral acquisition instruction sent by the interactive unit and controls the vehicle-mounted equipment (i.e., the agricultural vehicle) to move forward. The vehicle-mounted equipment pulls the pre-treated soil-breaking unit to crush, level and mix the surface soil of the farmland area to be tested, and pulls the pre-treated cleaning unit to remove large gravel and difficult-to-break stubble in the farmland area to be tested to obtain a flat ground.
[0063] Finally, on the flat ground, the control unit controls the vehicle-mounted equipment according to the spectrum collection instruction, drives the initialized and calibrated first near-infrared spectrometer to collect the first soil spectrum data at the first position in the farmland area to be tested, and drives the initialized and calibrated second near-infrared spectrometer to collect the second soil spectrum data at the second position in the farmland area to be tested. According to the first soil spectrum data and the second soil spectrum data, the calculation unit performs calculation to output the soil nutrient content.
[0064] The embodiment of the present invention uses a vehicle-mounted dual-channel method to simultaneously collect soil spectra of soils at two adjacent locations in the farmland area to be tested, which not only improves the data collection efficiency, but also obtains first soil spectral data and second soil spectral data for comparison with each other, thereby eliminating interference data caused by farmland soil topographic factors (for example, soil moisture, sand and stone and crop residues at different locations in the farmland will cause different spectral noises), improving data reliability and accuracy, and thereby improving the accuracy of soil nutrient detection.
[0065] Optionally, the pre-processing of the interaction unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the earth-breaking unit and the cleaning unit includes: The crop residues and residual soil on the interactive unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the soil-breaking unit and the cleaning unit are removed by a cleaning water gun installed on the cleaning water tank.
[0066] Specifically, before starting the equipment to collect soil spectral data, it is necessary to use a cleaning water gun installed on the cleaning water tank to clear the crop stubble and residual soil on the interactive unit (i.e., display / touch unit), the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the soil-breaking unit, and the cleaning unit, so as to eliminate the influence of interference, provide guarantee for subsequent data collection, and improve the reliability and accuracy of the data.
[0067] Optionally, obtaining a first eigenvector corresponding to the first soil spectral data and a second eigenvector corresponding to the second soil spectral data through an artificial neural network model based on the first soil spectral data and the second soil spectral data includes: Based on the first soil spectral data and the second soil spectral data, obtaining an initial first eigenvector corresponding to the first soil spectral data and an initial second eigenvector corresponding to the second soil spectral data through an input layer in an artificial neural network model; Based on the initial first eigenvector and the initial second eigenvector, obtaining a first intermediate eigenvector corresponding to the initial first eigenvector and a second intermediate eigenvector corresponding to the initial second eigenvector through a hidden layer in an artificial neural network model; Based on the first feature vector in the middle and the second feature vector in the middle, obtaining feature similarity between the first feature vector in the middle and the second feature vector in the middle through an output layer in the artificial neural network model; Based on the feature similarity, updating the parameters of the artificial neural network model through back propagation to obtain a trained artificial neural network model; Based on the trained artificial neural network model, a final first eigenvector corresponding to the first soil spectral data and a final second eigenvector corresponding to the second soil spectral data are obtained.
[0068] Specifically, Figure 5 FIG. 1 is a schematic diagram of a feature extraction process based on vehicle-mounted dual-channel soil spectral data provided by the present invention. Figure 5 shown.
[0069] After obtaining the first soil spectral data and the second soil spectral data simultaneously through two independent spectral detection units corresponding to the first near-infrared spectrometer and the second near-infrared spectrometer respectively, the first soil spectral data and the second soil spectral data are input into the input layer of the artificial neural network model, the input layer receives the first soil spectral data and the second soil spectral data, and converts them into a vector form suitable for internal processing of the neural network, that is, an initial first eigenvector and an initial second eigenvector. Then, the initial first eigenvector and the initial second eigenvector are input into the hidden layer (i.e., encoder) of the artificial neural network model, and the initial first eigenvector and the initial second eigenvector are converted into a higher-level feature representation, that is, an intermediate first eigenvector corresponding to the initial first eigenvector and an intermediate second eigenvector corresponding to the initial second eigenvector. Then, based on the intermediate first eigenvector and the intermediate second eigenvector, the feature similarity of the intermediate first eigenvector and the intermediate second eigenvector is calculated and output through the output layer of the artificial neural network model through a preset loss function, wherein the preset loss function can be any one of cosine similarity, Euclidean distance or KL divergence. Then, based on the feature similarity, the parameters of the artificial neural network model are updated by back propagation, and repeated iterative training is performed on this basis until the feature similarity output by the artificial neural network model is within a preset threshold range (e.g., 0.9 to 1), and the artificial neural network model at this time is used as the trained artificial neural network model. Finally, the first soil spectral data and the second soil spectral data are input into the trained artificial neural network model, and the artificial neural network model outputs the final first feature vector corresponding to the first soil spectral data and the final second feature vector corresponding to the second soil spectral data.
[0070] The embodiment of the present invention gradually eliminates the noise between the first eigenvector and the second eigenvector caused by farmland soil topography factors (for example, soil moisture, sand and crop residues at different locations in the farmland will cause different spectral noises) through loss function calculation, thereby improving the feature similarity between the first eigenvector and the second eigenvector, so that the soil nutrient information at the first position and the second position in the farmland soil can be accurately characterized, thereby improving the accuracy of subsequent soil nutrient detection.
[0071] Optionally, the training step of the target neural network model includes: Based on multiple location points in the farmland soil, multiple soil spectrum data are collected; each location point corresponds to a piece of soil spectrum data; Two different Gaussian random noises are added to each soil spectral data to generate a first historical soil spectral data and a second historical soil spectral data corresponding to each position point; the first historical soil spectral data is used to simulate the spectral data of the first position in the farmland soil, and the second historical soil spectral data is used to simulate the spectral data of the second position in the farmland soil; Based on a first historical soil spectrum data and a second historical soil spectrum data corresponding to each location point, a plurality of historical soil spectrum data samples are obtained; each historical soil spectrum data sample includes a first historical soil spectrum data and a second historical soil spectrum data corresponding to a location point; Based on each historical soil spectral data sample, a feature vector group corresponding to each historical soil spectral data sample is obtained through an artificial neural network model; each feature vector group includes a first feature vector corresponding to the first historical soil spectral data and a second feature vector corresponding to the second historical soil spectral data; Obtain a target feature vector corresponding to each feature vector group by calculating an average value of a first feature vector and a second feature vector in each feature vector group; Based on the target feature vectors corresponding to all feature vector groups, the target neural network model is trained to obtain a trained target neural network model.
[0072] Specifically, when training the target neural network model, it is first necessary to collect soil spectral data corresponding to multiple position points in the farmland soil, wherein each position point corresponds to a piece of soil spectral data.
[0073] Then, two different Gaussian random noises are added to each soil spectral data to generate a first historical soil spectral data and a second historical soil spectral data corresponding to each position point, wherein the first historical soil spectral data is used to simulate the spectral data of the first position in the farmland soil, and the second historical soil spectral data is used to simulate the spectral data of the second position in the farmland soil. In the embodiment of the present invention, by adding Gaussian random noise, a soil spectral data corresponding to each position point can be converted into two soil spectral data with different Gaussian random noises, which respectively represent the soil spectral data of two adjacent positions (i.e., the first position and the second position) in the farmland, which not only reduces the amount of training data collected in the farmland and improves the efficiency, but also because the two simulated spectral data actually represent the same position point in the farmland soil, the corresponding soil nutrient content is completely consistent, so that when the soil nutrient content data corresponding to the position point is used as label data for training the model in the future, it will be more consistent, thereby improving the effect of model training.
[0074] Then, based on a first historical soil spectrum data and a second historical soil spectrum data corresponding to each location point, a plurality of historical soil spectrum data samples are obtained, wherein each historical soil spectrum data sample includes a first historical soil spectrum data and a second historical soil spectrum data corresponding to a location point.
[0075] Then, based on each historical soil spectral data sample, a feature vector group corresponding to each historical soil spectral data sample is obtained through an artificial neural network model; each feature vector group includes a first feature vector corresponding to the first historical soil spectral data and a second feature vector corresponding to the second historical soil spectral data.
[0076] Then, the average value of the first eigenvector and the second eigenvector in each eigenvector group is calculated, and the average value of the first eigenvector and the second eigenvector in each eigenvector group is used as the target eigenvector corresponding to each eigenvector group (see Figure 5 ).
[0077] Finally, the target feature vectors corresponding to all feature vector groups are used as training data for model training, and the corresponding historical soil nutrient content data set actually measured is used as label data for model training to train the target neural network model and obtain a trained target neural network model.
[0078] The embodiment of the present invention performs supervised training on the target neural network model through a large number of historical soil spectral data samples and the corresponding historical soil nutrient contents, so that the model can fully learn the characteristics corresponding to the soil spectral data, thereby being able to accurately and quickly detect the total nitrogen content and organic matter content of farmland soil based on the target feature vector in subsequent soil nutrient detection tasks.
[0079] Optionally, the target neural network model includes any one of a support vector machine, XGBoost and a random forest.
[0080] Specifically, the target neural network model includes any one of support vector machine, XGBoost and random forest.
[0081] In the embodiment of the present invention, the target neural network model uses the target feature vector that can accurately characterize the soil nutrient information as input, thereby achieving accurate and efficient detection of soil nutrients and improving the effect of soil nutrient detection.
[0082] The following is a description of a soil nutrient detection device based on a vehicle-mounted dual-channel soil spectrum provided by the present invention. The soil nutrient detection device based on a vehicle-mounted dual-channel soil spectrum described below and the soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum described above can be referenced to each other.
[0083] Based on any of the above embodiments, Figure 6 Schematic diagram of the structure of a soil nutrient detection device based on vehicle-mounted dual-channel soil spectrum provided by the present invention. Figure 6 The embodiment of the present invention provides a soil nutrient detection device based on a vehicle-mounted dual-channel soil spectrum, comprising a collection module 601, a feature module 602, a target module 603 and a detection module 604, wherein: The acquisition module 601 is used to drive the first near-infrared spectrometer through a vehicle-mounted device to collect the first soil spectrum data of the first position in the farmland area to be tested, and to drive the second near-infrared spectrometer through the vehicle-mounted device to collect the second soil spectrum data of the second position in the farmland area to be tested; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in the horizontal direction and start collecting at the same time; the horizontal distance between the first position and the second position is within a preset distance range; the feature module 602 is used to obtain the first feature vector corresponding to the first soil spectrum data and the second feature vector corresponding to the second soil spectrum data through an artificial neural network model based on the first soil spectrum data and the second soil spectrum data; the target module 603 is used to obtain the target feature vector by calculating the average value of the first feature vector and the second feature vector; the detection module 604 is used to obtain the soil nutrient detection results of the first position and the second position based on the target feature vector through a trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectrum data samples.
[0084] The present invention provides a soil nutrient detection device based on a vehicle-mounted dual-channel soil spectrum. First, a first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in a farmland area to be tested, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be tested. Then, based on the first soil spectral data and the second soil spectral data, a first eigenvector corresponding to the first soil spectral data and a second eigenvector corresponding to the second soil spectral data are obtained through an artificial neural network model. The target eigenvector is determined by calculating the average value of the first eigenvector and the second eigenvector. In this process, data is collected in a dual-channel parallel manner by two near-infrared spectrometers, which can exclude interference data caused by farmland soil topographic factors (for example, soil water content, sand and stone and crop residues at different positions of the farmland will cause different spectral noises), and the reliability of the target eigenvector is improved by calculating the average value. Then, the soil nutrient detection results at the first position and the second position are obtained through the trained target neural network model, thereby improving the accuracy of detecting the total nitrogen content and organic matter content of farmland soil nutrients. In addition, vehicle-mounted equipment can be used to conduct on-the-go testing in farmland. The operation is simple and quick, and no destructive sampling is required, thus achieving accurate, efficient, non-destructive and environmentally friendly testing of soil nutrients.
[0085] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communications interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a soil nutrient detection method based on a vehicle-mounted dual-channel soil spectrum, the method comprising: A first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in a horizontal direction and start collecting at the same time; the horizontal distance between the first position and the second position is within a preset distance range; Based on the first soil spectrum data and the second soil spectrum data, obtaining a first eigenvector corresponding to the first soil spectrum data and a second eigenvector corresponding to the second soil spectrum data through an artificial neural network model; Obtaining a target feature vector by calculating an average value of the first feature vector and the second feature vector; Based on the target feature vector, the soil nutrient detection results of the first position and the second position are obtained through the trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
[0086] In addition, the logic instructions in the above-mentioned memory 730 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 this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable 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.
[0087] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum provided by the above methods, the method includes: A first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in a horizontal direction and start collecting at the same time; the horizontal distance between the first position and the second position is within a preset distance range; Based on the first soil spectrum data and the second soil spectrum data, obtaining a first eigenvector corresponding to the first soil spectrum data and a second eigenvector corresponding to the second soil spectrum data through an artificial neural network model; Obtaining a target feature vector by calculating an average value of the first feature vector and the second feature vector; Based on the target feature vector, the soil nutrient detection results of the first position and the second position are obtained through the trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
[0088] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum provided by the above methods, the method comprising: A first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in a horizontal direction and start collecting at the same time; the horizontal distance between the first position and the second position is within a preset distance range; Based on the first soil spectrum data and the second soil spectrum data, obtaining a first eigenvector corresponding to the first soil spectrum data and a second eigenvector corresponding to the second soil spectrum data through an artificial neural network model; Obtaining a target feature vector by calculating an average value of the first feature vector and the second feature vector; Based on the target feature vector, the soil nutrient detection results of the first position and the second position are obtained through the trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
[0089] 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.
[0090] 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.
[0091] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0092] It should also be noted that the terms "target", "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0093] "Determine B based on A" in the embodiments of the present application means that the factor A should be considered when determining B. It is not limited to "B can be determined based on A alone", but should also include: "Determine B based on A and C", "Determine B based on A, C and E", "Determine C based on A, and further determine B based on C", etc. In addition, it can also include taking A as a condition for determining B, for example, "When A meets the first condition, use the first method to determine B"; for another example, "When A meets the second condition, determine B", etc.; for another example, "When A meets the third condition, determine B based on the first parameter", etc. Of course, it can also be a condition that takes A as a factor for determining B, for example, "When A meets the first condition, use the first method to determine C, and further determine B based on C", etc.
[0094] In the present invention, the term "plurality" refers to two or more than two, and other quantifiers are similar to them.
[0095] 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 nutrient detection method based on vehicle-mounted dual-channel soil spectroscopy, characterized in that: include: A first near-infrared spectrometer is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be measured, and a second near-infrared spectrometer is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be measured; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in a horizontal direction and start collecting at the same time; the horizontal distance between the first position and the second position is within a preset distance range; Based on the first soil spectrum data and the second soil spectrum data, obtaining a first eigenvector corresponding to the first soil spectrum data and a second eigenvector corresponding to the second soil spectrum data through an artificial neural network model; Obtaining a target feature vector by calculating an average value of the first feature vector and the second feature vector; Based on the target feature vector, the soil nutrient detection results of the first position and the second position are obtained through the trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
2. The soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum according to claim 1 is characterized in that: The training steps of the target neural network model include: Based on multiple location points in the farmland soil, multiple soil spectrum data are collected; each location point corresponds to a piece of soil spectrum data; Two different Gaussian random noises are added to each soil spectral data to generate a first historical soil spectral data and a second historical soil spectral data corresponding to each position point; the first historical soil spectral data is used to simulate the spectral data of the first position in the farmland soil, and the second historical soil spectral data is used to simulate the spectral data of the second position in the farmland soil; Based on a first historical soil spectrum data and a second historical soil spectrum data corresponding to each location point, a plurality of historical soil spectrum data samples are obtained; each historical soil spectrum data sample includes a first historical soil spectrum data and a second historical soil spectrum data corresponding to a location point; Based on each historical soil spectral data sample, a feature vector group corresponding to each historical soil spectral data sample is obtained through an artificial neural network model; each feature vector group includes a first feature vector corresponding to the first historical soil spectral data and a second feature vector corresponding to the second historical soil spectral data; Obtain a target feature vector corresponding to each feature vector group by calculating an average value of a first feature vector and a second feature vector in each feature vector group; Based on the target feature vectors corresponding to all feature vector groups, the target neural network model is trained to obtain a trained target neural network model.
3. The soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum according to claim 2 is characterized in that: The target neural network model includes any one of support vector machine, XGBoost and random forest.
4. The soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum according to claim 1 is characterized in that: The obtaining, based on the first soil spectral data and the second soil spectral data, through an artificial neural network model, a first eigenvector corresponding to the first soil spectral data and a second eigenvector corresponding to the second soil spectral data comprises: Based on the first soil spectral data and the second soil spectral data, obtaining an initial first eigenvector corresponding to the first soil spectral data and an initial second eigenvector corresponding to the second soil spectral data through an input layer in an artificial neural network model; Based on the initial first eigenvector and the initial second eigenvector, obtaining a first intermediate eigenvector corresponding to the initial first eigenvector and a second intermediate eigenvector corresponding to the initial second eigenvector through a hidden layer in an artificial neural network model; Based on the first feature vector in the middle and the second feature vector in the middle, obtaining feature similarity between the first feature vector in the middle and the second feature vector in the middle through an output layer in the artificial neural network model; Based on the feature similarity, updating the parameters of the artificial neural network model through back propagation to obtain a trained artificial neural network model; Based on the trained artificial neural network model, a final first eigenvector corresponding to the first soil spectral data and a final second eigenvector corresponding to the second soil spectral data are obtained.
5. The soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum according to claim 1 is characterized in that: The method of driving a first near-infrared spectrometer to collect first soil spectral data at a first position in a tested farmland area by a vehicle-mounted device, and driving a second near-infrared spectrometer to collect second soil spectral data at a second position in the tested farmland area by a vehicle-mounted device, comprises: Pre-processing the interaction unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the earth-breaking unit, and the cleaning unit; The preprocessed interactive unit sends a spectrum acquisition instruction according to a preset sampling interval and sampling time, and the preprocessed first auxiliary detection unit initializes and corrects the preprocessed first near-infrared spectrometer, and the preprocessed second auxiliary detection unit initializes and corrects the preprocessed second near-infrared spectrometer; Based on the spectral acquisition instruction, the vehicle-mounted equipment tows the pre-treated soil-breaking unit to break, level and mix the surface soil of the farmland area to be tested, and tows the pre-treated cleaning unit to remove large gravel and stubble that is not easy to break in the farmland area to obtain a flat ground; Based on the leveled ground, the first near-infrared spectrometer that has been initialized and calibrated is driven by a vehicle-mounted device to collect first soil spectral data at a first position in the farmland area to be tested, and the second near-infrared spectrometer that has been initialized and calibrated is driven by a vehicle-mounted device to collect second soil spectral data at a second position in the farmland area to be tested.
6. The soil nutrient detection method based on vehicle-mounted dual-channel soil spectrum according to claim 5 is characterized in that: The pre-processing of the interaction unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the earth-breaking unit and the cleaning unit includes: The crop residues and residual soil on the interactive unit, the first auxiliary detection unit, the second auxiliary detection unit, the first near-infrared spectrometer, the second near-infrared spectrometer, the soil-breaking unit and the cleaning unit are removed by a cleaning water gun installed on the cleaning water tank.
7. A soil nutrient detection device based on vehicle-mounted dual-channel soil spectrum, characterized in that: include: The acquisition module is used to drive a first near-infrared spectrometer to acquire first soil spectral data at a first position in the farmland area to be measured through a vehicle-mounted device, and to drive a second near-infrared spectrometer to acquire second soil spectral data at a second position in the farmland area to be measured through a vehicle-mounted device; the first near-infrared spectrometer and the second near-infrared spectrometer are parallel in a horizontal direction and start acquisition at the same time; the horizontal distance between the first position and the second position is within a preset distance range; A feature module, used for obtaining a first feature vector corresponding to the first soil spectrum data and a second feature vector corresponding to the second soil spectrum data through an artificial neural network model based on the first soil spectrum data and the second soil spectrum data; A target module, configured to obtain a target feature vector by calculating an average value of the first feature vector and the second feature vector; A detection module is used to obtain soil nutrient detection results at the first position and the second position based on the target feature vector through a trained target neural network model; the soil nutrient detection results include the total nitrogen content and organic matter content of the soil; the target neural network model is trained based on multiple historical soil spectral data samples.
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 nutrient detection method based on vehicle-mounted dual-channel soil spectroscopy as described in any one of claims 1 to 6 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 nutrient detection method based on vehicle-mounted dual-channel soil spectroscopy as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the soil nutrient detection method based on vehicle-mounted dual-channel soil spectroscopy as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Automatic vehicle-mounted soil nutrient detection and sampling device based on near infrared spectrum technology
CN104483285A
Devices and methods for in situ soil analysis
CN112189132A
Intelligent plough with soil detection function
CN116660197A
Crop element deficiency identification method and identification system
CN118067654A
Soil organic matter detection system and method
CN118329829A
Cited By
Soil component detection method and system based on spectral analysis
CN120761303A
Vehicle-mounted soil nutrient detection system and method based on comparative learning
CN120908134A