Near-infrared spectrometer-based forest land soil heavy metal residue in-situ detection system

The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectrometer integrates near-infrared spectral acquisition, data processing, and deep learning prediction modules. It solves the problems of time-consuming, labor-intensive, and difficult-to-screen large-area problems of traditional detection methods, and realizes rapid and accurate in-situ detection of heavy metals in soil, providing real-time early warning and data visualization support.

CN120927607AInactive Publication Date: 2025-11-11RES INST OF SUBTROPICAL FORESTRY CHINESE ACAD OF FORESTRY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511034720.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-11-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

传统林地土壤重金属检测方法需要在实验室进行,耗时费力,难以满足现场快速检测需求,且难以实现大面积林地的快速筛查,存在二次污染风险,限制了其在环境监测和应急响应中的应用。

Method used

An in-situ detection system for heavy metal residues in forest soil based on a near-infrared spectrometer is adopted. It integrates a near-infrared spectral acquisition module, a data processing and transmission module, a deep learning prediction module, and an early warning module to achieve in-situ, rapid, and accurate detection. The system acquires spectral data in the wavelength range of 780-2526nm using a near-infrared spectrometer, and provides real-time early warning by combining an adaptive weighted smoothing algorithm, polynomial fitting baseline correction, and deep learning prediction.

Benefits of technology

It enables in-situ, rapid, and accurate detection of heavy metal residues in forest soil, improving detection efficiency and accuracy, providing technical support for environmental protection, timely detection and response to soil heavy metal pollution problems, and safeguarding ecological security and human health.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120927607A_ABST
    Figure CN120927607A_ABST
Patent Text Reader

Abstract

The invention discloses a forest land soil heavy metal residue in-situ detection system based on a near infrared spectrometer, and relates to the field of soil detection, the system comprises the following components: a near infrared spectrum acquisition module, a data processing and transmission module, a deep learning prediction module, an early warning module and a power supply module; through the integrated deep learning prediction module, on the basis of a cloud server or remote terminal equipment, preprocessed spectral data can be efficiently processed, the soil heavy metal content is accurately predicted, the early warning module compares a prediction result with a preset heavy metal element content threshold value, and once it is found that the content exceeds the standard, the early warning module gives an alarm. Early warning information is immediately sent out in a sound-light alarm, short message notification or APP push mode, different early warning levels are set according to the standard exceeding degree, and powerful support is provided for relevant personnel to take countermeasures in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of soil testing, specifically to an in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy. Background Technology

[0002] With the acceleration of industrialization and urbanization, heavy metal pollution in forest soil has become increasingly prominent, posing a serious threat to the ecological environment and human health. Heavy metal elements such as lead, mercury, and cadmium, due to their difficulty in degradation and bioaccumulation, will persist in the soil environment for a long time and cause lasting damage to the ecosystem once they enter it. Therefore, the rapid and accurate detection of heavy metal residues in forest soil has become an important task in the fields of environmental protection and soil remediation.

[0003] Traditional methods for detecting heavy metals in forest soil mainly include chemical analysis, atomic absorption spectrometry, and inductively coupled plasma mass spectrometry. While these methods have high accuracy and sensitivity, they also have significant limitations. First, these methods typically require laboratory settings and involve complex sample pretreatment processes, which are time-consuming and labor-intensive, making them unsuitable for rapid on-site detection. Second, chemical analysis methods consume large amounts of chemical reagents, resulting in high costs and potential secondary pollution. Furthermore, traditional methods often struggle to rapidly screen large areas of forest, limiting their application in environmental monitoring and emergency response.

[0004] In view of the shortcomings of traditional methods for detecting heavy metals in forest soil, it is particularly important to develop an in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide an in-situ detection system for heavy metal residues in forest soil based on near-infrared spectrometer. By integrating a near-infrared spectroscopy acquisition module, a data processing and transmission module, a deep learning prediction module, and an early warning module, it can achieve in-situ, rapid, and accurate detection of heavy metal residues in forest soil. This overcomes the limitations of traditional methods, improves detection efficiency and accuracy, and provides strong technical support for environmental protection departments. It also helps to promptly detect and respond to soil heavy metal pollution problems, ensuring ecological security and human health.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: an in-situ detection system for heavy metal residues in forest soil based on a near-infrared spectrometer, the system comprising the following components: a near-infrared spectroscopy acquisition module, a data processing and transmission module, a deep learning prediction module, an early warning module, and a power supply module;

[0007] The near-infrared spectral acquisition module includes a near-infrared spectrometer and a sampling probe, used to acquire near-infrared spectral data of forest soil;

[0008] The data processing and transmission module includes a microprocessor and a wireless communication module, used for preprocessing and transmitting spectral data;

[0009] The deep learning prediction module is built on a cloud server or remote terminal device and is used to receive preprocessed spectral data and predict the heavy metal content in the soil.

[0010] The early warning module is connected to the deep learning prediction module and is used to issue early warnings based on the prediction results.

[0011] The power module provides power to other modules.

[0012] Furthermore, the near-infrared spectrometer is capable of acquiring spectral data within a wavelength range of 780-2526 nm, with a spectral resolution of no less than 1 nm. The sampling probe is an optical fiber probe that can be directly inserted into the forest soil. The sampling probe is connected to the near-infrared spectrometer via optical fiber, transmitting the acquired soil near-infrared spectral signals to the near-infrared spectrometer for photoelectric conversion and signal amplification to obtain digitized spectral data. In practical applications, the high resolution and wide wavelength range of this near-infrared spectrometer can more comprehensively capture the spectral characteristics of the soil. The design of the optical fiber probe makes in-situ acquisition more convenient and efficient, laying the foundation for accurate subsequent detection.

[0013] Furthermore, the microprocessor performs preprocessing on the spectral data, including spectral smoothing, baseline correction, and normalization operations. The spectral smoothing employs an adaptive weighted smoothing algorithm for the spectral data sequence x = [x1, x2, ..., x...]. n The smoothed spectral data y i The calculation formula is: Where w j The adaptive weights are dynamically adjusted based on local fluctuations in the spectral data. The specific calculation method is as follows: For x i The mean of the spectral data within a local window centered at a width of 2k+1, ∈ [0, 1], is used. To avoid extremely small positive numbers with a denominator of zero, baseline correction employs a polynomial fitting baseline correction method. The baseline of the spectral data is fitted using the least squares method, and then the fitted baseline data is subtracted from the original spectral data. Normalization uses the max-min normalization method to map the spectral data to the interval [0, 1]. The formula is: These preprocessing operations can effectively eliminate noise and interference in spectral data, improve the quality of spectral data, and thus enhance the accuracy of subsequent predictions.

[0014] Furthermore, the measured data stored in the data storage unit of the deep learning prediction module is divided into samples through stratified sampling and cross-validation. Specifically, all measured data are divided into training set, validation set, and test set according to a certain ratio. During the stratified sampling process, the data is stratified according to different intervals of soil heavy metal content to ensure that each subset can represent the distribution characteristics of the overall data. During the training process, the training set is used to train the model, the validation set is used to adjust and optimize the model's hyperparameters, and finally the test set is used to evaluate the model's generalization ability. This ensures the scientific nature and reliability of the deep learning model training, enabling the model to better learn the relationship between near-infrared spectral features and soil heavy metal content.

[0015] Furthermore, the model training unit of the deep learning prediction module is trained using an improved hybrid attention network model. This model consists of a feature extraction layer, a multi-head attention mechanism layer, a long short-term memory network layer, and a fully connected layer. In the feature extraction layer, a convolutional neural network is used to extract features from the input spectral data to obtain a spectral feature vector F. In the multi-head attention mechanism layer, for the feature vector F, attention weights are calculated by multiple attention heads, and the attention weight of the h-th attention head is... The calculation formula is:

[0016]

[0017] in Let d be a learnable weight matrix. k The key vector dimension is used to concatenate the results of multiple attention heads before inputting them into an LSTM layer. The LSTM layer selectively memorizes and updates information through forget gates, input gates, and output gates. Finally, the predicted value of soil heavy metal content is output through a fully connected layer. During model training, an adaptive moment estimation optimization algorithm is used, combined with a dynamic learning rate adjustment strategy, with a learning rate η. t The adjustment formula is Where η0 is the initial learning rate, β is the adjustment parameter, and t is the number of training iterations, this improved hybrid attention network model and optimization strategy can more effectively extract key features from spectral data, enhance the model's ability to learn the complex relationship between spectral features and soil heavy metal content, and improve prediction accuracy.

[0018] Furthermore, the threshold values ​​for heavy metal content preset by the early warning module are determined based on statistical analysis of forest soil environmental quality standards and historical monitoring data. Specifically, historical monitoring data of various heavy metal elements in forest soil from different regions are collected, the data are statistically analyzed, and the mean μ and standard deviation σ of each heavy metal element content are calculated. Combined with the corresponding forest soil environmental quality standards, the mean plus a certain multiple of the standard deviation is used as the initial threshold value. Then, it is adjusted through expert evaluation and actual application testing to finally determine a reasonable threshold value for heavy metal elements. When the content of a certain heavy metal element in the prediction results exceeds the corresponding threshold, the early warning module issues an early warning message through audible and visual alarms, SMS notifications, or APP push notifications. Different early warning levels are set according to the degree of exceeding the threshold, including light pollution, moderate pollution, and heavy pollution, so that relevant personnel can more accurately understand the pollution situation and take corresponding measures.

[0019] Furthermore, the power management circuit of the power module employs maximum power point tracking (MPPT) technology and a battery health state prediction algorithm. During charging, MPPT technology is used to adjust the charging voltage and current in real time, ensuring that the solar panel always operates at its maximum power output point, thereby improving charging efficiency. The battery health state prediction algorithm is based on the battery's historical charging and discharging data and current state parameters, using a combination of a grey prediction model and support vector regression for prediction. For the battery health state parameter sequence S = [s1, s2, ..., s...], ... n First, a grey prediction model is used for preliminary prediction to obtain the predicted value. Then, the original data and the grey prediction results are used as input to the support vector regression model for secondary prediction to obtain a more accurate battery health status prediction value. Through this power management circuit, the service life of rechargeable lithium batteries can be effectively extended, ensuring that the system can operate stably in the field for a long time.

[0020] Furthermore, the wireless communication module employs adaptive modulation and coding (AMC) technology and a network congestion control mechanism. During data transmission, AMC dynamically adjusts the modulation scheme and coding rate based on the real-time quality of the wireless channel. When the channel quality is good, high-order modulation and high-speed coding rate are used to improve data transmission efficiency. When the channel quality is poor, it switches to low-order modulation and low-rate coding to ensure data transmission reliability. The network congestion control mechanism uses a congestion control algorithm based on queue length and packet loss rate. By monitoring the data transmission queue length and network packet loss rate of the wireless communication module in real time, the data transmission rate is dynamically adjusted. When the queue length exceeds the threshold or packet loss occurs, the data transmission rate is reduced to avoid network congestion. When the network condition improves, the data transmission rate is gradually increased. Through these technologies, it is possible to ensure that the preprocessed spectral data is transmitted stably and efficiently to the cloud server or remote terminal device.

[0021] Furthermore, the system also includes a data visualization module, which is connected to the deep learning prediction module. This module is used to visualize the prediction results of soil heavy metal content in the form of charts and maps. In the chart display, the changing trend of soil heavy metal content at different detection points over time and the comparison of the content of different heavy metal elements can be presented intuitively. In the map display, the geographical location of the detection point is combined with the soil heavy metal content, and different pollution levels are marked with different colors or icons. This makes it easier for relevant personnel to understand the distribution of heavy metal pollution in forest soil from both macro and micro perspectives, providing more intuitive and effective support for environmental decision-making.

[0022] Compared with existing technologies, this in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy has the following advantages:

[0023] First, the system, through its integrated deep learning prediction module, can efficiently process pre-processed spectral data based on cloud servers or remote terminal devices, accurately predicting the heavy metal content in the soil. The early warning module compares the prediction results with preset heavy metal element content thresholds. Once the content exceeds the standard, it immediately issues an early warning message through audible and visual alarms, SMS notifications, or APP push notifications. Different early warning levels are set according to the degree of exceedance, providing strong support for relevant personnel to take timely countermeasures.

[0024] Second, this system, through the design of a near-infrared spectrometer and sampling probe, enables in-situ and rapid detection of heavy metal residues in forest soil. The near-infrared spectrometer acquires spectral data in the wavelength range of 780-2526nm with a spectral resolution of no less than 1nm, ensuring the comprehensiveness and accuracy of the data. The sampling probe is an optical fiber probe that can be directly inserted into the soil, facilitating on-site operation and greatly improving detection efficiency. At the same time, the system uses a microprocessor to preprocess the spectral data, further improving data quality and laying the foundation for accurate prediction of heavy metal content in the future.

[0025] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0027] Figure 1 The flowchart shows the functional implementation of the in-situ detection system for heavy metal residues in forest soil based on near-infrared spectrometer. Detailed Implementation

[0028] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0029] Example 1

[0030] Located downwind of the industrial zone, the forest reserve has recently been found to have some abnormal tree species growth, raising suspicions that the soil may be affected by heavy metal deposition. To investigate pollution risks and protect the ecosystem, this detection system is being used to conduct quarterly in-situ monitoring.

[0031] Technicians carried near-infrared spectrometers with integrated fiber optic probes deep into the forest area. Based on vegetation distribution and terrain features, they selected 20 detection points in potentially polluted areas such as upstream streams and around abandoned mine sites. The thin fiber optic probes were vertically inserted 15-20 centimeters below the soil surface. The microlens group at the front end of the probes collected near-infrared light signals reflected by soil particles in real time. After the spectrometer was started, it quickly scanned within a wide wavelength range, capturing the characteristic spectral fingerprints of heavy metal elements in the soil like an "optical stethoscope." All light signals were transmitted through optical fibers to the spectrometer, where they were converted into digital signals by precise photoelectric conversion elements, forming the original spectral data file.

[0032] The microprocessor initiates a "data cleansing process" on the raw spectral data: First, it employs an adaptive weighted smoothing algorithm, the formula of which is: For the spectral data sequence x = [x1, x2, ..., x...] n The smoothed spectral data y i The calculation formula is: Where w j To achieve adaptive weighting, much like putting a "noise reduction filter" on the data, the weights of adjacent data points are dynamically adjusted to effectively suppress the interference of environmental noise on the spectral curve. Then, a polynomial fitting baseline correction method (least squares method) is used to eliminate the slow drift of the spectral baseline, like "smoothing out a crease in the paper," ensuring the accuracy of the data baseline. Finally, the spectral data is uniformly scaled to the [0, 1] interval through the max-min normalization method, which is like "unifying the standard of measurement" for data from different detection points, facilitating subsequent cross-regional comparative analysis.

[0033] The preprocessed spectral data is transported in real-time to the cloud server of the protected area management center via a wireless communication module's "digital express" and a 4G network. The deep learning prediction module, acting as a "soil heavy metal diagnostic expert," activates its internal hybrid attention network model. First, a convolutional neural network layer performs "feature mining" on the spectral data, extracting key band information hidden in the spectral curves. Then, a multi-head attention mechanism layer is used, with the formula: for a feature vector F, the attention weights are calculated by multiple attention heads, and the attention weight of the h-th attention head is... The calculation formula is:

[0034]

[0035] in Let d be a learnable weight matrix. k The key vector dimension acts like multiple "focused observers" analyzing the correlation of feature vectors from different angles, accurately capturing the mapping relationship between heavy metal content and spectral features. Then, the long short-term memory network layer "memorizes" the trend changes in the time series, and finally, the fully connected layer outputs the predicted values ​​of heavy metal elements such as lead, cadmium, and mercury. The whole process can be completed in just a few seconds.

[0036] The early warning module pre-sets safety thresholds for each heavy metal element based on five years of historical monitoring data from the protected area through statistical analysis. When the predicted mercury content at a monitoring point exceeds 1.2 times the threshold, the system immediately triggers a triple warning. The audible and visual alarms at the monitoring base station flash red and sound a buzzer to alert patrol personnel in the surrounding area. At the same time, a text message containing the pollution coordinates and level is sent to the person in charge of the protected area management department, such as "Alert, mercury content at point 3 in area B has reached a moderate pollution level." The APP simultaneously pushes a pollution details page, marking the pollution range and comparing it with historical data curves. Managers can activate emergency plans according to the warning level, such as setting up isolation zones for the polluted area and conducting phytoremediation experiments.

[0037] The data visualization module transforms cold, hard test data into an intuitive "environmental health map." In terms of time, it displays the quarterly trends of heavy metal content at each testing point through line graphs, clearly presenting the pollution evolution process like a "dynamic electrocardiogram." For example, it automatically highlights a point when cadmium content rises for two consecutive quarters. In terms of space, the electronic map uses a gradient of red to indicate the degree of pollution, with light pink for light pollution and dark red for heavy pollution. Overlaying topographic contour lines creates a "pollution heat map," helping decision-makers quickly locate high-risk areas. Technicians can also compare the pollution contribution rates of different elements through interactive charts. For example, if lead pollution accounts for more than 60%, they can conduct targeted investigations into the exhaust emissions of surrounding industrial and mining enterprises.

[0038] The power module uses a combination of solar panels and lithium batteries for power supply. Under sufficient sunlight, maximum power point tracking (MPPT) technology acts like a "smart regulator," adjusting the charging voltage and current in real time to ensure the solar panels always generate electricity at peak efficiency. The battery management system employs an algorithm combining a grey prediction model and support vector regression, with the formula: For the battery health state parameter sequence S = [s1, s2, ..., s...] n First, a grey prediction model is used for preliminary prediction to obtain the predicted value. By analyzing historical data such as charge / discharge cycles and voltage fluctuations, the system can predict battery capacity degradation trends 7 days in advance. When the estimated remaining battery capacity is below 30%, it automatically sends a battery swap reminder to the maintenance team, ensuring that the system can run continuously for more than 15 days without human intervention.

[0039] Example 2

[0040] An organic tea plantation plans to apply for EU certification and needs to ensure that the content of heavy metals such as lead, cadmium, and arsenic in the soil meets the stringent international standards. In order to achieve full-process quality control from planting to harvesting, this testing system has been introduced to build a "soil safety monitoring network".

[0041] The tea garden management team divided the area into 20m x 20m grids based on planting row spacing and soil type. Fixed detection stakes were set up at the center of each grid. Technicians used customized fiber optic probes (with anti-pollution protective sleeves at the front end) to insert into the root distribution layer of the tea trees (about 30 cm deep) to avoid interference from surface humus. The near-infrared spectrometer started the "rapid scanning mode" and completed the spectral acquisition of a single detection point within tens of seconds, just like a "spectral camera" taking a "chemical photo" of the soil. A total of more than 200 detection points in the entire garden were collected to form a "spectral fingerprint database" covering the entire tea garden.

[0042] The microprocessor initiates a parallel processing program on the massive spectral data. First, it uses an adaptive weighted smoothing algorithm to filter out random noise caused by changes in soil moisture, making the spectral curve smoother. The formula is: For the spectral data sequence x = [x1, x2, ..., x...] n The smoothed spectral data y i The calculation formula is: Where w j To achieve adaptive weights, a polynomial fitting baseline correction method (least squares method) is used to eliminate baseline shifts caused by differences in light intensity during different detection periods, ensuring that the data "starting point is consistent". Finally, the spectral data is standardized using the max-min normalization method, laying the foundation for subsequent modeling and analysis. The entire preprocessing process is completed at the edge computing node, improving data processing efficiency by more than 40%.

[0043] The preprocessed spectral data is transmitted to the tea garden management center server via a wireless communication module equipped with adaptive modulation and coding technology. The deep learning prediction module calls a hybrid attention network model optimized for tea planting scenarios. The model first identifies characteristic bands related to elements such as lead, cadmium, and arsenic through convolutional neural network layers, such as the absorption peak of lead in a specific near-infrared band. Then, it analyzes the mutual influence of the spectral characteristics of different elements through a multi-head attention mechanism layer. The formula is: For the feature vector F, the attention weights are calculated by multiple attention heads, and the attention weight of the h-th attention head is... The calculation formula is:

[0044]

[0045] in Let d be a learnable weight matrix. k The dimension of the bond vector is used, for example, when the arsenic content is high, it may enhance the spectral signal of cadmium. Then, the long short-term memory network layer "learns" the cumulative effect of soil heavy metals on the management measures such as fertilization and irrigation of tea gardens over the years, and finally outputs the predicted value of heavy metal content at each detection point, with the error rate controlled within 5%.

[0046] The early warning module sets a "three-level early warning threshold" based on the tea garden's internal control standards (30% stricter than regulations). When the cadmium content at a certain monitoring point reaches 80% of the internal control standard, a blue warning is triggered, and the system reminds workers to stop using cadmium-containing fertilizers via the tea garden broadcast. If the cadmium content exceeds the internal control standard, a yellow warning is triggered, and a "Pollution Area Control Plan" is automatically generated, recommending that the tea leaves in that area be picked separately and sent for testing. If the cadmium content exceeds the regulatory standard, a red warning is triggered, and the area is immediately sealed off and a soil leaching remediation project is initiated. In one test, the system found that the lead content in grid 15 of area C reached 45 mg / kg (close to the internal control threshold of 42 mg / kg), and promptly reminded the user to adjust the pesticide formula to prevent further escalation of pollution.

[0047] The data visualization module provides managers with a "one-stop decision panel." In the time dimension, it displays the dynamic balance between nutrients such as nitrogen, phosphorus, and potassium and heavy metal content through stacked area maps. For example, if a decrease in potassium content is accompanied by an increase in cadmium content in a certain area, it indicates a potential risk of nutrient imbalance exacerbating heavy metal activation. In the spatial dimension, the electronic map uses tea seedlings as the base map and uses different shaped icons to mark pollution types (such as triangles representing lead pollution and circles representing cadmium pollution). Clicking on an icon allows you to view the spectral curve and historical test reports for that point. The management team can also use the "pollution diffusion simulation function" to input meteorological data such as wind speed and precipitation to predict heavy metal migration trends and deploy prevention and control measures in advance.

[0048] The power module adopts a "dual power redundancy design," automatically switching between solar panels and mains power to ensure normal system operation even during seven consecutive days of no sunlight in the rainy season. The battery health status prediction algorithm acts like a "smart home manager," analyzing over 20 parameters such as battery voltage, temperature, and charge / discharge cycles. It uses a grey prediction model to predict short-term capacity changes, with the formula: For the battery health status parameter sequence S = s1, s2, ..., s... n First, a grey prediction model is used for preliminary prediction to obtain the predicted value. Then, the long-term trend is corrected by the support vector regression model, and potential faults such as battery aging and increased internal resistance are identified in advance to ensure the continuity of data collection. The network congestion control mechanism of the wireless communication module monitors the data transmission queue length in real time. When the centralized uploading of the entire park's detection data causes the network load to exceed 70%, the "priority scheduling strategy" is automatically activated to prioritize the transmission of early warning data and ensure that key information is delivered with "zero delay".

[0049] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A system for in-situ detection of heavy metal residues in forest soil based on near-infrared spectroscopy, characterized in that, The system comprises the following components: a near-infrared spectral acquisition module, a data processing and transmission module, a deep learning prediction module, an early warning module, and a power supply module; The near-infrared spectral acquisition module includes a near-infrared spectrometer and a sampling probe, used to acquire near-infrared spectral data of forest soil; The data processing and transmission module includes a microprocessor and a wireless communication module, used for preprocessing and transmitting spectral data; The deep learning prediction module is built on a cloud server or remote terminal device and is used to receive preprocessed spectral data and predict the heavy metal content in the soil. The early warning module is connected to the deep learning prediction module and is used to issue early warnings based on the prediction results. The power module provides power to other modules.

2. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The near-infrared spectrometer is capable of acquiring spectral data in the wavelength range of 780-2526nm, with a spectral resolution of not less than 1nm. The sampling probe is an optical fiber probe that can be directly inserted into the forest soil. The sampling probe is connected to the near-infrared spectrometer via optical fiber, and the acquired soil near-infrared spectral signal is transmitted to the near-infrared spectrometer for photoelectric conversion and signal amplification to obtain digitized spectral data.

3. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The microprocessor performs preprocessing on the spectral data, including spectral smoothing, baseline correction, and normalization. Spectral smoothing employs an adaptive weighted smoothing algorithm for the spectral data sequence x = [x1, x2, ..., x...]. n The smoothed spectral data y i The calculation formula is: Where w j For adaptive weighting, baseline correction employs a polynomial fitting baseline correction method. The baseline of the spectral data is fitted using the least squares method, and then the fitted baseline data is subtracted from the original spectral data. Normalization uses the max-min normalization method to map the spectral data to the [0, 1] interval, as shown in the formula:

4. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The measured data stored in the data storage unit of the deep learning prediction module is divided into samples through stratified sampling and cross-validation. Specifically, all measured data are divided into training set, validation set and test set according to a certain ratio. In the stratified sampling process, the data is stratified according to different intervals of soil heavy metal content. In the training process, the model is trained using the training set, the hyperparameters of the model are adjusted and optimized using the validation set, and finally the generalization ability of the model is evaluated using the test set.

5. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The deep learning prediction module's model training unit employs an improved hybrid attention network model. This model consists of a feature extraction layer, a multi-head attention mechanism layer, a long short-term memory network layer, and a fully connected layer. In the feature extraction layer, a convolutional neural network is used to extract features from the input spectral data, obtaining a spectral feature vector F. In the multi-head attention mechanism layer, for the feature vector F, attention weights are calculated through multiple attention heads, with the attention weight of the h-th attention head being... The calculation formula is: in Let d be a learnable weight matrix. k The key vector dimension is used to concatenate the results of multiple attention heads before inputting them into an LSTM layer. The LSTM layer selectively memorizes and updates information through forget gates, input gates, and output gates. Finally, the predicted value of soil heavy metal content is output through a fully connected layer. During model training, an adaptive moment estimation optimization algorithm is used, combined with a dynamic learning rate adjustment strategy, with a learning rate η. t The adjustment formula is Where η0 is the initial learning rate, β is the adjustment parameter, and t is the number of training iterations.

6. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The preset heavy metal element content thresholds of the early warning module are determined based on forest soil environmental quality standards and statistical analysis of historical monitoring data. Specifically, historical monitoring data of various heavy metal elements in forest soils of different regions are collected, the data are statistically analyzed, and the mean μ and standard deviation σ of the content of each heavy metal element are calculated. Combined with the corresponding forest soil environmental quality standards, the mean plus a certain multiple of the standard deviation is used as the initial threshold. Then, it is adjusted through expert evaluation and actual application testing to finally determine a reasonable heavy metal element content threshold. When the content of a certain heavy metal element in the prediction results exceeds the corresponding threshold, the early warning module issues an early warning information through audible and visual alarms, SMS notifications, or APP push notifications. Different early warning levels are set according to the degree of exceeding the threshold, including light pollution, moderate pollution, and heavy pollution.

7. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The power management circuit of the power module employs maximum power point tracking (MPPT) technology and a battery health state prediction algorithm. During charging, MPPT technology is used to adjust the charging voltage and current in real time. The battery health state prediction algorithm is based on the battery's historical charging and discharging data and current state parameters, and uses a combination of grey prediction model and support vector regression for prediction. For the battery health state parameter sequence S = [s1, s2, ..., s...], ... n First, a grey prediction model is used for preliminary prediction to obtain the predicted value. Then, the original data and the grey prediction results are used as input to the support vector regression model to perform a second prediction, resulting in a more accurate prediction of the battery health status.

8. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The wireless communication module employs adaptive modulation and coding (AMC) technology and a network congestion control mechanism. During data transmission, AMC dynamically adjusts the modulation scheme and coding rate based on the real-time quality of the wireless channel. When the channel quality is good, it uses high-order modulation and high-speed coding rate; when the channel quality is poor, it switches to low-order modulation and low-rate coding. The network congestion control mechanism uses a congestion control algorithm based on queue length and packet loss rate. By monitoring the data transmission queue length and network packet loss rate of the wireless communication module in real time, it dynamically adjusts the data transmission rate. When the queue length exceeds the threshold or packet loss occurs, the data transmission rate is reduced to avoid network congestion. When the network condition improves, the data transmission rate is gradually increased.

9. The in-situ detection system for heavy metal residues in forest soil based on near-infrared spectroscopy according to claim 1, characterized in that, The system also includes a data visualization module, which is connected to the deep learning prediction module. This module is used to visualize the prediction results of soil heavy metal content in the form of charts and maps. In the chart display, the changing trend of soil heavy metal content at different detection points over time and the comparison of the content of different heavy metal elements can be presented intuitively. In the map display, the geographical location of the detection point is combined with the soil heavy metal content, and different pollution levels are marked with different colors or icons.