An in-situ soil nitrogen profile detection device, method and system
The in-situ soil nitrogen detection device, which combines multi-wavelength LED chips and deep learning models, solves the problems of poor detection timeliness and low accuracy in existing technologies. It realizes stratified in-situ online detection and high-precision correction of soil nitrogen content, thereby improving the accuracy of detection.
Patent Information
- Application Number
- CN202611616610.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-19
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies for soil nitrogen detection suffer from problems such as poor timeliness, difficulty in covering the characteristic absorption bands of different target substances, inability to subtract interference from soil background spectra, and difficulty in simultaneously acquiring information on soluble organic carbon in pore water, which limits the accuracy of detection.
By employing multi-wavelength LED chips, dual detectors, and fluorescence detectors combined with a deep learning model, the system emits light beams with different center wavelengths at different times to collect leachate from different soil depths in real time. It simultaneously measures and corrects soluble organic carbon and uses the deep learning model to extract spectral features for nitrogen content prediction.
It enables stratified in-situ online detection of nitrogen content in soil profiles, improving detection accuracy, reducing detection errors, and simultaneously correcting soil background spectrum and baseline drift interference, thereby enhancing the accuracy of nitrogen detection.
Smart Images

Figure CN123111963A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of soil nitrogen detection technology, and in particular to an in-situ soil nitrogen profile detection device, method and system. Background Technology
[0002] Nitrogen in soil exists mainly in the form of organic nitrogen and mineral nitrogen. Among them, mineral nitrogen (nitrate nitrogen and ammonium nitrogen) can be directly absorbed and utilized by crops and is a key nutrient required for crop growth. The distribution of nitrate nitrogen and ammonium nitrogen in the soil profile varies with depth, and accurate detection of their content is of great significance for scientific fertilization, increasing crop yield, and reducing nitrogen loss from farmland.
[0003] Existing technologies typically employ a method of first sampling in the field and then analyzing in the laboratory. However, this requires manual soil collection, transportation, and pretreatment, which results in poor timeliness and makes it difficult to reflect the real-time dynamic changes in nitrogen content at different depths of the soil profile.
[0004] Existing technologies mostly use light sources with a single wavelength or a few wavelengths for optical detection, which makes it difficult to cover the characteristic absorption bands of different target substances such as nitrate nitrogen and ammonium nitrogen. At the same time, a single wavelength light source cannot provide enough correction wavelengths, making it difficult to subtract interferences such as soil background spectrum and baseline drift.
[0005] Existing technologies rely solely on absorption spectroscopy for nitrogen detection, making it difficult to simultaneously acquire information on interfering substances such as soluble organic carbon in pore water. Consequently, the nitrogen detection results cannot be corrected, limiting the detection accuracy. Summary of the Invention
[0006] Based on this, the purpose of the present invention is to provide an in-situ soil nitrogen profile detection device, method and system to solve the problems mentioned in the background art.
[0007] To achieve the above objectives, the first aspect of the present invention provides an in-situ soil nitrogen profile detection device, comprising: Optical flow cell; Several sampling tubes are distributed at different depths in the soil, and each sampling tube is connected to the inlet of the optical flow cell through a corresponding first solenoid valve; A moisture sensor installed in the soil, with each depth corresponding to a sampling tube. The leaching solution collection bottle has its inlet and vacuum outlet connected to the outlet of the optical flow cell and the inlet of the vacuum pump, respectively. An LED chip, a dual detector, and a fluorescence detector are disposed on different sides of an optical flow cell. The emission port of the LED chip and the detection ports of the dual detector and the fluorescence detector face the window of the optical flow cell. The LED chip and the dual detector are arranged on opposite sides of the optical flow cell. The LED chip includes multiple micro LEDs for time-division emitting emission beams with different center wavelengths. A narrow-band filter is provided between the detection port of the fluorescence detector and the window of the optical flow cell.
[0008] As a further embodiment of the present invention, the exhaust end and the sample outlet end of the leachate collection bottle are respectively connected to the inlet of the second solenoid valve and the inlet of the third solenoid valve, and a liquid level sensor is provided inside the leachate collection bottle.
[0009] As a further aspect of the present invention, it also includes a control processor, the input of which is connected to the output of the liquid level sensor and the moisture sensor, the output of which is connected to the control terminals of the first solenoid valve, the second solenoid valve and the third solenoid valve via a multi-channel relay, and the output of which is also connected to the control terminals of the vacuum pump and the LED chip; the control processor is also communicatively connected to the fluorescence detector and the dual detector.
[0010] As a further embodiment of the present invention, the inlet of the vacuum pump is connected to the vacuuming end of the eluent collection bottle through a one-way valve, and the one-way valve allows fluid to pass in the direction from the vacuuming end to the inlet of the vacuum pump.
[0011] As a further embodiment of the present invention, a collimating lens is provided between the emission port of the LED chip and the window of the optical flow cell, and a focusing lens is provided between the detection port of the dual detector and the window of the optical flow cell.
[0012] As a further embodiment of the present invention, the emitted beam includes a measurement beam with center wavelengths of 230 nm and 2200 nm, a fluorescence beam with a center wavelength of 350 nm, and a correction beam, and the narrowband filter is a 451 nm narrowband filter.
[0013] As a further embodiment of the present invention, the sampling tube is covered with a hydrophilic polyvinylidene fluoride membrane.
[0014] A second aspect of this invention provides an in-situ soil nitrogen profile detection method, which involves performing the following steps when the soil moisture content at the depth to be measured reaches a preset moisture content threshold: S1, in the absence of leached water in the optical flow cell, the transmission reference spectrum and fluorescence reference spectrum are obtained by a dual detector and a fluorescence detector, respectively; S2 allows leached water from the soil at the depth to be measured to enter the optical flow cell, and the original transmission spectrum and original fluorescence spectrum are obtained by a dual detector and a fluorescence detector, respectively. S3, based on the Lambert-Beer law, corrects the original spectrum using a reference spectrum to obtain the transmission measurement spectrum and the fluorescence measurement spectrum; S4. Input the normalized data of transmission and fluorescence spectra into the nitrogen detection model to obtain the predicted value of soil nitrogen content.
[0015] As a further aspect of the present invention, the nitrogen detection model is a deep learning model and includes: The multi-scale feature extraction unit extracts large-scale and fine-scale features from the measurement spectrum through broad-peak branching and narrow-peak branching, and then performs channel stitching of the large-scale and fine-scale features to obtain fused measurement features. The ECA channel attention unit, which is connected to the multi-scale feature extraction unit, is used to perform channel adaptive weight calibration on the fused measurement features to obtain weighted measurement features. The Transformer modeling unit, connected to the channel attention unit, is used to perform global feature interaction on the weighted measurement features to obtain globally associated measurement features. The prediction regression head unit, which is connected to the Transformer modeling unit, is used to perform regression calculations on globally associated measurement features to obtain predicted values for nitrogen content.
[0016] A third aspect of this invention provides an in-situ soil nitrogen profile detection system, comprising: The spectral acquisition module is used to acquire reference and raw spectra when the water content at the soil depth to be measured reaches a preset water content threshold. The spectral correction module is used to correct the original spectrum using a reference spectrum to obtain the transmission measurement spectrum and the fluorescence measurement spectrum. The prediction module is used to obtain predicted values of soil nitrogen content based on normalized data from transmission and fluorescence measurements.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention uses several sampling tubes distributed at different depths in the soil to collect leachate at different depths in real time, and collects spectral data through dual detectors and a fluorescence detector, enabling in-situ online detection of nitrogen content at different depths in the soil profile.
[0018] 2. This invention uses an LED chip that includes multiple micro LEDs to emit outgoing light beams with different center wavelengths in a time-division manner. The wavelengths cover the characteristic absorption bands of target substances such as nitrate nitrogen and ammonium nitrogen, and can provide multiple correction wavelengths to subtract soil background spectrum and baseline drift interference.
[0019] 3. This invention uses a fluorescence detector to simultaneously measure and correct interfering substances such as soluble organic carbon, further improving the accuracy of nitrogen detection.
[0020] 4. The nitrogen detection model of the present invention, through a multi-scale feature extraction unit, an ECA channel attention unit, a Transformer modeling unit, and a prediction regression head unit, can fully extract local features and global dependencies in the spectrum, strengthen effective feature channels that are strongly correlated with nitrogen content, suppress interference from noise and irrelevant feature channels, effectively reduce detection errors, and improve nitrogen detection accuracy.
[0021] 5. The original spectrum is corrected by using a reference spectrum to obtain the transmission measurement spectrum and fluorescence measurement spectrum, which effectively reduces detection error and improves detection accuracy. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of an in-situ soil nitrogen profile detection device. Figure 2 This is a schematic diagram of the LED chip structure; Figure 3 This is a flowchart illustrating an in-situ soil nitrogen profile detection method. Figure 4 This is a diagram of the architecture of the nitrogen detection model.
[0023] Reference numerals: 1-Optical flow cell, 2-Sampling tube, 3-First solenoid valve, 4-Moisture sensor, 5-Leachate collection bottle, 6-Vacuum pump, 7-LED chip, 71-Miniature LED, 8-Dual detector, 9-Fluorescence detector, 10-Narrow band filter, 11-Second solenoid valve, 12-Third solenoid valve, 13-Level sensor, 14-Control processor, 15-One-way valve, 16-Collimating lens, 17-Focusing lens, 18-Multi-channel relay, 19-One-to-three connector, 20-Housing shell. Detailed Implementation
[0024] To facilitate understanding of the present invention, a more comprehensive description will be given below with reference to specific embodiments. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of the present invention.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0026] Example 1 like Figure 1 As shown in the figure, this embodiment proposes an in-situ soil nitrogen profile detection device, including an optical flow cell 1, a sampling tube 2, a moisture sensor 4, a leachate collection bottle 5, an LED chip 7, a dual detector 8, and a fluorescence detector 9.
[0027] Specifically, the optical flow cell 1 is made of quartz, has a U-shaped structure, an optical path of 10mm, a window size of 4×10mm, an external size of 12.5×12.5×45mm, and is suitable for wavelengths of 200nm~2500nm.
[0028] There are at least three sampling tubes 2, and multiple sampling tubes 2 are distributed at different depths in the soil. Each sampling tube 2 is connected to the inlet end of the optical flow cell 1 through a corresponding first solenoid valve 3.
[0029] Specifically, there are three sampling tubes 2. The three sampling tubes 2 are connected to the inlet of the first solenoid valve 3 through pipes. The outlet of the first solenoid valve 3 is connected to the sample inlet of the optical flow cell 1 through pipes and a three-way connector 19. The three sampling tubes 2 are buried in the soil at depths of 60cm, 90cm and 120cm, respectively.
[0030] Preferably, sampling tube 2 is made of sintered alumina material. Sampling tube 2 has an outer diameter of 21 mm, a wall thickness of 6 mm, and a length of 40 mm.
[0031] The sampling tube 2 is covered with a hydrophilic polyvinylidene fluoride (PVDF) membrane with a thickness of 0.5 μm and a pore size of 0.45 μm. This hydrophilic PVDF membrane can prevent soil particles from adsorbing onto the sampling tube 2. When the leachate enters through the opening of the sampling tube 2, the hydrophilic PVDF membrane can also filter the leachate, preventing large-sized substances from entering the sampling tube 2. The sampling tube 2 is connected to the inlet of the first solenoid valve 3 through a silicone tube.
[0032] Moisture sensor 4 is installed in the soil, and a corresponding moisture sensor 4 is installed at the depth of each sampling tube 2 to measure the moisture content of the soil at the sampling tube 2.
[0033] The top cap of the leachate collection bottle 5 has three connectors: a sample inlet, a vacuum outlet, and a vent outlet. The bottom of the leachate collection bottle 5 has a sample outlet. The tubing connection of the leachate collection bottle 5 is as follows: (1) The inlet end of the leachate collection bottle 5 is connected to the outlet end of the optical flow cell 1 through a pipe so that the leachate in the optical flow cell 1 can enter the leachate collection bottle 5.
[0034] (2) The vacuum end of the rinsing solution collection bottle 5 is connected to the inlet of the vacuum pump 6 through the one-way valve 15, and the one-way valve 15 allows the fluid to pass in the direction from the vacuum end to the inlet of the vacuum pump 6.
[0035] When the vacuum pump 6 is working, it evacuates the leaching solution collection bottle 5, allowing the leaching solution in the optical flow cell 1 to enter the leaching solution collection bottle 5. The one-way valve 15 prevents outside air from entering the leaching solution collection bottle 5 when the vacuum pump 6 is not working.
[0036] (3) The exhaust end of the leachate collection bottle 5 is connected to the inlet of the second solenoid valve 11 through a pipe, and the sample outlet end of the leachate collection bottle 5 is connected to the inlet of the third solenoid valve 12 through a pipe. A liquid level sensor 13 is installed inside the leachate collection bottle 5.
[0037] When the liquid in the leachate collection bottle 5 reaches the set liquid level, the second solenoid valve 11 opens to allow air to pass through, so that the air pressure in the leachate collection bottle 5 is consistent with the external air pressure. Then the third solenoid valve 12 opens, allowing the leachate to be discharged from the outlet of the third solenoid valve 12.
[0038] LED chip 7, dual detector 8 and fluorescence detector 9 are arranged on different sides of optical flow cell 1, and the emission port of LED chip 7 and the detection ports of dual detector 8 and fluorescence detector 9 are directly opposite the window of optical flow cell 1.
[0039] The LED chip 7 and the dual detectors 8 are arranged on opposite sides of the optical flow cell 1. A collimating lens 16 is provided between the outlet of the LED chip 7 and the window of the optical flow cell 1, and a focusing lens 17 is provided between the detection port of the dual detectors 8 and the window of the optical flow cell 1.
[0040] The emitted light beam from LED chip 7 enters optical flow cell 1 through collimating lens 16, and after passing through optical flow cell 1, it enters dual detector 8 through focusing lens 17, thereby obtaining the transmission spectrum.
[0041] A narrow-band filter 10 is provided between the detection port of the fluorescence detector 9 and the window of the optical flow cell 1. The emitted light beam from the LED chip 7 enters the optical flow cell 1 through the collimating lens 16. After passing through the optical flow cell 1, it passes through the narrow-band filter 10 to filter stray light before entering the fluorescence detector 9, thereby obtaining the fluorescence spectrum.
[0042] like Figure 2 As shown, the LED chip 7 includes multiple micro LEDs 71 for time-division emitting beams with different center wavelengths.
[0043] In this embodiment, nitrogen detection refers to the detection of nitrate nitrogen and ammonium nitrogen in the soil.
[0044] For nitrate nitrogen detection, the beam with a center wavelength of 230 nm is its absorption beam, therefore the emitted beam includes the measurement beam with a center wavelength of 230 nm.
[0045] For ammonium nitrogen detection, the beam with a center wavelength of 2200nm is its absorption beam, therefore the emitted beam includes the measurement beam with a center wavelength of 2200nm.
[0046] The fluorescence detector 9 is used to detect soluble organic carbon in the leaching solution. When detecting soluble organic carbon, the soluble organic carbon generates fluorescence with a center wavelength of 451 nm under the excitation of a light beam with a center wavelength of 350 nm. Therefore, the emitted light beam includes a fluorescence beam with a center wavelength of 350 nm. The narrowband filter 10 is a 451 nm narrowband filter used to filter out other fluorescence and stray light with a center wavelength other than 451 nm.
[0047] It is also necessary to set an outgoing beam with a different center wavelength as a correction beam.
[0048] Specifically, in this embodiment, the LED chip 7 includes 30 micro LEDs 71, and the center wavelengths of the emitted light beams from each micro LED 71 are as follows: 235nm, 255nm, 275nm, 350nm, 400nm, 455nm, 520nm, 560nm, 610nm, 630nm, 667nm, 700nm, 804nm, 850nm, 890nm, 930nm, 973nm, 1000nm, 1217nm, 1300nm, 1470nm, 1545nm, 1635nm, 1800nm, 1900nm, 2000nm, 2100nm, 2200nm, 2300nm, and 2400nm.
[0049] The center wavelength of the emitted beam from LED chip 7 covers the range of 235nm to 2400nm, which is consistent with the wavelength range of optical flow cell 1 (200nm to 2500nm).
[0050] The LED chip 7 operates in a time-division multiplexing mode. During each detection process, each micro LED 71 emits light sequentially from low wavelength to high wavelength, and emits only one center wavelength beam at a time.
[0051] Preferably, the dual detector 8 includes a silicon detector and an indium gallium arsenide detector, and the fluorescence detector 9 is a silicon detector.
[0052] It also includes a control processor 14, whose input terminal is connected to the output terminal of the liquid level sensor 13 and the moisture sensor 4. The output terminal of the control processor 14 is connected to the control terminal of the first solenoid valve 3, the second solenoid valve 11 and the third solenoid valve 12 through the multi-channel relay 18. The output terminal of the control processor 14 is also connected to the control terminal of the vacuum pump 6 and the LED chip 7. The control processor 14 is also communicatively connected to the fluorescence detector 9 and the dual detector 8.
[0053] Specifically, apart from the sampling tube 2, the moisture sensor 4, the head of the outlet pipe of the third solenoid valve 12, the head of the outlet pipe of the second solenoid valve 11, and the head of the outlet pipe of the vacuum pump 6, other components in the in-situ soil nitrogen profile detection are protected inside the outer casing 20.
[0054] Example 2 like Figure 3 As shown, this embodiment proposes an in-situ soil nitrogen profile detection method. First, the moisture content of the soil at the depth to be measured is determined by the moisture sensor 4. When the three sampling tubes 2 are buried in the soil at depths of 60cm, 90cm and 120cm respectively, the moisture content at depths of 60cm, 90cm and 120cm is obtained respectively, and compared with the preset moisture content threshold, which is 75%.
[0055] Taking nitrogen detection at a depth of 60cm as an example, when the moisture content detected by moisture sensor 4 at a depth of 60cm is ≥75%, the following steps are performed to detect nitrogen in the soil at a depth of 60cm: S1, in the absence of leached water in the optical flow cell 1, the transmission reference spectrum and fluorescence reference spectrum are obtained by the dual detector 8 and the fluorescence detector 9, respectively.
[0056] like Figure 1 As shown, when the soil moisture content detected by the moisture sensor 4 at 60cm reaches or exceeds 75%, the transmission reference spectrum and fluorescence reference spectrum are obtained according to the following procedure.
[0057] (1) When each of the first solenoid valves 3 is closed, the control processor 14 controls the vacuum pump 6 to turn on, and the leaching solution collection bottle 5 is evacuated. Under the negative pressure, the residual leaching solution in the optical flow cell 1 enters the leaching solution collection bottle 5. After two minutes, the vacuum pump 6 is turned off, thereby emptying the leaching solution in the optical flow cell 1.
[0058] To ensure smooth extraction of leachate from the optical flow cell 1 into the leachate collection bottle 5, an interlock relationship can be established between the vacuum pump 6 and the second solenoid valve 11 and the third solenoid valve 12. That is, when the vacuum pump 6 is on, the second solenoid valve 11 and the third solenoid valve 12 cannot open. After the vacuum pump 6 is turned off, if the liquid level sensor 13 in the leachate collection bottle 5 detects that the liquid level in the bottle has reached the set level, the second solenoid valve 11 opens to allow ventilation, ensuring that the air pressure inside the leachate collection bottle 5 matches the external air pressure. Then, the third solenoid valve 12 opens, allowing the leachate to be discharged from its outlet.
[0059] (2) The control processor 14 controls the LED chip 7 to work and emit the emitted beams in order of wavelength from low to high. The dual detectors 8 and the fluorescence detector 9 respectively acquire the transmission reference spectrum and fluorescence reference spectrum of the optical flow cell 1 in the empty state.
[0060] S2 allows leached water from a depth of 60cm in the soil to enter the optical flow cell 1, where the original transmission spectrum and the original fluorescence spectrum are obtained by dual detectors 8 and fluorescence detector 9, respectively.
[0061] Open the first solenoid valve 3 corresponding to the sampling tube 2 at a depth of 60cm, keep the other first solenoid valves 3 closed, and keep the second solenoid valve 11 and the third solenoid valve 12 closed as well. Turn on the vacuum pump 6 for three minutes.
[0062] When vacuum pump 6 is turned off, first solenoid valve 3 is also turned off. Then, after a two-minute delay, the solution in optical flow cell 1 is stabilized. The original transmission spectrum and original fluorescence spectrum are obtained by dual detector 8 and fluorescence detector 9, respectively.
[0063] S3, based on the Lambert-Beer law, corrects the original spectrum using a reference spectrum to obtain the transmission measurement spectrum and the fluorescence measurement spectrum.
[0064] S4. Input the normalized data of transmission and fluorescence spectra into the nitrogen detection model to obtain the predicted value of soil nitrogen content at a depth of 60cm.
[0065] The nitrogen content in soil at depths of 90cm, 120cm, or any other depth can also be tested using the method described above.
[0066] Specifically, the nitrogen detection model in this embodiment can be trained according to different soil types to train different nitrogen detection models. For example, a nitrogen detection model for black soil, a nitrogen detection model for alluvial soil, and a nitrogen detection model for brown soil can be trained to call different detection models according to different soil types, thereby improving accuracy.
[0067] like Figure 4As shown, the nitrogen detection model is a deep learning model and includes: The multi-scale feature extraction unit extracts large-scale and fine-scale features from the measurement spectrum through broad-peak branching and narrow-peak branching, respectively, and then performs channel stitching of the large-scale and fine-scale features to obtain fused measurement features.
[0068] Broad peak branching is used to capture large-scale features in the spectrum, such as broad peaks and baseline drift, which correspond to the broad-band absorption characteristics of nitrogen molecules; narrow peak branching is used to focus fine features in the spectrum, such as narrow peaks and sharp peaks, which correspond to the detailed information of nitrogen characteristic absorption peaks.
[0069] The ECA channel attention unit, connected to the multi-scale feature extraction unit, is used to perform channel adaptive weight calibration on the fused measurement features to obtain weighted measurement features.
[0070] The ECA channel attention unit performs deep feature mining on the fused measurement features. Combined with pooling and dropout layers, it suppresses model overfitting. Through an efficient channel attention mechanism, it adaptively calibrates the feature channels of the fused measurement features, strengthens the effective feature channels that are strongly correlated with nitrogen content, and suppresses the interference of noise and irrelevant feature channels.
[0071] The Transformer modeling unit, connected to the channel attention unit, is used to perform global feature interaction on the weighted measurement features to obtain globally associated measurement features.
[0072] The Transformer modeling unit achieves global feature interaction across the entire wavelength dimension through a multi-head self-attention mechanism, enabling each wavelength point to reference full-spectrum information. This allows for a more accurate distinction between nitrogen feature absorption peaks and baseline drift, interference, etc. The Transformer modeling unit also enhances model stability through residual connections and layer normalization, avoiding gradient vanishing and distribution shift problems during deep network training.
[0073] The prediction regression head unit, which is connected to the Transformer modeling unit, is used to perform regression calculations on globally associated measurement features to obtain predicted values for nitrogen content.
[0074] The prediction regression head unit maps globally correlated measurement features into predicted values of nitrate nitrogen content and ammonium nitrogen content through global average pooling and a multi-layer fully connected structure.
[0075] Figure 4 middle: Conv1D(16,9,ReLU) is a one-dimensional convolutional layer with a kernel size of 9, 16 kernels, and ReLU activation function; Conv1D(16,5,ReLU) is a one-dimensional convolutional layer with a kernel size of 5, 16 kernels, and ReLU activation function; Conv1D(16,3,ReLU) is a one-dimensional convolutional layer with a kernel size of 3, 16 kernels, and ReLU activation function; Conv(16,1,ReLU) is a convolutional layer with a kernel size of 1, 16 kernels, and ReLU activation function; Conv(8,1,ReLU) is a convolutional layer with a kernel size of 1, 8 kernels, and ReLU activation function; Conv(8,1) is a convolutional layer with a kernel size of 1 and 8 kernels.
[0076] Dense(16,ReLU) is a fully connected layer with 16 neurons and the activation function ReLU; Dense(8,ReLU) is a fully connected layer with 8 neurons and the activation function ReLU; Dense(1,Linear) is a fully connected layer with 1 neuron and the activation function Linear.
[0077] BatchNormalization is a batch normalization layer; BatchNorm is a normalization layer.
[0078] MaxPooling1D(2) is the max pooling layer with a pooling window of 2.
[0079] Dropout(0.1) is a Dropout layer with a dropout rate of 0.1; Dropout(0.2) is a Dropout layer with a dropout rate of 0.2; Dropout(0.3) is a Dropout layer with a dropout rate of 0.3.
[0080] (Heads=4,KeyDim=16) indicates that the number of heads in the multi-head self-attention is 4 and the key dimension is 16.
[0081] Example 3 This embodiment proposes an in-situ soil nitrogen profile detection system, including: The spectral acquisition module is used to acquire reference and raw spectra when the water content at the soil depth to be measured reaches a preset water content threshold.
[0082] Specifically, when there is no leaching water in the optical flow cell 1, the spectral acquisition module acquires the transmission reference spectrum and the fluorescence reference spectrum through the dual detector 8 and the fluorescence detector 9, respectively. After the leaching water at the depth to be measured in the soil enters the optical flow cell 1, the dual detector 8 and the fluorescence detector 9 acquire the original transmission spectrum and the original fluorescence spectrum, respectively.
[0083] The spectral correction module is used to correct the original spectrum using a reference spectrum to obtain the transmission measurement spectrum and the fluorescence measurement spectrum.
[0084] Specifically, the spectral correction module is based on the Lambert-Beer law. It corrects the original transmission spectrum using a transmission reference spectrum to obtain the transmission measurement spectrum, and corrects the original fluorescence spectrum using a fluorescence reference spectrum to obtain the fluorescence measurement spectrum.
[0085] The prediction module is used to obtain predicted values of soil nitrogen content based on normalized data from transmission and fluorescence measurements.
[0086] Specifically, the prediction module normalizes the transmission and fluorescence spectra and inputs them into the nitrogen detection model to obtain the predicted value of soil nitrogen content.
[0087] Verification Experiment To verify the accuracy of the in-situ soil nitrogen profile detection device, detection method, and nitrogen detection deep learning model of the present invention in detecting nitrate nitrogen and ammonium nitrogen in soil leachate, a series of sample testing experiments were carried out.
[0088] The experiment used the in-situ soil nitrogen profile detection device of Example 1 of this invention, and the in-situ soil nitrogen profile detection method of Example 2 to detect nitrate nitrogen and ammonia nitrogen. The process includes the following steps: 1. Preparation of experimental samples Twelve sets of original soil leachate samples were collected from different soil types, resulting in significant differences in the concentrations of ammonium and nitrate nitrogen. Deionized water was added to perform gradient dilutions of the original samples to broaden the concentration coverage range and encompass the common concentration range of actual field soil profile leachates. A total of 33 test leachate samples with different concentration gradients were obtained in this experiment. The sample numbers and corresponding nitrate and ammonia nitrogen concentrations are shown in Table 1. Table 1
[0089] In Table 1, the units for nitrate nitrogen and ammonia nitrogen concentrations are ug / ml.
[0090] 2. Model Analysis The 33 leaching water samples were divided into a modeling set and a test set at a ratio of 26:7 (approximately 8:2). The traditional PLS model based on least squares and the nitrogen detection model based on deep learning, as described in this invention, were compared. The comparison results are shown in Table 2. Table 2
[0091] As shown in Table 2, the deep learning model achieves a significant performance improvement over the traditional optimal PLS model, especially in total nitrogen detection. For nitrate nitrogen detection, the model's Rp2 increased by 0.01, RMSEP decreased by 21.63%, and RPD increased by 24.19%; for ammonium nitrogen detection, the model's Rp2 increased by 0.11, RMSEP decreased by 17.39%, and RPD increased by 21.10%.
[0092] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0093] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. An in-situ soil nitrogen profile detection device, characterized by, include: Optical flow cell; Several sampling tubes are distributed at different depths in the soil, and each sampling tube is connected to the inlet of the optical flow cell through a corresponding first solenoid valve; A moisture sensor installed in the soil, with each depth corresponding to a sampling tube. The leaching solution collection bottle has its inlet and vacuum outlet connected to the outlet of the optical flow cell and the inlet of the vacuum pump, respectively. An LED chip, a dual detector, and a fluorescence detector are disposed on different sides of an optical flow cell. The emission port of the LED chip and the detection ports of the dual detector and the fluorescence detector face the window of the optical flow cell. The LED chip and the dual detector are arranged on opposite sides of the optical flow cell. The LED chip includes multiple micro LEDs for time-division emitting emission beams with different center wavelengths. A narrow-band filter is provided between the detection port of the fluorescence detector and the window of the optical flow cell.
2. The in-situ soil nitrogen profile detection device according to claim 1, wherein, The exhaust end and sample outlet end of the leachate collection bottle are connected to the inlet of the second solenoid valve and the inlet of the third solenoid valve, respectively, and a liquid level sensor is installed inside the leachate collection bottle.
3. The in-situ soil nitrogen profile detection device of claim 2, wherein, It also includes a control processor, whose input is connected to the output of the liquid level sensor and the moisture sensor, and whose output is connected to the control of the first solenoid valve, the second solenoid valve and the third solenoid valve via a multi-channel relay. The output of the control processor is also connected to the control of the vacuum pump and the LED chip. The control processor is also connected to the fluorescence detector and the dual detector.
4. The in-situ soil nitrogen profile detection device of claim 1, wherein, The inlet of the vacuum pump is connected to the vacuum end of the eluent collection bottle through a one-way valve. The one-way valve allows fluid to pass in the direction from the vacuum end to the inlet of the vacuum pump.
5. The in-situ soil nitrogen profile detection device of claim 1, wherein, A collimating lens is provided between the emission port of the LED chip and the window of the optical flow cell, and a focusing lens is provided between the detection port of the dual detector and the window of the optical flow cell.
6. The in-situ soil nitrogen profile detection device of claim 1, wherein, The emitted beam includes a measurement beam with center wavelengths of 230nm and 2200nm, a fluorescence beam with a center wavelength of 350nm, and a correction beam. The narrowband filter is a 451nm narrowband filter.
7. The in-situ soil nitrogen profile detection device of claim 1, wherein, The sampling tube is covered with a hydrophilic polyvinylidene fluoride membrane.
8. A method for in-situ soil nitrogen profile detection, which is executed based on the in-situ soil nitrogen profile detection device according to any one of claims 1-7, characterized in that, When the soil moisture content at the depth to be tested reaches the preset moisture content threshold, the following steps are performed: S1, in the absence of leached water in the optical flow cell, the transmission reference spectrum and fluorescence reference spectrum are obtained by the dual detector and the fluorescence detector, respectively. S2 allows leached water from the soil at the depth to be measured to enter the optical flow cell, and the original transmission spectrum and original fluorescence spectrum are obtained by a dual detector and a fluorescence detector, respectively. S3, based on the Lambert-Beer law, corrects the original spectrum using a reference spectrum to obtain the transmission measurement spectrum and the fluorescence measurement spectrum; S4. Input the normalized data of transmission and fluorescence spectra into the nitrogen detection model to obtain the predicted value of soil nitrogen content.
9. The method of claim 8, wherein the method is in-situ soil nitrogen profile detection. The nitrogen detection model is a deep learning model and includes: The multi-scale feature extraction unit extracts large-scale and fine-scale features from the measurement spectrum through broad-peak branching and narrow-peak branching, and then performs channel stitching of the large-scale and fine-scale features to obtain fused measurement features. The ECA channel attention unit, which is connected to the multi-scale feature extraction unit, is used to perform channel adaptive weight calibration on the fused measurement features to obtain weighted measurement features. The Transformer modeling unit, connected to the channel attention unit, is used to perform global feature interaction on the weighted measurement features to obtain globally associated measurement features. The prediction regression head unit, which is connected to the Transformer modeling unit, is used to perform regression calculations on globally associated measurement features to obtain predicted values for nitrogen content.
10. An in-situ soil nitrogen profile detection system, used to implement the in-situ soil nitrogen profile detection method according to claim 8, characterized in that, include: The spectral acquisition module is used to acquire reference and raw spectra when the water content at the soil depth to be measured reaches a preset water content threshold. The spectral correction module is used to correct the original spectrum using a reference spectrum to obtain the transmission measurement spectrum and the fluorescence measurement spectrum. The prediction module is used to obtain predicted values of soil nitrogen content based on normalized data from transmission and fluorescence measurements.
